TikZ in WordPress
No plugin or LaTeX server needed: the figure is compiled in your browser and becomes an HTML block to paste into WordPress. The SVG contains its fonts, fits the screen, and the TikZ code stays hidden in the block so you can fix a typo later.
Preamble (optional)
Your commands and TikZ libraries. Already loaded: tikz, amsmath, amssymb; pgfplots, tkz-tab and tikz-cd are added automatically when used, as are Otoolia's shortcuts (\R, \conj{A}, \proba…).
Preview
The preview will appear here.
Fix a figure you already published
Paste the whole content of the “Custom HTML” block here (the TikZ code is kept as a comment at the start of the block):
Using the figure in WordPress
- Paste the HTML block (recommended): add a “Custom HTML” block and paste the copied block. No image to upload, no plugin. The TikZ code is kept in the block as a comment, invisible to visitors: to fix a typo, paste the block back into “Fix a figure you already published”. You need an administrator account (WordPress strips SVG code pasted by other roles).
- Upload the .svg file: WordPress refuses SVG by default; install the “Safe SVG” plugin, then insert the file with an “Image” block.
The figure adapts to the screen width, stays crisp at any zoom, and several figures can share a page. It also works on any website or in an HTML file.
Frequently asked questions
Is my code sent to a server?
No. The TeX engine (TikZJax, TeX compiled to WebAssembly) runs in your browser. It weighs about 7 MB, downloaded once on the first generation; your browser keeps it afterwards.
Which packages can I use?
TikZ and all its libraries (\usetikzlibrary{…} in the preamble), pgfplots, tkz-tab, tikz-cd, tikz-3dplot, amsmath, amssymb, array.
For other packages (circuitikz, chemfig, tkz-euclide, venndiagram…), the Compile with the full engine button uses the TeX Live 2026 of Otoolia's LaTeX editor, still in your browser: you get a vector PDF and PNG images (no SVG).
Why is the SVG 40 to 80 KB?
The LaTeX fonts used by the figure are embedded in the file, so it displays identically everywhere without loading anything else. Once compressed by the web server, it is about half that size.
The figure does not compile: what now?
The tool points out the most common mistakes (unclosed braces or parentheses, missing semicolon, environment not closed). Custom commands must be defined in the preamble. To build a complex figure, Otoolia's LaTeX assistant generates trees, variation tables and plots without errors.
Engine: TikZJax (David Grice, after Jim Fowler), GPL-3.0 licence; tkz-tab package by Alain Matthes.
How to do it
- Paste the TikZ code and write a description for screen readers.
- Choose the size: × 1.3 to match MathJax formulas.
- Copy the HTML block and paste it into a WordPress “Custom HTML” block.
- To fix it, paste the block back into “Fix an already published figure”.
Tips
- You need an administrator account: WordPress strips SVG pasted by other roles.
- Several figures in one post do not clash: their IDs are unique.
- Several figures at once: paste them together, the .zip contains all the HTML blocks.
Frequently asked questions
Do I need the QuickLaTeX plugin?
No: QuickLaTeX sends the code to its server; here the figure is a standalone SVG that depends on no service.
Does the figure work with a dark theme?
The SVG is black on a transparent background: give the block a white background if your theme is dark.
Is my code sent to a server?
No: the TeX engine (TikZJax, in WebAssembly) runs in your browser; it is downloaded once (about 7 MB) and then kept.