On Wed, 5 Mar 2025 at 12:47, Oliver Kopp <kopp....@gmail.com> wrote:

> Hey,
>
> I have following document:
>
> \documentclass{article}
> \usepackage{lipsum}
> \begin{document}
> test
> \end{document}
>
> I run
>
> lualatex -ini -jobname=mwe "&lualatex" mylatex.ltx mwe.tex
>
> I get
>
> This is LuaHBTeX, Version 1.21.0 (MiKTeX 25.2) (INITEX)
> ...
> (C:/MiKTeX/tex/latex/l3backend/l3backend-luatex.def)))
> ! Use of \??? doesn't match its definition.
> <argument> \???
>                  ! LaTeX Error: Access to an entry beyond an array's
> bounds.
> l.208   }
>
>
As I wrote in the stackexchange answer that you referenced, you can not use
mylatex out of the box with luatex.
dumping the format does not save Lua state nor Opentype font information so
if you just use it as for pdflatex
when you reload the format for a document run, any Lua definitions that
were made at format time are lost.

In principle you could make things work (I did get some small examples
once)  you can for example byte compile
the lua state, save that as a string within a tex macro then re-execute it
in \everyjob . To get there you either need,
when making the format, to redefine the commands to byte compile instead of
executing, or you need to sweep over the global lua state and save stuff at
the end before you \dump, or both.

But I never really bothered.

I wrote mylatex.tex as I had a super fast Sun3 and I felt sorry for friends
with 640K PCs running sbtex. I wrote mylatex.ltx for them as dumping
article and a couple of packages in the format saved several minutes every
job. I never saw the need to use it myself.
On a modern machine the time you'd save by dumping a larger format probably
would never reclaim the time you lose in writing the code to make it work:-)

David

Reply via email to