glu

glu: Markdown, HTML and Lua to PDF

glu converts Markdown and HTML files to PDF, or executes Lua scripts for full programmatic control over PDF output.

glu document.md    # → document.pdf
glu page.html      # → page.pdf
glu script.lua     # → script.pdf

Installation

Homebrew (macOS / Linux):

brew install boxesandglue/tap/glu

Pre-built binaries:

Download the latest release from https://github.com/boxesandglue/glu/releases/latest.

Build from source (requires Go):

git clone https://github.com/boxesandglue/glu
cd glu
rake build

Quick start

Scaffold a starter project and build it:

glu init mydoc
cd mydoc
glu index.md

This produces index.pdf, an A4 page with title block, page numbers via CSS, and a small tour of Markdown features (headings, lists, table, inline Lua, links). The default report template ships inside the glu binary, so there’s nothing to download or configure.

Two other templates round out the staged-difficulty arc: bare (just index.md, minimal Markdown) and pdfua (preconfigured for format: PDF/UA with structural elements). Pass the name as a second argument:

glu init mydoc bare
glu init mydoc pdfua
glu init list                  # show available templates

See Command line for the full grammar and overwrite rules. You can also skip the scaffolder entirely and pass any .md, .html, or .lua file directly: every file the templates emit is valid standalone input.

For complete real-world documents, work through the How-tos: a DIN 5008 business letter, a ZUGFeRD e-invoice, letterheads and page footers, charts, barcodes, TeX math, and more.

Documentation

  • How-tos: recipes for complete documents, such as a letter, an invoice, charts or a PDF for the print shop.
  • Write documents: Markdown, HTML, styling with CSS, math, and standards such as PDF/UA and PDF/A.
  • Typography: fonts, line breaking, leading, columns and page breaks.
  • Prepress: PDF/X, color, bleed and crop marks, and lines in register.
  • Automate with Lua: Lua inside your documents, callbacks, and scripts that build a whole PDF.
  • Lua API reference: all Lua modules of glu.
  • Command line: options, watch mode, safe mode, reproducible builds and exit codes.