Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
    
\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 –  David Carlisle Oct 10 '12 at 20:03
    
If I uncomment the redefinition of \@begindocumenthook, it hangs at \captions@French ->\captions@French –  egreg Oct 10 '12 at 20:29
add comment

1 Answer

up vote 3 down vote accepted

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
share|improve this answer
    
Thanks for answering. Despite the fact that the class combine cannot work well with hyperref, is it possible to have citations colored (in red for example) in the text? –  Vince Nov 8 '12 at 20:05
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.