LaTeX-rs
An ergonomic library for programatically generating LaTeX documents and reports.
This originally came from a desire to create an alternate renderer for mdbook which saves to PDF. I quickly found that I needed a library for programatically generating LaTeX documents from an AST and because there wasn't anything out there which suited my use case, I made my own.
Getting Started
Here's a skeleton document which has a title page, table of contents, and two
sections. You can then render()
it to any Writer
(e.g. a File) and pass it
along to whatever you're using to compile LaTeX to PDF.
extern crate latex;
use ;
let mut doc = new;
// Set some metadata for the document
doc.preamble.title;
doc.preamble.author;
doc.push
.push
.push
.push;
let mut section_1 = new;
section_1
.push
.push;
doc.push;
let mut section_2 = new;
section_2.push;
doc.push;
let mut buffer = vec!;
doc.render?;
let rendered = String from_utf8?;
println!;
Contributing
This crate is still very young so pull requests and issues are welcome! If you there's something you want then create an issue and I'll try to implement it.