Skip to content

Commit

Permalink
use /root/.lyx directory
Browse files Browse the repository at this point in the history
  • Loading branch information
sergei.winitzki committed Nov 9, 2020
1 parent 281e2be commit 3d89dd3
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-pdf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
id: full-pdf
uses: docker://winitzki/sofp-docker-build:latest
with:
args: "bash sofp-src/make_sofp_pdf.sh"
args: "LYXDIR=/root/.lyx bash sofp-src/make_sofp_pdf.sh"

- name: Upload built PDF
id: upload-pdf
Expand Down
11 changes: 9 additions & 2 deletions sofp-src/make_sofp_pdf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ name="sofp"
draft="$name-draft"
srcbase="sofp-src"

# Set custom lyx directory if needed.
if [ x"$LYXDIR" == x ]; then
lyxdir=""
else
lyxdir="-userdir $LYXDIR"
fi

test -d $srcbase && cd $srcbase

function git_commit_hash {
Expand Down Expand Up @@ -109,12 +116,12 @@ pdftk=`which pdftk`
# LyX needs to be installed for this to work. Edit the next line as needed.
lyx=`which lyx`

echo "Info: Using pdftk from '$pdftk' and lyx from '$lyx'"
echo "Info: Using pdftk from '$pdftk' and lyx from '$lyx', lyx directory $lyxdir"

rm -f $name*tex $name*log $name*ilg $name*idx $name*toc

echo "Exporting LyX files $name.lyx and its child documents into LaTeX..."
"$lyx" --export pdflatex $name.lyx # Exports LaTeX for all child documents as well.
"$lyx" $lyxdir --export pdflatex $name.lyx # Exports LaTeX for all child documents as well.
echo "Post-processing LaTeX files..."
# Insert the number of examples and exercises. This replacement is only for the root file.
insert_examples_exercises_count $name $name.tex
Expand Down
Binary file modified sofp-src/sofp-draft.pdf
Binary file not shown.
Binary file modified sofp-src/sofp.pdf
Binary file not shown.
4 changes: 2 additions & 2 deletions sofp-src/sofp.tex
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,8 @@
~\\
ISBN: 978-0-359-76877-6\\
\\
{\scriptsize{}Source hash: 0b6314be48493c4785d3049162e147d8bf855fb7c13434baec80cd6beb76e2dd}\\
{\scriptsize{}Git commit: 9cda9f594d97030fb053e2e52ceeb3647d24c2a9}\\
{\scriptsize{}Source hash: 3d7efdfab0b385b97cdea2813011a782555209d2ed6d71825b1eb202583da478}\\
{\scriptsize{}Git commit: 281e2be2f70a53ae499592fc46d82016c05e2d76}\\
~\\
{\scriptsize{}Permission is granted to copy, distribute and/or modify
this document under the terms of the GNU Free Documentation License,
Expand Down

0 comments on commit 3d89dd3

Please sign in to comment.