Skip to main content

LatexExportOptions

Struct LatexExportOptions 

Source
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: String

The \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: bool

Wrap 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: bool

Drop 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

Source§

fn clone(&self) -> LatexExportOptions

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LatexExportOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for LatexExportOptions

Source§

fn default() -> LatexExportOptions

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for LatexExportOptions

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<LatexExportOptions, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for LatexExportOptions

Source§

fn eq(&self, other: &LatexExportOptions) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for LatexExportOptions

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for LatexExportOptions

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.