glu
How-tos

How-tos

Recipes for complete, real-world documents. Each one walks through a runnable example from the examples repository, so you can clone it and follow along: every file shown here is checked in there, together with a reference result.pdf.

DIN 5008 letter

Write a DIN 5008 letter

Address window, fold marks and date placed with CSS, the body in plain Markdown

ZUGFeRD invoice

Create a ZUGFeRD e-invoice

PDF/A-3b with embedded Factur-X XML, driven by a companion Lua script

Table of contents with page numbers

Generate a table of contents

Dot leaders and automatic page numbers with target-counter() and leader()

Offer letter on a corporate letterhead

Put a letterhead behind every page

Page backgrounds from a stationery PDF, with page 1 different from the rest

Page with a three-column running footer

Add page headers and footers

Page numbers via margin boxes, rich footers via CSS running elements

Report page with a bar chart

Render a chart from data

A Lua block turns a data table into an SVG bar chart, no browser involved

Page with EAN-13, Code 128, and QR codes

Generate barcodes

EAN-13, Code 128, and QR codes as vector graphics via the barcode element

Page with inline and display formulas

Typeset TeX math

Dollar-syntax formulas set by the OpenType-MATH engine, no Pandoc needed

Accessible report with headings, list, and table

Produce an accessible report

One frontmatter line turns Markdown into a tagged PDF/UA document

Page with signature block and tables with declared column widths

Control table column widths

Percentages and lengths on cells, nth-child rules for Markdown pipe tables

Page with notes hanging in the outer margin

Put notes in the outer margin

float: outside follows the wide margin from page to page, no page-side bookkeeping

Page with text lined up at tab stops

Line up text with tab stops

Contents lines, forms and decimal columns from plain Markdown with tabs

Page with a picture, an image and a box of facts, the text flowing around them

Wrap text around an image

float: left and right for figures, images in a paragraph and boxes that fit their content

Page with highlighted phrases and correction marks

Highlight and mark up text

A highlighter with background-color, a red pen with text-decoration, all from plain Markdown

Two-column scientific paper

Set a scientific paper

Two columns under a title block, numbered equations, figures and cross references from Markdown

Looking for more? The example collection covers many other topics: presentation slides, color emoji, font fallback, mixed left-to-right and right-to-left scripts, floats, and more.