pub struct Latex;Expand description
LaTeX renderer.
Trait Implementations§
Source§impl OutputFormat for Latex
impl OutputFormat for Latex
Source§fn visible_runs(&self, fragment: &str) -> Vec<Range<usize>>
fn visible_runs(&self, fragment: &str) -> Vec<Range<usize>>
Strip LaTeX commands (\emph, \textbf, …) and their brace
delimiters, keeping brace contents visible. A backslash-escaped
punctuation mark (\&, \_, \%, \#, \$, \{, \}) is visible
as the escaped character itself. \href{target}{content} is
special-cased so the URL target stays invisible — it must not
participate in separator/dedup decisions — while content does.
Named commands that stand in for a single visible character
(\textbackslash{}, \textasciitilde{}, \textasciicircum{}) have
no backing byte range here — see Self::visible_text, which
synthesizes them for boundary decisions.
Source§fn visible_text<'a>(&self, fragment: &'a str) -> Cow<'a, str>
fn visible_text<'a>(&self, fragment: &'a str) -> Cow<'a, str>
As Self::visible_runs, but additionally synthesizes the single
visible character that \textbackslash{}/\textasciitilde{}/
\textasciicircum{} stand in for (\, ~, ^), since those have no
backing byte range in the raw fragment. Used for read-only boundary
decisions (first/last visible char); visible_runs stays raw-byte
accurate for cleanup_dangling_punctuation’s in-place raw edits.