A Go library for rendering LaTeX documents
Switch branches/tags
Nothing to show
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE Initial commit Apr 10, 2017
README.md Add an option to set $TEXINPUTS Apr 12, 2017
main.go Add an option to set $TEXINPUTS Apr 12, 2017
main_test.go Initial import Apr 10, 2017

README.md

gotex

A simple Go library for rendering LaTeX documents

Install

go get -u github.com/rwestlund/gotex

Documentation

See the documentation at https://godoc.org/github.com/rwestlund/gotex

Example

package main

import "github.com/rwestlund/gotex"

func main() {
    var document = `
        \documentclass[12pt]{article}
        \begin{document}
        This is a LaTeX document.
        \end{document}
        `
    var pdf, err = gotex.Render(document, gotex.Options{
        Command: "/usr/bin/pdflatex",
        Runs: 1,
        Texinputs:"/my/asset/dir:/my/other/asset/dir"})

    if err != nil {
        log.Println("render failed ", err)
    } else {
        // Do something with the PDF file, like send it to an HTTP client
        // or write it to a file.
        sendSomewhere(pdf)
    }
}

License

This code is under the BSD-2-Clause license.