A LaTeX class and package is provided which allows LaTeX diagrams or other LaTeX code to be compiled standalone or as part of a main document. Special support for pictures with beamer overlays is also provided.
Using the standalone package in conjunction with the subfiles package, errors occur in complexer examples. Here is a minimal setup, producing an error:
test.tex:
\documentclass{article}
\usepackage{standalone}
\usepackage{tikz}
\usepackage{subfiles}
\begin{document}
Main document
\subfile{test2.tex}
\end{document}
test2.tex
\documentclass[test.tex]{subfiles}
\begin{document}
Hello World! from the subfile
\begin{figure}
\input{fig}
\end{figure}
\end{document}
Using the standalone package in conjunction with the subfiles package, errors occur in complexer examples. Here is a minimal setup, producing an error:
test.tex:
test2.tex
fig.tex
error:
it seems to have something todo with the figure environment, but I am not sure, since without it it works fine. Same error with pdflatex or lualatex.