Skip to main content
Media elements embed visual and technical content into your document: images, charts, QR codes, code blocks, and LaTeX math equations.

Image

Embeds an image from a URL or uploaded image path.

Properties

Images with a caption are automatically numbered (e.g., “Figure 1: Company headquarters”). The numbering prefix and style are controlled by defaults.styles.figureCaption. See Defaults — Figure caption style.

Cross-referencing images

Images with a caption and anchor can be referenced in text using internal references:
The three reference styles: [](#anchor) (auto — shows caption with number), [Figure {num}](#anchor) (template — replaces {num}), and [custom text](#anchor) (custom — shows your text as a link).

Chart

Renders a Chart.js chart as an image. Supports line, bar, pie, doughnut, radar, polar area, scatter, and bubble charts.

Chart element properties

Chart config

The config object follows the Chart.js configuration format:

Chart dataset

Variable substitution in charts

Chart data.labels and data.datasets[].data arrays support {{varName}} placeholders. At render time, variable references are resolved:
  • Number variables are substituted as numeric values directly (e.g., {{revenue}}1250.00)
  • Text variables containing a numeric string are parsed to numbers (e.g., "1500"1500)
  • For {x, y} point objects, both x and y fields support variable substitution
Default chart colors are configured via defaults.chart.colors and defaults.chart.borderColors. See Defaults — Chart defaults.

QR Code

Generates a QR code image. Supports URL, WiFi, and vCard data types.

URL QR code

WiFi QR code

vCard QR code

QR code base properties

URL data (qrType: "url")WiFi data (qrType: "wifi")vCard data (qrType: "vcard")

Code block

Renders a syntax-highlighted code block.

Properties

Captions and anchors

Code blocks support caption and anchor for auto-numbering and cross-references:
Code blocks with a caption are automatically numbered (e.g., “Listing 1: Configuration interface”) and appear in the List of Code Listings. The numbering prefix and style are controlled by defaults.styles.codeCaption. See Defaults — Code caption style. Default code block styling is configured via defaults.styles.code. See Defaults — Code style.

Diagrams

Code blocks with a supported diagram language are automatically rendered as images in the exported document.

Mermaid example

When the language is a supported diagram type, the code content is rendered as a PNG image. Diagrams with a caption are auto-numbered as figures (e.g., “Figure 1: System flowchart”) and appear in the List of Figures.

Supported diagram languages

Rendering diagram source as code (renderAsImage=false)

Set renderAsImage to false to display the diagram source code as a regular code block instead of rendering it as an image:
When renderAsImage is false on a diagram code block, the block is treated as a regular code listing. If it has a caption, it appears in the List of Code Listings instead of the List of Figures.
The global default for renderAsImage can be set via defaults.styles.code.renderAsImage (default: true). The element-level property always overrides the global default.

Math (LaTeX)

Renders a block-level LaTeX math equation as a standalone element.
Math is only supported as a block-level element. Inline math within paragraphs is not currently supported.
Block-level equation:

Properties

Default math styling is configured via defaults.styles.math. See Defaults — Math style.

Complete example