# Is the combine documentclass broken when using the fancyhdr package or vice versa?

The simplest example that I can construct to illustrate the problem requires two files.

main.tex contains:

\documentclass{combine}
\usepackage{fancyhdr}
\begin{document}
\pagestyle{combine}

Hello!

\begin{papers}
\import{sub}
\end{papers}

\end{document}


and sub.tex contains:

\documentclass{article}
\begin{document}
Bye!
\end{document}


compiling using the command: latex main.tex causes compilation to freeze.

If you comment out the line:

%\usepackage{fancyhdr}


then compilation works and output is as expected.

I don't know where to start to try and fix it, because there is no error messages.

Can anyone else replicate this problem? Is there a quick fix that I can implement? Can the style and package developers fix it?

It ends up defining \@makecol in terms of itself and looping. This seems to fix this case

\documentclass{combine}
\usepackage{fancyhdr}

\begin{document}

\pagestyle{combine}

Hello!

\begin{papers}
\makeatletter\let\@makecol\latex@makecol\makeatother
\import{sub}
\end{papers}

\end{document}

• Absolute genious! Thank you! It fixed the problem in my complex document as well. – combiner Jan 11 '17 at 16:36