summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/jmlr/sample-books/jmlrbook-sample.tex
blob: 465bca51f73e1a3caffb5c7907d0e667ccad138d (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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
 % Define \jmlrprehyperref to load packages before hyperref is
 % loaded
\def\jmlrprehyperref{%
  % Packages used by imported articles:
  \usepackage{lipsum}
  \usepackage{booktabs}
  \usepackage{siunitx}
}
\documentclass[wcp,7x10]{jmlrbook}% on-line color version, 7inx10in
 %\documentclass[wcp,gray,7x10]{jmlrbook}% print version, 7inx10in

 % Load last
 \ifprint{}{\usepackage{bookmark}}

 % Title is added to the PDF properties. Optional argument
 % is used instead, if present.
 %\title[Short Title]{Big Long Title}
\title{A Sample Book}

\author[Anne Editor et al.]{Anne Editor, Anne Other Editor and Nicola Talbot}

 % change the arguments, as appropriate, in the following:
\volume{1}
\subtitle{Making a Book from JMLR Articles}
\logo{\includegraphics{bookLogo}}
\team{The Sample Book Team}

\productioneditor{Nicola Talbot}

\begin{document}
\maketitle

\frontmatter

\chapter{Foreword}

This is an example book that combines multiple articles. Each
article uses the \textsf{jmlr} class file. \emph{The articles
should not need to be edited in order to combine them using this
class file.}\footnote{Unless the authors have done something
weird or have used problematic packages.} In particular, you
don't need to delete \verb|\documentclass|,
\verb|\begin{document}| and \verb|\end{document}|. The articles
should be able to compile on their own or as part of this book.

In the preamble of the book, you need to include the packages
that the articles include, but you don't need to include
any packages that are automatically loaded by the \textsf{jmlr}
class (\textsf{amsmath}, \textsf{amssymb}, \textsf{natbib},
\textsf{graphicx}, \textsf{url}, \textsf{xcolor} and
\textsf{algorithm2e}). You also don't need to include the
\textsf{hyperref} and \textsf{combnat} packages as they are
automatically loaded by \textsf{jmlrbook}. For example, some of the
articles imported in this book use the \textsf{lipsum} package,
so that package needs to be included in the preamble of the
book.

Commands defined in the imported articles will be local to that
article unless \verb|\gdef| or \verb|\global| has been used. This
means that if more than one article has defined the same command,
there shouldn't be a conflict unless the command has been defined
globally. For example, \texttt{paper1/paper1.tex} and
\texttt{paper2/paper2.tex} both define \verb|\samplecommand|, but
since \verb|\newcommand| has been used, rather than \verb|\gdef|,
there's no conflict. However, a problem will occur if the same
command is also defined in this document before either of those
files are imported.

Many packages must be loaded before \textsf{hyperref}. If these
packages haven't been loaded by \textsf{jmlr}, you will need
to specify them using \textsf{jmlrbook}'s \verb|\jmlrprehyperref|
hook. For example, to load the packages ``foo'' and ``bar'':
\begin{verbatim}
\def\jmlrprehyperref{\usepackage{foo}\usepackage{bar}}
\documentclass{jmlrbook}
\end{verbatim}
or:
\begin{verbatim}
\def\jmlrprehyperref{\usepackage{foo,bar}}
\documentclass{jmlrbook}
\end{verbatim}


The imported papers need to be placed inside the 
\texttt{jmlrpapers} environment. Papers that have already
been published should be included using \verb|\importpubpaper|
and papers that haven't been published elsewhere should be
imported using \verb|\importarticle|. Both commands have an
optional argument that specifies the prefix to use in the labels
within the imported article. If omitted, the article's file
name is used.

Both articles and the book may have appendices and parts created.
Parts are created using \verb|\part|\{\emph{title}\}. Switch
to appendices using \verb|\appendix| and then use \verb|\chapter|
(for the book) or \verb|\section| (in imported articles).

Cross-referencing other parts of the book is done using the
usual \verb|\label| and \verb|\ref| mechanism. The \textsf{jmlr}
class additional provides convenience commands such as
\verb|\sectionref| and \verb|\figureref|. Unlike \verb|\ref|,
these commands may take a comma-separated list of labels as the
argument.

The \textsf{jmlrbook} additionally provides \verb|\chapterref|
(which can take a comma-separated list of labels) and commands
to reference imported articles (which take a single label
as the argument): \verb|\articlepageref| (the starting page of
the article), \verb|\articlepagesref| (the page range for the
article), \verb|\articletitleref| (the short title for the
article) and \verb|\articleauthorref| (the article's author).

You may also cross-reference parts of the imported articles,
but you need to prefix the label with the label supplied
in the optional argument of \verb|\importpubpaper| or
\verb|\importarticle|. (If omitted, this is given by 
directory/file name.)

For example, the first appendix in this book is
\appendixref{apd:first}, but the first appendix in
``\articletitleref{paper1/paper1}'' by
\articleauthorref{paper1/paper1}
(pp.~\articlepagesref{paper1/paper1}) is
\appendixref{paper1/paper1apd:first}.
Here's a reference to a couple of tables in 
\articletitleref{paper1/paper1}:
\tableref{paper1/paper1tab:sample,paper1/paper1tab:sample2}.

The author of a foreword (or other chapter) can sign off using
the \texttt{authorsignoff} environment. Each author should be
specified using \verb|\Author|.

\begin{authorsignoff}
\Author{Nicola Talbot\\
University of East Anglia}
\end{authorsignoff}

\begin{preface}
The preface environment should be used for the preface if you want
makejmlrbook to extract the preface and turn it into a standalone
document.

The editorial team can sign off at the end of the preface using
the \texttt{signoff} environment. This has two arguments: the
optional argument is a name for the editorial team (defaults to
``The Editorial Team'') and the mandatory argument is the date.
Within the environment, use \verb|\Editor| for each editor.

\begin{signoff}{March 2010}
% First editor:
\Editor{Nicola Talbot\\
University of East Anglia\\
\mailto{N.Talbot@uea.ac.uk}}
% Second editor:
\Editor{Anne Editor\\
University of Nowhere\\
\mailto{ae@sample.com}}
\end{signoff}

\end{preface}

\tableofcontents

\mainmatter

\part{First Part of the Book}

\chapter{Introduction}

This is an introduction to the book.

\section{Sample Section}

This is a section in the introduction.

\subsection{Sample Sub-Section}

This is a sub-section.

\subsubsection{Sample Sub-Sub-Section}

This is a sub-sub-section.

\paragraph{Sample Sub-Sub-Sub-Section}

This is a sub-sub-sub-section.

\subparagraph{Sample Sub-Sub-Sub-Sub-Section}

This is a sub-sub-sub-sub-section.

% Add a part to the TOC but don't print anything
\addtocpart{Papers Published in JMLR W\&CP}

\begin{jmlrpapers}
  % Prepublished papers are imported using:
  % \importpubpaper[label]{dir}{file}{pages}
  % pages refers to the page range in the original publication
  % which doesn't necessarily correspond to the page numbers in
  % this book.
  \importpubpaper{paper1}{paper1}{23--45}

  \importpubpaper{paper2}{paper2}{63--70}

\end{jmlrpapers}

% Add a part to the TOC but don't print anything
\addtocpart{Unpublished Papers}

\begin{jmlrpapers}
  % Unpublished papers are imported using:
  % \importarticle[label]{dir}{file}
  \importarticle{paper3}{paper3}

  \importarticle{paper4}{paper4}
\end{jmlrpapers}

\appendix

\part{First Part of Appendices}\label{pt:apd1}

\chapter*{Introduction}

This is an introduction to \partref{pt:apd1}.

\chapter{First Appendix}
\label{apd:first}

This is an appendix.

\chapter{Second Appendix}
\label{apd:second}

This is another appendix.

\lipsum

\part{Second Part of Appendices}

\chapter{An Appendix}
\label{apd:third}

This is an appendix in another part.

\lipsum

\end{document}