pub struct Latex {
pub document_class: (Class, Option<u8>, Option<String>),
pub metadata: Metadata,
pub packages: Vec<Package>,
pub document_elements: Vec<Element>,
pub maketitle: bool,
}Expand description
Latex struct that contains everything related to a latex document
Fields§
§document_class: (Class, Option<u8>, Option<String>)Document class contains:
- Class
(\documentclass{...}) - Fontsize
(\documentclass[..pt]{...}) - Papersize
(\documentclass[..pt, ...]{...})
metadata: MetadataMetadata contains the author, title and date
packages: Vec<Package>Packages contains all the packages (\usepackage{...})
document_elements: Vec<Element>Document elements contains a vector of all the elements
maketitle: boolImplementations§
Source§impl Latex
impl Latex
pub fn new() -> Self
Sourcepub fn set_class_options(&mut self, font_size: u8, paper_size: &str)
pub fn set_class_options(&mut self, font_size: u8, paper_size: &str)
Sets the class options for Latex Document
Sourcepub fn set_metadata(&mut self, meta: Metadata)
pub fn set_metadata(&mut self, meta: Metadata)
Sets the metadata for the Latex Document
Sourcepub fn set_packages(&mut self, packages: &Vec<Package>)
pub fn set_packages(&mut self, packages: &Vec<Package>)
Sets the packages for the Latex Document
Sourcepub fn add_package(&mut self, package: String)
pub fn add_package(&mut self, package: String)
Adds a single package to the packages
Sourcepub fn set_elements(&mut self, elements: Vec<Element>)
pub fn set_elements(&mut self, elements: Vec<Element>)
Sets the elements for the Latex Document
Sourcepub fn get_ud(&self) -> Vec<UDTuple> ⓘ
pub fn get_ud(&self) -> Vec<UDTuple> ⓘ
Returns a vector of UDTuple, used for write so they can be written in the correct location
pub fn no_maketitle(&mut self)
Sourcepub async fn async_write(&self, path: PathBuf) -> Result<(), Error>
pub async fn async_write(&self, path: PathBuf) -> Result<(), Error>
Asynchronous and parallel write using async_std and rayon
Sourcepub async fn split_write(
&self,
main: PathBuf,
structure: PathBuf,
) -> Result<(), Error>
pub async fn split_write( &self, main: PathBuf, structure: PathBuf, ) -> Result<(), Error>
Split write that writes a main and structure file
Uses async_std to do write asynchronously
pub fn split_string(&self) -> (String, String)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Latex
impl RefUnwindSafe for Latex
impl Send for Latex
impl Sync for Latex
impl Unpin for Latex
impl UnwindSafe for Latex
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more