Skip to main content

TeXEngine

Trait TeXEngine 

Source
pub trait TeXEngine: Sized {
    type Types: EngineTypes;

    // Required method
    fn get_engine_refs(&mut self) -> EngineReferences<'_, Self::Types>;

    // Provided methods
    fn init_file(&mut self, s: &str) -> TeXResult<(), Self::Types> { ... }
    fn run<F: FnMut(&mut EngineReferences<'_, Self::Types>, VNode<Self::Types>) -> TeXResult<(), Self::Types>>(
        &mut self,
        f: F,
    ) -> TeXResult<(), Self::Types> { ... }
    fn do_file_default<F: FnMut(&mut EngineReferences<'_, Self::Types>, VNode<Self::Types>) -> TeXResult<(), Self::Types>>(
        &mut self,
        s: &str,
        f: F,
    ) -> TeXResult<(), Self::Types> { ... }
    fn initialize_tex_primitives(&mut self) { ... }
    fn initialize_plain_tex(&mut self) -> TeXResult<(), Self::Types> { ... }
    fn initialize_etex_primitives(&mut self) { ... }
    fn initialize_eplain_tex(&mut self) -> TeXResult<(), Self::Types> { ... }
    fn load_latex(&mut self) -> TeXResult<(), Self::Types> { ... }
}
Expand description

A TeXEngine combines all necessary components (see EngineTypes) to compile a TeX file into some output format.

Required Associated Types§

Required Methods§

Source

fn get_engine_refs(&mut self) -> EngineReferences<'_, Self::Types>

Returns mutable references to the components of the engine.

Provided Methods§

Source

fn init_file(&mut self, s: &str) -> TeXResult<(), Self::Types>

Initializes the engine with a file, e.g. latex.ltx or pdftex.cfg.

§Errors

On TeX errors in init files

Source

fn run<F: FnMut(&mut EngineReferences<'_, Self::Types>, VNode<Self::Types>) -> TeXResult<(), Self::Types>>( &mut self, f: F, ) -> TeXResult<(), Self::Types>

§Errors

On TeX errors in init files

Source

fn do_file_default<F: FnMut(&mut EngineReferences<'_, Self::Types>, VNode<Self::Types>) -> TeXResult<(), Self::Types>>( &mut self, s: &str, f: F, ) -> TeXResult<(), Self::Types>

Compile a .tex file. All finished pages are passed to the provided continuation.

§Errors

On TeX errors

Source

fn initialize_tex_primitives(&mut self)

Registers all primitives of plain TeX and sets the default variables.

Source

fn initialize_plain_tex(&mut self) -> TeXResult<(), Self::Types>

Initialize the engine by processing plain.tex.

§Errors

On TeX errors

Source

fn initialize_etex_primitives(&mut self)

Registers all primitives of plain TeX, e-TeX and sets the default variables.

Source

fn initialize_eplain_tex(&mut self) -> TeXResult<(), Self::Types>

Initialize the engine by processing eplain.tex.

§Errors

On TeX errors

Source

fn load_latex(&mut self) -> TeXResult<(), Self::Types>

Initialized the engine by processing latex.ltx. Only call this (for modern LaTeX setups) after calling initialize_etex_primitives first.

§Errors

On TeX errors

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§