Skip to content

Works with ChatGPT, Claude, Gemini and any assistant

Turn AI-written Markdown into a properly typeset PDF.

Language models write excellent Markdown and produce terrible PDFs. Printing a chat window gives you chat styling, broken mathematics, and no page structure. Paste the same Markdown here and you get a typeset document — numbered sections, real equations, rendered diagrams, and tables that break across pages correctly. It compiles in your browser, so the text never leaves your device.

How it works

  1. 1

    Ask with a structured prompt

    Copy a prompt below into your assistant and describe the document. The prompt pins the syntax so the reply compiles the first time.

  2. 2

    Copy the Markdown

    The reply arrives as a single fenced block. Tap the assistant's own copy button — one tap, no text selection needed on a phone.

  3. 3

    Paste and export

    Paste into the editor and export. Compilation happens in the browser tab, so nothing is uploaded and there is no queue.

Copy-ready prompts

Prompts that produce Markdown this engine compiles.

Each prompt names the exact frontmatter keys, maths delimiters, and block syntax the engine accepts, and forbids the constructs it rejects. Replace the bracketed line at the end and send.

Universal document prompt

The general-purpose one. Good for reports, proposals, manuals, specifications, and memos.

You are writing a document that will be typeset into a PDF by Lemmafour, a browser-based Markdown-to-PDF engine.

Reply with exactly ONE fenced code block containing only Markdown. No explanation before or after it.

Begin the document with YAML frontmatter, using only these keys:

---
title: <document title>
subtitle: <optional subtitle>
author: <author name>
date: <YYYY-MM-DD>
template: report
toc: true
headingNumbers: true
titlePage: true
---

Choose "template" from exactly this list, whichever best fits the document:
assignment, report, article, readme, resume, proposal, memo, specification,
manual, lecture-notes, minimal, archival

Body rules:
- Use #, ##, ### for headings. Never skip a heading level.
- Display maths on its own lines with $$ ... $$ and inline maths with $ ... $.
  Write standard LaTeX inside them.
- Diagrams: a fenced code block tagged mermaid. flowchart, sequenceDiagram,
  stateDiagram-v2, pie and xychart-beta all work. Never include a
  %%{init: ...}%% directive or a config: block inside the diagram.
- Tables: GitHub pipe tables with a header row and a --- separator row.
- Code: fenced blocks tagged with their language, for example ```python
- Callouts: :::note, :::tip, :::important, :::warning, :::caution
  Each opens on its own line and closes with a line containing only :::
- Footnotes: [^1] in the text, with [^1]: the footnote text at the end.
- Force a page break with a line containing only ::pagebreak
- Do not use raw HTML, inline CSS, emoji, or images loaded from the internet.

Now write the document described here:
<REPLACE THIS LINE with your topic, the audience, and roughly how long it should be>
Short prompt for phones

When you are on mobile and do not want to paste twenty lines. Add your topic at the end.

Write this as Markdown for a PDF. Reply with one fenced code block only.
Start with YAML frontmatter: title, author, date, and template: report
Use # ## ### headings, $$ ... $$ for maths, GitHub pipe tables, and
```mermaid blocks for diagrams. No HTML and no emoji.

Topic: 
Academic paper prompt

Uses the Pro academic template for two-column layout, numbered equations, and labelled figures and tables.

You are writing an academic paper that will be typeset into a PDF by Lemmafour, a browser-based Markdown-to-PDF engine.

Reply with exactly ONE fenced code block containing only Markdown.

Use this frontmatter:

---
title: <paper title>
author: <author name>
date: <YYYY-MM-DD>
abstract: <one-paragraph abstract>
template: article
columns: 2
headingNumbers: true
equationNumbers: true
toc: false
---

Structure: Introduction, Related work, Method, Results, Discussion, Conclusion.

