summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-multidoc.html
blob: 6bb12571065d532d16b0488c2d1fffa512345651 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<head>
<title>UK TeX FAQ -- question label multidoc</title>
</head><body>
<h3>A &#8216;report&#8217; from lots of &#8216;article&#8217;s</h3>
<p/>This is a requirement, for example, if one is preparing the
proceedings of a conference whose papers were submitted in LaTeX.
<p/>The nearest things to canned solutions are Peter Wilson&#8217;s
<i>combine</i> and Federico Garcia&#8217;s <i>subfiles</i> classes.
<p/><i>Combine</i> defines the means to &#8216;<code>\</code><code>import</code>&#8217; entire documents,
and provides means of specifying significant features of the layout of
the document, as well as a global table of contents, and so on.  The
complete set of facilities is pretty complex.  An auxiliary package,
<i>combinet</i>, allows use of the <code>\</code><code>title</code>s and <code>\</code><code>author</code>s
(etc.) of the <code>\</code><code>import</code>ed documents to appear in the global table
of contents.  The basic structure of a combined document would be:
<blockquote>
<pre>
\documentclass[...]{combine}
...
\begin{document}
...
&#60;introductory materiel&#62;
...
\begin{papers}
% title and author of first article,
% to go the the main ToC
\coltoctitle{...}
\coltocauthor{...}
\label{art1}
\import{art1}
...
\end{papers}
...
&#60;acknowledgements, etc.&#62;
...
\end{document}
</pre>
</blockquote><p>
<p/>The <i>subfiles</i> class is used in the component files of a multi-file
project, and the corresponding <i>subfiles</i> package is used in the
master file; so the structure of the master file looks like:
<blockquote>
<pre>
\documentclass{&#60;whatever&#62;}
...
\usepackage{subfiles}
...
\begin{document}
...
\subfile{subfile_name}
...
\end{document}
</pre>
</blockquote><p>
while a subfile has the structure:
<blockquote>
<pre>
\documentclass[mainfile_name]{subfiles}
\begin{document}
...
\end{document}
</pre>
</blockquote><p>
Arrangements may be made so that the component files will
be typeset using different page format, etc., parameters than those
used when they are typeset as a part of the main file.
<p/>A more &#8216;raw&#8217; toolkit is offered by Matt Swift&#8217;s <i>includex</i> and
<i>newclude</i> packages, both part of the <i>frankenstein</i>
bundle.  Note that Matt believes <i>includex</i> is obsolete
(though it continues to work for this author); furthermore, its
replacement, <i>newclude</i> remains &#8220;in development&#8221;, as it has
been since 1999.
<p/>Both <i>includex</i> and <i>newclude</i> enable you to
&#8216;<code>\</code><code>includedoc</code>&#8217; complete articles (in the way that you
&#8216;<code>\</code><code>include</code>&#8217; chapter files in an ordinary report).  The preamble
(everything up to <code>\</code><code>begin{document}</code>), and everything after
<code>\</code><code>end{document}</code>, is ignored by both packages.  Thus the
packages don&#8217;t &#8220;do the whole job&#8221; for you, though: you need to
analyse the package use of the individual papers, and ensure that a
consistent set is loaded in the preamble of the main report.  (Both
packages require <i>moredefs</i>, which is also part of the bundle.)
<p/>A completely different approach is to use the <i>pdfpages</i>
package, and to include articles submitted in PDF format into a
a PDF document produced by PDFLaTeX.  The package
defines an <code>\</code><code>includepdf</code> command, which takes arguments similar to
those of the <code>\</code><code>includegraphics</code> command.  With keywords in the
optional argument of the command, you can specify which pages you want
to be included from the file named, and various details of the layout
of the included pages.
<dl>
<dt><tt><i>combine.cls</i></tt><dd><a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/combine.zip">macros/latex/contrib/combine</a> (or <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/combine/">browse the directory</a>)
<dt><tt><i>combinet.sty</i></tt><dd><a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/combine.zip">macros/latex/contrib/combine</a> (or <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/combine/">browse the directory</a>)
<dt><tt><i>includex.sty</i></tt><dd>Distributed in the &#8220;unsupported&#8221; part of
  <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/frankenstein.zip">macros/latex/contrib/frankenstein</a> (or <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/frankenstein/">browse the directory</a>)
<dt><tt><i>moredefs.sty</i></tt><dd>Distributed as part of <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/frankenstein.zip">macros/latex/contrib/frankenstein</a> (or <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/frankenstein/">browse the directory</a>); <a href="http://www.tex.ac.uk/tex-archive/help/Catalogue/entries/moredefs.html">catalogue entry</a>
<dt><tt><i>newclude.sty</i></tt><dd>Distributed as part of <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/frankenstein.zip">macros/latex/contrib/frankenstein</a> (or <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/frankenstein/">browse the directory</a>); <a href="http://www.tex.ac.uk/tex-archive/help/Catalogue/entries/newclude.html">catalogue entry</a>
<dt><tt><i>pdfpages.sty</i></tt><dd><a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/pdfpages.zip">macros/latex/contrib/pdfpages</a> (or <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/pdfpages/">browse the directory</a>)
<dt><tt><i>subfiles.cls, etc.</i></tt><dd><a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/subfiles.zip">macros/latex/contrib/subfiles</a> (or <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/subfiles/">browse the directory</a>)
</dl>
<p/><p>This question on the Web: <a href="http://www.tex.ac.uk/cgi-bin/texfaq2html?label=multidoc">http://www.tex.ac.uk/cgi-bin/texfaq2html?label=multidoc</a>
</body>