pub struct LatexExportOptions {
pub document_class: String,
pub include_preamble: bool,
pub omit_images: bool,
}Expand description
The three export-time choices to_latex/to_latex_with_options have always taken: which
\documentclass to open with, whether to wrap the rendered body in a full compilable
document at all, and whether inline images are emitted or dropped.
Default reproduces exactly what bare to_latex(document_class, include_preamble) always
did: an empty document_class falls back to "article" inside the
writer (document_io::use_cases::export_latex_uc::ExportLatexUseCase::execute), and
omit_images is false — images are emitted as
\includegraphics{src} unless a caller opts out.
Fields§
§document_class: StringThe \documentclass{…} to open the document with, used only when
include_preamble is set. Empty ⇒ "article" — the writer’s
fallback, not this struct’s: an empty string round-trips through serde the same way
None would on an Option<String> field, without making this the one options struct in
the crate that special-cases an empty string as an error.
Ignored when include_preamble is false: a body-only fragment has no \documentclass
line to open.
include_preamble: boolWrap the rendered body in \documentclass{…} … \begin{document} … \end{document}, plus
the small fixed preamble the writer needs for hyperlinks, strikeout, images, and line
spacing, with secnumdepth forced to -1 so LaTeX’s own section counters never print
beside a heading this crate already numbered (see export_latex_uc’s own doc comment for
the full package list and reasoning). false returns just the body — for a caller
embedding the result inside a larger LaTeX document that owns its own preamble and
section-numbering policy.
omit_images: boolDrop inline images instead of emitting \includegraphics{…}.
LaTeX resolves a graphic against the filesystem when the document is compiled, so a
caller that will not place the files beside the .tex is choosing between a build error
and a missing picture. false (the historical default) still emits the reference — this
crate writes no image files itself, for LaTeX or any other format, so nothing here ever
changes that; it only changes whether the reference is written at all.
Trait Implementations§
Source§impl Clone for LatexExportOptions
impl Clone for LatexExportOptions
Source§fn clone(&self) -> LatexExportOptions
fn clone(&self) -> LatexExportOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more