diff options
author | Frederik Rietdijk <fridh@fridh.nl> | 2020-11-28 08:53:47 +0100 |
---|---|---|
committer | Frederik Rietdijk <fridh@fridh.nl> | 2020-11-28 08:53:47 +0100 |
commit | 9e062723b2d60d2be85268fb7eebb28abce0b5af (patch) | |
tree | 691e8a0b8cb475751f75f192dd3e16f452c6fcce /pkgs/tools/typesetting | |
parent | b2a3891e12777fa5e16bc93bc95c0d5ba256ebaf (diff) | |
parent | 8256fc2da56b573411144030c48812c12798676b (diff) |
Merge master into staging-next
Diffstat (limited to 'pkgs/tools/typesetting')
-rw-r--r-- | pkgs/tools/typesetting/tex/nix/run-latex.sh | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/pkgs/tools/typesetting/tex/nix/run-latex.sh b/pkgs/tools/typesetting/tex/nix/run-latex.sh index 7a5767f9c0633..3f8a16580ea58 100644 --- a/pkgs/tools/typesetting/tex/nix/run-latex.sh +++ b/pkgs/tools/typesetting/tex/nix/run-latex.sh @@ -41,7 +41,11 @@ showError() { exit 1 } +pass=0 + runLaTeX() { + ((pass=pass+1)) + echo "PASS $pass..." if ! $latex $latexFlags $rootName >$tmpFile 2>&1; then showError; fi runNeeded= if fgrep -q \ @@ -51,6 +55,7 @@ runLaTeX() { "$tmpFile"; then runNeeded=1 fi + echo } echo @@ -61,10 +66,7 @@ if test -n "$copySources"; then fi -echo "PASS 1..." runLaTeX -echo - for auxFile in $(find . -name "*.aux"); do # Run bibtex to process all bibliographies. There may be several @@ -89,11 +91,8 @@ for auxFile in $(find . -name "*.aux"); do fi done - if test "$runNeeded"; then - echo "PASS 2..." runLaTeX - echo fi @@ -105,20 +104,18 @@ if test -f $rootNameBase.idx; then makeindex $makeindexFlags $rootNameBase.idx runNeeded=1 echo -fi - +fi -if test "$runNeeded"; then - echo "PASS 3..." +# We check that pass is less than 2 to catch situations where the document is +# simple enough (no bibtex, etc.) so that it would otherwise require only one +# pass but also contains a ToC. +# In essence this check ensures that we do at least two passes on all documents. +if test "$runNeeded" = 1 -o "$pass" -lt 2 ; then runLaTeX - echo fi - if test "$runNeeded"; then - echo "PASS 4..." runLaTeX - echo fi |