Skip to main content
Deno 2 is finally here 🎉️
Learn more

denotex

A small wrapper for generating PDFs with LaTeX in Deno.

Requirements

LaTeX must be installed on your machine. You can download it here.

Usage

TeX file

import { denotex } from "https://deno.land/x/denotex/mod.ts";

const document = await Deno.readFile("./document.tex");
const pdf = await denotex(document);
await Deno.writeFile("./output.pdf", pdf);

TeX string

import { denotex } from "https://deno.land/x/denotex/mod.ts";

const document = `
  \\documentclass{article}
  \\begin{document}
  hello world
  \\end{document}
`

const pdf = await denotex(document);
await Deno.writeFile("./output.pdf", pdf);

Options

const pdf = await denotex(document, { 
  command: 'xelatex',
  args: ['-no-file-line-error', '-no-pdf'],
  inputs: ['./styles', './fonts'],
  passes: 3,
  errorLogsPath: './my-tex-errors.log'
});