Skip to main content

Module post

Module post 

Source
Expand description

Post-processing pipeline API.

Provides a public interface to the LaTeXML post-processing pipeline (Scan → Bibliography → CrossRef → Graphics → Split → MathML → XSLT → HTML5 fixups). Used by both the latexml_oxide binary and the cortex_worker binary.

Structs§

CoreReleaseAfterBibGuard
RAII guard returned by arm_core_release_after_bib that clears the flag on drop even if post-processing returns early before MakeBibliography.
PostOptions
Options for the post-processing pipeline.
PostOutcome
Result of run_post_processing_logged: the serialized HTML plus the post-phase log text and status code, mirroring Perl LaTeXML.pm’s convert_post, which flushes the log AFTER post and folds the post status into the final max(core, post) verdict (L631-634).
StagedHandoff
A core handoff staged on disk for the streaming file parser, removed when dropped and on the exits that skip destructors.

Functions§

arm_core_release_after_bib
Arm one-shot teardown of dead core TeX engine state (STATE, STOMACH, GULLET, StringInterner, and per-conversion caches) on the current thread right after MakeBibliography completes in run_post_processing_*.
default_stylesheet
The built-in XSLT stylesheet for an output format (Perl Config.pm L543-551), as the embed:/// name served from the binary, never a copy on disk (#806). Returns None for a format with no default (e.g. xml), so a caller keeps --stylesheet / no post.
parse_xslt_parameter
Split one --xsltparameter into (name, value): Perl’s name:value (LaTeXML.pm L575 /^\s*(\w+)\s*:\s*(.*)$/, bin/latexmlpost L354) first, else our name=value; None when it is neither (#803).
reserve_core_handoff
The handoff file a split run’s core result is serialized into (Config::handoff_file), reserved before the conversion: when the run would take the streaming split, which parses only files, the document-sized String would exist only to be staged (2 GiB on Nasser’s whole book, issue 777). None when it would not.
run_post_processing
Run the post-processing pipeline on in-memory XML output.
run_post_processing_from_file
File-input variant of run_post_processing.
run_post_processing_from_file_logged
File-input variant of run_post_processing_logged: parses the XML from disk via libxml2’s streaming reader rather than from an in-memory String. Used for already-converted .xml inputs, where slurping the file would keep a whole extra copy of a multi-hundred-MB document resident alongside the DOM.
run_post_processing_logged
Run post-processing while capturing its log into a fresh thread-local LOG_BUFFER. Converter::convert() already flushed the core log into its own response, leaving the buffer unbound — so without re-binding here every post-phase Info!/Warn!/post_error (incl. a silent EPS→PNG failure) reaches stderr only and never the persisted --log/cortex.log. Perl’s single flush_log() after convert_post sweeps up the post log for ALL consumers; this is the Rust equivalent, shared by the latexml_oxide and cortex_worker binaries so their logs reach parity. See SYNC_STATUS task 5.
run_post_processing_owned_logged
run_post_processing_logged taking the core result by value: a handoff staged to disk (see handoff_needs_file) is dropped before post runs, so the core XML is not resident beside the post pipeline — on Nasser’s 2,400-problem book a few hundred MB of the single-invocation peak.
run_post_processing_staged_logged
run_post_processing_owned_logged for a core result the conversion serialized into staged (reserve_core_handoff), so no String of it ever existed. A file the gate keeps in memory (a test’s LATEXML_POST_STREAM_THRESHOLD above its size) is read back and post-processed as that String would be.
used_core_handoff
The reserved handoff, kept only when the core serialized into it (ConversionResponse::handoff_file). An unused one is dropped here, removing a file an earlier attempt wrote: a fused eager attempt’s salvage, when the --streaming rerun on the same path ends without a document.