0

I wrote three papers (article class) for my dissertation and now I would like to put them together in a single work. I came across the combine package which looked like the perfect fit because it does not require any changes in the preamble. However, I cannot get it running. Anytime I compile the main.tex it prompts the following error message:

! Undefined control sequence. \@begindocumenthook ...fi \Hy@AtBeginDocumentHook {}\let \Hy@AtBeginDocument... l.41 \begin{document}

The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., \hobx'), typeI' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined.

Here is my main.tex:

\documentclass[11pt, english, twoside]{combine}
% Pakete laden
\usepackage[utf8]{inputenc} % Umlaute
\usepackage{xcolor}
\usepackage[colorlinks=true,urlcolor=blue!50!black,linkcolor=red!50!black,citecolor=blue!50!black]{hyperref} % Links
\usepackage[left=1in,top=1.5in,right=1in,bottom=1.5in]{geometry} % Seitenränder gemäß JF Vorgabe
\usepackage{setspace} % Zeilenabstände definieren
%\usepackage[colorinlistoftodos,prependcaption,textsize=tiny]{todonotes} % Für Notizen im Text
\usepackage{footmisc} % Fußnotendesign
\usepackage{booktabs} % schöne Tabellen
\usepackage[authoryear,round]{natbib} % für Literaturverzeichnis
\usepackage{tabularx} % hilft Tabellen auf Seitenbreite zu beschränken
\usepackage{lscape} % Seiten im Querformat
\usepackage{graphicx} % Einbinden von Abbildungen
\usepackage{amsmath} % Mathematische Formeln
\usepackage{longtable} % mehrseitige Tabellen
\usepackage{subfig}
\usepackage{appendix} % für Referenzierung des Appendix
\usepackage{array} % zur Definition neuer Spaltentypen
\usepackage{lmodern}
\usepackage[font=footnotesize, aboveskip=4pt, belowskip=4pt]{caption}

% Neuer Spaltentyp
\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}
\newcolumntype{R}[1]{>{\raggedleft\arraybackslash}p{#1}}

% Zeilenabstand
\onehalfspacing

\title{Proceedings of the ...}
\author{A. N. Editor\thanks{Support ...}}
\date{29 February, 2000}
\begin{document}
\pagestyle{combine} % use the combine page style
\maketitle % main title
\tableofcontents % main ToC

\section{Editor's introduction} \label{intro} % into main ToC (section 1)

\begin{papers} % start of individual articles/papers
\label{art1}
\import{./Projects/Dualholding/Work/Paper/paper/dh_paper_test} % first article, may have own ToC,
\end{papers} % end of individual articles/papers
\end{document}

And here is the document to be included:

\documentclass[11pt,a4paper,english]{article}

% Pakete laden
\usepackage[utf8]{inputenc} % Umlaute
\usepackage{xcolor}
\usepackage[colorlinks=true,urlcolor=blue!50!black,linkcolor=red!50!black,citecolor=blue!50!black]{hyperref} % Links
\usepackage[left=1in,top=1.5in,right=1in,bottom=1.5in]{geometry} % Seitenränder gemäß JF Vorgabe
\usepackage{setspace} % Zeilenabstände definieren
%\usepackage[colorinlistoftodos,prependcaption,textsize=tiny]{todonotes} % Für Notizen im Text
\usepackage{footmisc} % Fußnotendesign
\usepackage{booktabs} % schöne Tabellen
\usepackage[authoryear,round]{natbib} % für Literaturverzeichnis
\usepackage{tabularx} % hilft Tabellen auf Seitenbreite zu beschränken
\usepackage{lscape} % Seiten im Querformat
\usepackage{blindtext}
\usepackage{graphicx} % Einbinden von Abbildungen
\usepackage{amsmath} % Mathematische Formeln
\usepackage{longtable} % mehrseitige Tabellen
\usepackage{subfig}
\usepackage{appendix} % für Referenzierung des Appendix
\usepackage{array} % zur Definition neuer Spaltentypen
\usepackage[font=footnotesize, aboveskip=4pt, belowskip=4pt]{caption}

% Zusätzliche Befehle definieren
% Zwei Notizstile definieren: Einen für Sie \toma und einen für mich \roli
%\newcommand{\roli}[1]{\todo[linecolor=red,backgroundcolor=red!25,bordercolor=red]{\textbf{RL:} #1}}
%\newcommand{\toma}[1]{\todo[linecolor=blue,backgroundcolor=blue!25,bordercolor=blue]{\textbf{TM:} #1}}

% Neuer Spaltentyp
\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}
\newcolumntype{R}[1]{>{\raggedleft\arraybackslash}p{#1}}

% Zeilenabstand
\onehalfspacing

%opening
\title{The Title}
\author{RL\thanks{Catholic University Eichst\"att-Ingolstadt}  \and Someone Else}
\date{This Version: March 27, 2017}

\begin{document}
\maketitle
\thispagestyle{empty}

\begin{abstract} 
\blindtext \\
\\
\textbf{Keywords:} bla, blup. \\
\\
\textbf{JEL Classification:} A1, B2, C3
\end{abstract}


\newpage
\setcounter{page}{1}
\section{Introduction} 

\blindtext

\end{document}

Could someone please tell me what I am doing wrong here? Thanks very much.

EDIT

Note that the file dh_paper_test.tex which is to be included in main.tex compiles without any problems.

  • 1
    Anything that starts \Hy is from the hyperref package. – John Kormylo Mar 28 '17 at 14:05
  • Good to know. I commented \usepackage{hyperref} out. Still I can compile the document to be included but running the main.tex results in the following error: ! Undefined control sequence. \@begindocumenthook ...\relax \caption@FixArabTeX \let \caption@FixArabTeX \... l.41 \begin{document} – Roberto Liebscher Mar 28 '17 at 14:11
  • I tried running combine on some paper of mine, and it couldn't handle them either. I suspect that anything that HAS to be in the preamble of any paper will cause a problem. You might try pdfpages instead. – John Kormylo Mar 28 '17 at 14:26
  • Do you know whether there is an alternative to combine that does pretty much the same (combining complete article files without changes in the originals)? – Roberto Liebscher Mar 28 '17 at 15:22
  • I tried pdfpages but that seems to be a long way to go until I arrive at a document with correct page numbers and workable table of contents. – Roberto Liebscher Mar 29 '17 at 8:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.