I'm trying to put a TikZ picture inside an equation, and then turn that into a standalone image using the "standalone" class. Representative but meaningless MWE below:
% This compiles but gives me an entire page
%\documentclass{article}
%\usepackage{tikz}
% This is what I want to do.
\documentclass[tikz]{standalone}
\begin{document}
\begin{equation}
\begin{tikzpicture}[baseline=(current bounding box.center)]
\draw (1,0) -- (0,0) -- (0,1);
\end{tikzpicture}
\enspace = \enspace \exp(5)
\end{equation}
\end{document}
However, this gives me a lot of errors related to missing $s or \endgroups in maths mode, e.g. Missing $ inserted. \end{tikzpicture}.
Can anyone help me fix these errors? This compiles perfectly fine in an article (I'm trying to extract a standalone image from an existing document I've written). Worst case I'll just screenshot my document but I'd like the vector graphics!


equationin standalone. Usetikzpicturedirectly. Do you really need the equation number? – Sigur Jan 23 '23 at 16:51\lefthalfcupfrom the MnSymbol package which produces such a symbol – samcarter_is_at_topanswers.xyz Jan 23 '23 at 17:16