Trying to generate a tikz
diagram using tikzcd
package in a standalone document so that no excess white space and page header/footer is added around the diagram.
\documentclass[tikz, margin=1mm]{standalone}
\usepackage{tikz-cd}
\usetikzlibrary{arrows,arrows.meta}
\begin{document}
\tikzcdset{arrow style=tikz, diagrams={>=stealth}}
\begin{tikzpicture}
\begin{tikzcd}[column sep=normal]
& A \arrow[dl] & \\
B \arrow[rr] \arrow[ur, "a", dashed, xshift=-2ex, yshift=0.5ex] & & C
\end{tikzcd}
\qquad
\begin{tikzcd}[column sep=normal]
& A \arrow[dr] & \\
B \arrow[rr] & & C \arrow[ul, "b", swap, dashed, xshift=2ex, yshift=0.5ex]
\end{tikzcd}
\end{tikzpicture}
\end{document}
However, only part of the diagram is generated. Changing the document class to 'article' generates the full diagram. Is tikzcd
not compatible with the 'standalone' class? If so, how can I create a diagram using tikzcd
without excess white space and page header/footer etc?