-
Notifications
You must be signed in to change notification settings - Fork 0
/
ruler.sty
76 lines (70 loc) · 3.08 KB
/
ruler.sty
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
\ProvidesPackage{ruler}
\RequirePackage{eso-pic}
%\font\cvprtenhv = phvb at 7pt % *** IF THIS FAILS, SEE cvpr.sty ***
\def\cvprtenhv{\sffamily\scriptsize}
\def\cvprcolor{\color[rgb]{0.2,0.5,0.8}}
%\def\ConferenceHeader{\parbox{1in}{\begin{center}\bf\sf{\small CVPR}\\\#\cvprPaperID\end{center}}}
\def\ConferenceHeader{\parbox{1in}{\begin{center}\bf\sf{\small ECCV}\\\#\ECCV16SubNumber\end{center}}}
%\def\ConferenceHeaderB{CVPR 2012 Submission \#\cvprPaperID. CONFIDENTIAL REVIEW COPY. DO NOT DISTRIBUTE.}
\def\ConferenceHeaderB{}%CONFIDENTIAL REVIEW COPY. DO NOT DISTRIBUTE.}
%% --------- Page background marks: Ruler and confidentiality
% ----- define vruler
\makeatletter
\newbox\cvprrulerbox
\newcount\cvprrulercount
\newcount\cvprrulercounttmp
\newdimen\cvprruleroffset
\newdimen\cv@lineheight
\newdimen\cv@boxheight
\newbox\cv@tmpbox
\newcount\cv@refno
\newcount\cv@tot
% NUMBER with left flushed zeros \fillzeros[<WIDTH>]<NUMBER>
\newcount\cv@tmpc@ \newcount\cv@tmpc
\def\fillzeros[#1]#2{\cv@tmpc@=#2\relax\ifnum\cv@tmpc@<0\cv@tmpc@=-\cv@tmpc@\fi
\cv@tmpc=1 %
\loop\ifnum\cv@tmpc@<10 \else \divide\cv@tmpc@ by 10 \advance\cv@tmpc by 1 \fi
\ifnum\cv@tmpc@=10\relax\cv@tmpc@=11\relax\fi \ifnum\cv@tmpc@>10 \repeat
\ifnum#2<0\advance\cv@tmpc1\relax-\fi
\loop\ifnum\cv@tmpc<#1\relax0\advance\cv@tmpc1\relax\fi \ifnum\cv@tmpc<#1 \repeat
\cv@tmpc@=#2\relax\ifnum\cv@tmpc@<0\cv@tmpc@=-\cv@tmpc@\fi \relax\the\cv@tmpc@}%
% \makevruler[<SCALE>][<INITIAL_COUNT>][<STEP>][<DIGITS>][<HEIGHT>]
\def\makevruler[#1][#2][#3][#4][#5]{\begingroup\offinterlineskip
\textheight=#5\vbadness=10000\vfuzz=120ex\overfullrule=0pt%
\global\setbox\cvprrulerbox=\vbox to \textheight{%
{\parskip=0pt\hfuzz=150em\cv@boxheight=\textheight
\cv@lineheight=#1\global\cvprrulercount=#2%
\cv@tot\cv@boxheight\divide\cv@tot\cv@lineheight\advance\cv@tot2%
\cv@refno1\vskip-\cv@lineheight\vskip1ex%
\loop\setbox\cv@tmpbox=\hbox to0cm{{\cvprtenhv\hfil\fillzeros[#4]\cvprrulercount}}%
\ht\cv@tmpbox\cv@lineheight\dp\cv@tmpbox0pt\box\cv@tmpbox\break
\advance\cv@refno1\global\advance\cvprrulercount#3\relax
\ifnum\cv@refno<\cv@tot\repeat}}\endgroup}%
\makeatother
% ----- end of vruler
% \makevruler[<SCALE>][<INITIAL_COUNT>][<STEP>][<DIGITS>][<HEIGHT>]
\def\cvprruler#1{\makevruler[12.2pt][#1][1][3][0.983\textheight]\usebox{\cvprrulerbox}}
\AddToShipoutPicture{%
%\ifcvprfinal\else
%\AtTextLowerLeft{%
% \color[gray]{.15}\framebox(\LenToUnit{\textwidth},\LenToUnit{\textheight}){}
%}
\cvprruleroffset=\textheight
\advance\cvprruleroffset by -3.7pt
\cvprcolor
\AtTextUpperLeft{%
\cvprrulercounttmp=\cvprrulercount
\put(\LenToUnit{-30pt},\LenToUnit{-\cvprruleroffset}){%left ruler
\cvprruler{\cvprrulercount}}
%right ruler
\put(\LenToUnit{\textwidth\kern 17pt}, \LenToUnit{-\cvprruleroffset}){ \cvprruler{\cvprrulercounttmp}}
}
\AtTextUpperLeft{%paperID in corners
\put(\LenToUnit{-65pt},\LenToUnit{45pt}){\ConferenceHeader}
\put(\LenToUnit{\textwidth\kern-8pt},\LenToUnit{45pt}){\ConferenceHeader}
}
\AtTextUpperLeft{%confidential
\put(0,\LenToUnit{1cm}){\parbox{\textwidth}{\centering\cvprtenhv
\ConferenceHeaderB}}
}
}