I have the following main file
\documentclass{article}
\usepackage{standalone}
\usepackage{tikz}
\usepackage{apacite}
\bibliographystyle{apacite}
\begin{document}
\begin{figure}
\input{figures}
\caption{test \protect\cite{ahu61}}.
\end{figure}
\bibliography{test.bib}
\end{document}
depending on the file figures.tex
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw (0,0) rectangle (1,1);
\end{tikzpicture}
\end{document}
and the file test.bib
@article{ahu61,
author={Arrow, Kenneth J. and Leonid Hurwicz and Hirofumi Uzawa},
title={Constraint qualifications in maximization problems},
journal={Naval Research Logistics Quarterly},
volume={8},
year=1961,
pages={175-191}
}
When I compile the file main file I get the following error
Can be used only in preamble. \caption{test \protect\cite{ahu61}}
When I write instead {\input{figures}} or remove the line with \input{figures} completely the file compiles without any error. Why does this happen?