I'm writing a document such as the following one:
\section{A}\input{A}
\section{B}\input{B}
\section{C}\input{C}
...
Each section provides some content but requires other sections to be included before. For example, B could require A and C, C could require A, and A could require nothing. In this case, the above piece of code should just put A and C in the output document as B is before C. I tried something with the ifthen package, but I failed to obtain a solution that doesn't produce a compilation error if the order is wrong. In particular, it complains about undeclared boolean variables, as it may happen I check for a boolean variable before the section that declares it is loaded.
Any idea? Thank you.
