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.

An \includegraphics of a PNG or JPEG file is drawn as that image, at the size TEX gave it. The file goes into the page as it is, neither recompressed nor resized, so a large photograph makes a large page: scale it down before including it.

An EPS figure, named as figure.eps or as figure, is converted to PDF and drawn as that PDF. LA TEX converts such a figure by running a program from TEX (epstopdf), which needs shell escape. The build runs TEX with shell escape off, so that a document cannot run programs, and does not turn it on for this. Instead it converts every .eps and .ps file in the document’s directories itself, before TEX runs, with the same converter (TEX Live’s repstopdf, which needs Ghostscript), and puts each PDF where LA TEX looks for it. The figure comes out the size it has in a LA TEX run of your own. A figure that does not convert is reported by name, with the reason, and a document that includes it stops, as for a missing file.

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}