texrender 0.3.3

Thin wrapper around running `latexmk` to render LaTeX documents. Also supports generating Tex documents.
Documentation

texrender

A small crate to run latexmk from Rust, similar to latex, escape LaTeX code and generate LaTeX documents programmatically.

Example: Rendering latex

let doc = r"
      \documentclass{article}
      \begin{document}
      hello, world.
      \end{document}
      ";

let tex = TexRender::from_bytes(doc.into());
let _pdf = tex.render().expect("latex rendering failed");

Example: Generating latex code

use texrender::elems;
use texrender::tpl::TexElement;
use texrender::tpl::elements::{N, doc, document, documentclass, section, t};

let tex = doc(elems!(
    documentclass(N, "article"),
    document(elems!(
        section("Hello, world"),
        t("This is fun & easy.")
    ))
));

let output = tex.render().expect("rendering failed");

assert_eq!(output,
           "\\documentclass{article}\n\
            \\begin{document}\n\
            \\section{Hello, world}\n\
            This is fun \\& easy.\n\
            \\end{document}\n");