Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rwestlund/gotex
A Go library for rendering LaTeX documents
https://github.com/rwestlund/gotex
go golang latex
Last synced: 3 months ago
JSON representation
A Go library for rendering LaTeX documents
- Host: GitHub
- URL: https://github.com/rwestlund/gotex
- Owner: rwestlund
- License: bsd-2-clause
- Created: 2017-04-10T02:59:55.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-12T08:01:45.000Z (almost 8 years ago)
- Last Synced: 2024-09-29T05:03:58.705Z (3 months ago)
- Topics: go, golang, latex
- Language: Go
- Size: 3.91 KB
- Stars: 29
- Watchers: 4
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gotex
A simple Go library for rendering LaTeX documents# Install
```bash
go get -u github.com/rwestlund/gotex
```# Documentation
See the documentation at [https://godoc.org/github.com/rwestlund/gotex](https://godoc.org/github.com/rwestlund/gotex)# Example
```go
package mainimport "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.