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