Articles I've written for customers on IT issues.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

247 lines
7.5 KiB

5 years ago
  1. % Define \jmlrprehyperref to load packages before hyperref is
  2. % loaded
  3. \def\jmlrprehyperref{%
  4. % Packages used by imported articles:
  5. \usepackage{lipsum}
  6. \usepackage{booktabs}
  7. \usepackage{siunitx}
  8. }
  9. \documentclass[wcp,7x10]{jmlrbook}% on-line color version, 7inx10in
  10. %\documentclass[wcp,gray,7x10]{jmlrbook}% print version, 7inx10in
  11. % Load last
  12. \ifprint{}{\usepackage{bookmark}}
  13. % Title is added to the PDF properties. Optional argument
  14. % is used instead, if present.
  15. %\title[Short Title]{Big Long Title}
  16. \title{A Sample Book}
  17. \author[Anne Editor et al.]{Anne Editor, Anne Other Editor and Nicola Talbot}
  18. % change the arguments, as appropriate, in the following:
  19. \volume{1}
  20. \subtitle{Making a Book from JMLR Articles}
  21. \logo{\includegraphics{bookLogo}}
  22. \team{The Sample Book Team}
  23. \productioneditor{Nicola Talbot}
  24. \begin{document}
  25. \maketitle
  26. \frontmatter
  27. \chapter{Foreword}
  28. This is an example book that combines multiple articles. Each
  29. article uses the \textsf{jmlr} class file. \emph{The articles
  30. should not need to be edited in order to combine them using this
  31. class file.}\footnote{Unless the authors have done something
  32. weird or have used problematic packages.} In particular, you
  33. don't need to delete \verb|\documentclass|,
  34. \verb|\begin{document}| and \verb|\end{document}|. The articles
  35. should be able to compile on their own or as part of this book.
  36. In the preamble of the book, you need to include the packages
  37. that the articles include, but you don't need to include
  38. any packages that are automatically loaded by the \textsf{jmlr}
  39. class (\textsf{amsmath}, \textsf{amssymb}, \textsf{natbib},
  40. \textsf{graphicx}, \textsf{url}, \textsf{xcolor} and
  41. \textsf{algorithm2e}). You also don't need to include the
  42. \textsf{hyperref} and \textsf{combnat} packages as they are
  43. automatically loaded by \textsf{jmlrbook}. For example, some of the
  44. articles imported in this book use the \textsf{lipsum} package,
  45. so that package needs to be included in the preamble of the
  46. book.
  47. Commands defined in the imported articles will be local to that
  48. article unless \verb|\gdef| or \verb|\global| has been used. This
  49. means that if more than one article has defined the same command,
  50. there shouldn't be a conflict unless the command has been defined
  51. globally. For example, \texttt{paper1/paper1.tex} and
  52. \texttt{paper2/paper2.tex} both define \verb|\samplecommand|, but
  53. since \verb|\newcommand| has been used, rather than \verb|\gdef|,
  54. there's no conflict. However, a problem will occur if the same
  55. command is also defined in this document before either of those
  56. files are imported.
  57. Many packages must be loaded before \textsf{hyperref}. If these
  58. packages haven't been loaded by \textsf{jmlr}, you will need
  59. to specify them using \textsf{jmlrbook}'s \verb|\jmlrprehyperref|
  60. hook. For example, to load the packages ``foo'' and ``bar'':
  61. \begin{verbatim}
  62. \def\jmlrprehyperref{\usepackage{foo}\usepackage{bar}}
  63. \documentclass{jmlrbook}
  64. \end{verbatim}
  65. or:
  66. \begin{verbatim}
  67. \def\jmlrprehyperref{\usepackage{foo,bar}}
  68. \documentclass{jmlrbook}
  69. \end{verbatim}
  70. The imported papers need to be placed inside the
  71. \texttt{jmlrpapers} environment. Papers that have already
  72. been published should be included using \verb|\importpubpaper|
  73. and papers that haven't been published elsewhere should be
  74. imported using \verb|\importarticle|. Both commands have an
  75. optional argument that specifies the prefix to use in the labels
  76. within the imported article. If omitted, the article's file
  77. name is used.
  78. Both articles and the book may have appendices and parts created.
  79. Parts are created using \verb|\part|\{\emph{title}\}. Switch
  80. to appendices using \verb|\appendix| and then use \verb|\chapter|
  81. (for the book) or \verb|\section| (in imported articles).
  82. Cross-referencing other parts of the book is done using the
  83. usual \verb|\label| and \verb|\ref| mechanism. The \textsf{jmlr}
  84. class additional provides convenience commands such as
  85. \verb|\sectionref| and \verb|\figureref|. Unlike \verb|\ref|,
  86. these commands may take a comma-separated list of labels as the
  87. argument.
  88. The \textsf{jmlrbook} additionally provides \verb|\chapterref|
  89. (which can take a comma-separated list of labels) and commands
  90. to reference imported articles (which take a single label
  91. as the argument): \verb|\articlepageref| (the starting page of
  92. the article), \verb|\articlepagesref| (the page range for the
  93. article), \verb|\articletitleref| (the short title for the
  94. article) and \verb|\articleauthorref| (the article's author).
  95. You may also cross-reference parts of the imported articles,
  96. but you need to prefix the label with the label supplied
  97. in the optional argument of \verb|\importpubpaper| or
  98. \verb|\importarticle|. (If omitted, this is given by
  99. directory/file name.)
  100. For example, the first appendix in this book is
  101. \appendixref{apd:first}, but the first appendix in
  102. ``\articletitleref{paper1/paper1}'' by
  103. \articleauthorref{paper1/paper1}
  104. (pp.~\articlepagesref{paper1/paper1}) is
  105. \appendixref{paper1/paper1apd:first}.
  106. Here's a reference to a couple of tables in
  107. \articletitleref{paper1/paper1}:
  108. \tableref{paper1/paper1tab:sample,paper1/paper1tab:sample2}.
  109. The author of a foreword (or other chapter) can sign off using
  110. the \texttt{authorsignoff} environment. Each author should be
  111. specified using \verb|\Author|.
  112. \begin{authorsignoff}
  113. \Author{Nicola Talbot\\
  114. University of East Anglia}
  115. \end{authorsignoff}
  116. \begin{preface}
  117. The preface environment should be used for the preface if you want
  118. makejmlrbook to extract the preface and turn it into a standalone
  119. document.
  120. The editorial team can sign off at the end of the preface using
  121. the \texttt{signoff} environment. This has two arguments: the
  122. optional argument is a name for the editorial team (defaults to
  123. ``The Editorial Team'') and the mandatory argument is the date.
  124. Within the environment, use \verb|\Editor| for each editor.
  125. \begin{signoff}{March 2010}
  126. % First editor:
  127. \Editor{Nicola Talbot\\
  128. University of East Anglia\\
  129. \mailto{N.Talbot@uea.ac.uk}}
  130. % Second editor:
  131. \Editor{Anne Editor\\
  132. University of Nowhere\\
  133. \mailto{ae@sample.com}}
  134. \end{signoff}
  135. \end{preface}
  136. \tableofcontents
  137. \mainmatter
  138. \part{First Part of the Book}
  139. \chapter{Introduction}
  140. This is an introduction to the book.
  141. \section{Sample Section}
  142. This is a section in the introduction.
  143. \subsection{Sample Sub-Section}
  144. This is a sub-section.
  145. \subsubsection{Sample Sub-Sub-Section}
  146. This is a sub-sub-section.
  147. \paragraph{Sample Sub-Sub-Sub-Section}
  148. This is a sub-sub-sub-section.
  149. \subparagraph{Sample Sub-Sub-Sub-Sub-Section}
  150. This is a sub-sub-sub-sub-section.
  151. % Add a part to the TOC but don't print anything
  152. \addtocpart{Papers Published in JMLR W\&CP}
  153. \begin{jmlrpapers}
  154. % Prepublished papers are imported using:
  155. % \importpubpaper[label]{dir}{file}{pages}
  156. % pages refers to the page range in the original publication
  157. % which doesn't necessarily correspond to the page numbers in
  158. % this book.
  159. \importpubpaper{paper1}{paper1}{23--45}
  160. \importpubpaper{paper2}{paper2}{63--70}
  161. \end{jmlrpapers}
  162. % Add a part to the TOC but don't print anything
  163. \addtocpart{Unpublished Papers}
  164. \begin{jmlrpapers}
  165. % Unpublished papers are imported using:
  166. % \importarticle[label]{dir}{file}
  167. \importarticle{paper3}{paper3}
  168. \importarticle{paper4}{paper4}
  169. \end{jmlrpapers}
  170. \appendix
  171. \part{First Part of Appendices}\label{pt:apd1}
  172. \chapter*{Introduction}
  173. This is an introduction to \partref{pt:apd1}.
  174. \chapter{First Appendix}
  175. \label{apd:first}
  176. This is an appendix.
  177. \chapter{Second Appendix}
  178. \label{apd:second}
  179. This is another appendix.
  180. \lipsum
  181. \part{Second Part of Appendices}
  182. \chapter{An Appendix}
  183. \label{apd:third}
  184. This is an appendix in another part.
  185. \lipsum
  186. \end{document}