Autype
Back to blog

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.

Document AutomationTutorials#Autype#Charts#Chart.js#QR codes#QR-Codes#LaTeX#Markdown#Diagramme#document automation#Dokumentenautomatisierung

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:

  1. 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.
  2. 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.
  3. 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?

ContentElementKey propertiesWatch out
KPI curves, comparisons, distributionschart8 Chart.js types, {{variables}}, defaults.chart.colorsStatic at export — no interactivity in the PDF
Bridge from paper to webqrcode (url)size 50–1000, errorCorrection L–HTest the scan at final print size
On-site network or contactqrcode (wifi/vcard)typed payload per casePasswords in wifi codes travel in plain text
Formula, model, derivationmathLaTeX block, up to 5,000 chars, renderAsImageNo inline math in paragraphs
Flowchart, ER model, wiring plancode + diagram language17 languages, renderAsImagefalse 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: size and errorCorrection matched to print or screen, scan tested at final size?
  • Math: formulas as blocks, renderAsImage for uniform exports?
  • Diagrams: renderAsImage set 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):

Ready to automate your documents?

Start creating business documents with Autype. No credit card required.