Como usar mylatexformat para pré-compilar cabeçalhos com lualatex?

Como usar mylatexformat para pré-compilar cabeçalhos com lualatex?

Eu gostaria de usar mylatexformatpara pré-compilar cabeçalhos sem ter que colocá-los em um arquivo preamble.tex.

Isso funciona bem com pdflatex- posso fazer o mesmo com lualatex? Isto é o que eu tentei em bug.tex:

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

Eu construo este arquivo usando

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

Isso funciona bem.

No entanto, habilitar vários pacotes leva a erros muito diferentes:

  • 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!

informação relacionada