This page contains no pre-rendered images. Every figure below is typeset on load by MetaPost, pdfTeX, LuaTeX (for graph drawing) and dvisvgm running in this tab, from a <script> or custom tag in the HTML source.
A <script type="text/tikz"> holding just a tikzpicture. It is wrapped in a standalone document automatically; libraries come from data-libraries.
If the body contains \documentclass, it is compiled as is — any class, any package in the bundles, pgfplots included.
<tikz-diagram> and <metapost-diagram> work the same way and render when they enter the page (a MutationObserver catches later additions). Inside a custom element the content is HTML, so write < for <. A data-gdlibraries attribute (or any use of graphdrawing or \directlua) switches that diagram to LuaTeX.
<script type="text/metapost">: a body without beginfig becomes one figure; data-tex chooses the label engine.
A broken diagram shows its diagnostics instead of failing silently.
<script type="module" src="https://your-host/mp-tikz-wasm/dist/auto.js"></script>
<script type="text/tikz" data-libraries="arrows.meta">
\begin{tikzpicture} \draw[->] (0,0) -- (2,1); \end{tikzpicture}
</script>
<metapost-diagram>draw fullcircle scaled 50;</metapost-diagram>
Host the dist/ folder (the three .wasm files, the JS, and bundles/) anywhere static; the script finds them relative to itself. Rendered SVGs are cached in IndexedDB by content hash, so a revisit shows the figures without running TeX.