如何使用 mylatexformat 與 lualatex 預先編譯標頭?

如何使用 mylatexformat 與 lualatex 預先編譯標頭?

我想用來mylatexformat預編譯標頭,而不必將它們放入單獨的preamble.tex.

這適用於pdflatex- 我可以做同樣的事情lualatex嗎?這是我嘗試過的bug.tex

\documentclass{article}
\usepackage{datetime2}
% \usepackage{microtype}
% \usepackage{tikz}
\begin{document}
\DTMnow
\end{document}

我使用建立這個文件

lualatex -ini -jobname="bug" "&lualatex" mylatexformat.ltx bug.tex
lualatex --fmt="bug.fmt" bug.tex

這很好用。

然而,啟用不同的套件會導致非常不同的錯誤:

  • microtype:
(/home/bers/opt/texlive/2020/texmf-dist/tex/latex/microtype/mt-LatinModernRom
an.cfg[\directlua]:1: attempt to index a nil value (global 'microtype')
stack traceback:
        [\directlua]:1: in main chunk.
MT@ifstreq ...{microtype.if_str_eq([[#1]],[[#2]])}
                                                  endcsname 
l.105    }
  • tikz:
(/home/bers/opt/texlive/2020/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cf
g)) [1{/home/bers/opt/texlive/2020/texmf-var/fonts/map/pdftex/updmap/pdftex.m
ap}]
! error:  (pdf backend): referenced object has wrong type others; should be obj

!  ==> Fatal error occurred, no output PDF file produced!

相關內容