%This file follows \url{http://tex.stackexchange.com/questions/132830/adding-continuation-pages-for-overflowing-sections}


\documentclass[a4paper]{article}

\def\a{Red green blue black white cyan magenta yellow. }
\def\b{\subsection{zzz}\a\a\a One two three four five six \Roman{subsection}. }
\def\c{\b\b\b\a\a\b\par\a\a\a\b\b\b\a\a\b\b\par}

\newbox\appbox
\global\setbox\appbox\vbox{}

\def\sec#1{%
\def\sectitle{#1}%
\clearpage
\setbox0\vbox\bgroup\bgroup\section{#1}}

\def\endsec{\vfill\par\egroup\egroup
\vsplit0 to \textheight\vfill
\ifdim\ht0>0pt
\global\setbox\appbox\vbox{\unvbox\appbox
\clearpage
\section*{\thesection\ continued: \sectitle}%
\unvbox0}%
\fi}

\begin{document}

\begin{sec}{AAAAA}
\c\c
\end{sec}

\begin{sec}{BB BB}
\b
\end{sec}

\begin{sec}{CCCC}
\c\c\b\b\c
\end{sec}

\part{appendix}

\unvbox\appbox
\end{document}