Skip to main content

subfile_scope_at_depth

Function subfile_scope_at_depth 

Source
pub fn subfile_scope_at_depth(depth: usize) -> SymStr
Expand description

Named scope bracketing a subfile LaTeXML included itself — a standalone child’s preamble, an \imported file. Real LaTeX has no group at either spot (standalone gobbles the child preamble; import restores its paths by plain \def after the \input), so a package loaded inside one is an artifact of LaTeXML executing what the real packages skip. Bindings that open such a bracket activate this scope; require_package reads it to decide whether a load must outlive the bracket. See OXIDIZED_DESIGN #65.

The name carries the frame depth of the bracket that opened it — Perl’s own section:4 / label:foo convention (State.pm L965-975) — because activity alone is not enough: StashActive is Scope::Local at the bracket’s frame, so a plain “is the region active?” test is ALSO true at every deeper frame, and an author’s {\usepackage{…}} written inside a subfile preamble would be hoisted as well. That is a downgrade: pdflatex and Perl both leave such a package lost. Matching the depth confines the region to the bracket’s own level.