pub struct LatexObj {
    pub inner: Option<PngImage>,
    pub expr: &'static str,
    pub is_text: bool,
    /* private fields */
}
Expand description

Represents a LaTeX expression. When loaded, this will create a PNG of the expression and load it.

Fields

inner: Option<PngImage>

The rendered document

expr: &'static str

The LaTeX expression that will be rendered

is_text: bool

A LaTeX expression can either be text or math, with math being surrounded by dollar sings

Implementations

Create a LaTeX object containing math

use ytesrev::latex::LatexObj;

let e_mc2 = LatexObj::math("E = mc^2");
assert!(!e_mc2.is_text);
assert_eq!(e_mc2.expr, "E = mc^2");

Create a LaTeX object containing text

use ytesrev::latex::LatexObj;

let lorem = LatexObj::text("Lorem Ipsum");
assert!(lorem.is_text);
assert_eq!(lorem.expr, "Lorem Ipsum");

Trait Implementations

What this object contains
What this object contains, mutably
Draw everything
Register all content. This is mostly just used by LatexObjs, that need to be registered before loaded. Read more
Load all content
When the user presses space, the state of the presentation is advanced. This method is what is called. Read more
What state the object is in
When any event occurs
Tick the object
Retrieve the data in the image
Retrieve the data in the image, mutably
Retrieve the data in the image, consuming the object
Convert the object to a dynamic KnownSize object, as rust doesn’t support calling KnownSize -methods directly on this object Read more
The width of the object
The height of the object

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.