pub struct Header {
pub name: String,
pub header_level: u8,
/* private fields */
}
Expand description
Represents \section{}
in latex
Fields§
§name: String
§header_level: u8
Implementations§
source§impl Header
impl Header
sourcepub fn new(name: &str, header_level: u8) -> Self
pub fn new(name: &str, header_level: u8) -> Self
Examples found in repository?
examples/doc_example.rs (line 12)
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
fn main() -> Result<(), Error> {
let metadata = Metadata::new("Author", "date", "title", 11, "book", "article", true);
let mut list = ElementList::new(&metadata);
let part = Part::new("part");
let chapter = Chapter::new("chapter");
let header1 = Header::new("header1", 1);
let header2 = Header::new("header2", 2);
let text = Text::new("text", TextType::Normal);
let pkg = Package::new("dramatist");
list.push_array(Elements![part, chapter, header1, header2, text, pkg]);
// To compile, use the `compile` feature
// list.compile(PathBuf::from("test.pdf"))?;
// To write to single tex file:
list.write(PathBuf::from("test.tex"))?;
// To split write Packages and Main file:
let input = Input::new(PathBuf::from("structure"), Level::Meta);
list.write_split(
PathBuf::from("main.tex"),
PathBuf::from("structure.tex"),
input,
);
// To print:
list.print_tex();
Ok(())
}
Trait Implementations§
source§impl<'de> Deserialize<'de> for Header
impl<'de> Deserialize<'de> for Header
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl ExtraOptions for Header
impl ExtraOptions for Header
fn modify_element(&mut self, options: Vec<Options>)
source§impl PartialEq<Header> for Header
impl PartialEq<Header> for Header
source§impl PartialOrd<Header> for Header
impl PartialOrd<Header> for Header
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl StructuralPartialEq for Header
Auto Trait Implementations§
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnwindSafe for Header
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