FLM Feature flm.feature.cite

Citation support via external citation providers.

Implements the \cite macro with support for prefixed citation keys (e.g. arxiv:1234.56789), optional extra text (e.g. \cite[Thm.~3]{key}), endnote-based reference lists, and automatic sorting and compression of citation ranges.

class flm.feature.cite.FeatureExternalPrefixedCitations(external_citations_providers: Sequence[Any] | None, counter_formatter: None | TypeCounterFormatter | Literal['alph', 'Alph', 'roman', 'Roman', 'arabic', 'fnsymbol', 'unicodesuperscript', 'unicodesubscript'] | TypeFormatNumTemplate | TypeCounterFormatterSpecDict = 'arabic', citation_delimiters: tuple[str, str] | None = None, citation_optional_text_separator: str = '; ', references_heading_title: str = 'References', sort_and_compress: bool = True)

Bases: Feature

Feature providing the \cite macro backed by external citation providers. Citations are rendered as endnotes with configurable counter formatting and delimiters, and consecutive citation numbers can be sorted and compressed into ranges.

feature_name: str | None = 'citations'

A name that should uniquely identify this feature.

feature_title: str | None = 'Citations'

Descriptive name or title for this feature.

feature_optional_dependencies: Set[str] | Sequence[str] | None = ['endnotes']

If non-None, then this is a list (or set) of feature names that may enhance the functionality of the present feature. If these features are activated, they will be initialized prior to the present feature.

use_endnotes = True
class DocumentManager(feature, doc, **kwargs)

Bases: FeatureDocumentManagerBase

initialize(use_endnotes: None | bool = None)
class RenderManager(feature_document_manager, render_context, **kwargs)

Bases: FeatureRenderManagerBase

initialize(sort_and_compress: None | bool = None)
get_citation_content_flm(cite_prefix, cite_key, resource_info)
get_citation_endnote(cite_prefix, cite_key, resource_info)
render_citation_marks(cite_items, node)
set_external_citations_providers(external_citations_providers)
add_external_citations_provider(external_citations_provider)
add_latex_context_definitions()
class flm.feature.cite.CiteMoreArgsParser

Bases: LatexArgumentsParser

parse(latex_walker, token_reader, parsing_state, **kwargs)
class flm.feature.cite.TackOnMultipleCiteCommandsMacroParser(citemacronames)

Bases: LatexTackOnInformationFieldMacrosParser

get_macro_arg_parser(macroname)
class flm.feature.cite.CiteMacro(macroname)

Bases: FLMMacroSpecBase

Macro spec for the \cite command.

Parses one or more citation keys (comma-separated), an optional extra-text argument (\cite[extra]{key}), and any immediately following \cite calls that are tacked on via TackOnMultipleCiteCommandsMacroParser. Parsed citation items are stored on the node as node.flmarg_cite_items and rendered through the citations render manager.

allowed_in_standalone_mode: bool = False

Whether or not this node is allowed in standalone mode, i.e., whether or not this node can be rendered independently of any document object.

postprocess_parsed_node(node)
render(node, render_context)
recompose_pure_latex(node, recomposer)