pub struct Equation { /* private fields */ }
Expand description
A single equation.
§Examples
The Equation
struct is designed to be added to an Align
object.
Creating one is as simple as using the constructor.
let eq = Equation::new("y &= mx + c");
For convenience, you can also convert from a &str
to an Equation
using
into()
.
let eq: Equation = "y &= mx + c".into();
You can also assign a label
to an equation so it can be referenced later.
eq.label("basic-linear-equation");
Implementations§
Source§impl Equation
impl Equation
Sourcepub fn with_label(label: &str, text: &str) -> Equation
pub fn with_label(label: &str, text: &str) -> Equation
Create an equation which has a label.
Examples found in repository?
examples/complex.rs (line 36)
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 not_numbered(&mut self) -> &mut Self
pub fn not_numbered(&mut self) -> &mut Self
Set whether the \nonumber
command should be used to ignore numbering
for this equation.
Sourcepub fn is_numbered(&self) -> bool
pub fn is_numbered(&self) -> bool
Is this equation numbered?
Trait Implementations§
impl StructuralPartialEq for Equation
Auto Trait Implementations§
impl Freeze for Equation
impl RefUnwindSafe for Equation
impl Send for Equation
impl Sync for Equation
impl Unpin for Equation
impl UnwindSafe for Equation
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