pub struct CommandSig {
pub args: Cow<'static, [ArgSpec]>,
pub sectioning: Option<u8>,
pub verbatim: bool,
pub verbatim_delimited: bool,
pub rule: bool,
pub inline: bool,
}Expand description
The signature of a control sequence.
Fields§
§args: Cow<'static, [ArgSpec]>The ordered argument slots. A Cow so the build-time CWL tier can hold a
'static slice baked into the binary (see [command]) while the runtime
builtin/scanned paths own a Vec.
sectioning: Option<u8>Some(level) for a sectioning command, where 0 is the outermost
(\part) and larger numbers nest deeper. Relative depth only.
verbatim: booltrue for commands whose final argument is raw text the formatter must
not reshape (\verb, \lstinline, \url, \code). The lexer captures
that argument as one VERB token. Any leading, non-verbatim arguments
(e.g. \mintinline’s language) are declared in args; the verbatim
argument itself is implicit and not listed there.
verbatim_delimited: booltrue when the verbatim argument may also be a \verb-style delimiter
run (\lstinline|…|, \url|…|) instead of a balanced {…} group.
Braced-only commands (\code, \path) capture nothing when no brace
follows and lex normally — the name may be an unrelated user macro
(\code as a math operator, TikZ’s \path (0,0)), and a wrong
delimiter capture swallows text across the line. Only meaningful when
verbatim is set.
rule: booltrue for horizontal-rule commands (\hline, \midrule, \toprule, …).
In an alignment environment a physical line made up solely of rule
commands is a passthrough line the formatter keeps between grid rows
rather than treating as a cell (see the grid lowering in formatter).
inline: booltrue for inline commands that sit in running text (\citep, \ref,
\emph, \textbf, …) rather than occupying their own line. Paragraph reflow
treats such a command as an atom that flows into the fill even when the author
isolated it on its own source line, instead of preserving it as a
command-only line (the way a \usepackage/\section line is kept). For a
command that also has a prose argument this additionally flattens the
command into the paragraph so its body wraps as running text with the {/}
glued to the adjacent words. Block-level commands that head their own line
(\section, \caption) leave this false. Only meaningful to the formatter;
the parser ignores it.
Trait Implementations§
Source§impl Clone for CommandSig
impl Clone for CommandSig
Source§fn clone(&self) -> CommandSig
fn clone(&self) -> CommandSig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more