8

I would like to create a "journal" with several papers, using the combine class.

In the example below, there are one master file and two articles.

Master file:

\documentclass[11pt,a4paper]{combine}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage[english,french]{babel}
\usepackage[bookmarks=true, bookmarksopen=true, bookmarksnumbered=true, bookmarksopenlevel=\maxdimen, colorlinks=true, urlcolor=blue, linkcolor=red, implicit=false,dvipdfm]{hyperref}

\title{Journal of }
\author{A. N. Editor}

\begin{document}
\maketitle
\tableofcontents
\begin{papers}

\makeatletter
\let\@begindocumenthook\relax
\makeatother

\coltoctitle{An article}
\coltocauthor{A.~N.~Author}
\label{art1}
\import{art1}
\clearpage

\coltoctitle{Another article}
\coltocauthor{A.~N.~Other}
\label{art2}
\import{art2}
\clearpage

\end{papers}

\end{document}

First article:

\documentclass[11pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage[english,french]{babel}
\usepackage[bookmarks=true, bookmarksopen=true, bookmarksnumbered=true, bookmarksopenlevel=\maxdimen, colorlinks=true, urlcolor=blue, linkcolor=red, implicit=false, dvipdfm]{hyperref}

\title{An article}
\author{A.~N.~Author}

\begin{document}
\maketitle

Bla bla bla

\end{document}

Second article:

\documentclass[11pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage[english,french]{babel}
\usepackage[bookmarks=true, bookmarksopen=true, bookmarksnumbered=true, bookmarksopenlevel=\maxdimen, colorlinks=true, urlcolor=blue, linkcolor=red, implicit=false, dvipdfm]{hyperref}

\title{Another article}
\author{A.~N.~Other}

\begin{document}
\maketitle

Bla bla bla

\end{document}

The compilation is stopped and an error message is given:

! TeX capacity exceeded, sorry [input stack size=5000].
\clearpage ...Call@BeforeClearDocument \clearpage

\Call@AfterLastShipout
l.17 \end{document}

If you really absolutely need more capacity, you can ask a wizard to enlarge me.

Note: If the hyperref package is not activated in the preamble of the master file, the entire document is correctly created.

I would like to get a document with hyperlinks (e.g. figures) and bookmarks. Thus, I would like to use hyperref. How can I solve this problem?

2
  • \clearpage is being defined to expand to a definition that includes \clearpage so you get into an infinite loop didn't spot where the culprit was yet but this may help you narrow it down Commented Oct 10, 2012 at 20:03
  • If I uncomment the redefinition of \@begindocumenthook, it hangs at \captions@French ->\captions@French
    – egreg
    Commented Oct 10, 2012 at 20:29

1 Answer 1

3

I fixed the endless loop in package atveryend 2012/10/15 v1.9. Also hobsub 2012/10/15 v1.15 needs to be updated, because it contains atveryend. The PDF files contain the DTX sources as file attachments. The packages are unpacked by running the DTX files through tex (not latex). The new versions will be part of the next bundle update at a later time.

But the class combine will not work well with hyperref, because internals are overwritten, that are redefined by hyperref (\label, \ref, \@setref, …).

BTW,

\makeatletter
\let\@begindocumenthook\relax
\makeatother

can be abbreviated by

\emptyAtBeginDocument
0

You must log in to answer this question.

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