Skip to main content

StdlibConfig

Struct StdlibConfig 

Source
pub struct StdlibConfig {
Show 16 fields pub blocks: BlocksConfig, pub userdefs: UserdefsConfig, pub headings: HeadingsConfig, pub numbering: NumberingConfig, pub math: MathConfig, pub refs: RefsConfig, pub lists: ListsConfig, pub xnotes: XnotesConfig, pub defterm: DeftermConfig, pub theorems: TheoremsConfig, pub quote: QuoteConfig, pub annotations: AnnotationsConfig, pub graphics: GraphicsConfig, pub floats: FloatsConfig, pub cells: CellsConfig, pub citations: CitationsConfig,
}
Expand description

The configuration of the standard features: one field for each of the sixteen standard features that take a configuration. The other seventeen features take none.

add_features constructs each of these features from its field. Each field’s documentation says what it holds and what its default is; StdlibConfig::new is the default of every field. A feature’s configuration is the plain Rust value the feature is constructed from; it is fixed when the registry is built and cannot vary per document or per render (see settings, options and configuration). The configurations are fixed then because the commands the language knows, the trees a run freezes and the reference points that are numbered depend on them.

A program that reads the configurations as data uses add_features_from_settings, which reads each field from the settings of its feature.

§Examples

use flm_core::stdlib::StdlibConfig;
use flm_core::stdlib::features::blocks::BlocksConfig;
use flm_core::stdlib::features::headings::HeadingsConfig;

let config = StdlibConfig::new()
    .blocks(BlocksConfig::no_typography())
    .headings(HeadingsConfig::new().run_in_levels([4, 5]));
assert!(!config.blocks.auto_unicode_quotes);
assert!(config.headings.heading("paragraph").is_some_and(|kind| kind.run_in));

Fields§

§blocks: BlocksConfig

The blocks feature’s text options.

§userdefs: UserdefsConfig

The userdefs feature’s user definitions and expansion depth limit. A program that gathers definitions from several sources merges them into this one configuration.

§headings: HeadingsConfig

The headings feature’s heading kinds and heading commands, and which kinds are numbered. By default, the five standard kinds section to subparagraph, none set as a run-in heading and none numbered.

§numbering: NumberingConfig

The numbering feature’s style replacements: counter styles that each replace, by name, the counter style a feature declared. No replacement by default.

§math: MathConfig

The math feature’s configuration: whether equations are numbered. They are by default.

§refs: RefsConfig

The refs feature’s configuration: the texts that join the items of a reference to several targets. By default, A and B and A, B, and C.

§lists: ListsConfig

The lists feature’s list environments: whether each numbers its items, and the labels it writes beside them at each depth. By default, itemize, enumerate and description.

§xnotes: XnotesConfig

The xnotes feature’s xnote kinds: each kind’s commands, words, numbering, placement and list. By default, the one kind footnote, written \footnote{…}, numbered and listed after the content.

§defterm: DeftermConfig

The defterm feature’s configuration: the lead-in a term definition opens with, a template in which #{term} is the term. By default, #{term}: .

§theorems: TheoremsConfig

The theorems feature’s theorem classes and theorem kinds: the theorem-like environments, their words, numbering, heading, closing mark and back-reference. By default, the eight standard kinds, theorem to proof.

§quote: QuoteConfig

The quote feature’s quote environments: the quotation section commands each accepts, and what content written outside any quotation section is read as. By default, quote, blockquote and address.

§annotations: AnnotationsConfig

The annotations feature’s annotators: each one’s command and initials, in order. By default, no annotator, and therefore no command.

§graphics: GraphicsConfig

The graphics feature’s configuration: whether \includegraphics can be written anywhere in the document’s text, and not only in a float’s body. Not by default.

§floats: FloatsConfig

The floats feature’s float types: each one’s numbering policy, words, content handlers and label types. By default, figure and table, each numbered when it carries a \label.

