I'd like to try to make a LaTeX class which enforces a number of (non-empty) sections to exist-- if the user doesn't define them manually, then some default section content will be created.
\begin{document}
\section{Section which requires subsections ``African swallow'' and ``European swallow''}
\subsection{African swallow}
The unladen airspeed is \ldots % The section is defined and has content, so it is okay
% subsection ``European swallow'' doesn't exist (and therefore is also missing content, of course), so here the compiler adds:
% \subsection{European swallow}
%
% The unladen airspeed is \ldots, although when carrying a coconut it is much less.
\end{document}
It would be even cooler if I could also specify that certain sections must be defined (and are not empty), otherwise the compiler exits with an error.
I hope my question is understandable... I'd be grateful for any tips.