#reports #pdf #tex #generation

latex

An ergonomic library for programatically generating LaTeX documents and reports

6 releases

Uses old Rust 2015

0.3.1 May 20, 2019
0.3.0 May 13, 2019
0.2.0 May 20, 2017
0.1.2 May 19, 2017

#410 in Template engine

Download history 37/week @ 2024-07-20 62/week @ 2024-07-27 24/week @ 2024-08-03 28/week @ 2024-08-10 14/week @ 2024-08-17 19/week @ 2024-08-24 14/week @ 2024-08-31 19/week @ 2024-09-07 11/week @ 2024-09-14 31/week @ 2024-09-21 15/week @ 2024-09-28 3/week @ 2024-10-05 15/week @ 2024-10-12 23/week @ 2024-10-19 14/week @ 2024-10-26 23/week @ 2024-11-02

78 downloads per month
Used in 2 crates

MIT license

46KB
953 lines

LaTeX-rs

Build Status Crates.io Docs.rs latex-rs on Crates.io Build status

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

Most of the types used to construct a Document have examples showing how they can be used and roughly what they'll generate, however for a more in-depth example check out the complex example in the examples/ directory.

This is what your typical "Hello World" would look like:

use latex::{Document, DocumentClass, Element};

let mut doc = Document::new(DocumentClass::Article);
doc.push("Hello World");

Features

The crate is still incomplete, but the following features are available when generating your LaTeX documents:

  • Preamble
  • Sections
  • Paragraphs
  • Align environment and Equations
  • Lists (both numbered and not)
  • Table of contents, title page, and the \clearpage command
  • Figures
  • Tables
  • Appendices
  • Included PDF files
  • \include{...}
  • \input{...}
  • Partial documents
  • References and Bibliography
  • labels, plus \ref{...} for referencing them

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.

Dependencies

~65KB