pub struct EnvironmentSig {
pub args: Cow<'static, [ArgSpec]>,
pub verbatim_body: bool,
pub verbatim_arg: bool,
pub math: bool,
pub code: bool,
pub align: bool,
pub reflow: bool,
pub no_indent: bool,
pub list: bool,
pub block: bool,
pub outline: Option<OutlineKind>,
}Expand description
The signature of an environment.
Fields§
§args: Cow<'static, [ArgSpec]>The ordered argument slots that follow \begin{name} (e.g. tabular’s
column spec), excluding the name group itself. A Cow for the same
reason as CommandSig::args: a 'static slice for the CWL tier, an owned
Vec for the runtime paths.
verbatim_body: booltrue for environments whose body is raw text (verbatim, lstlisting,
minted, …) and must never be reflowed.
verbatim_arg: booltrue for environments whose name argument is xparse v-type (l3doc’s
macro/function/variable, declared { O{} +v }): besides the usual
braced form, the argument may be delimited \verb-style
(\begin{macro}+\@@_compile_{:+), chosen precisely when the name holds
unbalanced braces. The lexer captures that delimited form as one opaque
VERB token; the braced form lexes normally. Curated only — a wrong
grant swallows real text, so the CWL/user tiers never set it.
math: booltrue for math environments (equation, align, …).
code: booltrue for environments whose body is real parsed code, not prose —
the doc/ltxdoc macrocode/macrocode* (whose body is LaTeX/expl3 code,
parsed and re-lexed under the package regime, not an opaque verbatim
blob like verbatim_body). The formatter preserves the body’s layout and
never reflows it as prose; the distinction from verbatim_body is that the
content is a real CST, not a single VERBATIM_BODY token.
align: booltrue for alignment environments whose & columns the formatter lays out
into a grid (align, pmatrix, …). Independent of math: every flagged
environment here is also math, but the formatter consults this flag, not
math, to decide column alignment.
reflow: booltrue when the body is ordinary prose the formatter may reflow. Derived as
!(verbatim_body || math || code). (Reflow itself is a later item; this is
the recorded intent.)
no_indent: booltrue for sectioning-level containers whose body the formatter must
not indent (document, the appendix-package appendix, …). The shared
property is that the body is whole sections/paragraphs — content at the
same structural altitude as the sections the container sits among, not leaf
content like a figure or minipage — which is conventionally written
flush to the margin. The body is still laid out on its own lines, just at
the surrounding indentation level rather than nested one step in.
list: booltrue for list environments (itemize, enumerate, description, …)
whose \items the formatter lays out one per line, reflowing each item’s
body with continuation lines hanging-indented under the item text.
block: booltrue for block/display environments that occupy their own vertical space
(figure, center, lists, display math, verbatim, …). The parser uses this
to avoid wrapping a lone such environment in a redundant PARAGRAPH. Derived
as block_explicit || math || list || no_indent.
outline: Option<OutlineKind>Some(_) for an environment that earns a document-symbol outline entry — a
float or a theorem-like. None for everything else. Only meaningful to the
language server’s documentSymbol; the parser and formatter ignore it.
Trait Implementations§
Source§impl Clone for EnvironmentSig
impl Clone for EnvironmentSig
Source§fn clone(&self) -> EnvironmentSig
fn clone(&self) -> EnvironmentSig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more