0

Even the most trivial example fails.

Here's the main file, test.tex:

\documentclass[10pt]{combine}
\usepackage{combinet}

\begin{document}
\pagestyle{combine} 
\clearpage

\begin{papers}
\import{a1}
\end{papers}

\end{document}

The the tex file to import into the main document, a1.tex (in same folder):

\documentclass{article}
\author{Author}
\title{Title}
\begin{document}
  \maketitle
\end{document}

No matter what I try, it does not compile, generating the following error:

This is pdfTeX, Version 3.141592653-2.6-1.40.24 (MiKTeX 21.12) (preloaded format=pdflatex.fmt)
 restricted \write18 enabled.
entering extended mode
(C:/Users/vince/tex/MLbook/test.tex
LaTeX2e <2021-11-15> patch level 1
L3 programming layer <2021-11-22>
(C:\Users\vince\AppData\Local\Programs\MiKTeX\tex/latex/combine\combine.cls
Document Class: combine 2010/07/10 v0.7a collection of documents 
(C:\Users\vince\AppData\Local\Programs\MiKTeX\tex/latex/graphics\keyval.sty)
(C:\Users\vince\AppData\Local\Programs\MiKTeX\tex/latex/base\article.cls
Document Class: article 2021/10/04 v1.4n Standard LaTeX document class
(C:\Users\vince\AppData\Local\Programs\MiKTeX\tex/latex/base\size10.clo)))
(C:\Users\vince\AppData\Local\Programs\MiKTeX\tex/latex/combine\combinet.sty)
! Extra \endgroup.
\document ->\endgroup 
                      \let \mainjobname \jobname \def \c@lmainauxfile {\jobn...
l.4 \begin{document}
                    
? 

1 Answer 1

3

This solution relies on Peter Wilson's answer (the original developer) over the additional \endgroup in the \c@ladocument macro.

\documentclass{combine}
\usepackage{combinet}

\begin{filecontents*}{a1.tex}
    \documentclass{article}
    \author{Author}
    \title{Title}
    \begin{document}
        \maketitle
    \end{document}
\end{filecontents*}


% *********************************** added <<<<<<<<<<<<<
\makeatletter
\let\document\c@ladocument\begingroup%
\makeatother
% ***********************************

\begin{document}
    \pagestyle{combine} 
    \clearpage
    
    \begin{papers}
        \import{a1}
    \end{papers}
    
\end{document
2
  • thank you, still have plenty to learn and fine-tune about combining documents, but this was my bottleneck and you fixed it! Sep 2, 2022 at 20:40
  • how to show \tableofcontents?
    – John
    Dec 24, 2023 at 12:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .