Search...Search plugins and themes...
⌘K
Sign in
  • Get started
  • Download
  • Pricing
  • Enterprise
  • Account
  • Obsidian
  • Overview
  • Sync
  • Publish
  • Canvas
  • Mobile
  • Web Clipper
  • CLI
  • Learn
  • Help
  • Developers
  • Changelog
  • About
  • Roadmap
  • Blog
  • Resources
  • System status
  • License overview
  • Terms of service
  • Privacy policy
  • Security
  • Community
  • Plugins
  • Themes
  • Discord
  • Forum / 中文论坛
  • Merch store
  • Brand guidelines
Follow us
DiscordTwitterBlueskyThreadsMastodonYouTubeGitHub
© 2026 Obsidian

Typst Renderer

fenjalienfenjalien13k downloads

Render `typst` code blocks and math blocks to images with Typst.

Add to Obsidian
  • Overview
  • Scorecard
  • Updates15

Renders typst code blocks, and optionally math blocks, into images using Typst through the power of WASM! This is still very much in development, so suggestions and bugs are welcome!

Small Things to NOTE

  • Typst does not currently support exporting to HTML only PDFs, PNGs and SVGs. So due to image scaling, the rendered views may look a bit terrible. If you know how to fix this PLEASE HELP.
  • File paths should be relative to the vault folder.
  • To help with loading times the web assembly file must be downloaded separately. This will automatically happen the first time the plugin is enabled and after an update!

Versions

Plugin Typst
0.10 0.11.0
0.9 0.10.0
0.8 0.9.0
0.7 0.8.0
0.6 522708b (Some commits after 0.7.0 to include SVG export)
0.5 0.6.0
0.4 0.3.0
0.3 0.2.0

Using Packages

On desktop the plugin supports reading packages from the @preview and @local namespaces. If a package cannot be found in either folder and the "Download Missing Packages" setting is on, the package will be downloaded and saved within the current vault in the pulgin's folder.

On mobile only the @preview namespace is supported and will always download missing packages to the vault.

You can view the downloaded packages in the settings and choose which ones to delete.

Math Block Usage

The plugin can render typst inside math blocks! By default this is off, to enable it set the "Override Math Blocks" setting or use the "Toggle math block override" command. Math block types are conserved between Obsidian and Typst, $...$ -> $...$ and $$...$$ -> $ ... $.

From what I've experimented with, normal math blocks are okay with Typst but Typst is not happy with any Latex code.

For styling and using imports with math blocks see the next section.

Preambles

Need to style your typst code the same way everytime and don't to write it out each time? Or using math blocks and need a way to import things? Use PREAMBLES!

Preambles are prepended to your typst code before compiling. There are three different types on the "Typst Renderer" plugin settings page:

  • shared: Prepended to all typst code.
  • math: Prepended to typst code only in math blocks.
  • code: Prepended to typst code only in code blocks.

The following variables are defined for you in all preambles to help style the output correctly:

  • WIDTH: The horizontal size of the space the output will be placed in. Can be a length or auto if the space is not limited in that direction.
  • HEIGHT: The vertical size of the space the output will be placed in. Can be a length or auto if the space is not limited in that direction.
  • SIZE: The font size as defined by the CSS property "--font-text-size"
  • THEME: A string defining the current theme of Obsidian. Either "light" or "dark".

The following are the default preambles, I highly recommend you check this on each update to make sure you don't miss any changes that could break things. That being said you don't need them they are merely recommended.

Shared
#set text(fill: white, size: SIZE)
#set page(width: WIDTH, height: HEIGHT)
Math
#set page(margin: 0pt)
#set align(horizon)
Code
#set page(margin: (y: 1em, x: 0pt))

Known Issues

Runtime Error Unreachable or Recursive Use Of Object

These occur when the Typst compiler panics for any reason and means the compiler cannot be used again until it is restarted. There should be more information in the console log so please create an issue with this error!

Example

```typst
= Fibonacci sequence
The Fibonacci sequence is defined through the
_recurrence relation_ $F_n = F_(n-1) + F_(n-2)$.
It can also be expressed in closed form:

$ F_n = floor(1 / sqrt(5) phi.alt^n), quad
  phi.alt = (1 + sqrt(5)) / 2 $

#let count = 10
#let nums = range(1, count + 1)
#let fib(n) = (
  if n <= 2 { 1 }
  else { fib(n - 1) + fib(n - 2) }
)

The first #count numbers of the sequence are:

#align(center, table(
  columns: count,
  ..nums.map(n => $F_#n$),
  ..nums.map(n => str(fib(n))),
))

```​

Installation

Install "Typst Renderer" from the community plugins tab in settings

or

Install it by copying main.js, styles.css, obsidian_typst_bg.wasm and manifest.json from the releases tab to the folder .obsidian/plugins/typst in your vault.

TODO / Goals (In no particular order)

  • Better font loading
  • Fix importing
  • Fix Github Actions
  • Better error handling
  • ? Fix output image scaling
  • Use HTML output
  • Override default equation rendering
  • Custom editor for .typ files
  • Mobile file reading
  • Automate package downloading
  • Use sys.stdin for preambles instead of modifying the source cod
  • Overhall plugin structure (mostly communication with the webworker)
HealthFair
ReviewRisks
About
Render Typst code blocks and optional math blocks as PNG, SVG, or PDF images using Typst compiled to WASM, keeping paths relative to your vault. Manage packages from @preview and @local with automatic downloads, and prepend reusable preambles for consistent styling and imports.
ImagesMathExport
Details
Current version
0.10.0
Last updated
2 years ago
Created
3 years ago
Updates
15 releases
Downloads
13k
Compatible with
Obsidian 1.0.0+
Platforms
Desktop, Mobile
License
Apache-2.0
Report bugRequest featureReport plugin
Sponsor
GitHub Sponsors
Ko-fi
Author
fenjalienfenjalien
github.com/fenjalien
GitHubfenjalien
  1. Community
  2. Plugins
  3. Images
  4. Typst Renderer

Related plugins

Wechat Converter

将 Markdown 转换为微信公众号排版,并支持一键发送到微信公众号(支持自定义 CSS和公众号贴图)、飞书、小红书、知乎、微博、CSDN等20+平台。

Export Image plugin

Easily convert your article to image.

Export to HTML

Export your Markdown notes as HTML, directly in the clipboard or as a file.

Numerals

Turn any code block into an advanced calculator. Evaluate math expressions on each line of a code block, including units, currency, and optional TeX rendering.

Ink

Handwriting and drawing directly between paragraphs using a digital pen, stylus, or Apple pencil.

Featured Image

Automatically set a featured image property in your notes based on the first image.

PlantUML

Generate PlantUML diagrams.

TTRPG Tools - Maps

A toolbox for interactive fantasy maps.

Pandoc Plugin

Commands to export to Pandoc-supported formats like DOCX, ePub and PDF.

Pixel Perfect Image

Pixel perfect 100% image resizing, copy to clipboard, show image in Finder/Explorer, and much more.