Skip to main content

Module stomach

Module stomach 

Source
Expand description

The stomach is an abstraction responsible for digesting Tokens and Registers prepared by the Gullet into Boxes

Structs§

SpeculativeDigest
What digest_speculatively read of its run.
Stomach
The Stomach is responsible for digesting tokens into boxes, lists, etc.
StomachMark
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 (a Stomach:Recursion) left the whole MAXSTACK of tokens on the stack, and the document’s next digestion failed its first push with a ghost Fatal of its own (2502.10606’s \thanks inside a \thanks, all 8,054 words lost, as clear_token_stack’s 2410.07647); a \fi of the run’s closing a conditional the document opened before it left that conditional closed for the document, whose own \fi then had none (2003.03814: CUP-JNL-DCE.cls:505 \keywords leaves its \ifx open, \fi inside \@keywords, which \printkeywords balances; the title-page run’s \printkeywords closed it and the class’s real \maketitle raised “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§

RestartSignal
Why eager digestion stopped for memory on this thread.

Constants§

DISPLAY_FORMULA
Marks the frame of a display $$…$$ opened by \lx@begin@display@math outside 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), as INLINE_FORMULA marks 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-1047 insert_dollar_sign ends. OXIDIZED_DESIGN #553.
OWED_BRACES
The closers a frame owes: off_save (tex.web §1064-1065, latexml_engine tex_math.rs left_right_group) inserted a } or \endgroup for a \right/\middle that 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 \endgroup twin of OWED_BRACES.
PUT_BACK_BRACE
The } a \left/\middle/\right delimiter scan put back after “Missing delimiter” (latexml_engine tex_math.rs missing_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_mark in delete_extra_brace and at invoke_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 SALVAGED whatsit 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_whatsit sets it (ends_inside_groups moved during the digestion); the document lets every element such a whatsit opens auto-close (Document::open_element), Perl’s per-node _autoclose (Document.pm canAutoClose), so that structure closes it instead of being held inside as malformed:* (1611.05714, 1101.1959, physics0505113, math9805003). OXIDIZED_DESIGN #542.

Functions§

abandon_stack_frame
Abandons the current group, tex.web §1335 final_cleanup style: the stack frame (and its boxing entry, unless the group is non-boxing) is popped and its \aftergroup list 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, \cr or \span that 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_error steps the count towards 0 and ins_error’s back_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} lost a without a word. Perl has no align_error (KNOWN_PERL_ERRORS #923). Whether it fired. Guards perfect_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-memory ceiling (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. If noframe is 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 explicit noframe option. When noframe is true, no stack frame is pushed (the caller already did bgroup).
begin_mode_under_hook_groups
begin_mode_opt for X under a begin hook’s open groups (environment_frame_under_hook_groups): the mode is bound in the frame marked with end, 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 font set_mode_from binds 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 \begin that the open until-body is read in — LaTeX’s \@currenvir, whose end \@checkend checks — or None when 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’s current_environment, or lx@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_list and of the boxing stack: a mark for unwind_box_lists_to.
check_timeout
Check if conversion has timed out. Returns Err if deadline exceeded.
check_timeout_now
check_timeout reading 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_token pops its entry only on a normal exit, so every ? exit between the push and the pop leaves one: a Stomach:Recursion Fatal leaves the whole MAXSTACK of 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 beside salvage_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 at mark.
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 by push_stack_frame); 0 below the first frame.
current_frame_message
defer_print
Material TeX writes out raw for a later run to print — an \index phrase (latex.ltx:17713-17726 \@sanitize and \protected@write to the .idx), a \nomenclature entry (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_print keeps 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_prints digests 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 list has been printed: an entry made after that is typeset at once (TeX’s .ind of the earlier run holds every entry of the document, the later ones too).
deferred_print_content
What the deferred entry id digested to, once its list was printed (None while 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 §1160 scan_delimiter takes 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
digest a hook’s code as the plain input it is in TeX: a group it closes that was opened before it (an end hook’s \egroup closing its begin hook’s \bgroup) does not end the digestion; the rest of the code is digested in the enclosing group (Perl’s digest stops there, Stomach.pm:150; OD #1248).
digest_in_own_group
Runs digestion in 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 \Cref format \MakeUppercase#2\color{blue}…, whose \MakeUppercase takes \color alone (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 as abandon_stack_frame pops one, their \aftergroup discarded, but not counted as an abandonment, and the group is closed; the alignment brace count (tex.web’s align_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”; guards perfect_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
tokens digested 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 by read; 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). None when 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.rs speculative_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_FRAMES helper: which group bindings each of the top n frames carries — a frame without groupInitiator is a bare push_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 \begingroup groups 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 \begingroup and \endgroup (tex.web §1063-1069), so \end{X}’s \endgroup (latex.ltx:15384-15393 \end = \endX + \@checkend + \endgroup; \@checkend reads \@currenvir, still X) closes the innermost one, and the class’s own \endgroup closes 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\par an indent box alone, which \lastbox takes and \unskip cannot reach past (Rust kept nothing, so \vskip3pt \leavevmode\par\unskip removed 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 (Perl repackHorizontal: they would make an empty ltx:p), so it absorbs to nothing; the sizing pass gives it a line’s height (font.rs). Every \par that leave_horizontal inserts only repacks: before a block LaTeXML sets apart (a minipage), where TeX’s paragraph goes on, and also TeX’s own §1094 head_for_vmode \par (\vskip, \hrule, \unvbox in 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\par is 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 is UNENDED.
end_mode
End processing in mode; an error is signalled if stomach is not currently in mode. This also ends a level of grouping. Perl: sub endMode (Stomach.pm lines 522-541)
end_mode_opt
Like end_mode, but with an explicit noframe option. When noframe is 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 \everypar here (begin_token_list).
enter_horizontal_listed_indent
enter_horizontal for \noindent and \indent: a paragraph whose indent box, if any, is on the list — none for \noindent (tex.web §1091 new_graf(false)), \indent’s own whatsit — with \everypar read after it.
enter_horizontal_without_everypar
enter_horizontal without \everypar, as Perl’s enterHorizontal (Stomach.pm:422-433): the paragraph of a box LaTeX resets \everypar in, a float’s caption (PBoxContents; latex.ltx \@floatboxreset → \@setminipage leaves only \@minipagefalse there), 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 \begingroup left 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 its end — 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). None when 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 pos is being invoked around the one on top of the stack, from depth up (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, from depth up, 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 \par is 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 is LookaheadCommand::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 \par ends 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 \obeylines line end’s active ^^M among 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 one off_save closes 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 \hbox opened 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 $wasmath branch); None without one.
in_left_group
Whether the innermost group is the math_left_group a \left opened (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 one off_save closes 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 \endgroup meets the math shift group, §1064) arriving in an inline formula — “Missing $ inserted”, the formula’s end read first and again after 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). Guards perfect_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_save for the \left group: “Missing \right. inserted”, and \right. read before again (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 \par marker (\lx@normal@par) — \lastbox after a paragraph takes its line (end_graf), and \unskip, \lastskip and 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 \unvbox spliced (\lx@splice@begin, \lx@splice@end; tex_box.rs vlist_of): \lastbox after \unvbox takes 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 in check_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_save inserts for the innermost group when the document opened it: } for a {/\bgroup group, \endgroup for a \begingroup group (off_save_closer_at; the \left group’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 key bound on the innermost frame (0 when none).
peek_own_box
The last item of the current list for \lastbox, \unskip, \unkern and \unpenalty (tex.web §1080, §1105 delete_last), left in place: they look first and remove it only when it is theirs, so nothing they pass over moves. reledmac’s \autopar does \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 \vskip before 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_box returns; 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 \left group, whose group code \lx@math@left@group has just set — the reading context the \left was read in, for close_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. With None, 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 \printindex could 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 above n bytes. Precedence: the explicit set_memory_cap override, else LATEXML_RSS_CAP_BYTES, else the 4.5 GB default. A cap of 0 from EITHER source resolves to None, so --max-memory=0 / LATEXML_RSS_CAP_BYTES=0 mean “no limit” — not “abort immediately” (a literal 0 compared as rss_bytes > 0 is always true).
salvage_pending_box_lists
Recover the boxes a failed digest_next_body left stranded, in document order, and reset the accumulation stack.
set_fragment_yield_budget
Ask digestion to yield at legal fragment seams once budget boxes have accumulated at the current level (None restores 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 at n bytes; None restores the LATEXML_RSS_CAP_BYTES env / built-in default. Mirrors the --max-memory CLI convention where 0 means “no limit”. See resolve_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; None restores 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-memory ceiling (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. 0 in → 0 out (disabled), so --max-memory=0 disables the whole memory limit. This keeps --max-memory the 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::var there would be its own hotspot.
spill_mark_kb
The resident set (KB) at which this conversion spills: spill_watermark_bytes above 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’s LATEXML_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-memory knob, 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 \end against 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 fatal for the next digestion or build step to raise, as Perl’s die stops there: a register getter’s (Definition::value_of returns an Option), a fontTest’s in Document::set_node. The first one is kept.
stomach_root
take_fragment_yielded
Did the last digest_next_body return because of the yield budget (rather than EOF / terminal / depth-drop)? Read-and-clear.
take_implicit_indent
\lastbox at the start of a paragraph begun by a letter or \leavevmode takes 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_stack to put back.
truncate_token_stack
Drop the tokens above depth (token_stack_depth) that failed invocations left on the stack of tokens being invoked (see clear_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 List after 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, \aftergroup discarded) 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 (an Err leaves each new_local_box_list it was in unexpired) for a run that is undone (sect05.rs title_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 on localized_box_list (by new_local_box_list), outward. A binding asking what an enclosing construct has digested so far (sect11.rs holds_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 \vadjust material never reaches the paragraph around it: a restricted horizontal box’s contents (\hbox, \mbox, \sbox, calc’s \widthof, pgfmath’s width()), 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; guard box_primitives::vadjust). Residuals: a vertical-mode \hbox (§1076 adjusted_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_box sees them: in a paragraph only what the paragraph added. What \lastpenalty, \lastkern and \lastskip read (tex.web §424, the tail of the current list) must be what \unpenalty, \unkern and \unskip can remove: reading a vertical penalty from before the paragraph that \unpenalty could not remove looped diagram.sty’s \ifnum\lastpenalty…\unpenalty (2605.02221, 2605.25087). The readers skip is_list_tail_transparent items.

Type Aliases§

PendingListCloser
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).