Skip to main content

Module preamble_commands

Module preamble_commands 

Source
Expand description

latex.ltx:9521-9522 \gdef\do#1{\global\let#1\@notprerr}\@preamblecmds: after \begin{document} each listed command IS \@notprerr, which raw code tests with \ifx (ltnews23.tex:42-43). LaTeXML also reads a package, class or sub-file preamble in the body (Perl’s recovery for a body \usepackage, a binding’s load, standalone and subfiles), which pdflatex never does: there the walk’s commands are reopened, and disabled again after it. The walk keeps each meaning under \lx@onlypreamble@<name>; the State holds the list (OXIDIZED_DESIGN_DIVERGENCES #226). A binding’s lock goes aside with its meaning: \@notprerr is no binding’s, and the body’s \renewcommand of it stands as in TeX (imsart.sty:1223 \@onlypreamble\doi over OmniBus’s locked \doi, 2606.22730).

Structs§

ReopenedForLoad
reopen_preamble_commands for the extent of a load, closed when dropped (also on an Error’s early return).

Functions§

close_preamble_commands
The walk again over the reopened commands: what the load (re)defined is kept for the next reopening.
close_subfile_preamble
The close of the reopening a sub-file’s preamble holds; false when it holds none (closed at its \begin{document}).
disable_preamble_command
The walk’s \global\let<cs>\@notprerr, its meaning kept for a later reopen_preamble_commands.
end_subfile_preamble
\lx@subfile@preamble@end: a sub-file that ends with no \begin{document} ends its preamble there (pdflatex: “File ended while scanning use of \sa@gobble”).
reopen_for_subfile_preamble
reopen_preamble_commands for a sub-file’s preamble (standalone, subfiles): closed at its \begin{document} or, without one, where the sub-file ends (\lx@subfile@preamble@end, close_subfile_preamble).
reopen_preamble_commands
Give the disabled commands back their meanings and locks (a body load, a sub-file’s preamble); false when there is nothing to reopen (still in the preamble, or reopened by an enclosing load). One the body has redefined since is the body’s: the walk no longer holds it, and neither this nor the next walk touches it.