I make a lot of commutative diagrams and am trying to switch to Tikz from amcd,diagrams, etc. I often have to refer to these diagrams in the text and would rather have them as equations (i.e. with and equation number) rather than a figure. I have tried just putting it in an equation environment but it neither centers the diagram (as ma)
Tell me more
×
TeX - LaTeX Stack Exchange is a question and answer site for
users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.
|
\begin{equation}
\begin{tikzpicture}[baseline=(current bounding box.center)]
......
\end{tikzpicture}
\end{equation}
Copied from Mtikz.pdf. |
|||||||||||||
|
|
just place the TikZ picture into a box, for example using \text{} (which is an AMS command). In case you do not use AMS, you can also use \hbox (which is a plain TeX command) instead. Example which compiles without extra packages:
\begin{equation}
\hbox{\tikz\draw[draw=black,fill=red] (0,0) circle (5pt);}
\label{eq:test}
\end{equation}
\noindent
In (\ref{eq:test}), we see a TikZ picture.\dotfill
Christian |
|||||||||||
|
