Letur Open Letur

Markdown on the left, a typeset page on the right, redrawn as you write.

Letur is an editor for writing that ends as a PDF. You write markdown — with captions, figures, references, math and citations — and beside it the page is set in the type you are reading now.

Open Letur

Runs in this browser. Nothing to install, and no server sees your text.

Letur's window: a list of files, the markdown of a captioned figure, and the typeset page it makes, a diagram numbered Figure 1.

What the markdown can say

Twelve examples. Beside each source is the page Letur sets from it — or, for the three it refuses, what it says instead — and beneath, closed, the same text as plain HTML, which has no way to show what it means. Open any of them in Letur to change it and watch the page follow. The README lists everything the markdown may contain.

Captions, figures and references

A few short markers that plain markdown prints as ordinary text. Letur turns them into numbered tables, listings, figures and equations, and keeps every reference to them right as the document changes around them. Captions · Groups · Names

A caption makes a figure, and numbers it

Open in Letur

A paragraph opening : beneath a table, an image or a code block is that block's caption.

md2pdf
Table 1: a two-column table with its caption set beneath
the page Letur sets

Table 1, set beneath the table, on a counter tables keep to themselves.

Without Letur: the same parse, as plain HTML
ab
12

: The measurements.

The same marker under a code block

Open in Letur

One mechanism over three constructs, each counting on its own — so inserting a table above a listing does not renumber the listing.

md2pdf
Listing 1: a line of Rust set in monospace, indented, with its caption beneath
the page Letur sets

Listing 1, captioned beneath and standing 2em off the margin the prose stands on, because code is read from where its lines begin.

Without Letur: the same parse, as plain HTML
fn main() {}

: The entry point.

The same marker over an image

Open in Letur

The third construct a caption reaches, and the only one that needs a file — so the page carries one: pipeline.svg travels inside this page itself.

md2pdf
Figure 1: the diagram of three boxes joined by arrows, with its caption beneath
the page Letur sets

Figure 1, the caption set beneath the image, on a counter the tables and the listings above do not touch.

Without Letur: the same parse, as plain HTML

The three steps, drawn as boxes

: The conversion pipeline, with the emitter in the middle.

A pair of ::: lines makes several blocks one figure

Open in Letur

The members share one caption, one number and one name. No arrangement of the : marker alone can say that.

md2pdf
Table 1: two small tables side by side, under one caption
the page Letur sets

One Table 1 with both members side by side, taking a single number between them.

Without Letur: the same parse, as plain HTML

:::

stepwhat
1parse
stepwhat
2typeset

: The two halves of the pipeline.

:::

Name a figure, and point at it

Open in Letur

End a caption with {#name}, then write [](#name) — a link with nothing between the brackets — to refer to it.

md2pdf
Table 1 with its caption, and beneath it the sentence “As Table 1 shows, the two columns agree.”
the page Letur sets

“As Table 1 shows…”, and it stays true — insert another table above it and the sentence reads Table 2 without your touching it.

Without Letur: the same parse, as plain HTML
ab
12

: The measurements. {#tab:m}

As shows, the two columns agree.

Math is LaTeX, and it is checked before it is set

Open in Letur

$…$ sets in the running text and $$…$$ as a block of its own, converted in the browser rather than by a service.

md2pdf
The formula set as a display block: a square root over x squared plus y squared, at most the sum of the absolute values of x and y
the page Letur sets

The formula typeset as a display block, with the radical, the relation and the bars set as math rather than as characters that resemble it.

Without Letur: the same parse, as plain HTML

\sqrt{x^2 + y^2} \leq |x| + |y|

What a printed page has

A title block, notes at the foot of the column, a list of references: things a printed page carries and markdown has never had a way to ask for. Frontmatter · Footnotes · Citations

Nine frontmatter keys decide the look

Open in Letur

A leading --- block picks one of two looks, one or two columns, and whether display formulas are numbered. author takes several names separated by ;, and a ^ after one points at an affiliation. date is your text and nothing else — md2pdf never reads a clock.

md2pdf
A centred title, two authors marked 1 and 2, their affiliations and the date, then the heading Introduction and a line of body text
the page Letur sets

A centred title block, the body in one column, and every $$…$$ numbered (1), (2) down the page.

Without Letur: the same parse, as plain HTML

Introduction

Body text under a title block the markdown itself asked for.

A footnote lands at the foot of its column

Open in Letur

The definition may sit anywhere in the file, above or below the reference that cites it.

md2pdf
The top of a page, one sentence marked with note 1; a dashed cut where the empty page is left out; then the foot, the note set under a rule
the page Letur sets

The note at the foot of the column that carries the reference, where a reader's eye already is.

Without Letur: the same parse, as plain HTML

A claim that needs a source1.

1

The note itself, which may hold emphasis and code.

A citation earns a reference list

Open in Letur

A tenth frontmatter key names a bibliography — a Hayagriva .yml or a BibLaTeX .bib, the file you already have — and [@key] cites it. This page carries one: refs.yml, beside the diagram.

md2pdf
A sentence ending in the mark [1], and beneath it a References list giving Knuth’s The TeXbook, Addison-Wesley, 1986
the page Letur sets

A numbered mark where you cited, and the reference list set at the end of the document under the label the look draws.

Without Letur: the same parse, as plain HTML

Typesetting was rethought from the ground up @knuth1986.

What it refuses, and says so

Letur never quietly drops what it cannot set, because a PDF that leaves out part of its source looks finished and is wrong. It names the construct and the line instead, and these are the sentences it shows — checked against the compiler, like every example above.

Raw HTML

Open in Letur

A PDF has no <div>, and guessing what one should become is how a converter starts lying.

md2pdf

Letur sets no page, and says:

unsupported markdown construct 'raw HTML block' at line 3
Without Letur: the same parse, as plain HTML

A paragraph the emitter accepts.

a raw HTML block

A task marker in a numbered list

Open in Letur

A bullet list of - [ ] items compiles, the box drawn where the bullet was. In a numbered list the number and the box would both claim that place, so the compiler names the line rather than choosing one.

md2pdf

Letur sets no page, and says:

unsupported markdown construct 'task list marker in an ordered list' at line 1
Without Letur: the same parse, as plain HTML
  1. a numbered task
  2. and a second

A LaTeX command outside the accepted subset

Open in Letur

The dialect accepts a bounded list — the Greek letters, the relations, sums and integrals, \frac, \sqrt, the accents, the matrix and aligned environments. A command off it is named rather than dropped.

md2pdf

Letur sets no page, and says:

math error at line 1: unsupported command '\includegraphics'
Without Letur: the same parse, as plain HTML

A formula \includegraphics{fig.png} names a command outside the dialect.

A refusal reads the same in Letur as at a terminal: the window runs the compiler the md2pdf command-line tool runs, built for your browser.