Transitioning LaTeX typesetter engine from PDFLaTeX to LuaLaTeX

As I mentioned in another post, I learn’t from the Pandoc template and great derivatives like Eisvogel:

…that using the iftex package allows you to tweak any templates to optimise across all three engines without needing to hard-code for only one engine.

https://ctan.org/pkg/iftex

Now one may argue that PDFTeX is legacy and the new engines are the present/future of TeX compiling there is no need to keep supporting PDFTeX, and that would also be a fair assessment. I stick to using iftex largely just in-case one engine has a bug, then I can jump to the other engines as a fallback (my route is XeTeX > LuaTeX > PDFTeX [though I’ve never had to fallback to the crufty PDFTeX]). Also there are super cool projects like tectonic:

That are optimising all the crufty parts of LaTeX that choose one engine (XeTeX for tectonic for example), and using iftex should allow one to switch to tectonic even if you normally stick with LuaTeX and TeX-Live…


As to what needs change, again read through the Pandoc/Eisvogel template to see where iftex is used, that will guide you on what can be tweaked to benefit each engine… I personally refused to use any legacy 8-bit TeXisms and use UTF-8 characters everywhere, I simply refuse to write It is \SI{17}{\degreeCelsius} outside. when It is 17℃ can be used… LaTeX sadly suffers from font-fallback issues (i.e. if a character is not in your main font, LaTeX cannot search for an alternative font, which is normal behaviour in the OS itself). My hacky solution was to make a script to wrap characters I use and force them to use a font I know has them.

4 Likes