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: BlocksConfigThe blocks feature’s text options.
userdefs: UserdefsConfigThe userdefs feature’s user definitions and expansion depth limit. A
program that gathers definitions from several sources merges them into
this one configuration.
headings: HeadingsConfigThe 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: NumberingConfigThe numbering feature’s style replacements: counter styles that each
replace, by name, the counter style a feature declared. No replacement by
default.
math: MathConfigThe math feature’s configuration: whether equations are numbered. They
are by default.
refs: RefsConfigThe 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: ListsConfigThe 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: XnotesConfigThe 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: DeftermConfigThe defterm feature’s configuration: the lead-in a term definition
opens with, a template in which #{term} is the term. By default,
#{term}: .
theorems: TheoremsConfigThe 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: QuoteConfigThe 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: AnnotationsConfigThe annotations feature’s annotators: each one’s command and
initials, in order. By default, no annotator, and therefore no command.
graphics: GraphicsConfigThe 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: FloatsConfigThe 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: CellsConfigThe 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: CitationsConfigThe 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
impl StdlibConfig
Sourcepub fn new() -> StdlibConfig
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.
Sourcepub fn blocks(self, blocks: BlocksConfig) -> StdlibConfig
pub fn blocks(self, blocks: BlocksConfig) -> StdlibConfig
Builder: sets the blocks feature’s text options.
Sourcepub fn userdefs(self, userdefs: UserdefsConfig) -> StdlibConfig
pub fn userdefs(self, userdefs: UserdefsConfig) -> StdlibConfig
Builder: sets the userdefs feature’s user definitions and expansion
depth limit.
Sourcepub fn headings(self, headings: HeadingsConfig) -> StdlibConfig
pub fn headings(self, headings: HeadingsConfig) -> StdlibConfig
Builder: sets the headings feature’s heading kinds, heading commands, and
which kinds are numbered.
Sourcepub fn numbering(self, numbering: NumberingConfig) -> StdlibConfig
pub fn numbering(self, numbering: NumberingConfig) -> StdlibConfig
Builder: sets the numbering feature’s counter style replacements.
Sourcepub fn math(self, math: MathConfig) -> StdlibConfig
pub fn math(self, math: MathConfig) -> StdlibConfig
Builder: sets the math feature’s configuration.
Sourcepub fn refs(self, refs: RefsConfig) -> StdlibConfig
pub fn refs(self, refs: RefsConfig) -> StdlibConfig
Builder: sets the refs feature’s configuration.
Sourcepub fn lists(self, lists: ListsConfig) -> StdlibConfig
pub fn lists(self, lists: ListsConfig) -> StdlibConfig
Builder: sets the lists feature’s list environments.
Sourcepub fn xnotes(self, xnotes: XnotesConfig) -> StdlibConfig
pub fn xnotes(self, xnotes: XnotesConfig) -> StdlibConfig
Builder: sets the xnotes feature’s xnote kinds.
Sourcepub fn defterm(self, defterm: DeftermConfig) -> StdlibConfig
pub fn defterm(self, defterm: DeftermConfig) -> StdlibConfig
Builder: sets the defterm feature’s configuration.
Sourcepub fn theorems(self, theorems: TheoremsConfig) -> StdlibConfig
pub fn theorems(self, theorems: TheoremsConfig) -> StdlibConfig
Builder: sets the theorems feature’s theorem classes and theorem kinds.
Sourcepub fn quote(self, quote: QuoteConfig) -> StdlibConfig
pub fn quote(self, quote: QuoteConfig) -> StdlibConfig
Builder: sets the quote feature’s quote environments.
Sourcepub fn annotations(self, annotations: AnnotationsConfig) -> StdlibConfig
pub fn annotations(self, annotations: AnnotationsConfig) -> StdlibConfig
Builder: sets the annotations feature’s annotators.
Sourcepub fn graphics(self, graphics: GraphicsConfig) -> StdlibConfig
pub fn graphics(self, graphics: GraphicsConfig) -> StdlibConfig
Builder: sets the graphics feature’s configuration.
Sourcepub fn floats(self, floats: FloatsConfig) -> StdlibConfig
pub fn floats(self, floats: FloatsConfig) -> StdlibConfig
Builder: sets the floats feature’s float types.
Sourcepub fn cells(self, cells: CellsConfig) -> StdlibConfig
pub fn cells(self, cells: CellsConfig) -> StdlibConfig
Builder: sets the cells feature’s configuration.
Sourcepub fn citations(self, citations: CitationsConfig) -> StdlibConfig
pub fn citations(self, citations: CitationsConfig) -> StdlibConfig
Builder: sets the citations feature’s configuration.
Trait Implementations§
Source§impl Clone for StdlibConfig
impl Clone for StdlibConfig
Source§impl Debug for StdlibConfig
impl Debug for StdlibConfig
Auto Trait Implementations§
impl !RefUnwindSafe for StdlibConfig
impl !UnwindSafe for StdlibConfig
impl Forget for StdlibConfig
impl Freeze for StdlibConfig
impl Move for StdlibConfig
impl Send for StdlibConfig
impl Sync for StdlibConfig
impl Unpin for StdlibConfig
impl UnsafeUnpin for StdlibConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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