FLM Feature flm.feature.baseformatting

Provides basic text formatting macros and specials for FLM.

Defines constant-value macros (\textbackslash, \%, \#, \&, \$, \ ``, ``\{, \}), text format macros (\emph, \textit, \textbf), the \@ no-extra-space-after-dot macro, and specials for non-breaking space (~) and paragraph breaks (blank lines).

class flm.feature.baseformatting.NoExtraSpaceAfterDotMacro(macroname: str, arguments_spec_list=None, **kwargs)

Bases: FLMMacroSpecBase

Spec info class for the \@ macro. This macro should be placed immediately after a period that does not terminate a sentence, such as in initials or abbreviations, to avoid awkward spacing. For instance, type Well, well, Mr.\@ Bond.  You look surprised to see me..

allowed_in_standalone_mode: bool = True

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.

render(node, render_context)

Render the \@ macro.

Returns the fragment renderer’s latex_macro_no_extra_space_after_dot attribute if present, otherwise returns the empty string.

class flm.feature.baseformatting.FeatureBaseFormatting

Bases: SimpleLatexDefinitionsFeature

Feature providing basic inline formatting and literal character macros.

Registers macros for emphasis, bold, literal special characters, the \@ spacing hint, the ~ non-breaking space special, and paragraph break handling.

feature_name: str | None = 'baseformatting'

A name that should uniquely identify this feature.

feature_title: str | None = 'Basic formatting'

Descriptive name or title for this feature.

feature_flm_doc = '\n    You can produce basic formatting, including emphasis/italics and\n    boldface using the following macros.  Several macros also provide a way to\n    typeset literal characters that would otherwise have a special meaning in\n    your FLM environment.\n\n    Input accents, special characters, etc., directly as Unicode:\n    \\verbcode+éàààé😅Á+. Note that source files should always be encoded using\n    the UTF-8 encoding. You can use pretty quotes \\verbcode+‘+ \\verbcode+’+\n    \\verbcode+“+ \\verbcode+”+; dashes \\verbcode|—| (em dash), \\verbcode|–| (en\n    dash, for ranges); spaces \\verbcode|\xa0| (non-breaking space), \\verbcode|\u2003|\n    (em space), \\verbcode|\u2009| (thin space), etc.\n    '
latex_definitions: TypeDictWithLatexContextDefinitions = {'macros': [ConstantValueMacro(macroname='textbackslash', arguments_parser=<LatexNoArgumentsParser>, value='\\'), ConstantValueMacro(macroname='%', arguments_parser=<LatexNoArgumentsParser>, value='%'), ConstantValueMacro(macroname='#', arguments_parser=<LatexNoArgumentsParser>, value='#'), ConstantValueMacro(macroname='&', arguments_parser=<LatexNoArgumentsParser>, value='&'), ConstantValueMacro(macroname='$', arguments_parser=<LatexNoArgumentsParser>, value='$'), ConstantValueMacro(macroname=' ', arguments_parser=<LatexNoArgumentsParser>, value=' '), ConstantValueMacro(macroname='{', arguments_parser=<LatexNoArgumentsParser>, value='{'), ConstantValueMacro(macroname='}', arguments_parser=<LatexNoArgumentsParser>, value='}'), TextFormatMacro(arguments_spec_list=[LatexArgumentSpec(argname='text', parser='{', parsing_state_delta=FLMParsingStateDeltaSetBlockLevel(is_block_level=False))], macroname='emph', arguments_parser=<LatexArgumentsParser>, text_formats=('textit',)), TextFormatMacro(arguments_spec_list=[LatexArgumentSpec(argname='text', parser='{', parsing_state_delta=FLMParsingStateDeltaSetBlockLevel(is_block_level=False))], macroname='textit', arguments_parser=<LatexArgumentsParser>, text_formats=('textit',)), TextFormatMacro(arguments_spec_list=[LatexArgumentSpec(argname='text', parser='{', parsing_state_delta=FLMParsingStateDeltaSetBlockLevel(is_block_level=False))], macroname='textbf', arguments_parser=<LatexArgumentsParser>, text_formats=('textbf',)), NoExtraSpaceAfterDotMacro(macroname='@', arguments_parser=<LatexNoArgumentsParser>)], 'specials': [ConstantValueSpecials(specials_chars='~', arguments_parser=<LatexNoArgumentsParser>, value='\xa0'), ParagraphBreakSpecials(specials_chars='\n\n', arguments_parser=<LatexNoArgumentsParser>)]}

Set to a dictionary with one or more of the keys (‘macros’, ‘environments’, ‘specials’), whose corresponding values are lists of FLMMacroSpec, FLMEnvironmentSpec, and FLMSpecialsSpec instances.

flm.feature.baseformatting.FeatureClass = <class 'flm.feature.baseformatting.FeatureBaseFormatting'>

Feature providing basic inline formatting and literal character macros.

Registers macros for emphasis, bold, literal special characters, the \@ spacing hint, the ~ non-breaking space special, and paragraph break handling.