Updated October 9, 2026
Charts, QR Codes, and Math in One Markdown Document: A Practical Tour
Charts, QR codes, formulas, diagrams: in plain Markdown these are pasted assets, not document content. A tour of Autype's chart, qrcode, and math elements — with pitfalls, a decision table, and a pattern for documents that regenerate themselves.
Machine documentation, monthly reports, technical appendices: real business documents are rarely pure prose. A KPI curve here, a formula there, and more and more often a QR code that carries the reader from paper to the live dashboard. In a classic Markdown workflow, every one of these elements means a detour: render the chart in a separate tool, export a PNG, embed it, and repeat the loop after every data change. Converters such as Pandoc — version 3.12.1 was released on October 8, 2026, adding an FODT format the release notes describe as "a flattened representation of an ODT in a single XML file" — move content between dozens of formats. But a converter transports what already exists; it does not turn your document source into the chart, the QR code, or the rendered equation.
That is precisely the gap Autype closes: charts, QR codes, formulas, and diagrams are first-class elements of the Extended Markdown document model. You describe a chart as data, a QR code by its payload, a formula as LaTeX — and every export renders it natively, whether PDF, DOCX, or HTML. This tour walks through the four element families, names the pitfalls, and ends with a pattern for documents that regenerate themselves.
Where plain Markdown reaches its limits
Three gaps open up as soon as a document is more than prose:
- Charts have no syntax. Markdown defines no way to express a data series, so the chart always lives outside the document — in a spreadsheet, a BI tool, or a chart library you wire up yourself.
- QR codes are always screenshots. The code is generated in a web tool, downloaded, embedded. Change the target URL and the image in the document is quietly out of date.
- Math depends on the renderer. One viewer shows the LaTeX source, the next renders it, the Word export needs OMML instead. The formula survives, its presentation does not.
The common root: these elements are assets pasted into the document, not parts of it. Autype's JSON syntax flips this around — each element is a typed block with its own properties, defaults, and export behavior (media elements reference).
The chart element: Chart.js as a document building block
Under the hood, the chart element speaks Chart.js configuration — the same vocabulary as one of the most widely used open-source chart libraries (Chart.js documentation):
{
"type": "chart",
"config": {
"type": "line",
"data": {
"labels": ["Jan", "Feb", "Mar", "Apr"],
"datasets": [{ "label": "Requests/s", "data": [1200, 1500, 1800, 2100] }]
}
},
"width": 500,
"height": 300,
"caption": "Throughput by month"
}
Eight chart types are available: line, bar, pie, doughnut, radar, polarArea, scatter, and bubble. Two properties do the heavy lifting in practice:
{{variable}}substitution. Labels and dataset values may reference template variables. The chart then renders whatever the current job passes — January's numbers today, February's next month, without anyone touching the chart config.defaults.chart.colors. One palette for the whole document; every chart inherits it. Corporate colors live in the template, not in each individual chart.
The result is a chart that is data-bound at generation time and frozen into the export — exactly what a printed report needs.
QR codes: four payload types, four jobs
The qrcode element generates the code at export time from its payload, never as a pasted image. Four qrType values cover the practical cases:
- url — the classic bridge from paper to web: the code in the machine manual opens the current documentation page.
- wifi — network name, password, encryption; hardware handouts that let technicians join the workshop network without typing.
- vcard — contact data on the last page of a quote: scan once, and the project contact is in the phone.
- text — arbitrary payload up to 2,000 characters, for serial numbers, license keys, or batch identifiers.
Two properties decide scanability: size (50–1000 px) and errorCorrection — L (7 %), M (15 %), Q (25 %), or H (30 %). Rule of thumb: on screen, M is usually enough; for print that may be scuffed or photographed at an angle, choose Q or H with a generous size, accepting a denser pattern.
Math: LaTeX formulas that survive every export
The math element renders a block-level LaTeX equation; latex accepts up to 5,000 characters and align controls placement:
{
"type": "math",
"latex": "\\int_{0}^{\\infty} e^{-x^2}\\,dx = \\frac{\\sqrt{\\pi}}{2}",
"align": "center"
}
The honest limitation first: inline math within a paragraph is not supported. Formulas are always standalone blocks. If a sentence needs a formula, keep the sentence short and place the equation directly below it — in practice this improves readability anyway. For mixed-format delivery, renderAsImage renders the equation as an image, which keeps Word and PDF visually identical even where native math support differs between formats. If your formulas must also work with screen readers, see our article on PDF/UA-2 and accessible math.
The quiet fourth: seventeen diagram languages
Strictly speaking, diagrams ride along for free: a code block whose language is one of the 17 supported diagram languages — from mermaid, plantuml, and graphviz via structurizr, dbml, and vega to tikz and wireviz — is rendered as an image by default (renderAsImage: true). Set it to false and the same block appears as a numbered source listing instead. The architecture sketch and its source stay in one place, and readers always see both consistently.
Which element for which content?
| Content | Element | Key properties | Watch out |
|---|---|---|---|
| KPI curves, comparisons, distributions | chart | 8 Chart.js types, {{variables}}, defaults.chart.colors | Static at export — no interactivity in the PDF |
| Bridge from paper to web | qrcode (url) | size 50–1000, errorCorrection L–H | Test the scan at final print size |
| On-site network or contact | qrcode (wifi/vcard) | typed payload per case | Passwords in wifi codes travel in plain text |
| Formula, model, derivation | math | LaTeX block, up to 5,000 chars, renderAsImage | No inline math in paragraphs |
| Flowchart, ER model, wiring plan | code + diagram language | 17 languages, renderAsImage | false turns the figure into a listing |
Numbering without manual bookkeeping
Every visual element accepts caption and anchor. Captioned elements are auto-numbered — "Figure 1", "Listing 1" — and flow into the List of Figures and the List of Code Listings in the export. The anchor makes the element referenceable from the running text. Anyone who has renumbered figures by hand after inserting a new chart in chapter two knows why this belongs in the generator, not in the author.
One source, documents that regenerate
Put the pieces together and a monthly report becomes a template: variables at the top ({{month}}, {{revenue}}, {{reportUrl}}), a chart whose dataset reads them, a QR code whose url is that same variable, the commentary as plain text. Combined with bulk generation — one template, up to 100 personalized documents per job from CSV or Excel — the report for each region writes itself (how bulk PDF from CSV works). The typesetting side of this approach, compared with Typst and LaTeX, is covered in our stack comparison for 2026.
Checklist before you publish
- Charts: variables bound, palette set via
defaults.chart.colors? - QR:
sizeanderrorCorrectionmatched to print or screen, scan tested at final size? - Math: formulas as blocks,
renderAsImagefor uniform exports? - Diagrams:
renderAsImageset deliberately, captions and anchors for cross-references? - Sources: figures and listings named, so the export directories stay useful?
A document that describes its visuals as data is never "almost finished" — it is generated. And that difference pays off with every data update.
Sources (retrieved October 9, 2026):
- Autype documentation, media elements (chart, qrcode, math, code/diagrams): https://docs.autype.com/api-reference/json-syntax/sections/media.md
- Pandoc release notes, version 3.12.1, October 8, 2026: https://github.com/jgm/pandoc/releases
- Chart.js documentation: https://www.chartjs.org/docs/latest/
Latest Articles
MCP or REST API for Document Generation: Which Integration Fits Your AI Stack?
MCP or REST API for document generation? Not an either-or: the two interfaces solve different problems. Three integration patterns, a comparison of security and operating models, and which combination fits which use case.
Read articleBulk PDF from CSV or Excel: One Template, Up to 100 Personalized Documents per Job
One template plus a CSV or Excel file becomes up to 100 personalized PDFs per job. A practical guide to data preparation, mail-merge alternatives, records, and API automation for recurring document volumes.
Read articleTypst vs. LaTeX vs. Extended Markdown: Choosing a Typesetting Stack in 2026
Typst 0.15, LaTeX 2026-06-01, or Extended Markdown: a practical comparison of the three typesetting stacks — output formats, math, Word compatibility, automation, and a decision table.
Read articleReady to automate your documents?
Start creating business documents with Autype. No credit card required.