Skip to main content

Module content

Module content 

Source

Structs§

FindFileOptions
configuration for searching for a file in the local filesystem
InputDefinitionOptions
a configuration for loading LaTeX definition files (such as .sty, .cls, and their bindings)
InputOptions
configuration for input of a TeX source (content files mostly)
RequireOptions

Enums§

FallbackKind
Kind of fallback that matched, returned by find_file_fallback.

Functions§

build_invocation
Creates a single Tokens representing a TeX invocation of the lead token over a list of arguments.
build_invocation_str
String entry point for Invocation (Perl: Invocation($token,@args) with a string first argument). The string is tokenized via TokenizeInternal; if it yields a single token, this reduces to build_invocation on that token. Otherwise the tokens are treated as an “anonymous macro” containing parameter markers like #1, and the arguments are substituted in.
convert_latex_args
Convert a LaTeX-style argument spec to our Package form. Ie. given $nargs and $optional, being the two optional arguments to something like \newcommand, convert it to the form we use
convert_twoopt_args
Two-optional variant of convert_latex_args — mirrors Perl’s convert2optArgs helper in twoopt.sty.ltxml. \newcommandtwoopt{\cs}[n][d1][d2]{…} builds a signature of [Default d1][Default d2]{…}… where the remaining n - 2 args are plain required.
def_color
Define a named color (Perl: DefColor). Stores as color_{name} and also defines \color@{name} macro.
def_color_model
Define a derived color model (Perl: DefColorModel). Stores conversion functions for a derived color model.
digest_if
digest_literal
digest_text
Digest tokens in text mode, whatever mode the caller is in.
execute_options
Execute a list of options (Perl: ExecuteOptions). Tries each option’s \ds@{option} definition; logs unexpected ones.
find_file
search for a file as prescribed by a FindFileOptions configuration
find_file_fallback
Strip version/arxiv suffixes from package names to find existing bindings. Returns the fallback filename (with extension) and which kind of fallback fired.
find_file_fallback_exists
Perl Package.pm L2141-2210: FindFile_fallback Pure-check variant of find_file_fallback: strips the same suffix/prefix patterns and reports whether the fallback name has a registered binding, but DOES NOT eagerly invoke the binding’s load_definitions. Use this from pre-flight existence checks (e.g. class_cls_via_fallback in tex_job.rs) where firing the binding’s body has side effects (\LoadClass, \RequirePackage) that contaminate the subsequent real load. Witness: astro-ph0002213 — the \psfig cluster fix (mn1 → mn fallback was eagerly running mn.cls’s \LoadClass{article} before the \documentstyle[epsfig]{mn1} option-pass-through machinery had a chance to enqueue epsfig into opt@article.cls).
font_decode
Decode a codepoint using the fontmap for a given font and/or encoding (Perl: FontDecode). Returns the decoded glyph (if any) and the possibly-adjusted font.
font_decode_string
Decode a string using the fontmap for a given encoding (Perl: FontDecodeString). If implicit is true, codepoints missing from the map decode to themselves.
if_condition
Test a conditional \ifXXX and return its boolean result (Perl: IfCondition). Looks up the conditional’s test closure and invokes it.
input
This is essentially the \input equivalent
input_content
Input for cases when the file (or data) is plain TeX material that is expected to contribute content to the document (as opposed to pure definitions).
input_definitions
TODO: Flesh out with the full infrastructure, incremental functionality for now.
install_tag
Declare document-model properties for one element tag — Perl’s Tag (Package.pm L2015-2030).
load_binding
loads a binding from the main binding dispatcher, if available+found. Ok(Some(source)) on load — source is the on-disk path for a runtime .rhai file binding, None for a compiled-in one; Ok(None) = not loaded.
load_class
Load a document class — the \documentclass / \LoadClass implementation, port of Perl Package.pm:LoadClass L2702-2730.
load_class_with_options
Perl: LoadClass($name, withoptions => 1) — load a class passing the caller’s class options through to the child. Reads class_options from state (populated by the outer \documentclass invocation) and forwards those as the child’s options list, matching Perl Package.pm LoadClass’s withoptions branch.
load_external_binding
loads a binding from an external binding dispatcher, if available+found
load_font_map
load_tex_content
merge_font
Merge font attributes into the current font, locally — the change reverts with the enclosing TeX group.
merge_font_ref
Like merge_font but borrows the font. Saves a clone when the caller has a shared reference (e.g. via Rc) to the font being merged.
pass_options
Pass the sequence of @options to the package $name (if $ext is ‘sty’), or class $name (if $ext is ‘cls’). Perl Package.pm: PassOptions($name, $ext, @options) Stores options to be processed when the package/class is loaded.
preload_font_map
process_options
Perl Package.pm L2430-2465: ProcessOptions / ProcessOptions* inorder=false (\ProcessOptions) — execute in declared order, default handler for undeclared inorder=true (\ProcessOptions*) — execute in order passed, class options silently skipped
require_package
An opinionated binding for \RequirePackage.
require_package_with_options
Perl: RequirePackage($name, withoptions => 1) — forward the current package/class’s options to the required child package. Reads \@currname / \@currext to identify the caller, looks up its opt@<name>.<ext> options, and passes them explicitly as the child’s options list. Mirrors load_class_with_options for the package path.
require_resource
Attach a resource (CSS, JavaScript, …) to the document being built.
select_relaxng_schema
Selects the RelaxNG schema defining the XML output language
set_condition
Set the boolean value of a \newif-type conditional (Perl: SetCondition). This is only for simple conditionals taking no arguments.