Expand description
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.
§What an author writes
\cite[note]{key1,key2} cites the works whose citation keys are key1
and key2; it is shown as a citation mark, such as [1,3–5], that holds the numbers of the cited
works, each number a link to the work in the list of cited works.
\R[flags]\cite{keys} writes the citation as a noun of its sentence: a
word, ref.~ for one number and refs.~ for several, comes before the
citation mark (the citation counter style holds the words; see “The
configuration” below), so \R\cite{a,b} reads refs.~[1,2]. After the content, the list of cited works shows each work’s
citation entry, such as Knuth, The Art of Computer Programming, 1984,
labeled with its number. The language guide describes both commands for
authors (Citations).
§Citation keys and notes
A citation key refers to a cited work: it is the FLM code written for it
between the braces of \cite, kept as typed. The whitespace handling and
the typographic substitutions of the document’s text do not apply between
those braces, because the keys argument is declared with an opaque wrapper
(ArgDef::with_opaque_wrapper):
the quotes and the dashes of a citation key stay as written. When the
citation key is read, it is recomposed from the parsed nodes, with every run
of whitespace made one space and the ends trimmed
(spelling_identity):
arxiv:1234.5678, knuth84, manual:{A. Author, "Some title" -- 2024}. A
comma inside a group, a command’s argument or a formula belongs to the
citation key, and a citation key may hold a command. The feature reads no
meaning into a citation key: the citation providers decide what it refers to
(see “Citation entries and citation providers” below).
A note is the optional argument of a \cite: content shown after the
numbers ([31; Thm 4]). It belongs to every citation key of that call.
§Citation chunks
\cite calls written directly one after the other, with nothing between
them but spaces, a single line break and comments, are one citation
chunk, shown as one citation mark. A citation chunk is one \cite node
(CITE, flm.citations.cite) whose last argument, a tack-on argument
(the trailing argument that absorbs field macros written after a
construct; see fields)
named MORE_ARG, holds the further calls as fields named cite
(CITE_FIELD). A paragraph break, a ~ or a \ , or any other
content ends the citation chunk.
read_chunk reads a citation chunk as a list of items, each a
citation key and the note of its call, in the order written:
\cite{b}\cite[Thm 4]{a,c} gives (b), (a, Thm 4), (c, Thm 4). The
keys argument of a call is parsed FLM code, split at the commas that are
outside every group (\cite{a,{b,c},d} gives a, {b,c}, d); each part is
recomposed into its citation key, and an empty part is skipped. Because a
citation key is recomposed from the nodes rather than copied from the
source text, a citation key that a user definition writes into a \cite
is the one the expansion produced: \cite{manual:\emph{#1}}, used with the
argument {Title}, gives manual:\emph{Title}.
\R (REFCITE, flm.citations.refcite) takes an optional flags
argument (S for the capitalized word, Refs.~; I for no word) and,
as a field of its tack-on argument CITATION_ARG, the \cite
written directly after it, together with that call’s further calls. In
\R[S]{\cite{a}} the \cite is inside a group, so the \R holds no
citation.
The citation keys and the flags are not words of the text around them
(ApartFromText); the notes are. A
heading without a label gets an identifier encoded from the text of its
title; when the title holds \cite[Thm 4]{a}, that text is the title’s own
words and Thm 4, without the citation key a.
§Cited works, numbers and identifiers
A cited work is the article or book that a citation key refers to.
Two citation keys may refer to one work (arXiv:1211.1037 and
arxiv:1211.1037), and only a citation provider can know it: its answer
gives the work’s identity, one spelling that every citation key of the
work shares (CitationAnswer). The library compares identities as
characters. A citation key that no citation provider answered refers to the work
whose identity is the citation key as written, so a citation key spelled
exactly like a work’s identity is a citation key of that work.
The collect stage flm.citations.collect (COLLECT) walks every
citation chunk of the document in document order and records each distinct
citation key at its first citation, with where it is first cited, in the
table KEYS (flm.citations.keys).
After the citation providers have been asked (below), the retrieve stage
numbers the cited works (number_works): one work per distinct identity,
in the order of the first citation of any of its citation keys. It writes
the table CITATIONS (flm.citations): for each citation key, its
work’s number, its work’s identifier citation-<n> and its work’s
identity, the citation keys of one work sharing all three. The numbers
therefore depend only on the document and on the citation providers’
answers. The identifier prefix IDENTIFIER_PREFIX, citation-, belongs
to this feature, and no other feature creates identifiers with it. A cited
work is not a reference point, and a
citation is not a reference: nothing refers to a cited work by label.
§The citation mark
stage_mark stages (builds into the lowered tree; see
Lowerer) a citation chunk’s citation
mark: a span of role MARK_ROLE (a role is a name on a presentation
node that says what it is; see roles and kind
tokens) whose numbers are links of
kind cite to their works’ identifiers, with the delimiters and the join
texts outside the links. The items without a note come first, in one group,
their numbers sorted and compressed into ranges as the citation counter
style says (see “The configuration” below) ([1–3,5]); then
one group per distinct note, in the order of the note’s first appearance.
With a, b, c, d, e cited in that order earlier,
\cite{c,b}\cite[Thm 4]{a}\cite{d}\cite[Thm 4]{e} reads [2–4][1,5; Thm 4]. Each work appears once in a group: with arXiv:1211.1037 and
arxiv:1211.1037 one work, \cite{arXiv:1211.1037,arxiv:1211.1037} reads
[1].
The citation mark of a \cite is attached to the content before it
(kind token ATTACHED): the whitespace written before \cite is
removed, the spaces ~ and \ included (word~\cite{a}, word ~ \cite{a}
and word \cite{a} read alike), and a no-break space is written before the
citation mark (space_before), as a character in a span of role
SPACE_ROLE, under the bracketed form of the citation mark and under the
in-place placement; under the superscript form nothing is written (the form
and the placement are settings of the configuration; see “The
configuration” below). The
content around a citation mark is not read: a \cite at the start of a
paragraph or after ( also has its space written, and an author writes
\R[I]\cite{a} there instead. The citation mark of an \R is
standalone (kind token STANDALONE): shown inline, never raised, with
no space written before it and none removed.
§Citation entries and citation providers
The citation entry of a cited work (CitationEntry) is what is shown
for it: inline content written with the commands of the registry’s
language (text, \emph, a link, a formula), which may not declare a label
(see CitationEntry). The library performs no input or output: the citation
entries come from citation providers (CitationProvider), which the
host contributes to the service slot PROVIDERS_SLOT
(flm.citations.providers; see
service_slot and
services). The service slot takes any number of
citation providers and the feature never requires one. A citation provider
returns, for a citation key, an answer holding its citation entry, “not
mine”, or an error.
The retrieve stage flm.citations.retrieve (RETRIEVE) asks the
citation providers about the cited keys, in the order of precedence of the
service slot (the providers of the feature placed last in the feature order
first, each feature’s in the order it contributed them, the host’s last;
PROVIDERS_SLOT): the first citation provider receives every citation key in one call, in
order of first citation (CitationProvider::answer_all), and each later
one receives, in one call, the citation keys that every citation provider
before it answered “not mine”. A citation provider written for one citation
key at a time implements CitationProvider::answer alone. The first
citation provider that claims a citation key decides it: its answer
(CitationAnswer: the citation entry and the work’s identity), or an
error that is final for that citation key. The stage writes the table
ENTRIES (flm.citations.entries): for each citation key, its answer or
the reason it has no citation entry (MissingEntry); then it numbers the
cited works. Each citation entry is read as the document would show it,
with user definitions expanded, and is refused when it holds a citation or
block content (a paragraph break, a list, a heading). A citation key with no
citation entry is numbered and shown in citation marks like any other.
A citation provider makes a citation entry from FLM source
(ProviderCx::parse_entry) or from parts (EntryPiece,
ProviderCx::build_entry): characters, FLM source, emphasis, strong
importance and links. Each part with a meaning is written as the command of
the feature that owns that meaning (\emph, \textbf, \href), so the
citation entry is shown exactly as the same content written in FLM.
§The check that every cited key has a citation entry
The check stage flm.citations.check (CHECK) reports every cited key
that has no citation entry (NoEntry), one report per citation key, even
when several citation keys refer to one work. It provides a member of the
collection flm.validated, which every
workflow demands (asks the plan to run a stage that provides it; see
PlanRequest::demand), so the
check runs under every workflow, the check workflow included; because it
reads the citation entries, the citation providers are asked under every
workflow.
§The list of cited works
The bibliography is a piece (BIBLIOGRAPHY,
flm.citations.bibliography): a document-level synthesized
value that a
backend places beside the document’s content
(Piece), here after it. It holds a heading
(the configured title, References by default, at the configured level, 2
by default; no heading where the configuration sets no title) and one
citation entry per cited work, in the order of the numbers, each labeled
with its number ([1]) and carrying its work’s identifier. The citation
entry shown for a work is the one answered for the citation key under which
the work was first cited; a work with no citation entry shows a dropped
mark (a flm.pres.dropped node; see
recovery) in its place.
build_list builds such a list from any set of cited works; the builder
stage flm.citations.build-bibliography (BUILD_BIBLIOGRAPHY) calls it
over every cited work of the document. The feature contributes the piece’s
declaration to the pieces feature’s service slot as a peer contribution
(FeatureBuilder::peer_slot):
without the pieces feature, the list is built and no backend places it.
Two pieces placed after the content are placed in the order their features
contributed them; among the standard features
(stdlib::add_features) the xnotes feature comes
first, so the list of cited works follows the lists of xnotes (notes set
apart from the running text, such as footnotes; see
xnotes). On the latex-recomposed
backend (latex), no list is placed and no citation entry is written:
LaTeX writes its own list of cited works there.
§The placements of the citation entries
The configuration’s placement (CitationPlacement) decides where
the citation entries are shown. Under listed, the default, the
bibliography is placed after the content and the citation marks show
numbers. Under in place, a citation mark shows, for each item in the
order written, the item’s citation entry between the citation counter
style’s delimiters, then the note separator and the note:
[Knuth, 1984][Lamport, 1994; Thm 4]. The citation mark then holds no
link and carries the kind token IN_PLACE, and no list is placed. A
\cite writes its no-break space before an in-place citation mark, and an
\R writes its word.
§The configuration
CitationsConfig is the feature’s configuration, fixed when the registry
is built (configuration).
It holds:
- the placement of the citation entries (see above);
- the form of a citation mark (
MarkForm): bracketed, the default, or superscript. Under the superscript form, no delimiters are written wherever numbers are shown, the numbers of a\citeare raised, and those of an\Rstay inline. The form has no effect under the in-place placement; - the citation counter style, the counter style
(
CounterStyleDecl) that writes the numbers of the cited works, the delimiters, the texts joining several numbers and the words\Rwrites. This feature compiles it when the registry is built, and the counter styles a host sets in the numbering feature’s configuration (NumberingConfig::styles) do not replace it; - the heading above the list of cited works (its title and its level, or no heading);
- the text written before a note.
§What the feature registers
- Elements:
\cite(CITE) and\R(REFCITE), available in text mode; the synthesized list and list-entry elements of the bibliography (BIBLIOGRAPHY,BIBLIOGRAPHY_ENTRY), which no author writes. - The argument role
KEY_ARG_ROLE(flm.citations.key), which states that an argument holds citation keys (ArgDef::role): the role of the keys argument of\citeand of thecitefields of\citeand\R. - Tables:
KEYS,ENTRIES,CITATIONSand the piece tableBIBLIOGRAPHY(bibliography_table). - Stages, all of document scope: collect (
COLLECT); retrieve (RETRIEVE), which reads what collect writes; and the bibliography’s builder (BUILD_BIBLIOGRAPHY) and check (CHECK, which also provides the capability of that name), which read what retrieve writes. - The service slot
PROVIDERS_SLOT, which the host fills with citation providers. - The settings of the feature (see “The configuration”).
- The stylesheet
flm.citations.style(html::stylesheet) and the definition pieceflm.latex.def.citations(latex::definition_piece), the latter contributed to the style file’s service slot as a peer contribution. - Lowering rules: on every backend, the general rules of
\citeand\R(CITE_RULE,REFCITE_RULE), which stage the citation mark, and of the list of cited works (BIBLIOGRAPHY_RULE), which stages a block holding a heading and a labeled list. The general rules of\citeand\Rrequire the feature’s style identifierflm.citations.style(html::STYLE), which on thehtmlbackend names the stylesheet, so a page holding no citation does not carry it. On thelatex-recomposedbackend, rules (latex) that write a citation as the author wrote it through three LaTeX hooks, and write nothing for the list. The rendering guide shows the output on each backend (Citations, Citations in HTML, Citations in the recomposed LaTeX). - A build hook (
LateInit) that compiles the citation counter style, the note separator and the title of the list: a text that is not valid FLM fails the registry build.
§Dependencies
The feature requires the element index (the index feature,
index), whose table the stages walk,
and the presentation vocabulary of the lowering feature. It does not
depend on the numbering feature (it uses the counter-style code, not the
counters), nor on refs or xnotes. The latex-recomposed backend,
the LaTeX family’s constructs and the pieces feature are peer
declarations (PeerName) and peer
contributions: the feature builds without them, with its rules for an
absent backend set aside (excluded from rule selection; see
PeerName).
§Map of the items
- The feature:
Citations,feature,FEATURE; its configurationCitationsConfig,CitationPlacement,MarkForm,default_style. - The elements and the citation chunk reader:
CITE,REFCITE,CitationElement,read_chunk,calls,leading_call,Chunk,CitationItem,ChunkMistake,Reading. - The cited keys and the numbers:
KEYS,CitedKeys,CITATIONS,CitedWorks,CitedWork,number_works. - The citation providers:
PROVIDERS_SLOT,CitationProvider,CitationRequest,CitationAnswer,CitationEntry,EntryPiece,ProviderCx,CitationProviderError. - The citation entries:
ENTRIES,CitationEntries,Retrieval,MissingEntry. - The citation mark:
stage_mark,StagedMark,MarkSettings,space_before,Standing,CiteRule,RefCiteRule,report_mistakes, and the role and kind-token constants. - The list of cited works:
build_list,ListedWork,ListedEntry,BibliographyRule,BIBLIOGRAPHY. - The diagnostics:
NoKey,NoCitation,UnknownFlag,Uncollected,NoProvider,ProviderFailed,ProviderWarning,EntryCites,EntryNotInline,NoEntry,StageFailed. - The stylesheet:
html. Thelatex-recomposedbackend’s rules:latex. Thelatex-renderedbackend’s definition piece:latex_rendered.
Modules§
- html
- The stylesheet of the
citationsfeature on thehtmlbackend,flm.citations.style(stylesheet), and the markup it selects on. - latex
- The lowering rules of the
citationsfeature for thelatex-recomposedbackend (the recomposed LaTeX): a citation is written back as the author wrote it, through three LaTeX hooks, and the list of cited works is left to LaTeX. - latex_
rendered - The definition piece of the
citationsfeature on thelatex-renderedbackend,flm.latex.def.flmx.citations(piece).
Structs§
- Bibliography
Rule - The body of the general rule of the list element
BIBLIOGRAPHY,BIBLIOGRAPHY_RULE, the default on every backend except the recomposed LaTeX. It stages (builds into the lowered tree; seeLowerer) - Chunk
- A citation chunk as
read_chunkreturns it: its items in the order written, and the mistakes of its calls. - Citation
Answer - A citation provider’s answer for a citation key it knows: the work’s citation entry, the work’s identity, and warnings for the author.
- Citation
Entries - The value of the table
ENTRIES: the cited keys of the document, in order of first citation, each with the result of the retrieve stage (Retrieval). - Citation
Entry - The citation entry of one cited work: what the list of cited works shows
for it, and what a citation mark shows for it under the in-place placement
(
CitationPlacement::InPlace). - Citation
Item - One item of a citation chunk: a citation key, and the note of the call it was written in.
- Citation
Provider Error - Why a citation provider could not answer for a citation key it claims, in
the citation provider’s own words. The retrieve stage reports it in the
Error
ProviderFailed, and no later citation provider is asked about that citation key. - Citation
Request - What the retrieve stage asks a citation provider about one cited key.
- Citations
- The
citationsfeature (FlmFeature): it registers the elements\citeand\R, the collect, retrieve, check and bibliography-builder stages with their tables (the cited keys, the citation entries, the cited works, the bibliography piece), the service slot of the citation providers, and the lowering rules of the citation marks and of the list of cited works on every backend, thehtmlbackend and the recomposed LaTeX. The module documentation describes the feature in full. - Citations
Config - The configuration of the
citationsfeature: where the citation entries are shown, the form of a citation mark, the citation counter style, the heading of the list of cited works, and the text between the numbers and a note. - Cite
Rule - The body of the general rule of
\cite,CITE_RULE: it stages the space that the form calls for (space_before) in a span of roleSPACE_ROLE, then the citation chunk’s attached citation mark (stage_mark). It reports the citation chunk’s writing mistakes (report_mistakes), and requires the feature’s style identifierSTYLE. - Cited
Keys - The value of the table of cited keys (
KEYS). It contains every citation key that the document cites, once, in order of first citation, that is, in the order in which the citation keys first appear in the document. - Cited
Work - A
CitedWorkcontains the number, the identifier and the identity of a cited work. The table of cited works (CitedWorks) stores aCitedWorkfor each citation key, and the citation keys that refer to the same work have equalCitedWorkvalues. - Cited
Works - The value of the table of cited works (
CITATIONS). It contains every citation key that the document cites, in order of first citation, each with the cited work (CitedWork) that it refers to. Citation keys with the same identity refer to the same work (seeCitedWork::identity). The functionnumber_workscreates this value. - Entry
Cites - The error that is reported when the citation entry for a citation key
contains a citation (
flm.citations.entry-cites). - Entry
NotInline - The error that is reported when the citation entry for a citation key is
not inline content (
flm.citations.entry-not-inline). - Listed
Entry - The payload of a node of the entry element (
BIBLIOGRAPHY_ENTRY): the work’s citation key, number and identifier, and whether its citation entry is missing (the node then holds nothing). - Listed
Work - One cited work of a list, as
build_listtakes it: its citation key, number and identifier, and its citation entry, orNonefor a work with no citation entry. - Mark
Settings - The feature’s settings as the lowering rules read them: the configuration, and its texts (the citation counter style, the note separator and the title of the list of cited works) compiled when the registry is built.
- NoCitation
- Error raised when a
\Ris not immediately followed by\cite(flm.citations.no-citation). The\Rcommand must immediately be followed by a valid\cite{..}command invocation, as in\R\cite{bib:myref}or\R[I]\cite{bib:myref,bib:myref2}. Reported by the lowering rule for\Rwhen\Ris invoked. In such a case, the\Rexpands to a dropped mark (flm.pres.dropped). - NoEntry
- The error that is reported when a cited key has no citation entry
(
flm.citations.no-entry). - NoKey
- The error that is reported when a
\citecall has an empty argument (idflm.citations.no-key). An argument that contains only commas and whitespace counts as empty. - NoProvider
- The error that is reported when a document cites works and no citation
provider is set up (
flm.citations.no-provider). - Provider
Cx - The context the retrieve stage gives a citation provider together with the
requests: the built language of the registry, through which the citation
provider makes its citation entries into content of the document’s
vocabulary (
parse_entry,build_entry), and the scope under which it reports its slow work on the progress sheet of the build (progress). - Provider
Failed - The error that is reported when a citation provider fails to retrieve the
citation entry for a citation key (
flm.citations.provider-failed). - Provider
Warning - The warning that is reported for each warning text that a citation
provider adds to its answer for a citation key
(
flm.citations.provider-warning). - RefCite
Rule - The body of the general rule of
\R,REFCITE_RULE: it stages the citation counter style’s word in the variant the flags select, singular or plural byStagedMark::shown, in a span of roleWORD_ROLE, then the citation chunk’s standalone citation mark (stage_mark). It writes no word under the flagIor for a dropped mark, and nothing before the word. It reports an\Rwith no\citedirectly after it (NoCitation), the flags it does not define (UnknownFlag) and the citation chunk’s writing mistakes (report_mistakes). It requires the feature’s style identifierSTYLE. - Stage
Failed - The error that is reported when a stage of the
citationsfeature fails (idflm.citations.stage-failed). - Staged
Mark - What
stage_markstaged, and how many numbers the citation mark holds. - Uncollected
- Error raised when a citation key is cited only outside the trees of the
document, so that it has no number (condition id
flm.citations.uncollected). - Unknown
Flag - The error that is reported when the flags argument of
\Rcontains an unknown flag (flm.citations.unknown-flag).
Enums§
- Chunk
Mistake - A mistake in the writing of one call of a citation chunk, found by
read_chunk; the call contributes no item.report_mistakesreports each one as a diagnostic. - Citation
Element - The per-value data of the two elements: whether a node is a
\citeor an\R, the two kinds of node that carry a citation chunk. - Citation
Placement - Where the citation entries of the cited works are shown. In settings data,
listedorin-place. - Entry
Piece - One part of the content of a citation entry that a citation provider
builds with
ProviderCx::build_entry: characters, FLM source, or a group of parts with a meaning (emphasis, strong importance, a link). - Mark
Form - How a citation mark shows the numbers of the works its citation chunk
cites, where the citation entries are listed after the content
(
CitationPlacement::Listed); it has no effect under the in-place placement. In settings data,bracketedorsuperscript. - Missing
Entry - The reason why a cited key has no citation entry.
- Reading
- Where a citation chunk is read: in a lowering rule or in a stage. The two
differ in how they treat citation keys that hold a placeholder of a user
definition’s template (
\cite{arxiv:#1}inside a template). Such citation keys are not known until the template is expanded, because a placeholder has no spelling of its own. - Retrieval
- The result of the retrieve stage for one cited key: the answer of a citation provider, or the reason why the citation key has no citation entry.
- Standing
- How a citation mark is placed in its sentence: attached to the content
before it (
\cite) or standing alone (\R).
Constants§
- ATTACHED
- The kind token of the citation mark of a
\cite,attached: the citation mark belongs to the content before it, and the space that its form calls for is written before it. - BIBLIOGRAPHY
- The name
flm.citations.bibliography, used for four things: the synthesized element of a list of cited works, the role of the block that list lowers to, the piece that places the list of every cited work after the content, and that piece’s table (bibliography_table). - BIBLIOGRAPHY_
ENTRY - The name of the synthesized element of one entry of a list of cited works,
flm.citations.bibliography.entry: a node of it holds the citation entry’s content and carries aListedEntryas its payload. - BIBLIOGRAPHY_
ENTRY_ RULE - The name of the general lowering rule of the entry element,
flm.citations.bibliography.entry.lower.default. A list entry is lowered by its list’s rule; this rule fails with a structure error when a list entry is lowered on its own. - BIBLIOGRAPHY_
RULE - The name of the general lowering rule of the list element,
flm.citations.bibliography.lower.default(BibliographyRule), the default on every backend. - BUILD_
BIBLIOGRAPHY - The name of the bibliography’s builder stage,
flm.citations.build-bibliography, which writes the piece tableBIBLIOGRAPHY. - CAPITAL_
FLAG - The flag of
\Rthat selects the capitalized word (the citation counter style’s variantCAPITAL_VARIANT),S. - CAPITAL_
VARIANT - The name of the citation counter style’s variant of words that the flag
Sof\Rselects,capital:Ref.~andRefs.~rather thanref.~andrefs.~. - CHECK
- The name of the check stage and of the capability it provides,
flm.citations.check. The capability is a member of the collectionflm.validated, which every workflow demands (asks the plan to run a stage that provides it; seePlanRequest::demand), so the check runs under every workflow. - CITATIONS
- The name of the table of cited works,
flm.citations, whose value is aCitedWorks. The retrieve stageRETRIEVEwrites this table. The lowering rules of\citeand\Rread the number and the identifier of each cited work from this table, and the stageBUILD_BIBLIOGRAPHYreads it to build the list of cited works. - CITATION_
ARG - The name of
\R’s tack-on argument,citation, which holds the\citewritten directly after the\Ras a field namedCITE_FIELD. - CITE
- The name of the element of
\cite,flm.citations.cite. One node of it carries one citation chunk: its own call and the calls written directly after it, held in its tack-on argumentMORE_ARG. - CITE_
FIELD - The name of the field that each further call of a citation chunk is read
as,
cite:\cite{a}\cite{b}is one\citenode whose argumentMORE_ARGholds one field namedcite. The\citewritten after an\Ris also a field of this name, in the argumentCITATION_ARG. - CITE_
RULE - The name of the general lowering rule of
\cite,flm.citations.cite.lower.default(CiteRule), the default on every backend. - COLLECT
- The name of the collect stage,
flm.citations.collect. This stage records every citation key that the document cites in the tableKEYS. - ENTRIES
- The name of the table of the citation entries,
flm.citations.entries. The table (CitationEntries) contains, for each cited key, its citation entry or the reason why it has none. - ENTRY_
NUMBER_ ROLE - The role of the span that holds an entry’s label in a list of cited works
(its number written through the citation counter style),
flm.citations.entry.number. - FEATURE
- The feature’s registered name,
citations. - FLAGS_
ARG - The name of
\R’s optional flags argument,flags. - IDENTIFIER_
PREFIX - The prefix of the identifier of a cited work,
citation-. The identifier of the work numbered 3 iscitation-3. - INLINE_
FLAG - The flag of
\Rthat writes no word, only the citation mark,I. - IN_
PLACE - The kind token of a citation mark under the in-place placement,
in-place, which the span carries afterATTACHEDorSTANDALONE: the citation mark shows the citation entries. - KEYS
- The name of the table of cited keys,
flm.citations.keys, whose value is aCitedKeys. The collect stageCOLLECTwrites this table. The retrieve stageRETRIEVEand the check stageCHECKread it. - KEYS_
ARG - The name of a call’s citation keys argument,
keys. - KEY_
ARG_ ROLE - The argument role of citation keys,
flm.citations.key: the role of the keys argument (KEYS_ARG) of\citeand of thecitefields that\citeand\Rtake. - KIND_
CITATIONS - The kind token that a list of cited works carries on its block and on its
list,
citations; also the name given to the list’s heading (HeadingPayload::name). - LINK_
KIND - The kind of every link from a citation mark to a cited work,
cite. - MARK_
ROLE - The role of a citation mark’s span,
flm.citations.mark. - MORE_
ARG - The name of the tack-on argument of
\citethat holds the further calls of its citation chunk,more. - NOTE_
ARG - The name of a call’s optional note argument,
note. - NO_
BREAK_ SPACE - The no-break space (U+00A0) written before an attached citation mark, under the bracketed form and under the in-place placement.
- PROVIDERS_
SLOT - The name of the service slot of the citation providers,
flm.citations.providers(declared withservice_slot). It takes any number ofCitationProvidervalues, asked in the order of precedence (Services::services_by_precedence_named): the providers of the feature placed last in the feature order first, each feature’s in the order it contributed them, and the host’s last. The feature declares it and never requires a contribution: a registry with no citation provider builds, every cited key of its documents then has no citation entry, and the retrieve stage reportsNoProvideronce per document that cites a work. - REFCITE
- The name of the element of
\R,flm.citations.refcite. One node of it carries the citation chunk written directly after the\R, shown as a noun of its sentence with the citation counter style’s word before its citation mark. - REFCITE_
RULE - The name of the general lowering rule of
\R,flm.citations.refcite.lower.default(RefCiteRule), the default on every backend. - RETRIEVE
- The name of the retrieve stage,
flm.citations.retrieve. This stage obtains the citation entries from the citation providers, and writes the tablesENTRIESandCITATIONS. - SPACE_
ROLE - The role of the span that holds the space written before the citation
mark of a
\cite(space_before),flm.citations.space. - STANDALONE
- The kind token of the citation mark of an
\R,standalone: the citation mark is a part of its sentence, shown inline, with nothing written before it. - STYLE_
NAME - The name of the citation counter style,
flm.citations.style.citation(default_style). The citation counter style is the feature’s own counter style; a configuration read from settings data keeps this name. - WORD_
ROLE - The role of the span that holds the word
\Rwrites before its citation mark,flm.citations.word.
Traits§
- Citation
Provider - A citation provider: a service that answers cited keys with their works’
citation entries and identities. A host contributes citation providers to
the service slot
PROVIDERS_SLOT.
Functions§
- bibliography_
table - Returns the handle of the bibliography’s piece table,
BIBLIOGRAPHY: the builder stage writes it, and a backend that places pieces reads it. - build_
list - Builds the list of
works, in the order given, and returns it as a synthesized value’s tree. The tree holds one node of the list elementBIBLIOGRAPHY, whose children are one node of the entry elementBIBLIOGRAPHY_ENTRYper work. Each entry node carries itsListedEntryand holds a copy of its citation entry’s content as the synthesized value’s own content (ValueContent::Own), or nothing for a work with no citation entry. The new nodes takeanchor’s span and parsing state. - calls
- Returns every call of the citation chunk that
nodecarries, in the order written: the first call (leading_call), then the further calls held in its argumentMORE_ARG. Each call holds the argumentsNOTE_ARGandKEYS_ARG. Returns an empty list whereleading_callreturnsNone. - cite_
args - The argument declarations of
\cite, in order: the note (NOTE_ARG), the citation keys (KEYS_ARG), and the further calls of the citation chunk (MORE_ARG). - cite_
element - The element value of every
\citenode (one value, shared by all of them), as the feature registers it. - default_
style - Returns the default citation counter style, named
STYLE_NAME: arabic numbers, the delimiters[and], the compact join (1,2and1–3,5), ranges on, and the wordsref.~andrefs.~, with the variantCAPITAL_VARIANTholdingRef.~andRefs.~. - feature
- The
citationsfeature constructed from the default configuration (CitationsConfig::new). - leading_
call - Returns the first call of the citation chunk that
nodecarries: the\citenode itself, or the fieldcitewritten after an\R. ReturnsNonefor an\Rwith no\citedirectly after it, and for a node of neither element. - number_
works - Numbers the cited works of the citation keys
keys, and returns the result as the value of the table of cited works (CITATIONS). - read_
chunk - Reads the citation chunk that
nodecarries (a\citenode, or an\Rnode through the field written after it) as a list of items, each a citation key and its call’s note, in the order written. It serves both elements, in a lowering rule and in a stage (reading). - refcite_
args - The argument declarations of
\R, in order: the flags (FLAGS_ARG), then the tack-on argumentCITATION_ARG, which takes the\citewritten directly after the\Ras a field namedcitewith\cite’s three arguments.\R[S]\cite{a,b}\cite{c}therefore reads as one citation chunk, and\R[S]{\cite{a}}holds no citation, because the\citeis inside a group. - refcite_
element - The element value of every
\Rnode (one value, shared by all of them), as the feature registers it. - report_
mistakes - Reports each mistake that
read_chunkfound inchunkas an Error at the span of its call (ChunkMistake::NoKeyasNoKey). - space_
before - Returns the text written before the citation mark of a
\citeunderconfig: a no-break space (NO_BREAK_SPACE) under the bracketed form, and under the in-place placement regardless of the form;Noneunder the superscript form of the listed placement. Nothing is ever written before the citation mark of an\R. - stage_
mark - Stages the citation mark of
chunk(what is shown in the text for the citation chunk) and returns it with the count of numbers it holds. This is the only function that stages a citation mark; the rules of\citeand of\Rcall it.
Type Aliases§
- Citation
Result - What a citation provider returns for one citation key:
Ok(Some(answer))for a citation key it serves,Ok(None)(“not mine”) for a citation key it does not serve, so that the next citation provider is asked, or an error for a citation key it claims and could not answer.