7

I have a number of different LaTeX documents. Each document has a different title and author. Is there any way for me to:

  1. Combine all of these documents into one larger document with accurate page numbers and a single title page for the entire large document?
  2. Create a table of contents that includes the page number at which each separate document starts and the author of that document?

Edit: This template is being used for all the documents that need to be combined.

  • Well perhaps the class book or another equivalent such as memoir could be right for this project. – Aradnix Aug 20 '14 at 21:55
  • 1
    Yes, it is possible (I use such a functionality in every issue of the journal I typeset). However, I don't quite have a solution available to the public, the process I use is very complicated, involves a fixed directory structure and is deeply incorporated into the journal article and issue classes. I'm sorry that I'm unable to share my experience :( – yo' Aug 20 '14 at 21:57
  • 1
    @okarin: If all documents have the same structure and do not use any only-preamble commands in their preamble, it will be possible, I suppose, but it's not very easy. – user31729 Aug 20 '14 at 22:00
  • 2
    Perhaps ctan.org/pkg/tugboat might be helpful since it covers the macros etc. used to typeset issues of Tugboat? I expect there are other examples around - this is just one which seemed easier to find. ctan.org/topic/journalpub may include something useful. – cfr Aug 20 '14 at 22:19
  • 1
    Well, you may start with combine. – user11232 Aug 20 '14 at 23:09
7
+100

As @HarishKumar suggests, the combine package does the job. Here's a working example.

Here is the wrapper document, copied nearly verbatim from the package documentation at http://tug.ctan.org/tex-archive/macros/latex/contrib/combine/combine.pdf . Compile it multiple times to get the table of contents correct.

\documentclass[12pt]{combine}

\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
\clearpage
\begin{papers}
\coltoctitle{A Sample Article for  \textsc{ Mathematics Magazine}}
\coltocauthor{Jack Q.~Firstauthor} % first authors into main ToC
\import{mm1}

\coltoctitle{A second piece} 
\coltocauthor{Jill P.~Secondauthor}
\import{mm2}
\end{papers}

\end{document}

enter image description here Here are the two imported articles, each built with the template you linked to:

mm1.tex:

% Article template for Mathematics Magazine
% Revised 7/2002  Thanks for Greg St. George
\documentclass[12pt]{article}
\usepackage{amssymb}
\renewcommand{\baselinestretch}{1.2}
%This is the command that spaces the manuscript for easy reading

\begin{document}
%\thispagestyle{empty}
\begin{center}
\Large
% TITLE GOES HERE
A Sample Article for  \textsc{ Mathematics Magazine}
\end{center}

\begin{flushright}
Jack Q.~Firstauthor\footnote{Supported by the National Science
Foundation.}  \\
XXXX University \\
City, State 98765-4321\\
\verb+email@optional.edu+

\vspace{2 mm}

Jill P.~Secondauthor \\
Department of Physics
\footnote{Authors are in alphabetical order
unless there is an extraordinary reason to do otherwise.  Also,
the author address includes a department \emph{only} if
the department is \emph{not} mathematics. We use as few
footnotes as possible in the \textit{Magazine}.  This one, for instance,
contains information that really belongs in the body of the paper.
The previous footnote probably belongs among the Acknowledgments at the end.}\\
ZZZZ College \\
City, State 12345-6789
\end{flushright}

This document is meant to help you prepare an Article for
submission to \textsc{Mathematics Magazine}.  Of course,
editorial decisions depend entirely on
what you say and how you say it. Nonetheless, we will all save
time if you exercise some care in how you first present the paper.

\begin{thebibliography}{20}

\bibitem{Boas}  R.P. Boas, Can we make mathematics intelligible? \textit{Amer. Math.
Monthly} \textbf{88} (1981), 727--731.

\bibitem{Farris}  Frank Farris, \textit{A \textsc{Mathematics Magazine} Retrospective}, this \textsc{Magazine}, \textbf{79} (2006), 1-88.

\bibitem{Halmos} Paul Halmos, How to write mathematics,
\textit{Enseign.  Math.} \textbf{16} (1970), 123--152.  Reprinted in
Halmos, \textit{Selecta, expository writings}, Vol.  2, Springer, New
York, 1983, 157--186.

\bibitem{Hwang} Andrew Hwang, Writing in the age of Latex, \textit{AMS
Notices} \textbf{42} (1995), 878--882.

\bibitem{Knuth}  D.E. Knuth, T. Larrabee, and P.M. Roberts,
\textit{Mathematical Writing}, MAA Notes \#14, 1989.

\bibitem{Krantz}   Steven G. Krantz, \textit{A Primer of Mathematical Writing},
American Mathematical Society, 1997.

\bibitem{MAA} Mathematical Association of America, \textit{Electronic
Production Guidelines}, http://www.maa.org/pubs/bev.html .

\bibitem{Mermin} N. David Mermin, \textit{Boojums All the Way
Through}, Cambridge Univ.  Pr., Cambridge, UK, 1990.

\end{thebibliography}



\end{document}

mm2.tex:

% Article template for Mathematics Magazine
% Revised 7/2002  Thanks for Greg St. George
\documentclass[12pt]{article}
\usepackage{amssymb}
\renewcommand{\baselinestretch}{1.2}
%This is the command that spaces the manuscript for easy reading

\begin{document}
%\thispagestyle{empty}
\begin{center}
\Large
A second piece
\end{center}

\begin{flushright}
Jack Q.~Firstauthor\footnote{Supported by the National Science
Foundation.}  \\
XXXX University \\
City, State 98765-4321\\
\verb+email@optional.edu+

