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.

789 lines
26 KiB

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