Writing in Markdown
The full specification of LibreTimes Markdown — from CommonMark basics to the academic extensions
Everything you publish on LibreTimes — lectures, problem sets, expositions, essays — is written in LibreTimes Markdown. It is standard Markdown at the core, extended for academic writing: mathematics, theorem-style blocks, diagrams, and media.
The flavor is built in three layers, and this guide follows them in order:
- CommonMark — the standard core. Headings, emphasis, lists, links, quotes, code. If you have written Markdown anywhere, you already know this layer.
- GFM (GitHub Flavored Markdown) — widely adopted extensions: tables, footnotes, task lists, strikethrough, autolinks. Covered alongside the basics.
- LibreTimes extensions — what makes the flavor academic: mathematics with KaTeX, highlighted code, and the directive blocks — theorems and proofs, callouts, collapsible sections, tabs, TikZ diagrams, video embeds, mentions, and attachments.
Anything valid in a lower layer stays valid in the ones above it: a plain CommonMark document is already a valid LibreTimes document.
Quick example
Pythagorean theorem
Theorem (Pythagoras). For a right triangle with legs , and hypotenuse :
Proof. Drop the altitude from the right angle and compare similar triangles.
## Pythagorean theorem
:::theorem[Pythagoras]
For a right triangle with legs $a$, $b$ and hypotenuse $c$:
$$
a^2 + b^2 = c^2
$$
:::
:::proof
Drop the altitude from the right angle and compare similar triangles.
:::Sections
New to it? Start with the quickstart: a lecture note with formulae, a theorem, a figure and a citation, in about ten minutes.
The rest of the guide has four kinds of page. How-to guides take one task from start to finish. Concept pages explain why the dialect works the way it does. Reference pages say everything about one construct and are meant to be looked up. Troubleshooting starts from what went wrong on the page.
How-to guides
| Page | The task |
|---|---|
| Write mathematics | Formulae in a sentence and on their own lines, aligned and numbered equations, derivations |
| Write a theorem and its proof | Statements with names and numbers, proofs, problems with hints and solutions |
| Add a figure or a gallery | Captioned images, galleries, links to figures |
| Draw a diagram with TikZ | Diagrams, commutative squares and plots compiled from TikZ |
| Cite works and cross-reference | Footnote citations, the references list, links to your own and others' results |
| Organise a page with tabs and collapsible sections | Alternatives side by side, detail behind a click |
| Mention people and attach files | @handle links and attachment links |
| Write a book | Chapters, parts and publishing, on the site or with lt |
| Convert a LaTeX or Word document | Import a .tex, a LaTeX project or a .docx, and check the result |
Concepts
| Page | What it explains |
|---|---|
| LibreTimes Markdown and CommonMark | What is standard, added, changed and refused |
| Statements and admonitions | Why a theorem and a warning differ, and why only one is numbered |
| How a document is rendered | From source to page, why KaTeX, why the preview is the page |
| How a book is structured | Chapters as pages, parts as navigation, addresses that never move |
| HTML and security | Which raw HTML is allowed, and why the rest is removed |
Reference
| Page | What it covers |
|---|---|
| Basics | CommonMark + GFM: text, highlight, definition lists, headings, lists, links, images, quotes, tables, footnotes |
| Mathematics | KaTeX: inline and display math, delimiters, derivations, common commands |
| Code blocks | Syntax highlighting, titles, inline code |
| Extensions | The directive syntax and every LibreTimes block: statements, admonitions, figures and galleries, spoilers, tabs, TikZ, video, mentions, attachments, book blocks |
| Citations and cross-references | Anchors, links within a document, and the [@key] syntax |
| Syntax reference | Every mark, delimiter, directive, label and attribute in one place |
| Cheatsheet | Everything on one page, as source |
| Comments | The reduced flavor used in comments |
Troubleshooting
| Page | What it covers |
|---|---|
| Troubleshooting Markdown | A red formula, a directive shown as text, a printed attribute line, an image that does not open |
Where it applies
Publications use the full flavor. Comments use a reduced set — the same text syntax, but no media and no block extensions. The editor writes this syntax for you; this guide is the reference for what the syntax is, whether you type it directly in source mode or import documents written elsewhere.
One rule worth knowing up front
The page title is not part of the document body. The title you enter when
publishing renders as the page's only top-level heading, so headings in the
body start at the second level. If your document does contain a top-level
heading (# Title), the whole heading tree is shifted down one rank to keep
the hierarchy — see Headings.