This solution does not allow you to externalise diagrams produced using the tikzcd
environment but it does allow you to externalise other tikz
pictures in your document. It is based on a workaround mentioned in the tikz
manual in section 50.8.2 (pages 627-8). To make its use more convenient, etoolbox
is used to patch the tikzcd
environment. Essentially, this turns externalisation off at the beginning of tikzcd
environments and then switches it back on again at their ends.
\documentclass{article}
\usepackage{etoolbox,tikz}
\usetikzlibrary{external}
\tikzexternalize
\usetikzlibrary{cd}
\AtBeginEnvironment{tikzcd}{\tikzexternaldisable}
\AtEndEnvironment{tikzcd}{\tikzexternalenable}
\begin{document}
\begin{tikzpicture}
\node at (0,0) {node};
\end{tikzpicture}
\begin{tikzcd}
A \arrow[rd] \arrow[r, "\varphi"] & B \\ & C
\end{tikzcd}
\end{document}
On the first run, pdflatex --shell-escape <filename>.tex
includes this output:
===== 'mode=convert with system call': Invoking 'pdflatex -shell-escape -halt-o
n-error -interaction=batchmode -jobname "<filename>-figure0" "\def\tikzexternalreal
job{<filename>}\input{<filename>}"' ========
<filename>-figure0.pdf
looks like this:

Subsequent runs include the output:
===== Image '<filename>-figure0' is up-to-date. ======
The PDF combines the externalised image from <filename>-figure0.pdf
with the one produced from tikzcd
on the fly:

How helpful this is will depend on what proportion of your pictures are tikzcd
. If the answer is 100%, it will obviously be of no use at all. On the other hand, if the answer is less than 100%, there may be something to be said for it.
tikzcd
withtikzpicture
does not work. See Section 3.1 on page 11 of thetikz-cd
manual (version 0.9b, of March 8, 2014). Or am I doing something wrong? Have you tried my example? Thanks!tikzcd
environment withtikzpicture
because all definitions like\arrow
are initialized whentikzcd
begins. I would suggest you to contact the package author for this problem.cd
tikzlibrary defined? I thoughttikz-cd
was a separate package, not a TikZ library.