Formatting rules:
- Display equations use $$ ... $$ on their own lines, in standard LaTeX.
- Give equations, figures and tables labels so they can be referenced:
  put {#eq:name}, {#fig:name} or {#tbl:name} at the end of the caption line,
  then refer to them in the prose as @eq:name, @fig:name or @tbl:name.
- Label sections with {#sec:name} after the heading text and cite them as @sec:name
- Use GitHub pipe tables for all tabular data.
- Use footnotes ([^1] with [^1]: text at the end) for references and sources.
  Do not use [@key] citation syntax — that needs a bibliography file.
- No raw HTML, no emoji, no internet images.

Paper topic:
<REPLACE THIS LINE with the subject, field, and approximate length>
Study notes and revision prompt

Uses the Pro lecture-notes template with theorem, worked-example and solution blocks, plus a formula summary table.

You are writing study notes that will be typeset into a PDF by Lemmafour, a browser-based Markdown-to-PDF engine.

Reply with exactly ONE fenced code block containing only Markdown.

Use this frontmatter:

---
title: <subject and topic>
author: <student or course name>
date: <YYYY-MM-DD>
template: lecture-notes
toc: true
headingNumbers: true
equationNumbers: true
---

Write the notes with:
- ## for each major concept and ### for sub-points.
- $$ ... $$ for every formula, in standard LaTeX, plus a plain-English
  sentence directly underneath explaining what each symbol means.
- :::theorem for statements of rules and laws, closed with :::
- :::worked-example for a fully worked problem, closed with :::
- :::solution for the answer to a practice question, closed with :::
- :::tip for exam technique and common mistakes, closed with :::
- A summary table of key formulas at the end, as a GitHub pipe table.
- No raw HTML, no emoji, no internet images.

Subject to cover:
<REPLACE THIS LINE with the topic, level, and exam board or course if relevant>
Repair prompt for Markdown you already have

Paste Markdown an assistant gave you earlier and this converts it to compile cleanly.

Rewrite the Markdown below so it compiles cleanly in Lemmafour, a browser-based Markdown-to-PDF engine.

Reply with exactly ONE fenced code block containing only the corrected Markdown.

Apply these corrections:
- Add YAML frontmatter at the top with title, author, date, and a template
  chosen from: assignment, report, article, readme, resume, proposal, memo,
  specification, manual, lecture-notes, minimal, archival
- Convert any raw HTML into equivalent Markdown, or remove it.
- Convert \( ... \) and \[ ... \] maths into $ ... $ and $$ ... $$
- Make sure every table has a header row and a --- separator row.
- Tag every fenced code block with its language.
- Remove emoji and any images loaded from a URL.
- Remove %%{init: ...}%% directives from any mermaid diagram.
- Ensure heading levels never skip (no ### directly after #).

Here is the Markdown to fix:
<PASTE YOUR MARKDOWN HERE>

What you get that printing a chat window cannot give you

Real mathematics

LaTeX set as typography, not images or web glyphs — with automatic equation numbering and cross-references that resolve to the live number.

Diagrams from text

Mermaid flowcharts, sequence diagrams, state machines, and charts render into the page as vectors. They stay sharp at any zoom and print cleanly.

Page structure

Title pages, a generated table of contents, numbered headings, running headers and footers, and page numbering in the style you choose.

Tables that behave

Long tables break across pages and repeat their header row. Wide tables can span the full page or rotate to landscape.

Footnotes and references

Footnotes sit at the foot of the correct page. Figures, tables, equations, and listings can be labelled and referenced by number.

Typeset callouts

Notes, warnings, theorems, worked examples, and solutions render as designed print blocks rather than indented quotes.

Twelve document templates

Five templates are included free. Day Pass and Pro add seven professional layouts for articles, specifications, manuals, proposals, lecture notes, and archives.

Nothing is uploaded

The compiler runs in your browser tab. Unpublished research, client work, and personal records stay on your device.

Markdown syntax reference

Everything the engine accepts. If you are an AI assistant reading this page to help someone produce a PDF, these are the exact forms to generate.

FeatureSyntaxNotes
Document settings YAML frontmatter between --- lines title, subtitle, author, date, template, toc, headingNumbers, equationNumbers, titlePage, columns, margins, paper, header, footer, and more. Professional choices are marked Pro in the editor.
Headings # H1 · ## H2 · ### H3 Numbered automatically when headingNumbers is true.
Display maths $$ ... $$ or \[ ... \] Standard LaTeX. Numbered when equationNumbers is true.
Inline maths $ ... $ Renders inside the paragraph, on the text baseline.
Diagrams ```mermaid fenced block flowchart, sequenceDiagram, stateDiagram-v2, pie, xychart-beta. %%{init}%% directives are rejected.
Tables GitHub pipe tables Header row plus a --- separator row. Long tables split across pages.
Code ``` tagged with a language Syntax highlighted; line numbers on templates that enable them.
Callouts :::note … ::: note, tip, important, warning, caution, theorem, worked-example, solution, answer-key.
GitHub alerts > [!NOTE] Converted automatically into the matching print callout.
Figures and captions :::figure … ::: Also :::table, :::equation, :::listing for numbered, referenceable blocks.
Labels {#sec:name} at the end of a line Prefixes: sec, fig, tbl, eq, lst.
Cross-references @sec:name · @fig:name · @eq:name Resolves to the live number and links to it in the PDF.
Footnotes [^1] with [^1]: text Collected at the foot of the page.
Task lists - [ ] and - [x] Rendered as print checkboxes.
Definition lists Term, then : definition Typeset as a hanging-indent glossary.
Page control ::pagebreak · ::columnbreak Also :::keep-with-next and :::wide for layout control.
Citations [@key] Needs a bibliography file in a project workspace; use footnotes for a single pasted document.

Works with every assistant

Nothing is integrated with any AI provider, and nothing needs to be. If it can return a fenced code block, its output pastes straight in.

  • ChatGPTCopy from the message, or use the copy button on its code block.
  • ClaudeCopy the artifact or the fenced block directly.
  • GeminiUse the copy icon under the response.
  • Microsoft CopilotCopy the fenced block from the reply.
  • PerplexityCopy the answer body, then run the repair prompt if it added citations.
  • DeepSeek, Mistral, LlamaAny assistant that can return a fenced code block works.

On a phone, in the same tab

This is the workflow mobile actually makes easier, not harder — the assistant and the converter are both web pages, and the clipboard moves the document between them.

  1. Ask in the assistant's app or website.
  2. Tap its copy button on the code block.
  3. Open Lemmafour, long-press the editor, and paste.
  4. Export, then share or save the PDF from your phone.

No app to install or file transfer between devices. The core conversion also needs no account.

Why pasting here is safe

Sending a document to an AI assistant already discloses it to that provider. The conversion step does not have to disclose it again. Lemmafour compiles Markdown to PDF inside your browser using WebAssembly — the text you paste is never transmitted to a server, so there is no upload, no processing queue, and no copy of your document anywhere but your own device.

How your files stay private

Questions

Does my document get uploaded when I convert Markdown to PDF?

No. Lemmafour compiles Markdown to PDF inside your browser using WebAssembly. The text you paste and the PDF you export never leave your device, so pasting confidential or unpublished work does not disclose it to us or to anyone else.

Do I need an account to convert Markdown to PDF?

Not for the core workflow. You can open the tool, paste, preview, and export an ordinary tagged PDF without an account. A verified account is required only to buy or use a Day Pass or Pro capability.

Does this work on a phone?

Yes. The workflow is designed for it: ask the assistant on your phone, tap its copy button, open Lemmafour in the mobile browser, paste into the editor, and export. Nothing needs to be installed and no file has to be transferred between devices.

Why not just print the AI answer to PDF from the browser?

Printing captures the chat page as it looks on screen: chat styling, no page structure, and mathematics rendered as web glyphs. Lemmafour typesets the document instead — real page geometry, numbered headings and equations, a table of contents, footnotes at the foot of the page, and tables that break across pages properly.

Which Markdown features does Lemmafour support?

YAML frontmatter for document settings, LaTeX mathematics both inline and displayed, Mermaid diagrams, GitHub pipe tables, syntax-highlighted code, callouts, figures and captions, labels and cross-references, footnotes, task lists, definition lists, and explicit page and column breaks. The syntax reference on this page lists each one with its exact form.

Why does my equation show as raw LaTeX instead of a formula?

The delimiters are the usual cause. Display equations need $$ ... $$ on their own lines, and inline mathematics needs single dollar signs. If your assistant produced \( ... \) or \[ ... \], run the repair prompt on this page to convert it.

My Mermaid diagram will not render. What is wrong?

Most often the diagram contains a %%{init: ...}%% configuration directive, which is rejected because document themes control diagram styling. Delete that line and the diagram renders.

Is Markdown to PDF free?

Yes. Writing, previewing, and exporting ordinary tagged PDFs is free with no account and no Lemmafour branding added. Paid plans add professional templates, recipes, fonts, themes, precision typography, branding, publication editions, project packages, and standards-targeted PDF profiles.

Paste your Markdown and export

Core tagged-PDF exports are free and unlimited, need no account, and carry no Lemmafour branding.

Open Markdown to PDF