FLM Feature flm.feature.defterm¶
Provides the \begin{defterm}{...}...\end{defterm} environment for defining
terms and the \term macro for referencing them. Defined terms are
automatically registered as referenceable labels, and \term renders as a
hyperlink to the defining occurrence (or as styled inline text when used within
its own definition).
- class flm.feature.defterm.DefineTermEnvironment(environmentname, render_with_term=True, render_with_term_suffix=': ', **kwargs)¶
Bases:
FLMEnvironmentSpecBase- is_block_level: bool | None = True¶
If this flag is set to True, then elements of this type are always parsed as separate block-level elements (e.g., a section heading, an enumeration list, etc.)
If this flag is None, then the spec does not commit as to whether the node produces a block-level or inline-level element. It is strongly recommended you then manually set the flm_is_block_level attribute on the node object to True or False, since the default implementation of finalize_node() won’t be able to do it.
- 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.
- allowed_ref_label_prefixes = ('topic',)¶
- defterm_ref_type = 'defterm'¶
- postprocess_parsed_node(node)¶
- render(node, render_context)¶
- recompose_pure_latex(node, recomposer)¶
- class flm.feature.defterm.RefTermMacro(macroname, **kwargs)¶
Bases:
FLMMacroSpecBaseMacro spec for the
\termcommand that references a defined term.Uses delayed rendering so that forward references resolve correctly. On render, produces a hyperlink to the defining
deftermenvironment (via therefsfeature) or styled inline text when the reference occurs within the term’s own definition.- 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.
- delayed_render: bool | Callable[[LatexNode, TypeRenderContext], bool] = True¶
Whether this node needs to be rendered at the delayed rendering stage, i.e., after a first pass through the document. This is the case, for instance, for
\refcommands etc. for which the entire document needs to have been traversed at least once beforehand. See the delayed render mechanism in the documentation for theflmdocument.FLMDocumentclass.Set to True or False to determine whether or not the node needs a delayed render. Set to a callable func(node, render_context) -> bool to compute at render time whether the node should be delayed or not.
- defterm_ref_type = 'defterm'¶
- get_flm_doc()¶
- postprocess_parsed_node(node)¶
- prepare_delayed_render(node, render_context)¶
- render(node, render_context)¶
- recompose_pure_latex(node, recomposer)¶
- class flm.feature.defterm.FeatureDefTerm(render_defterm_with_term: None | bool = None, render_defterm_with_term_suffix: None | str = None)¶
Bases:
FeatureFeature plugin for definition terms. Registers the
deftermenvironment and the\termmacro. The term heading can optionally be rendered inline with a configurable suffix (default': '). Uses therefsfeature for cross-referencing when available, and supports additional\labelannotations with thetopicprefix.- class RenderManager(feature_document_manager, render_context, **kwargs)¶
Bases:
FeatureRenderManagerBase- initialize()¶
- register_term_node_info(node, **kwargs)¶
- get_term_node_info(node)¶
- render_defterm_with_term = True¶
- render_defterm_with_term_suffix = ': '¶
- add_latex_context_definitions()¶
- flm.feature.defterm.FeatureClass = <class 'flm.feature.defterm.FeatureDefTerm'>¶
Feature plugin for definition terms. Registers the
deftermenvironment and the\termmacro. The term heading can optionally be rendered inline with a configurable suffix (default': '). Uses therefsfeature for cross-referencing when available, and supports additional\labelannotations with thetopicprefix.