No Description
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.

nips_2018.sty 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  1. % partial rewrite of the LaTeX2e package for submissions to the
  2. % Conference on Neural Information Processing Systems (NIPS):
  3. %
  4. % - uses more LaTeX conventions
  5. % - line numbers at submission time replaced with aligned numbers from
  6. % lineno package
  7. % - \nipsfinalcopy replaced with [final] package option
  8. % - automatically loads times package for authors
  9. % - loads natbib automatically; this can be suppressed with the
  10. % [nonatbib] package option
  11. % - adds foot line to first page identifying the conference
  12. % - adds preprint option for submission to e.g. arXiv
  13. %
  14. % Roman Garnett (garnett@wustl.edu) and the many authors of
  15. % nips15submit_e.sty, including MK and drstrip@sandia
  16. %
  17. % last revision: March 2018
  18. \NeedsTeXFormat{LaTeX2e}
  19. \ProvidesPackage{nips_2018}[2018/03/03 NIPS 2018 submission/camera-ready style file]
  20. % declare final option, which creates camera-ready copy
  21. \newif\if@nipsfinal\@nipsfinalfalse
  22. \DeclareOption{final}{
  23. \@nipsfinaltrue
  24. }
  25. % declare nonatbib option, which does not load natbib in case of
  26. % package clash (users can pass options to natbib via
  27. % \PassOptionsToPackage)
  28. \newif\if@natbib\@natbibtrue
  29. \DeclareOption{nonatbib}{
  30. \@natbibfalse
  31. }
  32. % declare preprint option, which creates a preprint version ready for
  33. % upload to, e.g., arXiv
  34. \newif\if@preprint\@preprintfalse
  35. \DeclareOption{preprint}{
  36. \@preprinttrue
  37. }
  38. \ProcessOptions\relax
  39. % determine whether this is an anonymized submission
  40. \newif\if@submission\@submissiontrue
  41. \if@nipsfinal\@submissionfalse\fi
  42. \if@preprint\@submissionfalse\fi
  43. % fonts
  44. \renewcommand{\rmdefault}{ptm}
  45. \renewcommand{\sfdefault}{phv}
  46. % change this every year for notice string at bottom
  47. \newcommand{\@nipsordinal}{32nd}
  48. \newcommand{\@nipsyear}{2018}
  49. \newcommand{\@nipslocation}{Montr\'{e}al, Canada}
  50. % handle tweaks for camera-ready copy vs. submission copy
  51. \if@preprint
  52. \newcommand{\@noticestring}{%
  53. Preprint. Work in progress.%
  54. }
  55. \else
  56. \if@nipsfinal
  57. \newcommand{\@noticestring}{%
  58. \@nipsordinal\/ Conference on Neural Information Processing Systems
  59. (NIPS \@nipsyear), \@nipslocation.%
  60. }
  61. \else
  62. \newcommand{\@noticestring}{%
  63. Submitted to \@nipsordinal\/ Conference on Neural Information
  64. Processing Systems (NIPS \@nipsyear). Do not distribute.%
  65. }
  66. % line numbers for submission
  67. \RequirePackage{lineno}
  68. \linenumbers
  69. % fix incompatibilities between lineno and amsmath, if required, by
  70. % transparently wrapping linenomath environments around amsmath
  71. % environments
  72. \AtBeginDocument{%
  73. \@ifpackageloaded{amsmath}{%
  74. \newcommand*\patchAmsMathEnvironmentForLineno[1]{%
  75. \expandafter\let\csname old#1\expandafter\endcsname\csname #1\endcsname
  76. \expandafter\let\csname oldend#1\expandafter\endcsname\csname end#1\endcsname
  77. \renewenvironment{#1}%
  78. {\linenomath\csname old#1\endcsname}%
  79. {\csname oldend#1\endcsname\endlinenomath}%
  80. }%
  81. \newcommand*\patchBothAmsMathEnvironmentsForLineno[1]{%
  82. \patchAmsMathEnvironmentForLineno{#1}%
  83. \patchAmsMathEnvironmentForLineno{#1*}%
  84. }%
  85. \patchBothAmsMathEnvironmentsForLineno{equation}%
  86. \patchBothAmsMathEnvironmentsForLineno{align}%
  87. \patchBothAmsMathEnvironmentsForLineno{flalign}%
  88. \patchBothAmsMathEnvironmentsForLineno{alignat}%
  89. \patchBothAmsMathEnvironmentsForLineno{gather}%
  90. \patchBothAmsMathEnvironmentsForLineno{multline}%
  91. }{}
  92. }
  93. \fi
  94. \fi
  95. % load natbib unless told otherwise
  96. \if@natbib
  97. \RequirePackage{natbib}
  98. \fi
  99. % set page geometry
  100. \usepackage[verbose=true,letterpaper]{geometry}
  101. \AtBeginDocument{
  102. \newgeometry{
  103. textheight=9in,
  104. textwidth=5.5in,
  105. top=1in,
  106. headheight=12pt,
  107. headsep=25pt,
  108. footskip=30pt
  109. }
  110. \@ifpackageloaded{fullpage}
  111. {\PackageWarning{nips_2018}{fullpage package not allowed! Overwriting formatting.}}
  112. {}
  113. }
  114. \widowpenalty=10000
  115. \clubpenalty=10000
  116. \flushbottom
  117. \sloppy
  118. % font sizes with reduced leading
  119. \renewcommand{\normalsize}{%
  120. \@setfontsize\normalsize\@xpt\@xipt
  121. \abovedisplayskip 7\p@ \@plus 2\p@ \@minus 5\p@
  122. \abovedisplayshortskip \z@ \@plus 3\p@
  123. \belowdisplayskip \abovedisplayskip
  124. \belowdisplayshortskip 4\p@ \@plus 3\p@ \@minus 3\p@
  125. }
  126. \normalsize
  127. \renewcommand{\small}{%
  128. \@setfontsize\small\@ixpt\@xpt
  129. \abovedisplayskip 6\p@ \@plus 1.5\p@ \@minus 4\p@
  130. \abovedisplayshortskip \z@ \@plus 2\p@
  131. \belowdisplayskip \abovedisplayskip
  132. \belowdisplayshortskip 3\p@ \@plus 2\p@ \@minus 2\p@
  133. }
  134. \renewcommand{\footnotesize}{\@setfontsize\footnotesize\@ixpt\@xpt}
  135. \renewcommand{\scriptsize}{\@setfontsize\scriptsize\@viipt\@viiipt}
  136. \renewcommand{\tiny}{\@setfontsize\tiny\@vipt\@viipt}
  137. \renewcommand{\large}{\@setfontsize\large\@xiipt{14}}
  138. \renewcommand{\Large}{\@setfontsize\Large\@xivpt{16}}
  139. \renewcommand{\LARGE}{\@setfontsize\LARGE\@xviipt{20}}
  140. \renewcommand{\huge}{\@setfontsize\huge\@xxpt{23}}
  141. \renewcommand{\Huge}{\@setfontsize\Huge\@xxvpt{28}}
  142. % sections with less space
  143. \providecommand{\section}{}
  144. \renewcommand{\section}{%
  145. \@startsection{section}{1}{\z@}%
  146. {-2.0ex \@plus -0.5ex \@minus -0.2ex}%
  147. { 1.5ex \@plus 0.3ex \@minus 0.2ex}%
  148. {\large\bf\raggedright}%
  149. }
  150. \providecommand{\subsection}{}
  151. \renewcommand{\subsection}{%
  152. \@startsection{subsection}{2}{\z@}%
  153. {-1.8ex \@plus -0.5ex \@minus -0.2ex}%
  154. { 0.8ex \@plus 0.2ex}%
  155. {\normalsize\bf\raggedright}%
  156. }
  157. \providecommand{\subsubsection}{}
  158. \renewcommand{\subsubsection}{%
  159. \@startsection{subsubsection}{3}{\z@}%
  160. {-1.5ex \@plus -0.5ex \@minus -0.2ex}%
  161. { 0.5ex \@plus 0.2ex}%
  162. {\normalsize\bf\raggedright}%
  163. }
  164. \providecommand{\paragraph}{}
  165. \renewcommand{\paragraph}{%
  166. \@startsection{paragraph}{4}{\z@}%
  167. {1.5ex \@plus 0.5ex \@minus 0.2ex}%
  168. {-1em}%
  169. {\normalsize\bf}%
  170. }
  171. \providecommand{\subparagraph}{}
  172. \renewcommand{\subparagraph}{%
  173. \@startsection{subparagraph}{5}{\z@}%
  174. {1.5ex \@plus 0.5ex \@minus 0.2ex}%
  175. {-1em}%
  176. {\normalsize\bf}%
  177. }
  178. \providecommand{\subsubsubsection}{}
  179. \renewcommand{\subsubsubsection}{%
  180. \vskip5pt{\noindent\normalsize\rm\raggedright}%
  181. }
  182. % float placement
  183. \renewcommand{\topfraction }{0.85}
  184. \renewcommand{\bottomfraction }{0.4}
  185. \renewcommand{\textfraction }{0.1}
  186. \renewcommand{\floatpagefraction}{0.7}
  187. \newlength{\@nipsabovecaptionskip}\setlength{\@nipsabovecaptionskip}{7\p@}
  188. \newlength{\@nipsbelowcaptionskip}\setlength{\@nipsbelowcaptionskip}{\z@}
  189. \setlength{\abovecaptionskip}{\@nipsabovecaptionskip}
  190. \setlength{\belowcaptionskip}{\@nipsbelowcaptionskip}
  191. % swap above/belowcaptionskip lengths for tables
  192. \renewenvironment{table}
  193. {\setlength{\abovecaptionskip}{\@nipsbelowcaptionskip}%
  194. \setlength{\belowcaptionskip}{\@nipsabovecaptionskip}%
  195. \@float{table}}
  196. {\end@float}
  197. % footnote formatting
  198. \setlength{\footnotesep }{6.65\p@}
  199. \setlength{\skip\footins}{9\p@ \@plus 4\p@ \@minus 2\p@}
  200. \renewcommand{\footnoterule}{\kern-3\p@ \hrule width 12pc \kern 2.6\p@}
  201. \setcounter{footnote}{0}
  202. % paragraph formatting
  203. \setlength{\parindent}{\z@}
  204. \setlength{\parskip }{5.5\p@}
  205. % list formatting
  206. \setlength{\topsep }{4\p@ \@plus 1\p@ \@minus 2\p@}
  207. \setlength{\partopsep }{1\p@ \@plus 0.5\p@ \@minus 0.5\p@}
  208. \setlength{\itemsep }{2\p@ \@plus 1\p@ \@minus 0.5\p@}
  209. \setlength{\parsep }{2\p@ \@plus 1\p@ \@minus 0.5\p@}
  210. \setlength{\leftmargin }{3pc}
  211. \setlength{\leftmargini }{\leftmargin}
  212. \setlength{\leftmarginii }{2em}
  213. \setlength{\leftmarginiii}{1.5em}
  214. \setlength{\leftmarginiv }{1.0em}
  215. \setlength{\leftmarginv }{0.5em}
  216. \def\@listi {\leftmargin\leftmargini}
  217. \def\@listii {\leftmargin\leftmarginii
  218. \labelwidth\leftmarginii
  219. \advance\labelwidth-\labelsep
  220. \topsep 2\p@ \@plus 1\p@ \@minus 0.5\p@
  221. \parsep 1\p@ \@plus 0.5\p@ \@minus 0.5\p@
  222. \itemsep \parsep}
  223. \def\@listiii{\leftmargin\leftmarginiii
  224. \labelwidth\leftmarginiii
  225. \advance\labelwidth-\labelsep
  226. \topsep 1\p@ \@plus 0.5\p@ \@minus 0.5\p@
  227. \parsep \z@
  228. \partopsep 0.5\p@ \@plus 0\p@ \@minus 0.5\p@
  229. \itemsep \topsep}
  230. \def\@listiv {\leftmargin\leftmarginiv
  231. \labelwidth\leftmarginiv
  232. \advance\labelwidth-\labelsep}
  233. \def\@listv {\leftmargin\leftmarginv
  234. \labelwidth\leftmarginv
  235. \advance\labelwidth-\labelsep}
  236. \def\@listvi {\leftmargin\leftmarginvi
  237. \labelwidth\leftmarginvi
  238. \advance\labelwidth-\labelsep}
  239. % create title
  240. \providecommand{\maketitle}{}
  241. \renewcommand{\maketitle}{%
  242. \par
  243. \begingroup
  244. \renewcommand{\thefootnote}{\fnsymbol{footnote}}
  245. % for perfect author name centering
  246. \renewcommand{\@makefnmark}{\hbox to \z@{$^{\@thefnmark}$\hss}}
  247. % The footnote-mark was overlapping the footnote-text,
  248. % added the following to fix this problem (MK)
  249. \long\def\@makefntext##1{%
  250. \parindent 1em\noindent
  251. \hbox to 1.8em{\hss $\m@th ^{\@thefnmark}$}##1
  252. }
  253. \thispagestyle{empty}
  254. \@maketitle
  255. \@thanks
  256. \@notice
  257. \endgroup
  258. \let\maketitle\relax
  259. \let\thanks\relax
  260. }
  261. % rules for title box at top of first page
  262. \newcommand{\@toptitlebar}{
  263. \hrule height 4\p@
  264. \vskip 0.25in
  265. \vskip -\parskip%
  266. }
  267. \newcommand{\@bottomtitlebar}{
  268. \vskip 0.29in
  269. \vskip -\parskip
  270. \hrule height 1\p@
  271. \vskip 0.09in%
  272. }
  273. % create title (includes both anonymized and non-anonymized versions)
  274. \providecommand{\@maketitle}{}
  275. \renewcommand{\@maketitle}{%
  276. \vbox{%
  277. \hsize\textwidth
  278. \linewidth\hsize
  279. \vskip 0.1in
  280. \@toptitlebar
  281. \centering
  282. {\LARGE\bf \@title\par}
  283. \@bottomtitlebar
  284. \if@submission
  285. \begin{tabular}[t]{c}\bf\rule{\z@}{24\p@}
  286. Anonymous Author(s) \\
  287. Affiliation \\
  288. Address \\
  289. \texttt{email} \\
  290. \end{tabular}%
  291. \else
  292. \def\And{%
  293. \end{tabular}\hfil\linebreak[0]\hfil%
  294. \begin{tabular}[t]{c}\bf\rule{\z@}{24\p@}\ignorespaces%
  295. }
  296. \def\AND{%
  297. \end{tabular}\hfil\linebreak[4]\hfil%
  298. \begin{tabular}[t]{c}\bf\rule{\z@}{24\p@}\ignorespaces%
  299. }
  300. \begin{tabular}[t]{c}\bf\rule{\z@}{24\p@}\@author\end{tabular}%
  301. \fi
  302. \vskip 0.3in \@minus 0.1in
  303. }
  304. }
  305. % add conference notice to bottom of first page
  306. \newcommand{\ftype@noticebox}{8}
  307. \newcommand{\@notice}{%
  308. % give a bit of extra room back to authors on first page
  309. \enlargethispage{2\baselineskip}%
  310. \@float{noticebox}[b]%
  311. \footnotesize\@noticestring%
  312. \end@float%
  313. }
  314. % abstract styling
  315. \renewenvironment{abstract}%
  316. {%
  317. \vskip 0.075in%
  318. \centerline%
  319. {\large\bf Abstract}%
  320. \vspace{0.5ex}%
  321. \begin{quote}%
  322. }
  323. {
  324. \par%
  325. \end{quote}%
  326. \vskip 1ex%
  327. }
  328. \endinput