pub struct Paragraph {
pub elements: Vec<ParagraphElement>,
}
Expand description
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.
Implementations§
Trait Implementations§
impl StructuralPartialEq for Paragraph
Auto Trait Implementations§
impl Freeze for Paragraph
impl RefUnwindSafe for Paragraph
impl Send for Paragraph
impl Sync for Paragraph
impl Unpin for Paragraph
impl UnwindSafe for Paragraph
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more