[][src]Enum latex::Element

pub enum Element {
    Para(Paragraph),
    Section(Section),
    TableOfContents,
    TitlePage,
    ClearPage,
    Align(Align),
    Environment(StringVec<String>),
    UserDefined(String),
    List(List),
    Input(String),
    // some variants omitted
}

The major elements in a Document, representing each type of possible node.

For convenience, any variant which wraps a struct will implement From for that struct. Meaning you can create an Element::Para node just by using some_paragraph.into().

Variants

Para(Paragraph)

A bare paragraph.

Note

You probably don't want to add a paragraph directly to your document, instead add it to a Section so that if you are walking the AST later on things make sense.

Section(Section)

A section.

TableOfContents

The table of contents.

TitlePage

The title page.

ClearPage

Clear the page.

Align(Align)

An align environment for containing a bunch of equations.

Environment(StringVec<String>)

A generic environment and its lines.

UserDefined(String)

Any other element.

This can be used as an escape hatch if the particular element you want isn't directly supported or if you need to do something which isn't easily expressed any other way. You simply provide the raw string you want and it will be rendered unchanged in the final document.

List(List)

A list.

Input(String)

A generic include statement

Trait Implementations

impl Clone for Element[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Extend<Element> for Document[src]

impl From<Paragraph> for Element[src]

impl<'a> From<&'a str> for Element[src]

fn from(other: &'a str) -> Self[src]

Create an arbitrary unescaped element from a string.

impl From<List> for Element[src]

impl From<Align> for Element[src]

impl From<Section> for Element[src]

impl<S, I> From<(S, I)> for Element where
    S: AsRef<str>,
    I: IntoIterator,
    I::Item: AsRef<str>, 
[src]

fn from(other: (S, I)) -> Self[src]

Converts a tuple of name and a list of lines into an Element::Environment.

impl PartialEq<Element> for Element[src]

impl Debug for Element[src]

Auto Trait Implementations

impl Send for Element

impl Sync for Element

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]