Skip to main content

Module features

Module features 

Source
Expand description

The standard features of stdlib, one feature per submodule; the standard backend features are in stdlib::backends.

Each submodule documents one feature (FlmFeature): the commands and environments it provides to authors and what they produce, and the elements, tables, stages, lowering rules and settings it registers.

stdlib::add_features adds all of them but compose, which a host registers (see below). A program may register a feature without the rest of the standard features: a feature declares what it uses of a feature it can do without as a peer declaration (PeerName), so the registry still builds without that feature. Some features need others, however (for example, the stages of refs read the tables of refpoints and index), and a plan that runs such a feature’s stages fails when a feature it needs is absent (PlanError::NeedsUndeclared). See features and packages, and the extension guide for writing a feature.

§The features an author writes with

These features declare the commands and environments an author writes:

  • textstyles: the inline formatting commands \emph, \textbf, \textit and \texttt.
  • literals: the commands that stand for one character of text (\%, \#, \&, \$, \ , \{, \}, \textbackslash), the character ~ (a non-breaking space), and \@, a spacing hint that produces nothing.
  • headings: the heading commands \section to \subparagraph, and the heading kinds and heading commands a program declares.
  • math: inline and display mathematics: the display-math environments and their equation lines, the text commands of mathematics, \eqref, and equation numbering. No feature of this package processes mathematics: a registry adds one, such as the feature of the package math_passthrough.
  • refs: labels and references: the \label field (a macro a construct reads as data; see fields), \ref, \hyperref, and the stages that compute anchors and resolve references.
  • verbatim: content taken exactly as written: \verbtext, \verbcode, \verba, and the environments verbatimtext and verbatimcode.
  • lists: the list environments itemize, enumerate and description, their \items, and the label beside each item.
  • xnotes: footnotes and the other kinds of text set apart from the running text (xnotes), \footnote{…} by default, and the lists in which they are shown.
  • href: hyperlinks to an address outside the document: \href, \url and \email.
  • defterm: defined terms: the defterm environment, which defines a term where it is explained, and \term, a link to that definition.
  • theorems: the theorem-like environments theorem, lemma, definition, proof and the theorem kinds a program configures, numbered, with a heading and a proof’s back-reference.
  • quote: quotations: quote, blockquote, address and the quote environments a program configures, with their quotation sections (\text, \lines, \attributed, \block).
  • annotations: a reviewer’s highlights and comments, one command per reviewer a program configures; none by default.
  • graphics: \includegraphics[options]{path}, an image, in a float’s body or, when the configuration allows it, anywhere in the text.
  • floats: figure, table and the float types a program configures: a block of content shown where it is written, with a caption and labels, numbered under its type’s policy.
  • cells: tables of cells, the cells environment filled with \cell and \celldata, in the body of a table float or, when the configuration allows it, anywhere a block can be written.
  • citations: \cite[note]{keys}, each cited work numbered by first appearance and shown as a citation mark, and the list of cited works.
  • input: \input{file}, the content of another file, brought in where the command is written.
  • userdefs: the macros, environments and special character sequences an author or a program defines by substitution (user definitions), and the stages that expand them.
  • metadata: the document’s metadata (title, authors and date), which a program sets on the document and the feature shows before the content.
  • toc: the table of contents, the table of the listed headings and the piece that shows them as nested lists before the content.

§The features other features build on

These features declare no command. They contribute rewrites, tables and stages that other features and the backends read:

  • blocks: the block-structure rewrite stage, which lays content out in paragraphs and blocks, and the check of the tree contract.
  • index: the element index, the table of the nodes whose elements carry each aspect, which the stages that look for such nodes read.
  • refpoints: the table of every reference point of a run, as the elements declared them, which the refs and numbering features read.
  • numbering: counters, counter styles, and the number of every numbered reference point: the service slots in which features declare their counters, counter styles and parent sets, the numbering options (NumberingOptions, set on a document or on a render request) that say what a counter is numbered within, the stage that counts, and the counter table flm.counters.

§A feature a host registers

This feature is not added by stdlib::add_features; a host that wants it registers it in a package of its own:

  • compose: the service slots of the template engines and of the compose templates, the template engine content-only, and one stage per output made of output regions, which assembles the output’s entry artifact through the chosen compose template. It provides the same capability as each backend’s final stage, so a registry holding it needs a plan request that prefers one of the two.

Modules§

annotations
The annotations feature: a reviewer’s marks in a document, passages highlighted and remarks written into the text, under commands that a host configures, one per reviewer.
blocks
The blocks feature lays out every document tree in paragraphs and blocks and resolves its text, in a rewrite stage that a plan includes when its capability is demanded or required, and it checks the tree contract.
cells
The cells feature (Cells): tables of cells. A table of cells is a cells environment, a grid of rows and columns that an author fills one cell at a time with \cell, or by rows with \celldata.
citations
The citations feature: citing works by key, numbering the cited works in order of first citation, showing a citation mark where each citation is written, and listing the cited works after the document’s content.
compose
The feature compose: the stages that assemble each output’s entry artifact from the output’s regions through a compose template, a text with named places for those regions, and the service slots of the template engines and of the compose templates.
defterm
The defterm feature: defined terms. An author defines a term where it is explained, with the defterm environment, and links to that term definition from anywhere in the document with \term.
floats
The floats feature: figures, tables and other floats, blocks of content shown with an optional caption, labels and a number.
graphics
This module defines the graphics feature (Graphics), which provides the command \includegraphics[options]{path}. The command inserts an image, that is, an external picture file, into the document. For instance, \includegraphics[alt=A plot, width=5cm]{figures/plot.png} inserts the picture of the file figures/plot.png, 5cm wide, with the alternative text A plot. A path can also be an address, such as https://example.org/a.svg.
headings
This module defines the headings feature, which provides the commands that create the headings of a document, \section to \subparagraph by default. A program can declare its own heading kinds and heading commands in the configuration of the feature, HeadingsConfig.
href
This module defines the href feature (Href), which provides three commands that insert a link to an address outside the document:
index
This module defines the index feature, which provides the element index. The element index is a table that lists, for each frozen tree of a run, the nodes of the tree together with their elements. A stage reads the element index to find the nodes that it works on, without walking the trees itself.
input
The input feature: \input{file}, which brings the content of another file into the document where the command is written.
lists
The lists feature (Lists): list environments whose items are begun by \item, the label shown beside each item, and references to items. By default the list environments are itemize, enumerate and description.
literals
The literals feature: the commands that stand for one character of text, and \@.
math
The math feature: mathematics written in LaTeX notation, its display-math environments, its equation lines and their numbers.
metadata
The metadata feature: the document’s metadata (its title, its authors, its date, and any other key the author writes about the document) and the three pieces that show the title, the authors and the date before the document’s content.
numbering
The numbering feature: counters, counter styles, and the number that every numbered reference point of a document carries; and the functions that write a counter value as content, which a caller may use without the feature.
quote
The quote feature: quotations, blocks set apart from the running text whose content is organized in quotation sections (a quoted passage, lines set as written, an attribution, ordinary paragraphs). The feature declares the quote environments quote, blockquote and address by default, and any other quote environment a host configures.
refpoints
This module defines the refpoints feature, which collects the reference points of a document in the table REFPOINTS (flm.refpoints).
refs
The refs feature: labels and references. An author attaches a label to a construct with \label{sec:intro} and refers to it with \ref{sec:intro}, and the feature turns each reference into a link to the labeled place, showing that place’s number or title.
textstyles
The textstyles feature: the inline formatting commands \emph, \textbf, \textit and \texttt.
theorems
The theorems feature: the theorem-like environments of mathematical writing. These are numbered, titled block environments such as theorem, lemma and definition, and the proof environment, whose title can refer back to the statement it proves. Every environment is declared from the feature’s configuration (TheoremsConfig), so a host can add environments of its own (an exercise) or remove shipped ones.
toc
The toc feature: the document’s table of contents, as a table of entries a program can read and as a piece a backend places before the content.
userdefs
The userdefs feature: it registers every user definition of its configuration as an element, the rewrite stages that expand their use sites, and the lowering rules that write the use sites a plan keeps.
verbatim
The verbatim feature: content shown exactly as the author wrote it, through three macros and two environments.
xnotes
The xnotes feature: footnotes, and the other kinds of note set apart from the running text, written \footnote{…} by default.