![](https://secure.gravatar.com/avatar/cdac1bce4ec96619cde73d2f2be4e66d.jpg?s=120&d=mm&r=g)
"Martin Schröder"
2007/6/27, David Kastrup
: For example, preview-latex uses mylatex.ltx to dump the state of the TeX at \begin{document} time. Not allowing any image references (like in \savebox commands) before that point of time is a rather brutal restriction.
Why do you need it
What? preview-latex? mylatex.ltx?
and what do you gain by using \savebox?
Uh, it is _there_. For a reason. Saying that it (and similar functionality) should not get used anymore is creating a rather sordid restriction and backward incompatibility.
The speed increase is most likely minimal
The speed increase of what is most likely minimal? Of dumping a format with the preamble? Absolutely not. It is very relevant in preview-latex, for common editing work on single formulas easily a factor of 5. And we are talking about an interactive editing task and its response time here.
and the document needs to read the image anyway -- unless you want to dump fragments of pdf code into the format.
In DVI mode, a pointer to the image gets dumped in the form of a special. A similarly sufficient amount of information would have to get there in PDF mode.
If we expanded the dvi model we would dump the meta information about pdf things and then undump them later. This needs code for dumping and undumping this meta information. And \immediate\pdfximage would still fail.
Again: the \AtBeginDvi command was added to LaTeX precisely in order to conserve pretypeset stuff that would otherwise get lost at a format dump.
So store the commands there. Do you really need their expansion?
Not the expansion, the typeset result. This is what LaTeX uses and preserves. Since it is not untypical to put something in there which would rely on \@onlypreamble stuff, I don't see that anything except preserving the actual h/vlists could be depended on to work.
Don't forget: pdfTeX is one-pass, while TeX->dvips is two-pass.
Where is the relevance? -- David Kastrup