Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

📚 The CoCalc Library - books, templates and other resources

132928 views
License: OTHER
1
% File: icml2012.sty (LaTeX style file for ICML-2012)
2
3
% This file contains the LaTeX formatting parameters for a two-column
4
% conference proceedings that is 8.5 inches wide by 11 inches high.
5
6
% Modified by Francesco Figari, 2012: changed years, location
7
%
8
% Modified by Christoph Sawade and Tobias Scheffer, 2011: added line
9
% numbers, changed years
10
%
11
% Modified by Hal Daume III, 2010: changed years, added hyperlinks
12
%
13
% Modified by Kiri Wagstaff, 2009: changed years
14
%
15
% Modified by Sam Roweis, 2008: changed years
16
%
17
% Modified by Ricardo Silva, 2007: update of the ifpdf verification
18
%
19
% Modified by Prasad Tadepalli and Andrew Moore, merely changing years.
20
%
21
% Modified by Kristian Kersting, 2005, based on Jennifer Dy's 2004 version
22
% - running title. If the original title is to long or is breaking a line,
23
% use \icmltitlerunning{...} in the preamble to supply a shorter form.
24
% Added fancyhdr package to get a running head.
25
% - Updated to store the page size because pdflatex does compile the
26
% page size into the pdf.
27
%
28
% Hacked by Terran Lane, 2003:
29
% - Updated to use LaTeX2e style file conventions (ProvidesPackage,
30
% etc.)
31
% - Added an ``appearing in'' block at the base of the first column
32
% (thus keeping the ``appearing in'' note out of the bottom margin
33
% where the printer should strip in the page numbers).
34
% - Added a package option [accepted] that selects between the ``Under
35
% review'' notice (default, when no option is specified) and the
36
% ``Appearing in'' notice (for use when the paper has been accepted
37
% and will appear).
38
%
39
% Originally created as: ml2k.sty (LaTeX style file for ICML-2000)
40
% by P. Langley (12/23/99)
41
42
%%%%%%%%%%%%%%%%%%%%
43
%% This version of the style file supports both a ``review'' version
44
%% and a ``final/accepted'' version. The difference is only in the
45
%% text that appears in the note at the bottom of the first column of
46
%% the first page. The default behavior is to print a note to the
47
%% effect that the paper is under review and don't distribute it. The
48
%% final/accepted version prints an ``Appearing in'' note. To get the
49
%% latter behavior, in the calling file change the ``usepackage'' line
50
%% from:
51
%% \usepackage{icml2012}
52
%% to
53
%% \usepackage[accepted]{icml2012}
54
%%%%%%%%%%%%%%%%%%%%
55
56
\NeedsTeXFormat{LaTeX2e}
57
\ProvidesPackage{icml2012}[2012/01/01 v2.0 ICML Conference Style File]
58
59
% Use fancyhdr package
60
\RequirePackage{fancyhdr}
61
\RequirePackage{color}
62
\RequirePackage{algorithm}
63
\RequirePackage{algorithmic}
64
\RequirePackage{natbib}
65
\RequirePackage{eso-pic} % used by \AddToShipoutPicture
66
67
%%%%%%%% Options
68
\DeclareOption{accepted}{%
69
\renewcommand{\Notice@String}{\ICML@appearing}
70
\gdef\isaccepted{1}
71
}
72
\DeclareOption{nohyperref}{%
73
\gdef\nohyperref{1}
74
}
75
76
\ifdefined\nohyperref\else\ifdefined\hypersetup
77
\definecolor{mydarkblue}{rgb}{0,0.08,0.45}
78
\hypersetup{ %
79
pdftitle={},
80
pdfauthor={},
81
pdfsubject={Proceedings of the International Conference on Machine Learning 2010},
82
pdfkeywords={},
83
pdfborder=0 0 0,
84
pdfpagemode=UseNone,
85
colorlinks=true,
86
linkcolor=mydarkblue,
87
citecolor=mydarkblue,
88
filecolor=mydarkblue,
89
urlcolor=mydarkblue,
90
pdfview=FitH}
91
92
\ifdefined\isaccepted \else
93
\hypersetup{pdfauthor={Anonymous Submission}}
94
\fi
95
\fi\fi
96
97
%%%%%%%%%%%%%%%%%%%%
98
% This string is printed at the bottom of the page for the
99
% final/accepted version of the ``appearing in'' note. Modify it to
100
% change that text.
101
%%%%%%%%%%%%%%%%%%%%
102
\newcommand{\ICML@appearing}{Appearing in \textit{Proceedings of the
103
$\mathit{29}^{th}$ International Conference on Machine Learning},
104
Edinburgh, Scotland, UK, 2012. Copyright 2012 by the author(s)/owner(s).}
105
106
%%%%%%%%%%%%%%%%%%%%
107
% This string is printed at the bottom of the page for the draft/under
108
% review version of the ``appearing in'' note. Modify it to change
109
% that text.
110
%%%%%%%%%%%%%%%%%%%%
111
\newcommand{\Notice@String}{Preliminary work. Under review by the
112
International Conference on Machine Learning (ICML). Do not distribute.}
113
114
% Cause the declared options to actually be parsed and activated
115
\ProcessOptions\relax
116
117
% Uncomment the following for debugging. It will cause LaTeX to dump
118
% the version of the ``appearing in'' string that will actually appear
119
% in the document.
120
%\typeout{>> Notice string='\Notice@String'}
121
122
% Change citation commands to be more like old ICML styles
123
\newcommand{\yrcite}[1]{\citeyearpar{#1}}
124
\renewcommand{\cite}[1]{\citep{#1}}
125
126
127
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
128
% to ensure the letter format is used. pdflatex does compile the
129
% page size into the pdf. This is done using \pdfpagewidth and
130
% \pdfpageheight. As Latex does not know this directives, we first
131
% check whether pdflatex or latex is used.
132
%
133
% Kristian Kersting 2005
134
%
135
% in order to account for the more recent use of pdfetex as the default
136
% compiler, I have changed the pdf verification.
137
%
138
% Ricardo Silva 2007
139
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
140
141
\paperwidth=8.5in
142
\paperheight=11in
143
144
% old PDFLaTex verification, circa 2005
145
%
146
%\newif\ifpdf\ifx\pdfoutput\undefined
147
% \pdffalse % we are not running PDFLaTeX
148
%\else
149
% \pdfoutput=1 % we are running PDFLaTeX
150
% \pdftrue
151
%\fi
152
153
\newif\ifpdf %adapted from ifpdf.sty
154
\ifx\pdfoutput\undefined
155
\else
156
\ifx\pdfoutput\relax
157
\else
158
\ifcase\pdfoutput
159
\else
160
\pdftrue
161
\fi
162
\fi
163
\fi
164
165
\ifpdf
166
% \pdfpagewidth=\paperwidth
167
% \pdfpageheight=\paperheight
168
\setlength{\pdfpagewidth}{8.5in}
169
\setlength{\pdfpageheight}{11in}
170
\fi
171
172
% Physical page layout
173
174
\evensidemargin -0.23in
175
\oddsidemargin -0.23in
176
\setlength\textheight{9.0in}
177
\setlength\textwidth{6.75in}
178
\setlength\columnsep{0.25in}
179
\setlength\headheight{10pt}
180
\setlength\headsep{10pt}
181
\addtolength{\topmargin}{-20pt}
182
183
%\setlength\headheight{1em}
184
%\setlength\headsep{1em}
185
\addtolength{\topmargin}{-0.29in}
186
187
%\addtolength{\topmargin}{-2em}
188
189
%% The following is adapted from code in the acmconf.sty conference
190
%% style file. The constants in it are somewhat magical, and appear
191
%% to work well with the two-column format on US letter paper that
192
%% ICML uses, but will break if you change that layout, or if you use
193
%% a longer block of text for the copyright notice string. Fiddle with
194
%% them if necessary to get the block to fit/look right.
195
%%
196
%% -- Terran Lane, 2003
197
%%
198
%% The following comments are included verbatim from acmconf.sty:
199
%%
200
%%% This section (written by KBT) handles the 1" box in the lower left
201
%%% corner of the left column of the first page by creating a picture,
202
%%% and inserting the predefined string at the bottom (with a negative
203
%%% displacement to offset the space allocated for a non-existent
204
%%% caption).
205
%%%
206
\def\ftype@copyrightbox{8}
207
\def\@copyrightspace{
208
% Create a float object positioned at the bottom of the column. Note
209
% that because of the mystical nature of floats, this has to be called
210
% before the first column is populated with text (e.g., from the title
211
% or abstract blocks). Otherwise, the text will force the float to
212
% the next column. -- TDRL.
213
\@float{copyrightbox}[b]
214
\begin{center}
215
\setlength{\unitlength}{1pc}
216
\begin{picture}(20,1.5)
217
% Create a line separating the main text from the note block.
218
% 4.818pc==0.8in.
219
\put(0,2.5){\line(1,0){4.818}}
220
% Insert the text string itself. Note that the string has to be
221
% enclosed in a parbox -- the \put call needs a box object to
222
% position. Without the parbox, the text gets splattered across the
223
% bottom of the page semi-randomly. The 19.75pc distance seems to be
224
% the width of the column, though I can't find an appropriate distance
225
% variable to substitute here. -- TDRL.
226
\put(0,0){\parbox[b]{19.75pc}{\small \Notice@String}}
227
\end{picture}
228
\end{center}
229
\end@float}
230
231
% Note: A few Latex versions need the next line instead of the former.
232
% \addtolength{\topmargin}{0.3in}
233
% \setlength\footheight{0pt}
234
\setlength\footskip{0pt}
235
%\pagestyle{empty}
236
\flushbottom \twocolumn
237
\sloppy
238
239
% Clear out the addcontentsline command
240
\def\addcontentsline#1#2#3{}
241
242
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
243
%%% commands for formatting paper title, author names, and addresses.
244
245
%%start%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
246
%%%%%% title as running head -- Kristian Kersting 2005 %%%%%%%%%%%%%
247
248
249
%\makeatletter
250
%\newtoks\mytoksa
251
%\newtoks\mytoksb
252
%\newcommand\addtomylist[2]{%
253
% \mytoksa\expandafter{#1}%
254
% \mytoksb{#2}%
255
% \edef#1{\the\mytoksa\the\mytoksb}%
256
%}
257
%\makeatother
258
259
% box to check the size of the running head
260
\newbox\titrun
261
262
% general page style
263
\pagestyle{fancy}
264
\fancyhf{}
265
\fancyhead{}
266
\fancyfoot{}
267
% set the width of the head rule to 1 point
268
\renewcommand{\headrulewidth}{1pt}
269
270
% definition to set the head as running head in the preamble
271
\def\icmltitlerunning#1{\gdef\@icmltitlerunning{#1}}
272
273
% main definition adapting \icmltitle from 2004
274
\long\def\icmltitle#1{%
275
276
%check whether @icmltitlerunning exists
277
% if not \icmltitle is used as running head
278
\ifx\undefined\@icmltitlerunning%
279
\gdef\@icmltitlerunning{#1}
280
\fi
281
282
%add it to pdf information
283
\ifdefined\nohyperref\else\ifdefined\hypersetup
284
\hypersetup{pdftitle={#1}}
285
\fi\fi
286
287
%get the dimension of the running title
288
\global\setbox\titrun=\vbox{\small\bf\@icmltitlerunning}
289
290
% error flag
291
\gdef\@runningtitleerror{0}
292
293
% running title too long
294
\ifdim\wd\titrun>\textwidth%
295
{\gdef\@runningtitleerror{1}}%
296
% running title breaks a line
297
\else\ifdim\ht\titrun>6.25pt
298
{\gdef\@runningtitleerror{2}}%
299
\fi
300
\fi
301
302
% if there is somthing wrong with the running title
303
\ifnum\@runningtitleerror>0
304
\typeout{}%
305
\typeout{}%
306
\typeout{*******************************************************}%
307
\typeout{Title exceeds size limitations for running head.}%
308
\typeout{Please supply a shorter form for the running head}
309
\typeout{with \string\icmltitlerunning{...}\space prior to \string\begin{document}}%
310
\typeout{*******************************************************}%
311
\typeout{}%
312
\typeout{}%
313
% set default running title
314
\chead{\small\bf Title Suppressed Due to Excessive Size}%
315
\else
316
% 'everything' fine, set provided running title
317
\chead{\small\bf\@icmltitlerunning}%
318
\fi
319
320
% no running title on the first page of the paper
321
\thispagestyle{empty}
322
323
%%%%%%%%%%%%%%%%%%%% Kristian Kersting %%%%%%%%%%%%%%%%%%%%%%%%%
324
%end%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
325
326
{\center\baselineskip 18pt
327
\toptitlebar{\Large\bf #1}\bottomtitlebar}
328
}
329
330
331
\gdef\icmlfullauthorlist{}
332
\newcommand\addstringtofullauthorlist{\g@addto@macro\icmlfullauthorlist}
333
\newcommand\addtofullauthorlist[1]{%
334
\ifdefined\icmlanyauthors
335
\addstringtofullauthorlist{, #1}
336
\else
337
\addstringtofullauthorlist{#1}
338
\gdef\icmlanyauthors{1}
339
\fi
340
\ifdefined\nohyperref\else\ifdefined\hypersetup
341
\hypersetup{pdfauthor=\icmlfullauthorlist}
342
\fi\fi}
343
344
345
\def\toptitlebar{\hrule height1pt \vskip .25in}
346
\def\bottomtitlebar{\vskip .22in \hrule height1pt \vskip .3in}
347
\def\icmlauthor#1#2{%
348
\ifdefined\isaccepted
349
\par {\bf #1} \hfill {\sc #2}%
350
\addtofullauthorlist{#1}
351
\fi
352
}
353
\long\def\icmladdress#1{%
354
\ifdefined\isaccepted
355
\par\vskip 0.03in #1 \vskip 0.10in
356
\fi
357
}
358
359
%% keywords as first class citizens
360
\def\icmlkeywords#1{%
361
% \ifdefined\isaccepted \else
362
% \par {\bf Keywords:} #1%
363
% \fi
364
% \ifdefined\nohyperref\else\ifdefined\hypersetup
365
% \hypersetup{pdfkeywords={#1}}
366
% \fi\fi
367
% \ifdefined\isaccepted \else
368
% \par {\bf Keywords:} #1%
369
% \fi
370
\ifdefined\nohyperref\else\ifdefined\hypersetup
371
\hypersetup{pdfkeywords={#1}}
372
\fi\fi
373
}
374
375
% modification to natbib citations
376
\setcitestyle{authoryear,round,citesep={;},aysep={,},yysep={;}}
377
378
% Redefinition of the abstract environment.
379
\renewenvironment{abstract}
380
{%
381
% Insert the ``appearing in'' copyright notice.
382
\@copyrightspace
383
\centerline{\large\bf Abstract}
384
\vspace{-0.12in}\begin{quote}}
385
{\par\end{quote}\vskip 0.12in}
386
387
% numbered section headings with different treatment of numbers
388
389
\def\@startsection#1#2#3#4#5#6{\if@noskipsec \leavevmode \fi
390
\par \@tempskipa #4\relax
391
\@afterindenttrue
392
% Altered the following line to indent a section's first paragraph.
393
% \ifdim \@tempskipa <\z@ \@tempskipa -\@tempskipa \@afterindentfalse\fi
394
\ifdim \@tempskipa <\z@ \@tempskipa -\@tempskipa \fi
395
\if@nobreak \everypar{}\else
396
\addpenalty{\@secpenalty}\addvspace{\@tempskipa}\fi \@ifstar
397
{\@ssect{#3}{#4}{#5}{#6}}{\@dblarg{\@sict{#1}{#2}{#3}{#4}{#5}{#6}}}}
398
399
\def\@sict#1#2#3#4#5#6[#7]#8{\ifnum #2>\c@secnumdepth
400
\def\@svsec{}\else
401
\refstepcounter{#1}\edef\@svsec{\csname the#1\endcsname}\fi
402
\@tempskipa #5\relax
403
\ifdim \@tempskipa>\z@
404
\begingroup #6\relax
405
\@hangfrom{\hskip #3\relax\@svsec.~}{\interlinepenalty \@M #8\par}
406
\endgroup
407
\csname #1mark\endcsname{#7}\addcontentsline
408
{toc}{#1}{\ifnum #2>\c@secnumdepth \else
409
\protect\numberline{\csname the#1\endcsname}\fi
410
#7}\else
411
\def\@svsechd{#6\hskip #3\@svsec #8\csname #1mark\endcsname
412
{#7}\addcontentsline
413
{toc}{#1}{\ifnum #2>\c@secnumdepth \else
414
\protect\numberline{\csname the#1\endcsname}\fi
415
#7}}\fi
416
\@xsect{#5}}
417
418
\def\@sect#1#2#3#4#5#6[#7]#8{\ifnum #2>\c@secnumdepth
419
\def\@svsec{}\else
420
\refstepcounter{#1}\edef\@svsec{\csname the#1\endcsname\hskip 0.4em }\fi
421
\@tempskipa #5\relax
422
\ifdim \@tempskipa>\z@
423
\begingroup #6\relax
424
\@hangfrom{\hskip #3\relax\@svsec}{\interlinepenalty \@M #8\par}
425
\endgroup
426
\csname #1mark\endcsname{#7}\addcontentsline
427
{toc}{#1}{\ifnum #2>\c@secnumdepth \else
428
\protect\numberline{\csname the#1\endcsname}\fi
429
#7}\else
430
\def\@svsechd{#6\hskip #3\@svsec #8\csname #1mark\endcsname
431
{#7}\addcontentsline
432
{toc}{#1}{\ifnum #2>\c@secnumdepth \else
433
\protect\numberline{\csname the#1\endcsname}\fi
434
#7}}\fi
435
\@xsect{#5}}
436
437
% section headings with less space above and below them
438
\def\thesection {\arabic{section}}
439
\def\thesubsection {\thesection.\arabic{subsection}}
440
\def\section{\@startsection{section}{1}{\z@}{-0.12in}{0.02in}
441
{\large\bf\raggedright}}
442
\def\subsection{\@startsection{subsection}{2}{\z@}{-0.10in}{0.01in}
443
{\normalsize\bf\raggedright}}
444
\def\subsubsection{\@startsection{subsubsection}{3}{\z@}{-0.08in}{0.01in}
445
{\normalsize\sc\raggedright}}
446
\def\paragraph{\@startsection{paragraph}{4}{\z@}{1.5ex plus
447
0.5ex minus .2ex}{-1em}{\normalsize\bf}}
448
\def\subparagraph{\@startsection{subparagraph}{5}{\z@}{1.5ex plus
449
0.5ex minus .2ex}{-1em}{\normalsize\bf}}
450
451
% Footnotes
452
\footnotesep 6.65pt %
453
\skip\footins 9pt
454
\def\footnoterule{\kern-3pt \hrule width 0.8in \kern 2.6pt }
455
\setcounter{footnote}{0}
456
457
% Lists and paragraphs
458
\parindent 0pt
459
\topsep 4pt plus 1pt minus 2pt
460
\partopsep 1pt plus 0.5pt minus 0.5pt
461
\itemsep 2pt plus 1pt minus 0.5pt
462
\parsep 2pt plus 1pt minus 0.5pt
463
\parskip 6pt
464
465
\leftmargin 2em \leftmargini\leftmargin \leftmarginii 2em
466
\leftmarginiii 1.5em \leftmarginiv 1.0em \leftmarginv .5em
467
\leftmarginvi .5em
468
\labelwidth\leftmargini\advance\labelwidth-\labelsep \labelsep 5pt
469
470
\def\@listi{\leftmargin\leftmargini}
471
\def\@listii{\leftmargin\leftmarginii
472
\labelwidth\leftmarginii\advance\labelwidth-\labelsep
473
\topsep 2pt plus 1pt minus 0.5pt
474
\parsep 1pt plus 0.5pt minus 0.5pt
475
\itemsep \parsep}
476
\def\@listiii{\leftmargin\leftmarginiii
477
\labelwidth\leftmarginiii\advance\labelwidth-\labelsep
478
\topsep 1pt plus 0.5pt minus 0.5pt
479
\parsep \z@ \partopsep 0.5pt plus 0pt minus 0.5pt
480
\itemsep \topsep}
481
\def\@listiv{\leftmargin\leftmarginiv
482
\labelwidth\leftmarginiv\advance\labelwidth-\labelsep}
483
\def\@listv{\leftmargin\leftmarginv
484
\labelwidth\leftmarginv\advance\labelwidth-\labelsep}
485
\def\@listvi{\leftmargin\leftmarginvi
486
\labelwidth\leftmarginvi\advance\labelwidth-\labelsep}
487
488
\abovedisplayskip 7pt plus2pt minus5pt%
489
\belowdisplayskip \abovedisplayskip
490
\abovedisplayshortskip 0pt plus3pt%
491
\belowdisplayshortskip 4pt plus3pt minus3pt%
492
493
% Less leading in most fonts (due to the narrow columns)
494
% The choices were between 1-pt and 1.5-pt leading
495
\def\@normalsize{\@setsize\normalsize{11pt}\xpt\@xpt}
496
\def\small{\@setsize\small{10pt}\ixpt\@ixpt}
497
\def\footnotesize{\@setsize\footnotesize{10pt}\ixpt\@ixpt}
498
\def\scriptsize{\@setsize\scriptsize{8pt}\viipt\@viipt}
499
\def\tiny{\@setsize\tiny{7pt}\vipt\@vipt}
500
\def\large{\@setsize\large{14pt}\xiipt\@xiipt}
501
\def\Large{\@setsize\Large{16pt}\xivpt\@xivpt}
502
\def\LARGE{\@setsize\LARGE{20pt}\xviipt\@xviipt}
503
\def\huge{\@setsize\huge{23pt}\xxpt\@xxpt}
504
\def\Huge{\@setsize\Huge{28pt}\xxvpt\@xxvpt}
505
506
% Revised formatting for figure captions and table titles.
507
\newsavebox\captionbox\newdimen\captionboxwid
508
509
\long\def\@makecaption#1#2{
510
\vskip 10pt
511
\baselineskip 11pt
512
\setbox\@tempboxa\hbox{#1. #2}
513
\ifdim \wd\@tempboxa >\hsize
514
\sbox{\captionbox}{\small\sl #1.~}
515
\captionboxwid=\wd\captionbox
516
\usebox\captionbox {\footnotesize #2}
517
% \usebox\captionbox {\small #2}
518
\else
519
\centerline{{\small\sl #1.} {\small #2}}
520
\fi}
521
522
\def\fnum@figure{Figure \thefigure}
523
\def\fnum@table{Table \thetable}
524
525
% Strut macros for skipping spaces above and below text in tables.
526
\def\abovestrut#1{\rule[0in]{0in}{#1}\ignorespaces}
527
\def\belowstrut#1{\rule[-#1]{0in}{#1}\ignorespaces}
528
529
\def\abovespace{\abovestrut{0.20in}}
530
\def\aroundspace{\abovestrut{0.20in}\belowstrut{0.10in}}
531
\def\belowspace{\belowstrut{0.10in}}
532
533
% Various personal itemization commands.
534
\def\texitem#1{\par\noindent\hangindent 12pt
535
\hbox to 12pt {\hss #1 ~}\ignorespaces}
536
\def\icmlitem{\texitem{$\bullet$}}
537
538
% To comment out multiple lines of text.
539
\long\def\comment#1{}
540
541
542
543
544
%% Line counter (not in final version). Adapted from NIPS style file by Christoph Sawade
545
546
% Vertical Ruler
547
% This code is, largely, from the CVPR 2010 conference style file
548
% ----- define vruler
549
\makeatletter
550
\newbox\icmlrulerbox
551
\newcount\icmlrulercount
552
\newdimen\icmlruleroffset
553
\newdimen\cv@lineheight
554
\newdimen\cv@boxheight
555
\newbox\cv@tmpbox
556
\newcount\cv@refno
557
\newcount\cv@tot
558
% NUMBER with left flushed zeros \fillzeros[<WIDTH>]<NUMBER>
559
\newcount\cv@tmpc@ \newcount\cv@tmpc
560
\def\fillzeros[#1]#2{\cv@tmpc@=#2\relax\ifnum\cv@tmpc@<0\cv@tmpc@=-\cv@tmpc@\fi
561
\cv@tmpc=1 %
562
\loop\ifnum\cv@tmpc@<10 \else \divide\cv@tmpc@ by 10 \advance\cv@tmpc by 1 \fi
563
\ifnum\cv@tmpc@=10\relax\cv@tmpc@=11\relax\fi \ifnum\cv@tmpc@>10 \repeat
564
\ifnum#2<0\advance\cv@tmpc1\relax-\fi
565
\loop\ifnum\cv@tmpc<#1\relax0\advance\cv@tmpc1\relax\fi \ifnum\cv@tmpc<#1 \repeat
566
\cv@tmpc@=#2\relax\ifnum\cv@tmpc@<0\cv@tmpc@=-\cv@tmpc@\fi \relax\the\cv@tmpc@}%
567
% \makevruler[<SCALE>][<INITIAL_COUNT>][<STEP>][<DIGITS>][<HEIGHT>]
568
\def\makevruler[#1][#2][#3][#4][#5]{
569
\begingroup\offinterlineskip
570
\textheight=#5\vbadness=10000\vfuzz=120ex\overfullrule=0pt%
571
\global\setbox\icmlrulerbox=\vbox to \textheight{%
572
{
573
\parskip=0pt\hfuzz=150em\cv@boxheight=\textheight
574
\cv@lineheight=#1\global\icmlrulercount=#2%
575
\cv@tot\cv@boxheight\divide\cv@tot\cv@lineheight\advance\cv@tot2%
576
\cv@refno1\vskip-\cv@lineheight\vskip1ex%
577
\loop\setbox\cv@tmpbox=\hbox to0cm{ % side margin
578
\hfil {\hfil\fillzeros[#4]\icmlrulercount}
579
}%
580
\ht\cv@tmpbox\cv@lineheight\dp\cv@tmpbox0pt\box\cv@tmpbox\break
581
\advance\cv@refno1\global\advance\icmlrulercount#3\relax
582
\ifnum\cv@refno<\cv@tot\repeat
583
}
584
}
585
\endgroup
586
}%
587
\makeatother
588
% ----- end of vruler
589
590
591
% \makevruler[<SCALE>][<INITIAL_COUNT>][<STEP>][<DIGITS>][<HEIGHT>]
592
\def\icmlruler#1{\makevruler[12pt][#1][1][3][\textheight]\usebox{\icmlrulerbox}}
593
\AddToShipoutPicture{%
594
\icmlruleroffset=\textheight
595
\advance\icmlruleroffset by 5.2pt % top margin
596
\color[rgb]{.7,.7,.7}
597
\ifdefined\isaccepted \else
598
\AtTextUpperLeft{%
599
\put(\LenToUnit{-35pt},\LenToUnit{-\icmlruleroffset}){%left ruler
600
\icmlruler{\icmlrulercount}}
601
\put(\LenToUnit{1.04\textwidth},\LenToUnit{-\icmlruleroffset}){%right ruler
602
\icmlruler{\icmlrulercount}}
603
}
604
\fi
605
}
606
\endinput
607
608