Skip to main content

Module binding

Module binding 

Source
Expand description

The programmable API foundation for creating bindings of LaTeX sty/cls libraries

Modules§

author_files
The bindings that stand in for an author’s file: a journal’s, a conference’s or a person’s class or style that TeX Live has never distributed and LaTeXML does not provide, so a paper that uses it ships its copy (arxiv.sty, neurips_2024.sty, JHEP.cls, svjour3.cls, aa.cls, …). The binding is a stand-in for that copy, not the file: \IfFileExists and \InputIfFileExists find the file only when the paper ships it, as TeX does (crate::binding::content::binding_counts_as_file); witness 2606.27281 (\IfFileExists{arxiv.sty} without the file). The copy the paper ships is read after the binding, every definition of a name the binding owns holding only inside the copy’s own code, so that its extra commands are defined (“a stand-in’s copy provides”, crate::binding::content read_stand_in_copy, OXIDIZED_DESIGN_DIVERGENCES #731; 1309.5950’s aas_macros.sty \kms). Every other compiled binding is the file it is named for — TeX Live’s (found where the host’s tree lacks it: babel’s italian.ldf on a trimmed tree), a file TeX Live once distributed (FORMER_TEX_LIVE: TeX in the paper’s era found it, so 1710.04900’s harvard.sty \IfFileExists{html.sty} loads the html binding), or LaTeXML’s own (LATEXML_OWN; the pools, font maps and drivers such as pgfsys-latexml.def need no list).
content
counter
def
kernel_autoload
Autoload the LaTeX format when an undefined control sequence turns out to be one the LaTeX kernel defines.
preamble_commands
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).
store_setters
K11’s table of title-page setters (latexml_engine/src/frontmatter_stores.rs reroutes a raw class’s — or package’s — stores through it), and which of them a binding defined: a setter whose definition changed while a binding loaded is the binding’s own (acmart.cls’s \copyrightyear, ported as the class’s store), never a raw class’s store, though a raw class that loads the binding (\LoadClass[nonacm]{acmart} in a wrapper class) ends with it defined. input_definitions snapshots the setters around each binding load; the snapshot is a Rust local, so nested loads pair by the call stack and nothing transient enters the State (or a format dump). So: raw TeX a binding loads itself (noltxml) counts as the binding’s, a raw class a binding loads still reroutes at its own end, and a raw class’s later redefinition of a binding’s setter is the raw class’s. Only loads through input_definitions are tracked (a plain-TeX .tex binding loaded by load_binding directly is not).
virtual_files
The in-memory virtual file store — TeX’s write-out/read-back round trip.