Expand description
The stomach is an abstraction responsible for digesting Tokens and Registers prepared by the
Gullet into Boxes
Structs§
- Speculative
Digest - What
digest_speculativelyread of its run. - Stomach
- The Stomach is responsible for digesting tokens into boxes, lists, etc.
- Stomach
Mark - What a speculative digestion — one whose output is discarded and whose assignments its journal undoes (the
frontmatter’s title-page runs, rehearsals and label reads) — must leave as it found it besides its assignments: the
stack of tokens being invoked and the active conditionals. Taken before the run, put back however it ends
(
StomachMark::restore): the document never runs the run’s tokens. A runaway Fatal the run raised and discarded (aStomach:Recursion) left the wholeMAXSTACKof tokens on the stack, and the document’s next digestion failed its first push with a ghost Fatal of its own (2502.10606’s\thanksinside a\thanks, all 8,054 words lost, asclear_token_stack’s 2410.07647); a\fiof the run’s closing a conditional the document opened before it left that conditional closed for the document, whose own\fithen had none (2003.03814: CUP-JNL-DCE.cls:505\keywordsleaves its\ifxopen,\fiinside\@keywords, which\printkeywordsbalances; the title-page run’s\printkeywordsclosed it and the class’s real\maketitleraised “Didn’t expect a \fi”). Runs that read one text in pieces share its conditionals as TeX reads it, in one pass: the observer rehearses an author list block by block, a conditional opened in one block’s run closed in the next’s (2606.17718’s\IEEEauthorblockA{… \if… E-mail: …} \else … \fi), so its shadow takes the mark around the whole sequence and each rehearsal puts back only its token stack (truncate_token_stack). Put back on drop too, so every exit restores — a?that propagates a run’s Fatal included (review rev135c S1) —, except while a panic unwinds (the state may be borrowed).
Enums§
- Restart
Signal - Why eager digestion stopped for memory on this thread.
Constants§
- DISPLAY_
FORMULA - Marks the frame of a display
$$…$$opened by\lx@begin@display@mathoutside an alignment (latexml_engine tex_math.rs, latex_constructs sect07.rs): the display a math shift ends through the groups opened in it (tex.web §1193 + §1064-1065), asINLINE_FORMULAmarks an inline formula. - INLINE_
FORMULA - Marks the frame of a formula
$…$(or\(…\)) opened by\lx@begin@inline@math(latexml_engine tex_math.rs): the inline formula tex.web §1046-1047insert_dollar_signends. OXIDIZED_DESIGN #553. - OWED_
BRACES - The closers a frame owes:
off_save(tex.web §1064-1065, latexml_engine tex_math.rsleft_right_group) inserted a}or\endgroupfor a\right/\middlethat met this group, so the author’s own closer, when it comes, has already been used. The debt is a frame value; at every pop it moves to the frame then innermost (pop_stack_frame), so it follows the stack to wherever that closer arrives. OXIDIZED_DESIGN #530. - OWED_
ENDGROUPS - The
\endgrouptwin ofOWED_BRACES. - PUT_
BACK_ BRACE - The
}a\left/\middle/\rightdelimiter scan put back after “Missing delimiter” (latexml_engine tex_math.rsmissing_delimiter,mark_put_back_brace). The mark lives as long as that brace: a serial bound on the frame innermost when it was put back — inside the formula, so it dies with the formula at the latest — and valid only while it equals the live serial (PUT_BACK_LIVE), which the next}digested anywhere clears (take_put_back_markindelete_extra_braceand atinvoke_token). OXIDIZED_DESIGN #530. - PUT_
BACK_ LIVE - The serial of the one live put-back mark (0: none), global.
- SALVAGED
- The whatsit property of a construct a Fatal left unfinished, made by the salvage with what it had digested
(
close_pending_list_as, OD #251): a binding whose element the HTML does not show counts the words it keeps there. The list a constructor’s last argument closed carries it too, for the constructor’s properties (OD #1185). - SALVAGED_
PART - Which part of a
SALVAGEDwhatsit its closer filled with the boxes digested before the Fatal:"argument"(its last) or"body"; none where its after-digest code failed (its arguments are whole). - TEMPLATE_
BRACE_ OPEN - Bound in an alignment cell’s frame while its template’s
{($\displaystyle{##}$) is open — latexml_engine tex_box.rs\lx@template@bgroup/\lx@template@egroup; a}that would close the frame closes it (close_template_brace). - UNENDED
- The whatsit property of a construct the document ended inside of:
\end{document}came while its arguments or body were still being digested and abandoned their groups (tex.web §1335), so it never ended — whatever came after the defect that left it open (a section, a bibliography) is inside it.Constructor::digest_to_whatsitsets it (ends_inside_groupsmoved during the digestion); the document lets every element such a whatsit opens auto-close (Document::open_element), Perl’s per-node_autoclose(Document.pmcanAutoClose), so that structure closes it instead of being held inside asmalformed:*(1611.05714, 1101.1959, physics0505113, math9805003). OXIDIZED_DESIGN #542.
Functions§
- abandon_
stack_ frame - Abandons the current group, tex.web §1335
final_cleanupstyle: the stack frame (and itsboxingentry, unless the group is non-boxing) is popped and its\aftergrouplist is discarded, never run. Used where open groups are unwound wholesale —\end{document}(\lx@finalize@document, Perl latex_constructs.pool.ltxml:353-386) and a bounded body’s terminal met inside a group (until_terminal_inside_group). - align_
error - tex.web §1127
align_error: a tab,\cror\spanthat reaches the stomach while the alignment count is not 0 — the cell left a brace unbalanced, so the gullet did not take it for the cell’s end (§342) — gets the brace TeX supposes was omitted: count −1 or −2 (the cell’s}closed one more group than it opened,a} &=& b) inserts a{(“Missing { inserted”), count +1 or +2 ({a & b},\textbf{a & b}) a}(“Missing } inserted”), and the column end is read again behind it, now at count 0, so the v-part runs and the cell ends as the template says (§789). The ledger moves as TeX’s does:align_errorsteps the count towards 0 andins_error’sback_input(§325) retracts the inserted brace, which counts again when it is read. A larger count (abs(align_state)>2, “Misplaced &”) is left to the cell’s reader, as is a count past the v-part’s 1000000 (the column’s own end). Before, the column end was taken for the cell’s end with no v-part: an eqnarray/amsmath cell left its template’s math open (pdflatex 1 error, ours 17: “Attempt to close a group that switched to mode math”), and a tabular cell’s{a & b}lostawithout a word. Perl has noalign_error(KNOWN_PERL_ERRORS #923). Whether it fired. Guardsperfect_kernel_batch70b::{eqnarray_stray_close_brace_inserts_a_left_brace, tabular_open_brace_at_a_cell_end_inserts_a_right_brace}. - apply_
memory_ ceiling - Apply the single
--max-memoryceiling (MiB) to this thread’s cooperative soft fuse, so the one knob means the same thing on every conversion path. - begin_
mode - Begin processing in
mode; one of “text”, “display-math” or “inline-math”. This also begins a new level of grouping and switches to a font appropriate for the mode. Ifnoframeis true, skip pushing a stack frame (e.g. for \begin{document}). Perl: sub beginMode (Stomach.pm lines 474-517) - begin_
mode_ opt - Like
begin_mode, but with an explicitnoframeoption. Whennoframeis true, no stack frame is pushed (the caller already did bgroup). - begin_
mode_ under_ hook_ groups begin_mode_optfor X under a begin hook’s open groups (environment_frame_under_hook_groups): the mode is bound in the frame marked withend, X’s own, so it ends with the environment and the hook’s groups close as plain groups (in TeX a list environment’s begin code opens no group); a hook environment’s mode on top stays in force. The text fontset_mode_frombinds when a text mode is begun from math stays on top, beside a hook’s own font.- begingroup
- Begin a new level of binding by pushing a new stack frame.
- begun_
environment - The environment begun with
\beginthat the open until-body is read in — LaTeX’s\@currenvir, whose end\@checkendchecks — orNonewhen the body is a begin code called as a command: a bare begin code (lx@env@bare@end), or one whose innermost recorded environment is{document}(mn2e\keywords{…}, mn2e.cls:993-1003, opens its body in the document’s own environment, which LaTeX never checks against it). The innermost frame that records an environment names it:\begin’scurrent_environment, orlx@until@begun, which the kernel’s\begin{abstract}(no environment frame of its own) leaves in its body’s frame. - bgroup
- box_
lists_ mark - The depth of the box lists suspended by
new_local_box_listand of the boxing stack: a mark forunwind_box_lists_to. - check_
timeout - Check if conversion has timed out. Returns Err if deadline exceeded.
- check_
timeout_ now check_timeoutreading the deadline on the exact clock even while a watchdog runs, for a caller that polls rarely (once a page, the render workers’ parent at 10 Hz) and so should not wait for the watchdog’s next 100 ms publish.- clear_
pending_ list_ closers - As a Fatal leaves a construct that took
mark(pending_list_mark) and closes nothing of its own: the closers set inside it go, so its text joins the enclosing list as it is (an\item’s label, digested in its properties: a tag closed there landed in the item before it). - clear_
token_ stack - Empty the stack of tokens being invoked, after a recovered Fatal (Perl
hardYankProcessing, Common/Error.pm:329$$stomach{token_stack} = [], run for every Fatal).invoke_tokenpops its entry only on a normal exit, so every?exit between the push and the pop leaves one: aStomach:RecursionFatal leaves the wholeMAXSTACKof them, and the next digestion after the recovery — the build’s own, a frontmatter name read at insert time — failed its first push with a second, ghost Fatal and stopped the build (2410.07647: 886 words to 96; 2105.02599). Called by the recovery arms besidesalvage_pending_box_lists, after the Fatal is logged (the message lists the stack). - clone_
box_ list - close_
pending_ list_ as - As a Fatal leaves the construct that took
mark(pending_list_mark): how the box list it opened there, still pending, closes if a salvage keeps it (salvage_pending_box_lists). A closer a construct inside it set on the same list (one that opened none of its own) runs first. Nothing when no list is pending atmark. - close_
template_ brace - A
}met at the frame of an alignment cell whose template’s{is open ($\displaystyle{##}$,TEMPLATE_BRACE_OPEN): it closes that{(tex.web §789, the u-part’s brace), the frame stays —G_t(h)=}\det…in an eqnarray cell (2207.06932, 1912.10594). Whether it did. - conversion_
deadline_ passed - Whether the conversion’s deadline (
set_timeout) has passed — for a reader that may never return to a digestion loop (the gullet’s token reads). - current_
frame_ id - Begin a new level of binding by pushing a new stack frame,
and a new level of boxing the digested output.
The serial of the stack frame on top (
lx@frame@id, written bypush_stack_frame); 0 below the first frame. - current_
frame_ message - defer_
print - Material TeX writes out raw for a later run to print — an
\indexphrase (latex.ltx:17713-17726\@sanitizeand\protected@writeto the.idx), a\nomenclatureentry (nomencl.sty:208-219, the.nlo) — is typeset only when the document prints that list (\printindex,\printnomenclature); without one it is never typeset, and its errors are never TeX’s.defer_printkeeps the entry’s tokens (already expanded as the write expands them) under a fresh id and returns that id for the anchor (\lx@deferred@print{id}, which marks the entry’s place);resolve_deferred_printsdigests them when the list is printed, and the anchor absorbs what was digested. Witnesses 1112.3972, 2506.02168 (user ruling 2026-10-18). - deferred_
list_ is_ printed - Whether the list
listhas been printed: an entry made after that is typeset at once (TeX’s.indof the earlier run holds every entry of the document, the later ones too). - deferred_
print_ content - What the deferred entry
iddigested to, once its list was printed (Nonewhile it is not). - digest
- Digest a list of tokens independent from any current Gullet. Typically used to digest arguments to primitives or constructors. Returns a List containing the digested material.
- digest_
as_ delimiter - Digests
f’s token as a delimiter: tex.web §1160scan_delimitertakes a letter or other character by its\delcode, never its\mathcode, so a math-active character (\mathcode(=“8000, the active(a\left() is that character, not its active meaning — which,\left(` itself, recursed without end (2609.40266). - digest_
group_ body_ in_ paragraph - The body of a text-mode
{opened in a paragraph. Perl digests it flat into the paragraph’s list, after an open-brace box (TeX_Box.pool.ltxml:30-42); here it has a list of its own, continuing the paragraph (ParagraphStart::in_group). - digest_
hook_ code digesta hook’s code as the plain input it is in TeX: a group it closes that was opened before it (an end hook’s\egroupclosing its begin hook’s\bgroup) does not end the digestion; the rest of the code is digested in the enclosing group (Perl’sdigeststops there, Stomach.pm:150; OD #1248).- digest_
in_ own_ group - Runs
digestionin a group of its own, as a text built ahead of its use and not read from the document: a tag a reference prints (latexml_engine tags_refnums.rs\lx@tag@intags@held), a form cleveref typesets only at a reference (latexml_package cleveref_sty.rs\lx@cref@docformat), whose text need not close what it opens — the derived\Crefformat\MakeUppercase#2\color{blue}…, whose\MakeUppercasetakes\coloralone (2008.12750, 2604.24399). Whatever the digestion leaves is undone, so the document reads on as it was: the groups it left open are popped asabandon_stack_framepops one, their\aftergroupdiscarded, but not counted as an abandonment, and the group is closed; the alignment brace count (tex.web’salign_state, §789) is put back, as the{such a text scanned is not the document’s — left counted, a figure’s tabular of two captioned minipages read its next&as text and moved the following cell into the row above (“Missing } inserted”, “Extra alignment tab”; guardsperfect_kernel_batch78j::cleveref_format_form_keeps_the_alignment_brace_count,::cleveref_format_form_keeps_an_alignment_row_end). Returns the digestion’s result and the group balance: the groups it left open, or, negative, how many it closed that it did not open. - digest_
next_ body - digest_
speculatively tokensdigested in a run of their own, in a group, from a mouth of their own (an argument read past their end reads nothing of the document’s), the boxes read byread; nothing else of the run stays — its assignments undone, local and global, its diagnostics held and discarded, the frames it left open popped, the tokens being invoked and the conditionals put back (StomachMark), the field ledger too (crate::token::FieldLedgerScope).Nonewhen no journal opens (journals do not nest); a resource Fatal, or an error a run that could not be undone raised, propagates (Fatal stays Fatal). The frontmatter’s label reads (queue_digest.rsspeculative_label_ink) and the reference forms of a label the document wrote (\lx@reread@speculative).- digesting_
delimiter - Whether a delimiter is being digested (
digest_as_delimiter). - drop_
pending_ box_ lists - Drop every pending box list unclosed: a run abandoned for a rerun (
streaming_restart::release_before_rerun). - dump_
frame_ bindings - explain the current frame
LXML_TRACE_FRAMEShelper: which group bindings each of the topnframes carries — a frame withoutgroupInitiatoris a barepush_frame(construct-time scope,\protected@edef, semiverbatim), invisible to the[frames]push/pop trace. - egroup
- End a level of binding by popping the last stack frame, undoing whatever bindings appeared there, and also decrementing the level of boxing.
- end_
environment_ over_ plain_ groups \end{X}met while plain\begingroupgroups opened inside X stand above X’s own frame — raa.cls:322-349\institutename:\begin{flushleft}\begingroup … \end{flushleft}\endgroup. That is TeX’s scoping, not an error: groups are untyped between\begingroupand\endgroup(tex.web §1063-1069), so\end{X}’s\endgroup(latex.ltx:15384-15393\end=\endX+\@checkend+\endgroup;\@checkendreads\@currenvir, still X) closes the innermost one, and the class’s own\endgroupcloses the group\begin{X}opened. Here, as there:- end_
graf - tex.web §1096
end_graf, for an explicit\par: the paragraph ends and its material goes on the vertical list as its line (repack_horizontal). A paragraph that holds nothing still makes a line —\leavevmode\paran indent box alone, which\lastboxtakes and\unskipcannot reach past (Rust kept nothing, so\vskip3pt \leavevmode\par\unskipremoved the\vskip) — unless it is null: no indent box and nothing listed (\noindent\par,\indent\setbox0\lastbox\par;ParagraphStart). Only spaces are kept out of the line (PerlrepackHorizontal: they would make an emptyltx:p), so it absorbs to nothing; the sizing pass gives it a line’s height (font.rs). Every\parthatleave_horizontalinserts only repacks: before a block LaTeXML sets apart (a minipage), where TeX’s paragraph goes on, and also TeX’s own §1094head_for_vmode\par(\vskip,\hrule,\unvboxin a paragraph), which does end it — residual:\vbox{\leavevmode\vskip3pt\hbox{B}}is 9.83pt high, TeX 15pt. The end of a box’s contents (leave_horizontal_internal, §1085) only repacks too. Residual: LaTeX’s\par(\para_end:, latex.ltx:9088)\unskips first, so\noindent\hfill\paris null there too; here it makes a line. - end_
inside_ groups - Records that the document ended inside open groups (
\lx@finalize@document): every construct still digesting isUNENDED. - end_
mode - End processing in
mode; an error is signalled ifstomachis not currently inmode. This also ends a level of grouping. Perl: sub endMode (Stomach.pm lines 522-541) - end_
mode_ opt - Like
end_mode, but with an explicitnoframeoption. Whennoframeis true, executeBeforeAfterGroup is run but the stack frame is not popped. - endgroup
- End a level of binding by popping the last stack frame, undoing whatever bindings appeared there.
- ends_
inside_ groups - How many times the document ended inside open groups on this thread, for
UNENDED. - enter_
horizontal - Switch to horizontal mode without stacking the mode.
Can only switch from vertical|internal_vertical to horizontal.
Perl: sub enterHorizontal.
tex.web
new_graf(L21117) fires\everyparhere (begin_token_list). - enter_
horizontal_ listed_ indent enter_horizontalfor\noindentand\indent: a paragraph whose indent box, if any, is on the list — none for\noindent(tex.web §1091new_graf(false)),\indent’s own whatsit — with\everyparread after it.- enter_
horizontal_ without_ everypar enter_horizontalwithout\everypar, as Perl’senterHorizontal(Stomach.pm:422-433): the paragraph of a box LaTeX resets\everyparin, a float’s caption (PBoxContents; latex.ltx\@floatboxreset→\@setminipageleaves only\@minipagefalsethere), where a hook an enclosing list armed — aasms4’s\references, whose paragraphs are entries — does not run.- environment_
end_ hooks_ ran - Whether the open environment’s end hooks ran already, before the end of a command-form environment left open in it
(
end_command_form_before_enclosing_end): read on that environment’s own frame, so a\begingroupleft above it (raa.cls) does not hide the flag, and an environment begun and ended inside a hook does not see it. - environment_
ended_ by_ group - Whether the environment whose frame is on top is being ended by a plain
group closer (
close_environment_frame) rather than by its own\end: end code TeX never runs then (\end’s hooks, latex.ltx:15386-15393; a theorem’s end mark and postwork) is skipped by the bindings that emit it. - environment_
frame_ under_ hook_ groups - The stack frame (0 = innermost)
\begin{X}opened — the one marked with itsend— when a begin hook left plain groups or a text-mode environment open above it (2001.02707’s\AtBeginEnvironment{thm}{\begin{samepage}}; a hook’s\begin{center}opens no TeX group beyond\begin’s, nested in X’s).Nonewhen X’s frame is on top, when X’s mode is a math mode or its begin code opened a TeX group (a box’s), as TeX opens those inside the hook’s groups, and when a frame above it holds a math mode, a box or a bare\X(not handled: row QA47REB). - execute_
before_ after_ group - Execute tokens stored on beforeAfterGroup (if any); done before popping a stack frame. Perl: sub executeBeforeAfterGroup (Stomach.pm lines 286-295)
- expire_
local_ box_ list - extend_
box_ list - field_
position_ encloses - Whether a token of field position
posis being invoked around the one on top of the stack, fromdepthup (field_token_encloses): a call at that position still digesting what it reads (an environment’s\begin, its body). - field_
token_ encloses - Whether a token with a field provenance (
Token::prov) is being invoked around the one on top of the stack, fromdepthup, a box made of what it digests (its argument, an environment’s body); a group’s opening is none, though{digests up to its}too. - formula_
continues_ past_ par - Whether the inline formula a
\paris read in goes on past it: OXIDIZED_DESIGN #553 as narrowed (66w). The input is looked at, not read (gullet::peek_upcoming_tokens, unexpanded, each token by its current meaning), as far as the formula’s would-be closer — the next$or\)— within the paragraph after the\par. The formula continues when the material before that closer holds a math-only token (a_/^, or a command that isLookaheadCommand::MathOnly): the author split the formula with a blank line and the math goes on (hep-th9402135$Z_{YM}(\epsilon) =⏎⏎\int_{\cal A} … D A$, whose ending put every later$of the paragraph out of step, Fatal TooManyErrors). It does not when no math-only token comes first — that$opens the next paragraph’s own formula, and the\parends this one (tex.web §1047, a forgotten$) — nor on any doubt: no closer before the paragraph’s end (PAR_LOOKAHEAD_STOPS), the bounds (PAR_LOOKAHEAD_LINES,PAR_LOOKAHEAD_TOKENS,PAR_LOOKAHEAD_CHARS), a closer inside a group, a bracket or a$$, a}closing a group the look-ahead did not see open, an&, a command it cannot follow (LookaheadCommand::GiveUp:\verb|make_all|,\lstinline,\url). The arguments of a command that is not math-only are not looked into: a*right after it, then every[…]and{…}group in a row (\cite[p.~2]{smith_2001},\ref*{eq_1},\includegraphics[width=1cm]{fig_1},\citep[e.g.][]{a_b}) — their scripts may be a key’s or a file name’s, never typeset; any other group is ({\cf^{1}/G}$,\left[0,1\right)). The look-ahead starts after the judged\par, its leading\pars and spaces skipped — an\obeylinesline end’s active^^Mamong them (hep-ph9809328). - formula_
reachable - Whether the innermost mode is a formula whose frame carries
flag(INLINE_FORMULA,DISPLAY_FORMULA) and every group opened inside it is oneoff_savecloses on the way (off_save_closer_at). - fragment_
yield_ budget - The armed fragment-yield box budget, if any — see
set_fragment_yield_budget. - fragment_
yield_ count - How many times digestion has yielded since the budget was last set.
- fragment_
yield_ rss_ soft_ kb - The armed soft-RSS yield watermark (KB), if any — see
set_fragment_yield_rss_soft_kb. - get_
boxing_ level - get the current boxing level
- get_
script_ level - ScriptLevel is similar to boxing level, but relative to current Math mode’s level
- hbox_
font_ in_ math - The font an
\hboxopened in math gets: the text font in use before the math (savedfont), with the current colour, background and size (Perl Stomach.pm:531-536,beginMode’s$wasmathbranch);Nonewithout one. - in_
left_ group - Whether the innermost group is the
math_left_groupa\leftopened (its group code, latexml_engine tex_math.rs\lx@math@left@group). - initialize_
stomach - Initialize various stomach parameters, preload, etc.
- inline_
formula_ reachable - Whether the innermost mode is an inline formula (
INLINE_FORMULA) that a math shift read now would end: every group opened inside it is oneoff_savecloses on the way (off_save_closer_at), so the$tex.web §1047 inserts closes those groups (§1193 + §1064-1065) and then the formula. A formula held by a frame LaTeXML’s machinery opened (a constructor’s argument, an environment, an alignment inside it) is not reached, nor is a formula in an alignment, unmarked (latexml_engine tex_math.rs\lx@begin@inline@math). - insert_
dollar_ sign - tex.web §1046-1047
insert_dollar_sign: a command inline math cannot hold (mmode+par_end; an environment’s end, whose\endgroupmeets the math shift group, §1064) arriving in an inline formula — “Missing $ inserted”, the formula’s end read first andagainafter it. Returns whether it was inserted. An Error, as TeX’s; Perl has no such recovery, and the formula ran on through the paragraphs to the next$, its text and the document’s math swapped (OXIDIZED_DESIGN #553; 65d review probes f4, a18, a19). Guardsperfect_kernel_batch65n::{par_in_inline_math_ends_the_formula, environment_end_in_inline_math_ends_the_formula}. - insert_
missing_ right_ before - tex.web §1065
off_savefor the\leftgroup: “Missing \right. inserted”, and\right.read beforeagain(the primitive that met the group, read again). A Warning: TeX errs, Perl does not model it, and the inserted\right.is TeX’s recovery (user ruling 2026-10-11). OXIDIZED_DESIGN #530. - invoke_
token - Invoke a token
- is_
list_ tail_ transparent - Items the list-tail primitives see through, being no node in TeX: a comment, a paragraph’s closing
\parmarker (\lx@normal@par) —\lastboxafter a paragraph takes its line (end_graf), and\unskip,\lastskipand the rest act on what came before the marker —,\noindent, which only starts a paragraph (tex.web §1091), and the boundary marks of a list\unvboxspliced (\lx@splice@begin,\lx@splice@end; tex_box.rsvlist_of):\lastboxafter\unvboxtakes the list’s last box (§1080, §1110). - last_
sampled_ rss_ kb - The most recent sampled RSS in KiB — seeded with the real RSS at
initialize_stomach/rebaseline_soft_yield_growth, then refreshed by the periodic sampler incheck_timeout. - leave_
horizontal - Resume vertical mode by executing \par, in TeX-like fashion. Perl: sub leaveHorizontal
- leave_
horizontal_ internal - Resume vertical mode internally: reset mode without firing \par. Used within argument digestion, e.g. endMode for vertical modes. Perl: sub leaveHorizontal_internal
- mark_
conversion_ rss_ baseline - Record the resident set the spill watermark is measured from: the conversion’s own start, so a persistent worker switches a paper to streaming where that paper alone would (ST3b: 2507.13358 after 63 others).
- mark_
put_ back_ brace - Mark the
}a delimiter scan is putting back (PUT_BACK_BRACE). - new_
local_ box_ list - note_
streaming_ restart_ signal - Record a memory stop for the restart decision (
take_streaming_restart_signal). - off_
save_ closer - The closer tex.web §1064-1065
off_saveinserts for the innermost group when the document opened it:}for a{/\bgroupgroup,\endgroupfor a\begingroupgroup (off_save_closer_at; the\leftgroup’s\right.has its own callers,insert_missing_right_before). OXIDIZED_DESIGN #553. - owe_
inserted_ closer - Record that an inserted
closer(}or\endgroup) took the place of the author’s own: the innermost group owes it (OWED_BRACES/OWED_ENDGROUPS), so that closer, when it comes and meets a group it cannot close, is deleted as tex.web §1069 deletes it. OXIDIZED_DESIGN #530. - owed_
closers - The debt
keybound on the innermost frame (0 when none). - peek_
own_ box - The last item of the current list for
\lastbox,\unskip,\unkernand\unpenalty(tex.web §1080, §1105delete_last), left in place: they look first and remove it only when it is theirs, so nothing they pass over moves. reledmac’s\autopardoes\everypar{\setbox0=\lastbox …}to drop the indent box TeX puts there; reaching past the paragraph’s start took the previous paragraph’s line instead (reledmac.sty:2179; reledmac and eledmac 2-line_numbers_in_header lost 1,448 of ~1,600 words; KNOWN_PERL_ERRORS #401), and\everypar{\unskip}removed the\vskipbefore the paragraph. - pending_
list_ mark - The depth at which a box list opened now is suspended: the mark a construct takes before it digests, for
close_pending_list_as. - pop_
box_ list - pop_
own_ box - Remove the item
peek_own_boxreturns; transparent items after it stay where they are. - pop_
stack_ frame - Removes the last/current stack frame, ending a TeX group
- push_
box_ list - push_
stack_ frame - Adds a new stack frame for a TeX group.
- raw_tex
- Perl
RawTeX(Package.pm:981-997): a convenience function for including chunks of raw TeX (or LaTeX) code It is useful for copying portions of the normal implementation that can be handled simply using macros and primitives. - rebaseline_
soft_ yield_ growth - Re-baseline the growth floor on the CURRENT resident set — called where the adaptive eager phase arms the soft trigger, i.e. after the engine load, so the first growth window measures the document alone.
- record_
left_ group_ input - Record on the innermost frame — the
\leftgroup, whose group code\lx@math@left@grouphas just set — the reading context the\leftwas read in, forclose_left_group_at_input_end. - regurgitate
- steal the previously digested boxes from the current level.
- repack_
horizontal - Repack recently digested horizontal items into single horizontal List. Note that TeX would have done paragraph line-breaking, resulting in essentially a vertical list. Perl: sub repackHorizontal (Stomach.pm lines 440-454)
- request_
fragment_ yield - Ask digestion to yield at the next legal fragment seam whatever the box count — a binding’s signal that a large self-contained unit (a picture) just closed. Inert under eager digestion.
- resolve_
deferred_ prints - Print the list
list: digest every entry deferred for it, in document order, and mark it printed. WithNone, digest every deferred entry of every list without marking any printed — the streaming yield’s fallback (an anchor is built and spilled with the fragment it is in, before a later\printindexcould fill it), where the entries are typeset as Perl typesets them, at once. - resolve_
rss_ cap - Resolve the effective soft-RSS budget:
None= disabled (no ceiling),Some(n)= abort abovenbytes. Precedence: the explicitset_memory_capoverride, elseLATEXML_RSS_CAP_BYTES, else the 4.5 GB default. A cap of0from EITHER source resolves toNone, so--max-memory=0/LATEXML_RSS_CAP_BYTES=0mean “no limit” — not “abort immediately” (a literal0compared asrss_bytes > 0is always true). - salvage_
pending_ box_ lists - Recover the boxes a failed
digest_next_bodyleft stranded, in document order, and reset the accumulation stack. - set_
fragment_ yield_ budget - Ask digestion to yield at legal fragment seams once
budgetboxes have accumulated at the current level (Nonerestores eager digestion). Set by the streaming pass-1 driver; the budget is a box COUNT — the driver derives it from the byte ceiling via the measured per-box footprint, the same basis as the box-list guards. - set_
fragment_ yield_ rss_ soft_ kb - Set (or clear) the soft-RSS yield threshold, in KiB.
- set_
memory_ cap - Override the cooperative soft-RSS memory budget, in bytes.
Some(0)disables the budget;Some(n)caps atnbytes;Nonerestores theLATEXML_RSS_CAP_BYTESenv / built-in default. Mirrors the--max-memoryCLI convention where0means “no limit”. Seeresolve_rss_cap(private) for the precedence order. - set_
mode - Sets the mode without doing any grouping (NOR does it stack the modes!!)
- set_
soft_ yield_ min_ boxes - Minimum boxes that must accumulate before the soft-RSS yield branch may fire (the box-budget branch is unaffected and still yields on its own).
- set_
spill_ disabled - See
SPILL_DISABLED; wins over the override, the env and the default. - set_
spill_ watermark_ override - See
SPILL_WATERMARK_OVERRIDE;Nonerestores the env/default policy. - set_
stomach - set_
streaming_ restart_ watermark - Arm (or clear) the streaming-restart watermark for this thread.
- set_
timeout - Set a conversion timeout (seconds from now). 0 = no timeout.
- soft_
cap_ from_ ceiling - Derive the cooperative soft-RSS budget (bytes) from the hard
--max-memoryceiling (MiB). The soft fuse sits at 75% of the ceiling, leaving ~25% headroom for the post-processing phase (libxml DOM + XSLT) that runs above digestion and which this cooperative guard cannot see.0in →0out (disabled), so--max-memory=0disables the whole memory limit. This keeps--max-memorythe single knob: the hard Watchdog rides the ceiling, this fuse rides a fixed fraction below it — no independent second number. - soft_
yield_ min_ boxes - Cached: this sits on the per-seam yield predicate, which the 131 MB witness
evaluates tens of millions of times — an
std::env::varthere would be its own hotspot. - spill_
mark_ kb - The resident set (KB) at which this conversion spills:
spill_watermark_bytesabove its starting RSS, never closer to the fuse (process RSS, it guards the machine) than two watermarks — the headroom the fuse fraction was calibrated for (a half-of-fuse mark crept into the fuse,spill_watermark_bytes). With the default third-of-fuse watermark that cap is the watermark itself, so under a fuse the mark is absolute, as before the conversion’s baseline (revSTRM: a worker near its recycle threshold must not spill later than the calibration allows); the baseline moves the mark only without a fuse or under a smaller calibration watermark. Order independence rests on a switched conversion writing the eager XML, not on the mark. A zero watermark (a test’s or a calibration’sLATEXML_SPILL_AT_MIB=0) puts every seam over it. - spill_
watermark_ bytes - The RAM watermark, in bytes above the conversion’s starting RSS (
spill_mark_kb), at which streaming pass 1 begins spilling closed subtrees to disk — the second derived quantity of the single--max-memoryknob, and deliberately NOT a flag of its own (a watermark a user could raise above the fuse would Fatal before it ever spilled). - split_
off_ after_ leading_ math - The boxes of an unfinished math list a Fatal left pending that its construct does not own (OD #251): from the first
box that is not math material on, when the list leads with math. A math construct whose ender failed (a stray
$, an\endagainst an open group) takes in the text, displays and sections after it, where the formula drops them (2203.12624, cond-mat9807003); they go back to the enclosing list, in order, as the salvage did before closers. - stash_
fatal - Keep
fatalfor the next digestion or build step to raise, as Perl’sdiestops there: a register getter’s (Definition::value_ofreturns anOption), afontTest’s inDocument::set_node. The first one is kept. - stomach_
root - take_
fragment_ yielded - Did the last
digest_next_bodyreturn because of the yield budget (rather than EOF / terminal / depth-drop)? Read-and-clear. - take_
implicit_ indent \lastboxat the start of a paragraph begun by a letter or\leavevmodetakes its indent box (tex.web §1080), which LaTeXML does not list: the paragraph is then without one, and null if nothing follows (§1096). True when there was one to take.- take_
stashed_ fatal - Take the stashed Fatal out to raise it, marked as printed (its line is: a Fatal logged since must not make a sink print it again).
- take_
streaming_ restart_ signal - The pending memory stop, cleared by the read.
- token_
stack_ depth - The depth of the stack of tokens being invoked, for
truncate_token_stackto put back. - truncate_
token_ stack - Drop the tokens above
depth(token_stack_depth) that failed invocations left on the stack of tokens being invoked (seeclear_token_stack). - until_
body_ at_ own_ level - Whether the open until-body’s own loop reads the next token: no group of the body is open inside it (an
unbalanced
\abstract{has its{open), so its terminal ends it without closing one (until_terminal_inside_group). - until_
terminal_ inside_ group - Return the digested
Listafter reading and digesting a body from the its Gullet. The body extends until the current level of boxing or environment is closed. A bounded body’s terminal token (\lx@add@frontmatter@until’s\lx@end@abstract…) invoked INSIDE a group opened within that body — a{group is a nested digest body here (and in Perl, TeX_Box.pool.ltxml: 30-41), so the body’s own loop never sees the token. LaTeX’s rule for an environment end met inside an open group is\@checkend’s “\begin{X} ended by \end{Y}” (latex.ltx:15394) with the groups closed by the error recovery; here the groups above the body are abandoned (abandon_stack_frame: popped,\aftergroupdiscarded) with a Warning, and the body’s loop is told its terminal arrived (lx@until@terminal@hit). Returns true when it acted. Witness: screenplay-pkg.tex:67\abstract{…\section— the section then lands at document level, as the brace-less form does. - unwind_
box_ lists_ to - Back to the box lists and boxing depth of
mark(box_lists_mark), what was digested since discarded: the lists a failed digestion left suspended (anErrleaves eachnew_local_box_listit was in unexpired) for a run that is undone (sect05.rstitle_page_probe_run). - with_
box_ list - with_
box_ list_ levels - The box lists being built, innermost first: the current
box_list, then each outer one suspended onlocalized_box_list(bynew_local_box_list), outward. A binding asking what an enclosing construct has digested so far (sect11.rsholds_nothing_yet) reads them from where it is, inside an environment’s or a box’s own list. - with_
box_ list_ mut - with_
box_ list_ mut_ vec - Access to the current box_list as a
&mut Vec— allows push/pop operations. - with_
own_ adjust_ queue - Run
f, the digestion of a list of its own whose\vadjustmaterial never reaches the paragraph around it: a restricted horizontal box’s contents (\hbox,\mbox,\sbox, calc’s\widthof, pgfmath’swidth()), where it stays in the box and prints nothing (tex.web §655 migrates it only when the packer is handed an adjust list: a paragraph’s lines §889, an alignment’s cells §796), and a\vadjust’s own material, whose paragraph sets what it queued. The list starts with an empty queue and the paragraph’s is put back after (KNOWN_PERL_ERRORS #441; guardbox_primitives::vadjust). Residuals: a vertical-mode\hbox(§1076adjusted_hbox_group) drops it too, where TeX sets it after the box; a tabular’s cells inside the box lose theirs (§799 sets it after the row); hboxes built outside the box reader (\phantom,\text,\resizebox,\underline) keep printing theirs (RED boxes-groups/vadjust_material_stays_in_its_hbox). - with_
own_ box_ list - The current list’s own items, as
pop_own_boxsees them: in a paragraph only what the paragraph added. What\lastpenalty,\lastkernand\lastskipread (tex.web §424, the tail of the current list) must be what\unpenalty,\unkernand\unskipcan remove: reading a vertical penalty from before the paragraph that\unpenaltycould not remove looped diagram.sty’s\ifnum\lastpenalty…\unpenalty(2605.02221, 2605.25087). The readers skipis_list_tail_transparentitems.
Type Aliases§
- Pending
List Closer - How a box list a Fatal leaves pending closes when the salvage keeps it (
salvage_pending_box_lists, OD #251): the list’s boxes in, what goes to the enclosing list out. Set by the construct that opened the list (close_pending_list_as); a list with none joins the enclosing one as it is (a body, a group).