https://github.com/kube/node-pdflatex
PDFLaTeX wrapper for NodeJS
https://github.com/kube/node-pdflatex
javascript latex node pdf tex typescript
Last synced: 11 months ago
JSON representation
PDFLaTeX wrapper for NodeJS
- Host: GitHub
- URL: https://github.com/kube/node-pdflatex
- Owner: kube
- Created: 2016-11-29T10:34:05.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-06-02T18:29:36.000Z (about 8 years ago)
- Last Synced: 2025-04-11T18:25:06.286Z (about 1 year ago)
- Topics: javascript, latex, node, pdf, tex, typescript
- Language: TypeScript
- Homepage:
- Size: 11.7 KB
- Stars: 7
- Watchers: 2
- Forks: 6
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
node-pdflatex
=============
> PDFLaTeX wrapper for Node
Install
-------
```sh
npm install node-pdflatex
```
Usage
-----
`pdflatex` takes latex source and returns a Promise of Buffer.
```js
import pdflatex from 'node-pdflatex'
const source = `
\\documentclass{article}
\\begin{document}
Hello World!
\\end{document}
`
const pdf = await pdflatex(source)
```
### Options
#### `shellEscape`: `boolean`
Adds the `-shell-escape` flag during compilation.
```js
pdflatex(latexContent, { shellEscape: true })
```
#### `texInputs`: `Array`
Adds paths to `TEXINPUTS` env var during compilation.
```js
pdflatex(latexContent, { texInputs: ['../resources/'] })
```
TypeScript
----------
This package is written in **TypeScript**.
That means the NPM package comes with type definitions included.
License
-------
MIT