8

How do I combine multiple articles into a single volume with auto generated table of content. Is it possible?

Jan
  • 5,293
  • 2
    Welcome to TeX.SE. Please, add a MWE to show us your problem and what you already have tried out. – Jan Jan 08 '17 at 08:14
  • I have prepared multiple articles with cej.cls but I have no idea to combine that. – Kannan J Kumar Jan 08 '17 at 08:22
  • 1
    PLEASE: add an example with at least one minimal article and your attempt, to combine several of those articles in one document. – Jan Jan 08 '17 at 10:30
  • 4
    Have a look into combine package, for example –  Jan 08 '17 at 11:27
  • 1
    @ChristianHupfer - Please post an answer that elaborates on your suggestion to use the combine package. – Mico Feb 24 '17 at 05:50
  • 1
    @Mico: Done so.... –  Feb 24 '17 at 10:27
  • Some organizations with this requirement use an external custom script to compile the pdf files output by (La)TeX into the final volume, applying final page numbers directly to the pdf pages. – barbara beeton May 21 '23 at 15:32
  • If the combine class is no longer usable as the answers suggest, can we archive all the questions using the combine class and remove them from the internet? I wasted two days trying to make it work. – deps_stats May 22 '23 at 20:22

2 Answers2

2

EDIT: As noted here the combine class is no longer usable with current versions of LaTeX. Please disregard this answer...


Here is a MWE using the combine class, as suggested in the comments.

main.tex

\documentclass{combine}
\usepackage{combinet}
\begin{document}
  \tableofcontents
  \begin{papers}
    \import{a1}
  \end{papers}
\end{document}

a1.tex

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

Result

result


The combine class allows importing complete LaTeX documents, essentially ignoring the \begin{document} and \end{document} commands, with options for handling sub-document packages, etc. The combinet package works with the combine class to add imported document titles and authors to the main TOC when they are imported.


Having used this combination to create a complete journal volume from multiple articles, I can tell you there are many challenges to this task. For example, the authblk package will not behave as expected, and likewise for biblatex. However, similar problems emerge if you are going to try to roll your own title-blocks, etc.

jessexknight
  • 2,732
0

create a single .tex file named as your wish (ie., book.tex, master.tex)

then include all your article in that same file like below, and dont forget to delete \documentclass{cej}, \begin{document}, and \end{document} in each and every article.

\documentclass{cej}
\begin{document}
\tableofcontents

\include{article1} %% include your multiple article
\include{article2} %% 
\include{article3} %% 
....
....
\include{articleN} %% 
\end{document}
RCV
  • 2,030
  • 7
    These suggestions fail to address important issues, such as what to do with the title- and date-related information that must have been associated with the original stand-alone LaTeX documents. – Mico Feb 24 '17 at 05:47