Struct ytesrev::latex::latex_obj::LatexObj[][src]

pub struct LatexObj {
    pub inner: Option<PngImage>,
    pub expr: &'static str,
    pub is_text: bool,
    // some fields omitted
}

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

Fields

The rendered document

The LaTeX expression that will be rendered

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

Methods

impl LatexObj
[src]

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

impl KnownSize for LatexObj
[src]

The width of the object

The height of the object

impl ImageContainer for LatexObj
[src]

Important traits for Vec<u8>

Retrieve the data in the image

Important traits for Vec<u8>

Retrieve the data in the image, mutably

Important traits for Vec<u8>

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

impl Drawable for LatexObj
[src]

Important traits for Vec<u8>

What this object contains

Important traits for Vec<u8>

What this object contains, mutably

Draw everything

Register all content. This is mostly just used by [LatexObj]s, 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

Auto Trait Implementations

impl Send for LatexObj

impl Sync for LatexObj