Contents

Pictures

Typesetting

Pictures

TikZ pictures, tikz-cd diagrams and included PDFs are captured once TEX has finished them, and drawn as inline SVG with TEX’s metrics. They can go anywhere a box can, even inside an alignment, and their colours follow the theme like the text. A nicematrix environment is drawn with PGF as well – its rules, blocks and dotted lines – so the whole environment is captured as one picture, after a second TEX run has given its cells’ positions.

A TikZ picture

A finished TikZ box is saved to a tightly cropped PDF page, converted to inline SVG, and placed back in the text with TEX’s metrics. It can go anywhere a box can; here it is an automaton inside align*:

The same capture works for front ends such as tikz-cd, with no need for PGF externalisation:

\section*{A TikZ picture}
A finished TikZ box is saved to a tightly cropped PDF page, converted to
inline SVG, and placed back in the text with \TeX's metrics. It can go anywhere
a box can; here it is an automaton inside \texttt{align*}:
\begin{align*}
\begin{tikzpicture}[>=Stealth, baseline=(q0.base), thick]
  \node[draw, circle] (q0) at (0,0) {$q_0$};
  \node[draw, circle] (q1) at (2.4,0) {$q_1$};
  \node[draw, circle, double] (q2) at (4.8,0) {$q_2$};
  \draw[->, blue] (q0) -- node[above] {$a$} (q1);
  \draw[->, blue] (q1) -- node[above] {$b$} (q2);
  \draw[->, red]  (q1) to[bend left=40] node[below] {$a$} (q0);
\end{tikzpicture}
\end{align*}

The same capture works for front ends such as \texttt{tikz-cd}, with no need
for PGF externalisation:
\begin{center}
\begin{tikzcd}[math mode=false]
  $A^*$ \arrow[r, bend left, "$f$"] \arrow[r, bend right, "$g$"']
    & $B^*$ \arrow[r, hookrightarrow, "$\iota$"] & $\mathbb{R}$
\end{tikzcd}
\end{center}