Is the standalone package compatible with the crossref (xr) package? This has been asked before, but the answer does not work for me.
MWE: main.tex
\documentclass[]{article}
\usepackage{standalone}
\begin{document}
An equation
\begin{equation}
\label{eq:test_eq}
a=b+c
\end{equation}
\begin{figure}
\centering
\includestandalone[mode=build]{sub}
\caption{A figure}
\end{figure}
\end{document}
sub.tex
\documentclass[tikz]{standalone}
\usepackage{xr}
\externaldocument[main::]{main}
\begin{document}
\tikzstyle{block} = [rectangle]
\begin{tikzpicture}[auto]
% Place nodes
\begin{scope}
% title
\node [block]{Reference to equation Eq.~(\ref{main::eq:test_eq}) };
\end{scope}
\end{tikzpicture}
\end{document}
Reference to equation does not work. Compiling sub.tex directly works fine
