Agostino Cesarano19 downloadsRender LaTeX and TikZ diagrams locally using your system TeX installation with support for any package.
Render any LaTeX and TikZ diagram directly inside your Obsidian notes using your local LaTeX installation (latex, dvisvgm).
Unlike WebAssembly-based solutions with limited package support, this plugin invokes your system's native TeX distribution. This means you can use any package installed on your computer — including pgfplots, circuitikz, chemfig, tikz-cd, forest, quantikz, and more!
\begin{tikzpicture} ... \end{tikzpicture}. The plugin automatically wraps it with a customizable standalone preamble.\documentclass, packages, and macros.MiKTeX, TeX Live, MacTeX).dvisvgm setup.Because this plugin executes your local compiler, you must have the following tools installed and accessible in your system's PATH:
dvisvgm (included by default in MiKTeX, TeX Live, and MacTeX).Tip: You can check if they are available in your terminal by running:
latex --version dvisvgm --version
latex-tikz-renderer).agostino-code/obsidian-tikz.main.js, manifest.json, and styles.css from the latest Release..obsidian/plugins/ and create a folder named latex-tikz-renderer..obsidian/plugins/latex-tikz-renderer/.In Obsidian Settings → LaTeX and TikZ Renderer:
| Setting | Default | Description |
|---|---|---|
| LaTeX Compiler Path | latex |
Executable name or absolute path to your compiler (e.g., latex, pdflatex, xelatex, or C:\...\latex.exe). |
| dvisvgm Path | dvisvgm |
Executable name or absolute path to dvisvgm. |
| Test Toolchain | Button | Tests and displays version info for both the compiler and dvisvgm. |
| Auto-wrap Snippets | true |
When enabled, code without \documentclass is automatically wrapped with the Default Preamble. |
| Default Preamble | \documentclass[tikz, border=2pt]{standalone}... |
Preamble prepended to snippets. Add custom \usepackage{...} or macros here. |
| Compilation Timeout | 25 |
Maximum seconds to wait before aborting a compile job. |
| Invert dark colors in dark mode | true |
Automatically recolors black/white diagram lines to match light/dark themes. |
| Clear cached SVGs | Button | Empties the IndexedDB SVG cache to force re-rendering all diagrams. |
Create a code block with language identifier tikz or latex.
No document boilerplate needed!
```tikz
\begin{tikzpicture}[domain=0:4]
\draw[very thin,color=gray] (-0.1,-1.1) grid (3.9,3.9);
\draw[->] (-0.2,0) -- (4.2,0) node[right] {$x$};
\draw[->] (0,-1.2) -- (0,4.2) node[above] {$f(x)$};
\draw[color=red] plot (\x,\x) node[right] {$f(x) =x$};
\draw[color=blue] plot (\x,{sin(\x r)}) node[right] {$f(x) = \sin x$};
\draw[color=orange] plot (\x,{0.05*exp(\x)}) node[right] {$f(x) = \frac{1}{20} \mathrm e^x$};
\end{tikzpicture}
```
circuitikz)```tikz
\usepackage{circuitikz}
\begin{document}
\begin{circuitikz}[american, voltage shift=0.5]
\draw (0,0)
to[isource, l=$I_0$, v=$V_0$] (0,3)
to[short, -*, i=$I_0$] (2,3)
to[R=$R_1$, i>_=$i_1$] (2,0) -- (0,0);
\draw (2,3) -- (4,3)
to[R=$R_2$, i>_=$i_2$] (4,0)
to[short, -*] (2,0);
\end{circuitikz}
\end{document}
```
pgfplots)```tikz
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\begin{document}
\begin{tikzpicture}
\begin{axis}[colormap/viridis]
\addplot3[surf, samples=18, domain=-3:3] {exp(-x^2-y^2)*x};
\end{axis}
\end{tikzpicture}
\end{document}
```
tikz-cd)```tikz
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}
T \arrow[drr, bend left, "x"] \arrow[ddr, bend right, "y"] \arrow[dr, dotted, "{(x,y)}" description] & & \\
K & X \times_Z Y \arrow[r, "p"] \arrow[d, "q"] & X \arrow[d, "f"] \\
& Y \arrow[r, "g"] & Z
\end{tikzcd}
\end{document}
```
chemfig)```tikz
\usepackage{chemfig}
\begin{document}
\chemfig{[:-90]HN(-[::-45](-[::-45]R)=[::+45]O)>[::+45]*4(-(=O)-N*5(-(<:(=[::-60]O)-[::+60]OH)-(<[::+0])(<:[::-108])-S>)--)}
\end{document}
```
If you encounter a MiKTeX session initialization error on Windows, register the MiKTeX DLLs manually in an Administrator Command Prompt (adjust version if different):
cd %LOCALAPPDATA%\Programs\MiKTeX\miktex\bin\x64
regsvr32 MiKTeX240400-core-PS.dll
regsvr32 MiKTeX240400-core.dll
regsvr32 MiKTeX240400-packagemanager.dll
regsvr32 MiKTeX240400-packagemanager-PS.dll
If the "Test Toolchain" button reports that latex or dvisvgm cannot be found:
C:\Program Files\MiKTeX\miktex\bin\x64\latex.exe or /Library/TeX/texbin/latex).PATH.This plugin is configured as desktop-only ("isDesktopOnly": true) because it relies on your local TeX distribution:
child_process.execFile): The plugin executes your locally installed LaTeX compiler and dvisvgm. Commands are invoked strictly via execFile with segregated argument arrays (no shell interpolation), protecting against shell injection.fs/promises): Temporary .tex, .dvi/.xdv/.pdf, and .svg files are created exclusively inside an isolated temporary directory within your system's tmpdir() (e.g. tmpdir()/tikz-XXXXXX). This directory is deleted in a finally block immediately after conversion.