pub enum ContentKind {
Opaque,
Prose,
TokenList,
Keyval,
}Expand description
How the formatter treats an argument’s content — its whitespace and break policy. This metadata is for formatter consumers; the parser ignores it.
Variants§
Opaque
Left exactly as authored: names, identifiers, code, or option lists
(\label, the \newcommand body). The default, so an unmarked argument
never reflows — for most arguments interior whitespace can matter (a
minipage/\parbox body, a label key).
Prose
Running prose the formatter may reflow to the line width (e.g. a
\footnote/\caption body, a sectioning title).
TokenList
A comma-separated token list whose interior whitespace is insignificant,
so the formatter may collapse a multi-line authored form to a single line
(a \citep/\cite key list). Unlike Prose, the
content participates in the surrounding paragraph fill only at its
top-level commas, so an over-width citation can wrap between keys without
splitting a key or detaching its delimiters. Incidental source line breaks
are normalized away, so \citep{\n a,\n b\n} formats identically to
\citep{a, b} (determinism).
Keyval
A key=value list consumed by a keyval-family processor — keyval, xkeyval,
pgfkeys, l3keys, or LaTeX’s own option-list scanner — every one of which
strips spaces around keys and values before acting on them. That is what
licenses the formatter to break the list at a comma the author glued
([xmin=-5,xmax=5]), materializing a space token TeX will see: in a keyval
argument the space is discarded, so the typeset output cannot change.
The distinction is load-bearing and was settled by compiling both spellings:
keyval brackets (\usepackage, \includegraphics, tikz/pgfplots,
lstlisting) render identically, while textual optionals do not
(\item[red,green], \caption[short,list], \cite[see,also], and a
\newcommand default all gain a visible space). So this flag must never be
set on an argument whose content is typeset — hold it to the same curated
standard as the math-env routing.
Unlike TokenList, which flows inline with its
surrounding paragraph, a keyval list expands as its own delimited group.
Trait Implementations§
Source§impl Clone for ContentKind
impl Clone for ContentKind
Source§fn clone(&self) -> ContentKind
fn clone(&self) -> ContentKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more