[−][src]Struct latex::Paragraph
A single paragraph.
Examples
Like most of the other types in this crate, the standard workflow is to
create an empty Paragraph
then incrementally add bits to it using method
chaining and the push()
method.
use latex::{Paragraph, ParagraphElement}; let mut p = Paragraph::new(); p.push("Hello ") .push(ParagraphElement::italic("World")) .push("!") .push(" Here is an equation ") .push(ParagraphElement::InlineMath("y = mx + c".to_string())) .push(".");
The above paragraph would get rendered to something like this:
Hello \textit{World}! Here is an equation $y = mx + c$.
Fields
elements: Vec<ParagraphElement>
A list of ParagraphElements
which make up the paragraph's contents.
Methods
impl Paragraph
[src]
pub fn new() -> Self
[src]
Create a new paragraph.
pub fn push<P>(&mut self, elem: P) -> &mut Self where
P: Into<ParagraphElement>,
[src]
P: Into<ParagraphElement>,
Add a ParagraphElement
to the Paragraph
.
pub fn push_text(&mut self, text: &str) -> &mut Self
[src]
Add some raw text to the paragraph.
pub fn iter(&self) -> Iter<ParagraphElement>
[src]
Iterate over the ParagraphElement
s in this Paragraph
.
Trait Implementations
impl Default for Paragraph
[src]
impl Clone for Paragraph
[src]
fn clone(&self) -> Paragraph
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl From<Paragraph> for Element
[src]
impl<'a> From<&'a str> for Paragraph
[src]
impl PartialEq<Paragraph> for Paragraph
[src]
impl Debug for Paragraph
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,