While I was reading a thread on LaTeX workflows, I came across a comment in https://tex.stackexchange.com/a/22433/32782 which seemed to indicate that there are more than one person who can/could use the standalone package for book chapters. Usually people would use \includeonly
rather than the standalone package for dividing a document into different tex files and activating just one tex file, but the idea of using standalone intrigued me and I thought I should give it a try, starting with an article with sections first, but my example doesn't seem to work. Here is my example:
The main tex file, flying-animals.tex
:
\documentclass{article}
\usepackage{standalone}
\begin{document}
\input{dragons}
\input{birds}
\input{superman}
\end{document}
And a tex file for one section, dragons.tex
:
\documentclass{standalone}
\begin{document}
\section{Theories of dragons}
Being dragons.
\subsection{Theory of angry dragons}
Being angry dragons.
\subsection{Theory of tiny dragons}
Being tiny dragons.
\end{document}
When I compile dragons.tex
, I get the following error.
LaTeX Error: Something's wrong--perhaps a missing \item.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.3 \section
{Theories of dragons}
Is it possible to make standalone work with sections?
standalone.cls
. if you want to use\section
in your input, you need to have a document class or.sty
file that defines it, andstandalone
doesn't.include
andincludeonly