Cloudscript Typst Renderer

Cloudscript Typst Renderer renders Typst source, and the mathematics Typst is known for, as crisp typeset output directly on a Confluence page. It is a Confluence Cloud app built on Atlassian Forge, and every document is compiled and drawn in your browser when the page is viewed.

Because the page holds the live document (not a screenshot or an exported PDF), the rendered output stays in step with its source: edit the source in the macro and the page re-renders, so nothing goes stale when the underlying document changes. Typst is the modern typesetting language occupying the ground LaTeX established, with comparable publication-quality output and much less ceremony, and mathematics is its headline strength and the most common reason to reach for it. If your team already authors maths, research notes, specifications or technical documentation in Typst, or maintains a LaTeX-screenshot workflow it would like to retire, this macro puts that work on the Confluence pages where the rest of your documentation already lives.

View on Marketplace

The bundled maths sample rendered on the page: the Cauchy-Schwarz inequality, a Gaussian integral, a matrix, and Maxwell's equations, followed by prose and a syntax-highlighted code block.
The bundled maths sample rendered live on the page: mathematics, prose and code, set in Typst's own fonts.

Adding a document

Edit a Confluence page and insert the Typst macro, either by typing /typst in the editor or by choosing it from the macro browser (where it also answers to searches for "latex", "math", "equation", and "typesetting"). Open the macro's configuration panel, paste your Typst source into the editor, then save the macro and publish the page; the document is compiled and rendered when the page is viewed. To place several documents on one page, add a separate macro for each, since every macro holds and renders its own source independently.

The configuration editor

The configuration panel is a single monospace editor titled Typst source, into which you paste the source you have authored. It is a paste-and-publish surface: the macro's job is to publish a document you write in your own Typst tooling, so there is no in-panel preview, syntax highlighting or autocomplete, and you see the rendered result once you save. A size meter shows how close the source is to the input limit as you work, and, starting from an empty editor, you can load a maths-heavy sample document so that a first render succeeds in seconds and gives you a working example to adapt.

The Typst source configuration editor with sample source pasted in, a size meter reading 866 bytes of 64 KiB, and Cancel and Save buttons.
The configuration editor: paste your Typst source and save. The meter shows how close you are to the 64 KiB limit.

What renders

The macro compiles full Typst documents, so headings, prose, lists, tables, and code blocks all render as they would in Typst itself, and mathematical notation renders with the fonts and layout that make Typst worth using for maths in the first place. Multi-page documents are supported and are shown as pages stacked vertically down the macro. The text in the rendered output remains selectable, so a reader can highlight it and use the browser's in-page find, and the output scales cleanly because it is drawn as vector graphics rather than as a raster image. (The rendered SVG is selectable; Confluence's own page search, however, does not index the Typst source stored in the macro's configuration, so searching a Confluence space will not find a Typst document by its content.)

A multi-section document titled Project Aurora rendered on the page, with a heading, prose, a latency-budget table, and a numbered rollout-plan list.
A full document rendered on the page: headings, prose, a table and stacked pages, from a single macro.

The maths sample

An empty Typst macro offers a maths-heavy sample document you can load with one action, so a blank editor is never your starting point. It is the fastest way to see the renderer's headline strength (mathematical notation set in New Computer Modern Math) and gives you a working document to copy from and adapt into your own source.

Page size and layout

Typst documents normally begin with a #set page(...) rule that fixes the page geometry, and when your source includes one it is respected exactly. When your source contains no page rule, the macro applies a sensible default in its place (#set page(width: 16cm, height: auto, margin: 1.2em)), which gives prose a readable measure inside a Confluence column and grows the page to fit its content rather than leaving a fixed-height frame. This default is only a fallback: your own #set page always takes precedence, so to control the width, height, or margins of the rendered output you simply include the page rule you want. Compile-error locations are reported against the source you actually pasted, so line numbers remain meaningful even though the default rule is applied behind the scenes.

Fonts

The app ships Typst's default font families and renders with them: Libertinus Serif for text, New Computer Modern Math for mathematics, and DejaVu Sans Mono for monospaced content. A document that relies on these families (which covers the great majority of Typst documents, and all of its default output) renders exactly as it does locally. Supplying your own fonts is not part of the current version, so a document that calls for a font outside the bundled set will not have that font available to it.

