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.

840 lines
28 KiB

4 years ago
  1. % use the "wcp" class option for workshop and conference
  2. % proceedings
  3. %\documentclass[gray]{jmlr} % test grayscale version
  4. %\documentclass[tablecaption=bottom]{jmlr}% journal article
  5. \documentclass[tablecaption=bottom,wcp]{jmlr} % W&CP article
  6. % The following packages will be automatically loaded:
  7. % amsmath, amssymb, natbib, graphicx, url, algorithm2e
  8. %\usepackage{rotating}% for sideways figures and tables
  9. %\usepackage{longtable}% for long tables
  10. % The booktabs package is used by this sample document
  11. % (it provides \toprule, \midrule and \bottomrule).
  12. % Remove the next line if you don't require it.
  13. \usepackage{booktabs}
  14. % The siunitx package is used by this sample document
  15. % to align numbers in a column by their decimal point.
  16. % Remove the next line if you don't require it.
  17. \usepackage[load-configurations=version-1]{siunitx} % newer version
  18. %\usepackage{siunitx}
  19. % The following command is just for this sample document:
  20. \newcommand{\cs}[1]{\texttt{\char`\\#1}}% remove this in your real article
  21. % Define an unnumbered theorem just for this sample document for
  22. % illustrative purposes:
  23. \theorembodyfont{\upshape}
  24. \theoremheaderfont{\scshape}
  25. \theorempostheader{:}
  26. \theoremsep{\newline}
  27. \newtheorem*{note}{Note}
  28. % change the arguments, as appropriate, in the following:
  29. \jmlrvolume{1}
  30. \jmlryear{2010}
  31. \jmlrsubmitted{submission date}
  32. \jmlrpublished{publication date}
  33. \jmlrworkshop{workshop title} % W&CP title
  34. % The optional argument of \title is used in the header
  35. \title[Short Title]{Full Title of Article\titlebreak This Title Has
  36. A Line Break}
  37. % Anything in the title that should appear in the main title but
  38. % not in the article's header or the volume's table of
  39. % contents should be placed inside \titletag{}
  40. %\title{Title of the Article\titletag{\thanks{Some footnote}}}
  41. % Use \Name{Author Name} to specify the name.
  42. % If the surname contains spaces, enclose the surname
  43. % in braces, e.g. \Name{John {Smith Jones}} similarly
  44. % if the name has a "von" part, e.g \Name{Jane {de Winter}}.
  45. % If the first letter in the forenames is a diacritic
  46. % enclose the diacritic in braces, e.g. \Name{{\'E}louise Smith}
  47. % \thanks must come after \Name{...} not inside the argument for
  48. % example \Name{John Smith}\nametag{\thanks{A note}} NOT \Name{John
  49. % Smith\thanks{A note}}
  50. % Anything in the name that should appear in the title but not in the
  51. % article's header or footer or in the volume's
  52. % table of contents should be placed inside \nametag{}
  53. % Two authors with the same address
  54. \author{\Name{Author Name1\nametag{\thanks{A note}}} \Email{abc@sample.com}\and
  55. \Name{Author Name2} \Email{xyz@sample.com}\\
  56. \addr Address}
  57. % Three or more authors with the same address:
  58. % \author{\Name{Author Name1} \Email{an1@sample.com}\\
  59. % \Name{Author Name2} \Email{an2@sample.com}\\
  60. % \Name{Author Name3} \Email{an3@sample.com}\\
  61. % \Name{Author Name4} \Email{an4@sample.com}\\
  62. % \Name{Author Name5} \Email{an5@sample.com}\\
  63. % \Name{Author Name6} \Email{an6@sample.com}\\
  64. % \Name{Author Name7} \Email{an7@sample.com}\\
  65. % \Name{Author Name8} \Email{an8@sample.com}\\
  66. % \Name{Author Name9} \Email{an9@sample.com}\\
  67. % \Name{Author Name10} \Email{an10@sample.com}\\
  68. % \Name{Author Name11} \Email{an11@sample.com}\\
  69. % \Name{Author Name12} \Email{an12@sample.com}\\
  70. % \Name{Author Name13} \Email{an13@sample.com}\\
  71. % \Name{Author Name14} \Email{an14@sample.com}\\
  72. % \addr Address}
  73. % Authors with different addresses:
  74. % \author{\Name{Author Name1} \Email{abc@sample.com}\\
  75. % \addr Address 1
  76. % \AND
  77. % \Name{Author Name2} \Email{xyz@sample.com}\\
  78. % \addr Address 2
  79. %}
  80. \editor{Editor's name}
  81. %\editors{Editor One and Editor Two}% for multiple editors
  82. \begin{document}
  83. \maketitle
  84. \begin{abstract}
  85. This is the abstract for this article.
  86. \end{abstract}
  87. \begin{keywords}
  88. List of keywords
  89. \end{keywords}
  90. \section{Introduction}
  91. \label{sec:intro}
  92. This is a sample article that uses the \textsf{jmlr} class with
  93. the \texttt{wcp} class option. Please follow the guidelines in
  94. this sample document as it can help to reduce complications when
  95. combining the articles into a book. Please avoid using obsolete
  96. commands, such as \verb|\rm|, and obsolete packages, such as
  97. \textsf{epsfig}.\footnote{See
  98. \url{http://www.ctan.org/pkg/l2tabu}} Some packages that are known
  99. to cause problems for the production editing process are checked for
  100. by the \textsf{jmlr} class and will generate an error. (If you want
  101. to know more about the production editing process, have a look at
  102. the video tutorials for the production editors at
  103. \url{http://www.dickimaw-books.com/software/makejmlrbookgui/videos/}.)
  104. Please also ensure that your document will compile with PDF\LaTeX.
  105. If you have an error message that's puzzling you, first check for it
  106. at the UK TUG FAQ
  107. \url{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=man-latex}. If
  108. that doesn't help, create a minimal working example (see
  109. \url{http://theoval.cmp.uea.ac.uk/~nlct/latex/minexample/}) and post
  110. to somewhere like \TeX\ on StackExchange
  111. (\url{http://tex.stackexchange.com/}) or the \LaTeX\ Community Forum
  112. (\url{http://www.latex-community.org/forum/}).
  113. \begin{note}
  114. This is an numbered theorem-like environment that was defined in
  115. this document's preamble.
  116. \end{note}
  117. \subsection{Sub-sections}
  118. Sub-sections are produced using \verb|\subsection|.
  119. \subsubsection{Sub-sub-sections}
  120. Sub-sub-sections are produced using \verb|\subsubsection|.
  121. \paragraph{Sub-sub-sub-sections}
  122. Sub-sub-sub-sections are produced using \verb|\paragraph|.
  123. These are unnumbered with a running head.
  124. \subparagraph{Sub-sub-sub-sub-sections}
  125. Sub-sub-sub-sub-sections are produced using \verb|\subparagraph|.
  126. These are unnumbered with a running head.
  127. \section{Cross-Referencing}
  128. Always use \verb|\label| and \verb|\ref| (or one of the commands
  129. described below) when cross-referencing. For example, the next
  130. section is Section~\ref{sec:math} but you can also refer to it using
  131. \sectionref{sec:math}. The \textsf{jmlr} class
  132. provides some convenient cross-referencing commands:
  133. \verb|\sectionref|, \verb|\equationref|, \verb|\tableref|,
  134. \verb|\figureref|, \verb|\algorithmref|, \verb|\theoremref|,
  135. \verb|\lemmaref|, \verb|\remarkref|, \verb|\corollaryref|,
  136. \verb|\definitionref|, \verb|\conjectureref|, \verb|\axiomref|,
  137. \verb|\exampleref| and \verb|\appendixref|. The argument of these
  138. commands may either be a single label or a comma-separated list
  139. of labels. Examples:
  140. Referencing sections: \sectionref{sec:math} or
  141. \sectionref{sec:intro,sec:math} or
  142. \sectionref{sec:intro,sec:math,sec:tables,sec:figures}.
  143. Referencing equations: \equationref{eq:trigrule} or
  144. \equationref{eq:trigrule,eq:df} or
  145. \equationref{eq:trigrule,eq:f,eq:df,eq:y}.
  146. Referencing tables: \tableref{tab:operatornames} or
  147. \tableref{tab:operatornames,tab:example} or
  148. \tableref{tab:operatornames,tab:example,tab:example-booktabs}.
  149. Referencing figures: \figureref{fig:nodes} or
  150. \figureref{fig:nodes,fig:teximage} or
  151. \figureref{fig:nodes,fig:teximage,fig:subfigex} or
  152. \figureref{fig:circle,fig:square}.
  153. Referencing algorithms: \algorithmref{alg:gauss} or
  154. \algorithmref{alg:gauss,alg:moore} or
  155. \algorithmref{alg:gauss,alg:moore,alg:net}.
  156. Referencing theorem-like environments: \theoremref{thm:eigenpow},
  157. \lemmaref{lem:sample}, \remarkref{rem:sample},
  158. \corollaryref{cor:sample}, \definitionref{def:sample},
  159. \conjectureref{con:sample}, \axiomref{ax:sample} and
  160. \exampleref{ex:sample}.
  161. Referencing appendices: \appendixref{apd:first} or
  162. \appendixref{apd:first,apd:second}.
  163. \section{Equations}
  164. \label{sec:math}
  165. The \textsf{jmlr} class loads the \textsf{amsmath} package, so
  166. you can use any of the commands and environments defined there.
  167. (See the \textsf{amsmath} documentation for further
  168. details.\footnote{Either \texttt{texdoc amsmath} or
  169. \url{http://www.ctan.org/pkg/amsmath}})
  170. Unnumbered single-lined equations should be displayed using
  171. \verb|\[| and \verb|\]|. For example:
  172. \[E = m c^2\]
  173. or you can use the \texttt{displaymath} environment:
  174. \begin{displaymath}
  175. E = m c^2
  176. \end{displaymath}
  177. Numbered single-line equations should be displayed using the
  178. \texttt{equation} environment. For example:
  179. \begin{equation}\label{eq:trigrule}
  180. \cos^2\theta + \sin^2\theta \equiv 1
  181. \end{equation}
  182. This can be referenced using \verb|\label| and \verb|\equationref|.
  183. For example, \equationref{eq:trigrule}.
  184. Multi-lined numbered equations should be displayed using the
  185. \texttt{align} environment.\footnote{For reasons why you
  186. shouldn't use the obsolete \texttt{eqnarray} environment, see
  187. Lars Madsen, \emph{Avoid eqnarray!} TUGboat 33(1):21--25, 2012.} For example:
  188. \begin{align}
  189. f(x) &= x^2 + x\label{eq:f}\\
  190. f'(x) &= 2x + 1\label{eq:df}
  191. \end{align}
  192. Unnumbered multi-lined equations can be displayed using the
  193. \texttt{align*} environment. For example:
  194. \begin{align*}
  195. f(x) &= (x+1)(x-1)\\
  196. &= x^2 - 1
  197. \end{align*}
  198. If you want to mix numbered with unnumbered lines use the
  199. \texttt{align} environment and suppress unwanted line numbers with
  200. \verb|\nonumber|. For example:
  201. \begin{align}
  202. y &= x^2 + 3x - 2x + 1\nonumber\\
  203. &= x^2 + x + 1\label{eq:y}
  204. \end{align}
  205. An equation that is too long to fit on a single line can be
  206. displayed using the \texttt{split} environment.
  207. Text can be embedded in an equation using \verb|\text| or
  208. \verb|\intertext| (as used in \theoremref{thm:eigenpow}).
  209. See the \textsf{amsmath} documentation for further details.
  210. \subsection{Operator Names}
  211. \label{sec:op}
  212. Predefined operator names are listed in \tableref{tab:operatornames}.
  213. For additional operators, either use \verb|\operatorname|,
  214. for example $\operatorname{var}(X)$ or declare it with
  215. \verb|\DeclareMathOperator|, for example
  216. \begin{verbatim}
  217. \DeclareMathOperator{\var}{var}
  218. \end{verbatim}
  219. and then use this new command. If you want limits that go above and
  220. below the operator (like \verb|\sum|) use the starred versions
  221. (\verb|\operatorname*| or \verb|\DeclareMathOperator*|).
  222. \begin{table*}[htbp]
  223. \floatconts
  224. {tab:operatornames}%
  225. {\caption{Predefined Operator Names (taken from
  226. \textsf{amsmath} documentation)}}%
  227. {%
  228. \begin{tabular}{rlrlrlrl}
  229. \cs{arccos} & $\arccos$ & \cs{deg} & $\deg$ & \cs{lg} & $\lg$ & \cs{projlim} & $\projlim$ \\
  230. \cs{arcsin} & $\arcsin$ & \cs{det} & $\det$ & \cs{lim} & $\lim$ & \cs{sec} & $\sec$ \\
  231. \cs{arctan} & $\arctan$ & \cs{dim} & $\dim$ & \cs{liminf} & $\liminf$ & \cs{sin} & $\sin$ \\
  232. \cs{arg} & $\arg$ & \cs{exp} & $\exp$ & \cs{limsup} & $\limsup$ & \cs{sinh} & $\sinh$ \\
  233. \cs{cos} & $\cos$ & \cs{gcd} & $\gcd$ & \cs{ln} & $\ln$ & \cs{sup} & $\sup$ \\
  234. \cs{cosh} & $\cosh$ & \cs{hom} & $\hom$ & \cs{log} & $\log$ & \cs{tan} & $\tan$ \\
  235. \cs{cot} & $\cot$ & \cs{inf} & $\inf$ & \cs{max} & $\max$ & \cs{tanh} & $\tanh$ \\
  236. \cs{coth} & $\coth$ & \cs{injlim} & $\injlim$ & \cs{min} & $\min$ \\
  237. \cs{csc} & $\csc$ & \cs{ker} & $\ker$ & \cs{Pr} & $\Pr$
  238. \end{tabular}\par
  239. \begin{tabular}{rlrl}
  240. \cs{varlimsup} & $\varlimsup$
  241. & \cs{varinjlim} & $\varinjlim$\\
  242. \cs{varliminf} & $\varliminf$
  243. & \cs{varprojlim} & $\varprojlim$
  244. \end{tabular}
  245. }
  246. \end{table*}
  247. \section{Vectors and Sets}
  248. \label{sec:vec}
  249. Vectors should be typeset using \cs{vec}. For example $\vec{x}$.
  250. (The original version of \cs{vec} can also be accessed using
  251. \cs{orgvec}, for example $\orgvec{x}$.)
  252. The \textsf{jmlr} class also provides \cs{set} to typeset a
  253. set. For example $\set{S}$.
  254. \section{Floats}
  255. \label{sec:floats}
  256. Floats, such as figures, tables and algorithms, are moving
  257. objects and are supposed to float to the nearest convenient
  258. location. Please don't force them to go in a particular place. In
  259. general it's best to use the \texttt{htbp} specifier and don't
  260. put the figure or table in the middle of a paragraph (that is
  261. make sure there's a paragraph break above and below the float).
  262. Floats are supposed to have a little extra space above and below
  263. them to make them stand out from the rest of the text. This extra
  264. spacing is put in automatically and shouldn't need modifying.
  265. If your article will later be reprinted in the Challenges for
  266. Machine Learning, please be aware that the CiML books use a
  267. different paper size, so if you want to resize any images use a
  268. scale relative to the line width (\verb|\linewidth|), text width
  269. (\verb|\textwidth|) or text height (\verb|\textheight|).
  270. To ensure consistency, please \emph{don't} try changing the format of the caption by doing
  271. something like:
  272. \begin{verbatim}
  273. \caption{\textit{A Sample Caption.}}
  274. \end{verbatim}
  275. or
  276. \begin{verbatim}
  277. \caption{\em A Sample Caption.}
  278. \end{verbatim}
  279. You can, of course, change the font for individual words or
  280. phrases, for example:
  281. \begin{verbatim}
  282. \caption{A Sample Caption With Some \emph{Emphasized Words}.}
  283. \end{verbatim}
  284. \subsection{Tables}
  285. \label{sec:tables}
  286. Tables should go in the \texttt{table} environment. Within this
  287. environment use \verb|\floatconts| (defined by \textsf{jmlr})
  288. to set the caption correctly and center the table contents.
  289. The location of the caption depends on the \verb|tablecaption|
  290. setting in the document class options.
  291. \begin{table}[htbp]
  292. % The first argument is the label.
  293. % The caption goes in the second argument, and the table contents
  294. % go in the third argument.
  295. \floatconts
  296. {tab:example}%
  297. {\caption{An Example Table}}%
  298. {\begin{tabular}{ll}
  299. \bfseries Dataset & \bfseries Result\\
  300. Data1 & 0.12345\\
  301. Data2 & 0.67890\\
  302. Data3 & 0.54321\\
  303. Data4 & 0.09876
  304. \end{tabular}}
  305. \end{table}
  306. If you want horizontal rules you can use the \textsf{booktabs}
  307. package which provides the commands \verb|\toprule|,
  308. \verb|\midrule| and \verb|\bottomrule|. For example, see
  309. \tableref{tab:example-booktabs}.
  310. \begin{table}[hbtp]
  311. \floatconts
  312. {tab:example-booktabs}
  313. {\caption{A Table With Horizontal Lines}}
  314. {\begin{tabular}{ll}
  315. \toprule
  316. \bfseries Dataset & \bfseries Result\\
  317. \midrule
  318. Data1 & 0.12345\\
  319. Data2 & 0.67890\\
  320. Data3 & 0.54321\\
  321. Data4 & 0.09876\\
  322. \bottomrule
  323. \end{tabular}}
  324. \end{table}
  325. If you really want vertical lines as well, you can't use the
  326. \textsf{booktabs} commands as there'll be some unwanted gaps.
  327. Instead you can use \LaTeX's \verb|\hline|, but the rows may
  328. appear a bit cramped. You can add extra space above or below a
  329. row using \verb|\abovestrut| and \verb|\belowstrut|. For example,
  330. see \tableref{tab:example-hline}. However, you might want to read
  331. the \textsf{booktabs} documentation regarding the use of vertical
  332. lines.
  333. \begin{table}[htbp]
  334. \floatconts
  335. {tab:example-hline}
  336. {\caption{A Table With Horizontal and Vertical Lines}}%
  337. {%
  338. \begin{tabular}{|l|l|}
  339. \hline
  340. \abovestrut{2.2ex}\bfseries Dataset & \bfseries Result\\\hline
  341. \abovestrut{2.2ex}Data1 & 0.12345\\
  342. Data2 & 0.67890\\
  343. Data3 & 0.54321\\
  344. \belowstrut{0.2ex}Data4 & 0.09876\\\hline
  345. \end{tabular}
  346. }
  347. \end{table}
  348. If you want to align numbers on their decimal point, you can
  349. use the \textsf{siunitx} package. For example, see
  350. \tableref{tab:example-siunitx}. For further details see the
  351. \textsf{siunitx} documentation\footnote{Either \texttt{texdoc
  352. siunitx} or \url{http://www.ctan.org/pkg/siunitx}}.
  353. \begin{table}[htbp]
  354. \floatconts
  355. {tab:example-siunitx}
  356. {\caption{A Table With Numbers Aligned on the Decimal Point}}
  357. {\begin{tabular}{lS[tabformat=3.5]}
  358. \bfseries Dataset & {\bfseries Result}\\
  359. Data1 & 0.12345\\
  360. Data2 & 10.6789\\
  361. Data3 & 50.543\\
  362. Data4 & 200.09876
  363. \end{tabular}}
  364. \end{table}
  365. If the table is too wide, you can adjust the inter-column
  366. spacing by changing the value of \verb|\tabcolsep|. For
  367. example:
  368. \begin{verbatim}
  369. \setlength{\tabcolsep}{3pt}
  370. \end{verbatim}
  371. If the table is very wide but not very long, you can use the
  372. \texttt{sidewaystable} environment defined in the
  373. \textsf{rotating} package (so use \verb|\usepackage{rotating}|).
  374. If the table is too long to fit on a page, you can use the
  375. \texttt{longtable} environment defined in the \textsf{longtable}
  376. package (so use \verb|\usepackage{longtable}|).
  377. \subsection{Figures}
  378. \label{sec:figures}
  379. Figures should go in the \texttt{figure} environment. Within this
  380. environment, use \verb|\floatconts| to correctly position the
  381. caption and center the image. Use \verb|\includegraphics|
  382. for external graphics files but omit the file extension. Do not
  383. use \verb|\epsfig| or \verb|\psfig|. If you want to scale the
  384. image, it's better to use a fraction of the line width rather
  385. than an explicit length. For example, see \figureref{fig:nodes}.
  386. \begin{figure}[htbp]
  387. % Caption and label go in the first argument and the figure contents
  388. % go in the second argument
  389. \floatconts
  390. {fig:nodes}
  391. {\caption{Example Image}}
  392. {\includegraphics[width=0.5\linewidth]{images/nodes}}
  393. \end{figure}
  394. If your image is made up of \LaTeX\ code (for example, commands
  395. provided by the \textsf{pgf} package) you can include it using
  396. \cs{includeteximage} (defined by the \textsf{jmlr} class). This
  397. can be scaled and rotated in the same way as \cs{includegraphics}.
  398. For example, see \figureref{fig:teximage}.
  399. \begin{figure}[htbp]
  400. \floatconts
  401. {fig:teximage}
  402. {\caption{Image Created Using \LaTeX\ Code}}
  403. {\includeteximage[angle=45]{images/teximage}}
  404. \end{figure}
  405. If the figure is too wide to fit on the page, you can use the
  406. \texttt{sidewaysfigure} environment defined in the
  407. \textsf{rotating} package.
  408. Don't use \verb|\graphicspath|.\footnote{This is specific to the
  409. \textsf{jmlr} class, not a general recommendation. The main file
  410. that generates the proceedings or the CiML book is typically in a
  411. different directory to the imported articles, so it modifies the
  412. graphics path when it imports an article.} If the images
  413. are contained in a subdirectory, specify this when you include the image, for
  414. example \verb|\includegraphics{figures/mypic}|.
  415. \subsubsection{Sub-Figures}
  416. \label{sec:subfigures}
  417. Sub-figures can be created using \verb|\subfigure|, which is
  418. defined by the \textsf{jmlr} class. The optional argument allows
  419. you to provide a subcaption. The label should be placed in the
  420. mandatory argument of \verb|\subfigure|. You can reference the
  421. entire figure, for example \figureref{fig:subfigex}, or you can
  422. reference part of the figure using \verb|\figureref|, for example
  423. \figureref{fig:circle}. Alternatively you can reference the
  424. subfigure using \verb|\subfigref|, for example
  425. \subfigref{fig:circle,fig:square} in \figureref{fig:subfigex}.
  426. \begin{figure}[htbp]
  427. \floatconts
  428. {fig:subfigex}
  429. {\caption{An Example With Sub-Figures.}}
  430. {%
  431. \subfigure[A Circle]{\label{fig:circle}%
  432. \includegraphics[width=0.2\linewidth]{images/circle}}%
  433. \qquad
  434. \subfigure[A Square]{\label{fig:square}%
  435. \includegraphics[width=0.2\linewidth]{images/square}}
  436. }
  437. \end{figure}
  438. By default, the sub-figures are aligned on the baseline.
  439. This can be changed using the second optional argument
  440. of \verb|\subfigure|. This may be \texttt{t} (top), \texttt{c}
  441. (centered) or \texttt{b} (bottom). For example, the subfigures
  442. \subfigref{fig:circle2,fig:square2} in \figureref{fig:subfigex2}
  443. both have \verb|[c]| as the second optional argument.
  444. \begin{figure}[htbp]
  445. \floatconts
  446. {fig:subfigex2}
  447. {\caption{Another Example With Sub-Figures.}}
  448. {%
  449. \subfigure[A Small Circle][c]{\label{fig:circle2}%
  450. \includegraphics[width=0.1\linewidth]{images/circle}}%
  451. \qquad
  452. \subfigure[A Square][c]{\label{fig:square2}%
  453. \includegraphics[width=0.2\linewidth]{images/square}}
  454. }
  455. \end{figure}
  456. \subsection{Sub-Tables}
  457. \label{sec:subtables}
  458. There is an analogous command \verb|\subtable| for sub-tables.
  459. It has the same syntax as \verb|\subfigure| described above.
  460. You can reference the table using \verb|\tableref|, for example
  461. \tableref{tab:subtabex} or you can reference part of the table,
  462. for example \tableref{tab:ab}. Alternatively you can reference the
  463. subtable using \verb|\subtabref|, for example
  464. \subtabref{tab:ab,tab:cd} in \tableref{tab:subtabex}.
  465. \begin{table}[htbp]
  466. \floatconts
  467. {tab:subtabex}
  468. {\caption{An Example With Sub-Tables}}
  469. {%
  470. \subtable{%
  471. \label{tab:ab}%
  472. \begin{tabular}{cc}
  473. \bfseries A & \bfseries B\\
  474. 1 & 2
  475. \end{tabular}
  476. }\qquad
  477. \subtable{%
  478. \label{tab:cd}%
  479. \begin{tabular}{cc}
  480. \bfseries C & \bfseries D\\
  481. 3 & 4\\
  482. 5 & 6
  483. \end{tabular}
  484. }
  485. }
  486. \end{table}
  487. By default, the sub-tables are aligned on the top.
  488. This can be changed using the second optional argument
  489. of \verb|\subtable|. This may be \texttt{t} (top), \texttt{c}
  490. (centered) or \texttt{b} (bottom). For example, the sub-tables
  491. \subtabref{tab:ab2,tab:cd2} in \tableref{tab:subtabex2}
  492. both have \verb|[c]| as the second optional argument.
  493. \begin{table}[htbp]
  494. \floatconts
  495. {tab:subtabex2}
  496. {\caption{Another Example With Sub-Tables}}
  497. {%
  498. \subtable[][c]{%
  499. \label{tab:ab2}%
  500. \begin{tabular}{cc}
  501. \bfseries A & \bfseries B\\
  502. 1 & 2
  503. \end{tabular}
  504. }\qquad
  505. \subtable[][c]{%
  506. \label{tab:cd2}%
  507. \begin{tabular}{cc}
  508. \bfseries C & \bfseries D\\
  509. 3 & 4\\
  510. 5 & 6
  511. \end{tabular}
  512. }
  513. }
  514. \end{table}
  515. \subsection{Algorithms}
  516. \label{sec:algorithms}
  517. Enumerated textual algorithms can be displayed using the
  518. \texttt{algorithm} environment. Within this environment, use
  519. \verb|\caption| to set the caption and you can use an
  520. \texttt{enumerate} or nested \texttt{enumerate} environments.
  521. For example, see \algorithmref{alg:gauss}. Note that algorithms
  522. float like figures and tables.
  523. \begin{algorithm}[htbp]
  524. \floatconts
  525. {alg:gauss}%
  526. {\caption{The Gauss-Seidel Algorithm}}%
  527. {%
  528. \begin{enumerate}
  529. \item For $k=1$ to maximum number of iterations
  530. \begin{enumerate}
  531. \item For $i=1$ to $n$
  532. \begin{enumerate}
  533. \item $x_i^{(k)} =
  534. \frac{b_i - \sum_{j=1}^{i-1}a_{ij}x_j^{(k)}
  535. - \sum_{j=i+1}^{n}a_{ij}x_j^{(k-1)}}{a_{ii}}$
  536. \item If $\|\vec{x}^{(k)}-\vec{x}^{(k-1)} < \epsilon\|$,
  537. where $\epsilon$ is a specified stopping criteria, stop.
  538. \end{enumerate}
  539. \end{enumerate}
  540. \end{enumerate}
  541. }%
  542. \end{algorithm}
  543. If you'd rather have the same numbering throughout the algorithm
  544. but still want the convenient indentation of nested
  545. \texttt{enumerate} environments, you can use the
  546. \texttt{enumerate*} environment provided by the \textsf{jmlr}
  547. class. For example, see \algorithmref{alg:moore}.
  548. \begin{algorithm}
  549. \floatconts
  550. {alg:moore}%
  551. {\caption{Moore's Shortest Path}}%
  552. {%
  553. Given a connected graph $G$, where the length of each edge is 1:
  554. \begin{enumerate*}
  555. \item Set the label of vertex $s$ to 0
  556. \item Set $i=0$
  557. \begin{enumerate*}
  558. \item \label{step:locate}Locate all unlabelled vertices
  559. adjacent to a vertex labelled $i$ and label them $i+1$
  560. \item If vertex $t$ has been labelled,
  561. \begin{enumerate*}
  562. \item[] the shortest path can be found by backtracking, and
  563. the length is given by the label of $t$.
  564. \end{enumerate*}
  565. otherwise
  566. \begin{enumerate*}
  567. \item[] increment $i$ and return to step~\ref{step:locate}
  568. \end{enumerate*}
  569. \end{enumerate*}
  570. \end{enumerate*}
  571. }%
  572. \end{algorithm}
  573. Pseudo code can be displayed using the \texttt{algorithm2e}
  574. environment. This is defined by the \textsf{algorithm2e} package
  575. (which is automatically loaded) so check the \textsf{algorithm2e}
  576. documentation for further details.\footnote{Either \texttt{texdoc
  577. algorithm2e} or \url{http://www.ctan.org/pkg/algorithm2e}}
  578. For an example, see \algorithmref{alg:net}.
  579. \begin{algorithm2e}
  580. \caption{Computing Net Activation}
  581. \label{alg:net}
  582. % older versions of algorithm2e have \dontprintsemicolon instead
  583. % of the following:
  584. %\DontPrintSemicolon
  585. % older versions of algorithm2e have \linesnumbered instead of the
  586. % following:
  587. %\LinesNumbered
  588. \KwIn{$x_1, \ldots, x_n, w_1, \ldots, w_n$}
  589. \KwOut{$y$, the net activation}
  590. $y\leftarrow 0$\;
  591. \For{$i\leftarrow 1$ \KwTo $n$}{
  592. $y \leftarrow y + w_i*x_i$\;
  593. }
  594. \end{algorithm2e}
  595. \section{Description Lists}
  596. The \textsf{jmlr} class also provides a description-like
  597. environment called \texttt{altdescription}. This has an
  598. argument that should be the widest label in the list. Compare:
  599. \begin{description}
  600. \item[add] A method that adds two variables.
  601. \item[differentiate] A method that differentiates a function.
  602. \end{description}
  603. with
  604. \begin{altdescription}{differentiate}
  605. \item[add] A method that adds two variables.
  606. \item[differentiate] A method that differentiates a function.
  607. \end{altdescription}
  608. \section{Theorems, Lemmas etc}
  609. \label{sec:theorems}
  610. The following theorem-like environments are predefined by
  611. the \textsf{jmlr} class: \texttt{theorem}, \texttt{example},
  612. \texttt{lemma}, \texttt{proposition}, \texttt{remark},
  613. \texttt{corollary}, \texttt{definition}, \texttt{conjecture}
  614. and \texttt{axiom}. You can use the \texttt{proof} environment
  615. to display the proof if need be, as in \theoremref{thm:eigenpow}.
  616. \begin{theorem}[Eigenvalue Powers]\label{thm:eigenpow}
  617. If $\lambda$ is an eigenvalue of $\vec{B}$ with eigenvector
  618. $\vec{\xi}$, then $\lambda^n$ is an eigenvalue of $\vec{B}^n$
  619. with eigenvector $\vec{\xi}$.
  620. \begin{proof}
  621. Let $\lambda$ be an eigenvalue of $\vec{B}$ with eigenvector
  622. $\xi$, then
  623. \begin{align*}
  624. \vec{B}\vec{\xi} &= \lambda\vec{\xi}
  625. \intertext{premultiply by $\vec{B}$:}
  626. \vec{B}\vec{B}\vec{\xi} &= \vec{B}\lambda\vec{\xi}\\
  627. \Rightarrow \vec{B}^2\vec{\xi} &= \lambda\vec{B}\vec{\xi}\\
  628. &= \lambda\lambda\vec{\xi}\qquad
  629. \text{since }\vec{B}\vec{\xi}=\lambda\vec{\xi}\\
  630. &= \lambda^2\vec{\xi}
  631. \end{align*}
  632. Therefore true for $n=2$. Now assume true for $n=k$:
  633. \begin{align*}
  634. \vec{B}^k\vec{\xi} &= \lambda^k\vec{\xi}
  635. \intertext{premultiply by $\vec{B}$:}
  636. \vec{B}\vec{B}^k\vec{\xi} &= \vec{B}\lambda^k\vec{\xi}\\
  637. \Rightarrow \vec{B}^{k+1}\vec{\xi} &= \lambda^k\vec{B}\vec{\xi}\\
  638. &= \lambda^k\lambda\vec{\xi}\qquad
  639. \text{since }\vec{B}\vec{\xi}=\lambda\vec{\xi}\\
  640. &= \lambda^{k+1}\vec{\xi}
  641. \end{align*}
  642. Therefore true for $n=k+1$. Therefore, by induction, true for all
  643. $n$.
  644. \end{proof}
  645. \end{theorem}
  646. \begin{lemma}[A Sample Lemma]\label{lem:sample}
  647. This is a lemma.
  648. \end{lemma}
  649. \begin{remark}[A Sample Remark]\label{rem:sample}
  650. This is a remark.
  651. \end{remark}
  652. \begin{corollary}[A Sample Corollary]\label{cor:sample}
  653. This is a corollary.
  654. \end{corollary}
  655. \begin{definition}[A Sample Definition]\label{def:sample}
  656. This is a definition.
  657. \end{definition}
  658. \begin{conjecture}[A Sample Conjecture]\label{con:sample}
  659. This is a conjecture.
  660. \end{conjecture}
  661. \begin{axiom}[A Sample Axiom]\label{ax:sample}
  662. This is an axiom.
  663. \end{axiom}
  664. \begin{example}[An Example]\label{ex:sample}
  665. This is an example.
  666. \end{example}
  667. \section{Color vs Grayscale}
  668. \label{sec:color}
  669. It's helpful if authors supply grayscale versions of their
  670. images in the event that the article is to be incorporated into
  671. a black and white printed book. With external PDF, PNG or JPG
  672. graphic files, you just need to supply a grayscale version of the
  673. file. For example, if the file is called \texttt{myimage.png},
  674. then the gray version should be \texttt{myimage-gray.png} or
  675. \texttt{myimage-gray.pdf} or \texttt{myimage-gray.jpg}. You don't
  676. need to modify your code. The \textsf{jmlr} class checks for
  677. the existence of the grayscale version if it is print mode
  678. (provided you have used \verb|\includegraphics| and haven't
  679. specified the file extension).
  680. You can use \verb|\ifprint| to determine which mode you are in.
  681. For example, in \figureref{fig:nodes}, the
  682. \ifprint{dark gray}{purple} ellipse represents an input and the
  683. \ifprint{light gray}{yellow} ellipse represents an output.
  684. Another example: {\ifprint{\bfseries}{\color{red}}important text!}
  685. You can use the class option \texttt{gray} to see how the
  686. document will appear in gray scale mode. \textcolor{blue}{Colored
  687. text} will automatically be converted to gray scale in print mode.
  688. The \textsf{jmlr} class loads the \textsf{xcolor}
  689. package, so you can also define your own colors. For example:
  690. \ifprint
  691. {\definecolor{myred}{gray}{0.5}}%
  692. {\definecolor{myred}{rgb}{0.5,0,0}}%
  693. \textcolor{myred}{XYZ}.
  694. The \textsf{xcolor} class is loaded with the \texttt{x11names}
  695. option, so you can use any of the x11 predefined colors (listed
  696. in the \textsf{xcolor} documentation\footnote{either
  697. \texttt{texdoc xcolor} or \url{http://www.ctan.org/pkg/xcolor}}).
  698. \section{Citations and Bibliography}
  699. \label{sec:cite}
  700. The \textsf{jmlr} class automatically loads \textsf{natbib}
  701. and automatically sets the bibliography style, so you don't need to
  702. use \verb|\bibliographystyle|.
  703. This sample file has the citations defined in the accompanying
  704. BibTeX file \texttt{jmlr-sample.bib}. For a parenthetical
  705. citation use \verb|\citep|. For example
  706. \citep{guyon-elisseeff-03}. For a textual citation use
  707. \verb|\citet|. For example \citet{guyon2007causalreport}.
  708. Both commands may take a comma-separated list, for example
  709. \citet{guyon-elisseeff-03,guyon2007causalreport}.
  710. These commands have optional arguments and have a starred
  711. version. See the \textsf{natbib} documentation for further
  712. details.\footnote{Either \texttt{texdoc natbib} or
  713. \url{http://www.ctan.org/pkg/natbib}}
  714. The bibliography is displayed using \verb|\bibliography|.
  715. \acks{Acknowledgements go here.}
  716. \bibliography{jmlr-sample}
  717. \appendix
  718. \section{First Appendix}\label{apd:first}
  719. This is the first appendix.
  720. \section{Second Appendix}\label{apd:second}
  721. This is the second appendix.
  722. \end{document}