§cells: CellsConfig

The cells feature’s configuration: whether the cells environment can be written anywhere a block can, and not only in the body of a float of the table float type. Not by default.

§citations: CitationsConfig

The citations feature’s configuration: the form of a citation mark, the citation counter style and the text before a note. By default, bracketed marks: arabic numbers between [ and ], the words ref.~ and refs.~, and ; before a note.

Implementations§

Source§

impl StdlibConfig

Source

pub fn new() -> StdlibConfig

The default configuration: every family of typographic substitutions on, no user definitions, the five standard heading kinds and their commands with none numbered, no counter style replaced, equations numbered, the default texts that join a reference to several targets, the three standard list environments, the one xnote kind footnote, the lead-in #{term}: , the eight standard theorem kinds, the three standard quote environments, no annotator, \includegraphics only in a float’s body, the float types figure and table, the cells environment only in the body of a table float, and bracketed citation marks in the default citation counter style.

Source

pub fn blocks(self, blocks: BlocksConfig) -> StdlibConfig

Builder: sets the blocks feature’s text options.

Source

pub fn userdefs(self, userdefs: UserdefsConfig) -> StdlibConfig

Builder: sets the userdefs feature’s user definitions and expansion depth limit.

Source

pub fn headings(self, headings: HeadingsConfig) -> StdlibConfig

Builder: sets the headings feature’s heading kinds, heading commands, and which kinds are numbered.

Source

pub fn numbering(self, numbering: NumberingConfig) -> StdlibConfig

Builder: sets the numbering feature’s counter style replacements.

Source

pub fn math(self, math: MathConfig) -> StdlibConfig

Builder: sets the math feature’s configuration.

Source

pub fn refs(self, refs: RefsConfig) -> StdlibConfig

Builder: sets the refs feature’s configuration.

Source

pub fn lists(self, lists: ListsConfig) -> StdlibConfig

Builder: sets the lists feature’s list environments.

Source

pub fn xnotes(self, xnotes: XnotesConfig) -> StdlibConfig

Builder: sets the xnotes feature’s xnote kinds.

Source

pub fn defterm(self, defterm: DeftermConfig) -> StdlibConfig

Builder: sets the defterm feature’s configuration.

Source

pub fn theorems(self, theorems: TheoremsConfig) -> StdlibConfig

Builder: sets the theorems feature’s theorem classes and theorem kinds.

Source

pub fn quote(self, quote: QuoteConfig) -> StdlibConfig

Builder: sets the quote feature’s quote environments.

Source

pub fn annotations(self, annotations: AnnotationsConfig) -> StdlibConfig

Builder: sets the annotations feature’s annotators.

Source

pub fn graphics(self, graphics: GraphicsConfig) -> StdlibConfig

Builder: sets the graphics feature’s configuration.

Source

pub fn floats(self, floats: FloatsConfig) -> StdlibConfig

Builder: sets the floats feature’s float types.

Source

pub fn cells(self, cells: CellsConfig) -> StdlibConfig

Builder: sets the cells feature’s configuration.

Source

pub fn citations(self, citations: CitationsConfig) -> StdlibConfig

Builder: sets the citations feature’s configuration.

Trait Implementations§

Source§

impl Clone for StdlibConfig

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StdlibConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for StdlibConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<Src, Dst> LosslessTryInto<Dst> for Src
where Dst: LosslessTryFrom<Src>,

Source§

fn lossless_try_into(self) -> Option<Dst>

Performs the conversion.
Source§

impl<Src, Dst> LossyInto<Dst> for Src
where Dst: LossyFrom<Src>,

Source§

fn lossy_into(self) -> Dst

Performs the conversion.
Source§

impl<T> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> StrictAs for T

Source§

fn strict_as<Dst>(self) -> Dst
where T: StrictCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> StrictCastFrom<Src> for Dst
where Src: StrictCast<Dst>,

Source§

fn strict_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.