Errors and limits

Each edge case renders a specific, readable message in place of a blank frame:

  • Empty. A macro with no source saved invites you to add some (or load the maths sample).
  • Compile error. Invalid Typst source shows the compiler's own message together with a humanised, 1-based line and column pointing at the source you actually pasted, so you can fix a paste without leaving the page.
  • Unsupported feature. A check runs before the compiler starts: source that uses a @preview/ package import, an image() call, or #include is caught early and shown a message naming the specific feature and explaining that it is outside the current version, rather than a confusing compiler error about a missing file or package.
  • Timeout. A compile that runs longer than 10 seconds is stopped and reported as a timeout; the underlying worker is torn down and rebuilt for your next attempt.
  • Over the size cap. Source over 64 KiB is stopped before it reaches the compiler at all, with a message explaining the limit. The cap is enforced in both the configuration editor and the live page, so a document that was valid when saved cannot later blow the limit and break the page.
  • Internal error. Anything else that goes wrong falls back to a generic, readable error card rather than a blank macro.

These messages carry the rendering engine's version in a small footer; quote it if you contact support. For anything the in-macro message does not resolve, see the Support page.

A compile-error card reading 'Typst could not compile this document', an error at line 5 (unknown variable: openIssues), and the engine version typst.ts 0.7.0.
When source is invalid, a readable card shows the compiler's message with a humanised line and column, plus the engine version.

What the app does not do

The current version renders self-contained documents on the live page. The limits below follow from that boundary and from the security model described in the next section, and each one produces a clear explanation in the macro instead of a silent failure.

Page exports (PDF and Word) carry the Typst source rather than the rendered output. Confluence's export pipeline cannot run the in-browser compiler, so a page exported to PDF or Word reproduces the macro's Typst source in a captioned code block ("Typst source — rendered on the live page") in place of the typeset result. If a macro has no source configured, the export says so plainly instead of showing an empty code block. The rendered document lives on the page; an export carries its source.

Documents are self-contained. Typst package imports (@preview/…) and file access (image() and #include) are outside the current version, because each would need the network or file access that the store-nothing, zero-egress design avoids; a document that uses one of them shows an in-macro explanation naming the feature. In practice, the macro renders documents whose content is entirely in the source you paste.

The app is a publisher for documents you author elsewhere. It has no live preview or syntax-highlighting IDE, and no button to download the render as a PDF or PNG image: Confluence pages are the surface the app is built for, and Typst authors write in their own tooling. Source is capped at 64 KiB and compilation at 10 seconds, with a clear message at each limit, which keeps a pathological paste from affecting the host page.

Security and privacy

The Typst compiler runs as WebAssembly inside the macro's own sandboxed frame, so your documents are compiled in your browser and are never sent to Cloudscript.io or to any third party. The app requests no Confluence permissions, declares no external network destinations (the compiler and fonts ship inside the app and load from Atlassian's own infrastructure, so a render makes no request to any non-Atlassian origin), and stores nothing outside the macro on your page.

One narrow exception applies. When a page is exported to PDF or Word, a stateless, server-side Forge function reads the pasted source from the export payload for the sole purpose of writing it into the exported document (see "Page exports" above); it stores nothing, and logs nothing beyond the shape of the payload if the source cannot be found.

For a reviewing administrator, one technical note: the macro's iframe declares the unsafe-eval content-security directive, because instantiating the WebAssembly compiler requires it and Forge offers no narrower WASM-only directive. The directive applies only inside the macro's own sandboxed iframe, and it does not permit loading remote code, making network calls, or reaching the host page. The full detail is in the app's Privacy Policy, and our broader posture is described in the Security Policy and Trust Center.

About Typst

Cloudscript Typst Renderer is an independent integration and is not affiliated with, or endorsed by, Typst. Learn more about the language at typst.app. The app bundles the typst.ts / reflexo-typst WebAssembly toolchain and Typst's default fonts under their respective open-source licences.

Legal

Terms and privacy specific to this app: