> Let’s start the discussion. We need feedback on this.
>
> Pros and Contras of moving on to using lualatex as default compiler.

Another vote for NOT changing the default from pdflatex.

In the upcoming LaTeX preview feature rewrite, previews using lualatex
are 10-50x slower than previews with pdflatex.  pdflatex previews are
fast enough that you can get live updates as you type[1]:

https://karthinks.com/img/olp-auto-mode-1.mp4
https://karthinks.com/img/olp-auto-mode-array.mp4
https://karthinks.com/img/olp-auto-mode-tikz.mp4

When org-pdf-compiler is set to lualatex, the update time for a LaTeX
fragment goes from 0.3-0.6 seconds to 3-20 seconds, depending on the
size of the LaTeX preamble.  At that point LaTeX previews are more or
less useless for getting quick feedback on your edits, and the value of
using LaTeX previews goes down considerably.

There are two reasons for this.

1. lualatex is slower to start up than pdflatex.  I have not measured
how much the difference is, but it's noticeable.
2. lualatex does not support precompilation, as you cannot save lua
state or opentype fonts in the precompile dump.  This slows down
lualatex by a large factor.
https://tex.stackexchange.com/questions/593723/lualatex-and-mylatexformat-precompiling-not-working

We have tried some mitigations, including using pdflatex for LaTeX
previews but lualatex for exports (by introducing an
org-preview-pdf-compiler variable), but this does not work because of
the incompatibilities between LaTeX preambles created for pdflatex and
lualatex, and because of unicode characters in LaTeX fragments, etc.

Users who are aware of this tradeoff or do not use org-latex-preview can
change org-latex-compiler to lualatex.  Most other users will only
notice that LaTeX previews don't work well and that LaTeX exports take
much longer than expected.

Karthik

[1]: org-latex-preview can extend to all of Emacs, providing live LaTeX
previews in all major modes, all of which will get much slower:
https://www.youtube.com/watch?v=u44X_th6_oY

Reply via email to