\vspace{2 mm}

Jill P.~Secondauthor \\
Department of Physics
\footnote{Authors are in alphabetical order
unless there is an extraordinary reason to do otherwise.  Also,
the author address includes a department \emph{only} if
the department is \emph{not} mathematics. We use as few
footnotes as possible in the \textit{Magazine}.  This one, for instance,
contains information that really belongs in the body of the paper.
The previous footnote probably belongs among the Acknowledgments at the end.}\\
ZZZZ College \\
City, State 12345-6789
\end{flushright}

This document is meant to help you prepare an Article for
submission to \textsc{Mathematics Magazine}.  Of course,
editorial decisions depend entirely on
what you say and how you say it. Nonetheless, we will all save
time if you exercise some care in how you first present the paper.

Now that I have caught your attention with an interesting introductory paragraph,
here is what you will find:
specific information about the style of Articles in the \textsc{Magazine}
and a description of the \LaTeX\ code we prefer that you use
to prepare your manuscript.

Since this section is very clearly
an introduction, I thought that labeling it ``Introduction" would add
nothing.  Note that I am willing to use the first person in an Article
and you might be as well.  Another equally respectable choice is ``we,''
even when there is only one author; this can
create an author-reader partnership to
work through the mathematics together.
Whatever voice you choose, consistency is important.

You may be looking at this document in a variety of ways:  the .pdf or .ps files
are meant to be viewed on a screen or printed, while
the .tex file contains the codes used to create those
viewable versions via the program \LaTeX.  Even if you are a novice with \TeX,
there may be enough here to teach you what
you need to know.  And if you are an ace with \TeX,
we have a warning: please do not overload your
document with special kludges and tricks that will
only be removed later by our compositor.

This document is prepared with extremely simple \LaTeX\ formatting,
using the unadorned \verb+article+ template.
It is designed for simplicity and ease of handling---not
to imitate the \textsc{Magazine}'s final, typeset style in every
detail.    For authors less familiar with \LaTeX, we offer a
brief lesson, showing how certain common elements of mathematical
style are typeset using this program.  For hardcore technical
specifications, please see the Electronic Publication Guidelines~\cite{MAA}.

\subsection*{Notes on writing an Article}
Articles in the \textsc{Magazine} tend to be longer and
more substantial than Notes,
offering a broad overview of some field
or making new connections.
Being longer, they often
benefit from more sectioning. We use
the \verb+\subsection*+ command to create titles
for these sections, which are not usually numbered
(the \verb+*+ in \verb+\subsection*+ accomplishes this).

To judge the length of your piece,  consider that
this document prints to six pages with the current code, but would run
about four pages in the \textsc{Magazine}.  The current settings produce
a document that is generously spaced in consideration of
referees' eyesight.

Few pieces of mathematical writing are entirely self-contained,
although we try to make Articles reasonably so.    Consider
providing a section of background material that our
more knowledgeable readers can skip. Define
enough terms to enable an eager undergraduate student
to read your piece without having to consult
too many references.

For readers intrigued by your exposition,
you should provide friendly references.
Bibliographies may contain suggested reading along with sources actually referenced.  In all cases,
cite sources that are currently and readily available.

\LaTeX\ has a way to keep track of references automatically,
which is illustrated in the code that ends this file.  To refer
to Halmos~\cite{Halmos}, you use a codename that you have created
as a mnemonic, often the author's last name.
 \LaTeX\
 keeps track, numbering the references in
the order they appear in your list.  If you add a reference
(positioning it correctly in the list) the numbers will be adjusted accordingly.

Please follow our bibliographic format carefully, based
on the examples below.  Entries may appear either in alphabetical
order or in order of citation (but choose one order and
stick to it).   Journal titles are abbreviated
as in \emph{Mathematical Reviews},
for instance, \textit{Amer. Math. Monthly}; volume numbers
of journals are set in \textbf{bold}.  Authors names are
not inverted: Frank A. Farris, not Farris, Frank A.~\cite{Farris}.
The abbreviation pp. is used for books, but not journal
articles.  Note the slightly different style for
citing articles in the \textsc{Magazine}.


\paragraph*{How to do things in \LaTeX}

Roman letters used as variables will be correctly
italicized if enclosed with \$s in your code, as in ``functions $f$, $g$, and $h$.''
This makes for typing lots of \$s when writing in \TeX.
Other popular fonts are $\mathcal A$, for sets and the like, and

\end{document}

Note: That template has lots of outdated LaTeX constructs. I hope it's not the one currently in use at the Mathematics Magazine. Here are some of them

  • Hard coded format for title and author. \maketitle would be better.

  • Many line breaks with \\ .

  • ${\mathbb Z}$ wouldn't compile.

  • eqnarray environment is no longer the wise choice.

  • The use of $$...$$ rather than \[...\] for displayed maths. [In the linked template but not the excerpts repeated in this answer.]

  • probably others too ...

  • Which of the constructs would be considered outdated? – okarin Aug 23 '14 at 0:03
  • 3
    I added some LaTeX critique to the answer. – Ethan Bolker Aug 23 '14 at 0:16
  • 1
    @EthanBolker I hope you don't mind but I added not to use $$ for display maths. (This stood out to me when I looked at the template but I don't think that code is included in your extracts. I didn't want to create an answer for that since it isn't about the question but thought it should be highlighted as Very Bad.) – cfr Aug 24 '14 at 0:49
  • 1
    @cfr Cooperating to improve answers is just how this site should work. Your edit may help convince the OP to abandon this old template. – Ethan Bolker Aug 24 '14 at 0:59

Your Answer

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

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