RusTeX
A library to make simple auto-generated LaTeX files in Rust.
Quick start
To use RusTeX, add the crate to your Cargo.toml.
[]
= "0.1.0"
Documentation
The documentation is accessible here.
Implemented Features
Components
- Package
- Command
- Chapter
- Section
- Enumerate
- Table
- Figure
- Text
- Label
- PageBreak
Formatting
- Markdown bold (**bold**)
- Markdown italic (_italic_)
- Color text (#blue{text})
Example
A full example with the resulting PDF file is accessible in the example folder.
-
Start by creating a base
Documentconst DOCUMENT_NAME: &str = "generated_tex/main.tex"; const DOCUMENT_CLASS: ClassType = Report; const FONT_SIZE: &str = "12pt"; let doc_file: File = create.unwrap; let doc_class: DocumentClass = new; let mut doc: Document = new; -
Add some
Packageslet packages = vec!; doc.add_packages; -
Add some global
Commandslet commands = vec!; doc.add_global_commands; -
Then you can add different
Items-
Any
Itemcan be added to aDocument -
Any
Itemcan be added to aContainer -
A
Containeris anItem, so they can be nested -
Itemsare displayed by order that they have been addedlet mut section_1: Section = new; let paragraph_1 = new; section_1.add_item; doc.add_item;
-