pub struct Align { /* private fields */ }
Expand description
A list of equations to be used in an align
environment.
§Note
Using this environment requires you to include the amsmath
package in
your preamble.
§Examples
The typical workflow is to create an empty Align
and then add equations
to it.
use latex::{Align, Equation};
let mut equations = Align::new();
equations.push("y &= mx + c")
.push(Equation::with_label("emc2", "E &= m c^2"));
When rendered, you should get something like this:
\begin{align}
y &= mx + c \\
E &= m c^2 \\
\end{align}
Implementations§
Source§impl Align
impl Align
Sourcepub fn new() -> Align
pub fn new() -> Align
Create an empty equation list.
Examples found in repository?
examples/complex.rs (line 33)
29fn first_section() -> Section {
30 let mut section_1 = Section::new("Introduction");
31 section_1.push("This is an example paragraph.");
32
33 let mut equations = Align::new();
34 equations
35 .push("y &= mx + c")
36 .push(Equation::with_label("quadratic", "y &= a x^2 + bx + c"));
37
38 section_1
39 .push("Please refer to the equations below:")
40 .push(equations);
41
42 let mut objectives = List::new(ListKind::Enumerate);
43 objectives
44 .push(r"Demonstrate how to use the \textit{latex} library.")
45 .push("Create a reasonably complex document")
46 .push("???")
47 .push("PROFIT!");
48
49 section_1.push("Here are our objectives:").push(objectives);
50
51 section_1
52}
Sourcepub fn push<E: Into<Equation>>(&mut self, eq: E) -> &mut Self
pub fn push<E: Into<Equation>>(&mut self, eq: E) -> &mut Self
Add an equation to the end of the list.
Examples found in repository?
examples/complex.rs (line 35)
29fn first_section() -> Section {
30 let mut section_1 = Section::new("Introduction");
31 section_1.push("This is an example paragraph.");
32
33 let mut equations = Align::new();
34 equations
35 .push("y &= mx + c")
36 .push(Equation::with_label("quadratic", "y &= a x^2 + bx + c"));
37
38 section_1
39 .push("Please refer to the equations below:")
40 .push(equations);
41
42 let mut objectives = List::new(ListKind::Enumerate);
43 objectives
44 .push(r"Demonstrate how to use the \textit{latex} library.")
45 .push("Create a reasonably complex document")
46 .push("???")
47 .push("PROFIT!");
48
49 section_1.push("Here are our objectives:").push(objectives);
50
51 section_1
52}
Trait Implementations§
impl StructuralPartialEq for Align
Auto Trait Implementations§
impl Freeze for Align
impl RefUnwindSafe for Align
impl Send for Align
impl Sync for Align
impl Unpin for Align
impl UnwindSafe for Align
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