Skip to content

Missing font slows down build and causes non-zero status code

The \tryfont macro considerably increases build time by repeatably searching for the (missing) Calibri font. It also causes xelatex to exit with a non-zero status code since the missing font counts as an error; on older latexmk, such as the version on IDA's systems, the build continues anyway, which is probably a bug; on newer latexmk the build stops after the first pass.

With \tryfont:

$ time make all
...
...
Latexmk: Errors, so I did not complete making targets
Collected error summary (may duplicate other messages):
  pdflatex: Command for 'pdflatex' gave return code 256
Latexmk: Use the -f option to force complete processing,
 unless error was exceeding maximum runs of latex/pdflatex.
make: *** [demo_student_thesis.pdf] Error 12

real    0m51.090s
user    0m46.436s
sys     0m2.788s

Without \tryfont: (body commented out)

$ time make all
...
...
Latexmk: All targets (demo_student_thesis.pdf) are up-to-date

real    0m9.563s
user    0m8.964s
sys     0m0.692s

Tested on IDA's system (parlomba3).

Whether or not one considers this a bug I guess comes down to wheater or not one considers Linux/Mac supported platforms (since it's caused by Calibri, which is Windows-only, not being available).