diff --git a/Programming/PORR/.gitattributes b/Programming/PORR/.gitattributes deleted file mode 100644 index e42fe68c..00000000 --- a/Programming/PORR/.gitattributes +++ /dev/null @@ -1,3 +0,0 @@ -code/spd_5000.npz filter=lfs diff=lfs merge=lfs -text -code/poli3_1.npz filter=lfs diff=lfs merge=lfs -text -code/poli3_2.npz filter=lfs diff=lfs merge=lfs -text diff --git a/Programming/PORR/code/spd_5000.npz b/Programming/PORR/code/spd_5000.npz deleted file mode 100644 index 11b44646..00000000 --- a/Programming/PORR/code/spd_5000.npz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2aa92da25acfeafeb204ee81e2feafd04b39f3a86fad2765f538ab95e4581d96 -size 200041030 diff --git a/Programming/ZPOB/run.sh b/Programming/ZPOB/run.sh index 0ad11059..3aa3c4bb 100755 --- a/Programming/ZPOB/run.sh +++ b/Programming/ZPOB/run.sh @@ -7,5 +7,11 @@ set -euo pipefail # shellcheck source=../../scripts/course_lib.sh . "$(dirname "$(readlink -f "$0")")/../../scripts/course_lib.sh" -course_main --kind tex \ +# esej.tex ends with \bibliography{references} but contains no \cite and no +# \bibliographystyle, so bibtex aborts and latexmk reports 12 -- after having +# already written a correct esej.pdf. That is how the essay was handed in: +# the submitted esej.pdf (LuaTeX, 2023-12-12) has no bibliography either. +# Adding \bibliographystyle would print a References section that was never +# part of the deliverable, so the build skips bibtex instead. +course_main --kind tex --no-bibtex \ -- "$@" diff --git a/scripts/course_lib.sh b/scripts/course_lib.sh index 52050655..46a1c47f 100644 --- a/scripts/course_lib.sh +++ b/scripts/course_lib.sh @@ -218,8 +218,20 @@ _run() { local dir base dir="$(dirname "$tex")" base="$(basename "$tex")" + # A document that declares \bibliography but never cites anything + # makes bibtex exit 2 ("I found no \citation commands"), and + # latexmk turns that into exit 12 even though the PDF is fine. + # --no-bibtex says "this one was handed in without a bibliography", + # which is a fact about the deliverable, not a suppression. + # An `x && y=1` one-liner would be a set -e landmine here: when x + # is false the list returns 1 and the whole runner exits. + local bibflag=() + if [[ -n "${COURSE_TEX_NO_BIBTEX:-}" ]]; then + bibflag=(-bibtex-) + fi if [[ $tool == latexmk ]]; then - ( cd "$dir" && latexmk -pdf -interaction=nonstopmode -outdir=build "$base" ) + ( cd "$dir" && latexmk -pdf "${bibflag[@]}" \ + -interaction=nonstopmode -outdir=build "$base" ) else ( cd "$dir" && mkdir -p build \ && "$tool" -interaction=nonstopmode -output-directory=build "$base" ) @@ -320,12 +332,14 @@ course_main() { COURSE_ENTRY="" COURSE_NOTE="" COURSE_TEST_DIR="" + COURSE_TEX_NO_BIBTEX="" while [[ $# -gt 0 ]]; do case "$1" in --kind) COURSE_KIND="$2"; shift 2 ;; --entry) COURSE_ENTRY="$2"; shift 2 ;; --note) COURSE_NOTE="$2"; shift 2 ;; --test-dir) COURSE_TEST_DIR="$2"; shift 2 ;; + --no-bibtex) COURSE_TEX_NO_BIBTEX=1; shift ;; --) shift; break ;; *) break ;; esac