| 1 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2 |
% |
| 3 |
% Typographic ruler for TeX, version 1.1 |
| 4 |
% Copyright Victor Eijkhout 1999 |
| 5 |
% file name: ruler.tex |
| 6 |
% |
| 7 |
% Author: |
| 8 |
% Victor Eijkhout |
| 9 |
% Department of Computer Science |
| 10 |
% University of Tennessee, Knoxville TN 37996 |
| 11 |
% |
| 12 |
% [email protected] |
| 13 |
% |
| 14 |
% This program is free software; you can redistribute it and/or |
| 15 |
% modify it under the terms of the GNU General Public License |
| 16 |
% as published by the Free Software Foundation; either version 2 |
| 17 |
% of the License, or (at your option) any later version. |
| 18 |
% |
| 19 |
% This program is distributed in the hope that it will be useful, |
| 20 |
% but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 21 |
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 22 |
% GNU General Public License for more details. |
| 23 |
% |
| 24 |
% For a copy of the GNU General Public License, write to the |
| 25 |
% Free Software Foundation, Inc., |
| 26 |
% 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, |
| 27 |
% or find it on the net, for instance at |
| 28 |
% http://www.gnu.org/copyleft/gpl.html |
| 29 |
% |
| 30 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 31 |
% |
| 32 |
% This file is identical to an earlier version which was on ctan and |
| 33 |
% other archive sites; only the license and copyright information |
| 34 |
% has changed. |
| 35 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 36 |
% |
| 37 |
\hsize=14.5cm \vsize=32cm \voffset=-1.5cm |
| 38 |
\nopagenumbers \raggedbottom |
| 39 |
\overfullrule=0pt |
| 40 |
%\tracingoutput=1 |
| 41 |
\showboxbreadth=20 \showboxdepth=7 |
| 42 |
|
| 43 |
\font\tiny=cmr5 \font\ss=cmr8 |
| 44 |
\font\big=cmss10 scaled \magstep3 |
| 45 |
\font\manual=cmr10 |
| 46 |
|
| 47 |
%\font\tiny=helv at 5pt \font\ss=helv at 8pt |
| 48 |
%\font\big=helv at 16pt |
| 49 |
%\font\manual=times at 10pt |
| 50 |
|
| 51 |
\let\tt=\ss \let\rm=\ss |
| 52 |
\parindent=0cm \offinterlineskip |
| 53 |
\def\\{\hfill\break} |
| 54 |
|
| 55 |
\newdimen\margin \margin=.5cm |
| 56 |
\newdimen\linewidth \linewidth=0.05mm |
| 57 |
\newdimen\scalewidth \scalewidth=6mm \newdimen\magboxwidth |
| 58 |
\newdimen\gridheight \gridheight=8cm |
| 59 |
\newdimen\rulewidth \rulewidth=\scalewidth |
| 60 |
\newdimen\ruleboxheight \ruleboxheight=6mm |
| 61 |
|
| 62 |
\newbox\magscalenames \newbox\scale \newbox\grid |
| 63 |
\newbox\stairs \newbox\ruler |
| 64 |
\newcount\ncol \newcount\nrow |
| 65 |
\newcount\tempcount \newcount\tempcountb \newcount\tempcounth |
| 66 |
\newbox\tempboxa \newbox\tempboxb |
| 67 |
\newskip\tempskip \newskip\tempskipb |
| 68 |
\newdimen\tempdimen \newdimen\tempdimenb \newdimen\tempdimenc |
| 69 |
|
| 70 |
\newbox\storea \newbox\storeb \newbox\storec |
| 71 |
\newbox\stored \newbox\storee \newbox\storef |
| 72 |
\newbox\storeg \newbox\storeh \newbox\storei |
| 73 |
\newbox\storej |
| 74 |
|
| 75 |
\def\gobble#1{} |
| 76 |
\def\gobbletwo#1#2{} |
| 77 |
\def\gobblethree#1#2#3{} |
| 78 |
\def\gobblefive#1#2#3#4#5{} |
| 79 |
|
| 80 |
\def\hfilll{\hskip 0cm plus 1filll\relax} |
| 81 |
|
| 82 |
%%%%%%%%%%%%%%%% trace |
| 83 |
%\tracingonline=1 |
| 84 |
%\tracingmacros=1 |
| 85 |
|
| 86 |
%%%%%%%%%%%%%%%% auxiliaries |
| 87 |
\def\decimala %% #1=getal; a-> 1 plaats achter de komma |
| 88 |
#1{{\tempcounth=#1\relax |
| 89 |
\tempcountb=\tempcounth |
| 90 |
\divide\tempcountb by 10\relax |
| 91 |
\number\tempcountb.% |
| 92 |
\multiply\tempcountb by 10\relax |
| 93 |
\advance\tempcounth by -\tempcountb |
| 94 |
\number\tempcounth}} |
| 95 |
|
| 96 |
\def\decimalb %% #1=getal; b-> 2 plaatsen achter de komma |
| 97 |
#1{{\tempcounth=#1\relax |
| 98 |
\tempcountb=\tempcounth |
| 99 |
\divide\tempcountb by 100\relax |
| 100 |
\number\tempcountb.% |
| 101 |
\multiply\tempcountb by 100\relax |
| 102 |
\advance\tempcounth by -\tempcountb |
| 103 |
\ifnum\tempcounth<10 0\fi |
| 104 |
\number\tempcounth}} |
| 105 |
|
| 106 |
\def\hundred#1{{\tempcounth=#1 |
| 107 |
\tempcountb=\tempcounth |
| 108 |
\divide\tempcounth by 100\relax |
| 109 |
\ifnum\tempcounth>0 |
| 110 |
\number\tempcounth.\fi |
| 111 |
\multiply\tempcounth by 100 |
| 112 |
\advance\tempcountb by -\tempcounth |
| 113 |
\ifnum\tempcountb<10 0\fi |
| 114 |
\number\tempcountb}} |
| 115 |
|
| 116 |
\def\thousand#1{{\tempcount=#1 \tempcountb=\tempcount |
| 117 |
\divide\tempcount by 1000 |
| 118 |
\ifnum\tempcount>0 \number\tempcount.\fi |
| 119 |
\multiply\tempcount by 1000 |
| 120 |
\advance\tempcountb by -\tempcount |
| 121 |
\ifnum\tempcountb<100 0\fi |
| 122 |
\ifnum\tempcountb<10 0\fi |
| 123 |
\number\tempcountb}} |
| 124 |
|
| 125 |
\def\headedbox %% #1=heading text #2=vbox |
| 126 |
#1#2{\vtop{\vbox to 0cm{\vss\setbox0=\hbox to 0cm{\tt #1\hss} \dp0=0cm |
| 127 |
\box0 \vskip2pt} |
| 128 |
#2}} |
| 129 |
\def\boxit#1{\vbox{\hrule |
| 130 |
\hbox{\vrule #1\vrule} |
| 131 |
\hrule}} |
| 132 |
|
| 133 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 134 |
%%%%%%%%%%%%%%%%%%%%%% baseline measurement %%%%%%%%%%%%%%%%%%%%%%%% |
| 135 |
\newskip\liftskip |
| 136 |
%% what baselineskips are needed? |
| 137 |
\def\baselinedist#1{\ifcase#1\or 5\or 6\or 7\or 8\or 9\or 10\or |
| 138 |
11\or 12\or 13\or 14\or 15\or 16\or 17\or |
| 139 |
18\or 20\or 22\or 25\or 30\fi} |
| 140 |
|
| 141 |
%% first one step in a ladder of baselineskips |
| 142 |
\def\baselinebox %% #1=size #2=number label |
| 143 |
#1#2{\vbox to #1pt{\vfil |
| 144 |
\moveright .5\hsize\vbox{\hrule height \linewidth |
| 145 |
width .5\hsize} |
| 146 |
\vfil\vbox to 0cm{\vss\hskip2pt\tiny\number#2\vskip\liftskip} |
| 147 |
\hrule height \linewidth}} |
| 148 |
|
| 149 |
%% next a whole ladder of baselineskips |
| 150 |
\def\baselinescale %% #1=number of steps #2=point size |
| 151 |
#1#2{\ifnum#2<7 \liftskip=0pt \else \liftskip=2pt \fi |
| 152 |
\setbox\scale=\vbox{}% |
| 153 |
\baselinescalei 1{#1}{#2}% |
| 154 |
\edef\tcs{{#2}{\box\scale}}\expandafter\headedbox\tcs} |
| 155 |
\def\baselinescalei %% #1=label #2=number of steps #3=point size |
| 156 |
#1#2#3{\ifnum#1>#2 \def\tcs{0}\let\next=\gobblethree |
| 157 |
\else\tempcount=#1 \advance\tempcount by 1 |
| 158 |
\setbox\scale=\vtop{\hsize=\scalewidth |
| 159 |
\advance\hsize by -\linewidth |
| 160 |
\unvbox\scale |
| 161 |
\baselinebox{#3}{#1}}% |
| 162 |
\let\next\baselinescalei \edef\tcs{{\number\tempcount}}\fi |
| 163 |
\expandafter\next\tcs{#2}{#3}} |
| 164 |
|
| 165 |
%% finally a grid of ladders of baselineskips |
| 166 |
\def\baselinegrid %% #1=number of baseline scales #2=storage box |
| 167 |
#1#2{\setbox\grid=\hbox{}% |
| 168 |
\setbox#2=\vtop{\hrule height 0pt depth \linewidth |
| 169 |
\baselinegridi 1{#1} |
| 170 |
\hrule height \linewidth}} |
| 171 |
\def\baselinegridi %% #1=current number #2=total number of baseline scales |
| 172 |
#1#2{\ifnum#1>#2 \hbox{\vsize=\gridheight \unhbox\grid |
| 173 |
\vrule width \linewidth} |
| 174 |
\else\tempcount=\gridheight \tempskip=\baselinedist{#1}pt |
| 175 |
\divide\tempcount by \tempskip \edef\tcs{{\number\tempcount}} |
| 176 |
\setbox\grid= |
| 177 |
\hbox{\vsize=\gridheight \unhbox\grid |
| 178 |
\vrule width \linewidth |
| 179 |
\expandafter\baselinescale\tcs{\baselinedist{#1}}} |
| 180 |
\tempcount=#1 \advance\tempcount by 1 \edef\tcs{{\number\tempcount}} |
| 181 |
\expandafter\baselinegridi\tcs{#2}\fi} |
| 182 |
|
| 183 |
|
| 184 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 185 |
%%%%%%%%%%%%%%%%%%%%% magnified font sizes %%%%%%%%%%%%%%%%%%%%%%%%% |
| 186 |
\newcount\honcor |
| 187 |
\long\def\bungeltext#1#2{ |
| 188 |
\hrule height \linewidth |
| 189 |
\kern1mm |
| 190 |
\vbox{\hsize=#1\relax \rightskip=0cm plus 1fil |
| 191 |
\lineskiplimit=0pt \lineskip=0pt \baselineskip=6pt |
| 192 |
\tiny #2\par}} |
| 193 |
|
| 194 |
\def\magstep#1{\ifcase#1 1000\or 1095\or 1200\or 1440\or 1728\or |
| 195 |
2074\or 2488\fi} |
| 196 |
\def\tienstep#1{\ifcase#1 10\or 10.95\or 12\or 14.4\or 17.28\or |
| 197 |
20.74\or 24.88\fi} |
| 198 |
\def\zevenstep#1{\ifcase#1 7\or 7.67\or 8.4\or 10.08\or 12.10\or |
| 199 |
14.52\or 17.42\fi} |
| 200 |
\def\vijfstep#1{\ifcase#1 5\or 5.48\or 6\or 7.2\or 8.64\or |
| 201 |
10.37\or 12.44\fi} |
| 202 |
|
| 203 |
\def\magname#1{\ifcase#1 0\or half\or 1\or 2\or 3\or 4\or 5\fi} |
| 204 |
\def\cmmagbox#1{{\divide\tempdimen by 1000 |
| 205 |
\multiply\tempdimen by \magstep#1% |
| 206 |
\tempdimenb=.01mm \tempdimenc=\tempdimen |
| 207 |
\divide\tempdimenc by \tempdimenb |
| 208 |
\tempcount=\tempdimenc |
| 209 |
\edef\next{\the\tempcount}% |
| 210 |
\divide\honcor by 1000 |
| 211 |
\multiply \honcor by \magstep#1\relax |
| 212 |
\tempdimenc=.01pt \divide\honcor by \tempdimenc |
| 213 |
\edef\mixt{\the\honcor}% |
| 214 |
\edef\next{\noexpand\magbox{\the\tempdimen}{\magname#1}% |
| 215 |
{\noexpand\hundred{\next}} |
| 216 |
{\noexpand\corrout#1}}\next}} |
| 217 |
\def\magbox %% #1=height #2=first text #3=second #4=third |
| 218 |
#1#2#3#4{\vtop{\hbox{\vrule width\linewidth |
| 219 |
\vbox{\hrule width \magboxwidth height \linewidth |
| 220 |
\kern #1}} |
| 221 |
\bungeltext\magboxwidth |
| 222 |
{#2\par #3\par #4\par} |
| 223 |
}} |
| 224 |
|
| 225 |
\def\magsteps{\vtop{\hbox{\cmmagbox0\cmmagbox1\cmmagbox2% |
| 226 |
\cmmagbox3\cmmagbox4\cmmagbox5\cmmagbox6% |
| 227 |
\vrule width \linewidth depth 0cm}}} |
| 228 |
|
| 229 |
\def\magrow %% #1=name #2=unit numerator #3=unit denominator |
| 230 |
%% #4=unit size #5=design size #6=store box |
| 231 |
#1#2#3#4#5#6{\tempdimen=#4 \divide\tempdimen by #3 |
| 232 |
\multiply\tempdimen by #2 |
| 233 |
\tempdimenb=#5pt \honcor=\tempdimenb |
| 234 |
\ifnum#5=10 \let\corrout\tienstep |
| 235 |
\else\ifnum#5=7 \let\corrout\zevenstep |
| 236 |
\else \let\corrout\vijfstep \fi\fi |
| 237 |
\magboxwidth=\scalewidth \setbox\tempboxa=\magsteps |
| 238 |
\setbox\tempboxb= |
| 239 |
\vtop{\vbox{\hsize=1.2cm |
| 240 |
\lineskiplimit=0pt \lineskip=0pt |
| 241 |
\baselineskip=6pt |
| 242 |
\def\\{\hfil\break} \tiny #1 |
| 243 |
\par \kern1mm} |
| 244 |
\setbox0=\hbox{\tiny point size } |
| 245 |
\bungeltext{\wd0}{magstep\par |
| 246 |
mm \par point size\par}} |
| 247 |
\tempdimen=\wd\tempboxa \advance\tempdimen by \wd\tempboxb |
| 248 |
\advance\tempdimen by 2mm |
| 249 |
\setbox#6= |
| 250 |
\hbox to \tempdimen{\box\tempboxa \kern2mm \box\tempboxb}} |
| 251 |
|
| 252 |
\def\magsizebox %% #1=text |
| 253 |
#1{\hbox to 1.5\scalewidth{\hfil \tiny #1\hfil}} |
| 254 |
|
| 255 |
%%%%%%%%%%%%%%%%%%%%%%%% general magrows %%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 256 |
|
| 257 |
\def\gmagsteps %% #1=from #2=by #3=to |
| 258 |
#1#2#3{\tempcount=#1\relax |
| 259 |
{\multiply\tempdimen by \tempcount \tempcountb=\tempdimen |
| 260 |
\tempdimenc=.01mm \divide\tempcountb by \tempdimenc |
| 261 |
\edef\next{\the\tempcountb}% |
| 262 |
\edef\next{\noexpand\magbox{\the\tempdimen}{\the\tempcount}% |
| 263 |
{\noexpand\hundred{\next}}{}}% |
| 264 |
\next}% |
| 265 |
\advance\tempcount by #2% |
| 266 |
\ifnum\tempcount=#3\relax\vrule width \linewidth depth 0cm |
| 267 |
\else\edef\next{\noexpand\gmagsteps |
| 268 |
{\number\tempcount}{#2}{#3}}\next\fi} |
| 269 |
|
| 270 |
\def\gmagrow %% #1=name #2=unit numerator #3=unit denominator |
| 271 |
%% #4=unit size #5=from #6=by #7=to #8=store box |
| 272 |
#1#2#3#4#5#6#7#8{\tempdimen=#4 \divide\tempdimen by #3 |
| 273 |
\multiply\tempdimen by #2 |
| 274 |
\setbox#8=\hbox{\magboxwidth\scalewidth \gmagsteps{#5}{#6}{#7} |
| 275 |
\ {} |
| 276 |
\vtop{\kern0cm |
| 277 |
\setbox0=\hbox{\tiny point size } |
| 278 |
\bungeltext{\wd0}{point size\\mm}}}} |
| 279 |
|
| 280 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 281 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%% rulers %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 282 |
\newif\ifleftruler \newdimen\stapje \newdimen\Stap \newdimen\hstapje |
| 283 |
\newcount\halfway \newcount\alltheway |
| 284 |
\newbox\onerulerbox |
| 285 |
\newdimen\vollebreedte \newdimen\vollebreedteplus |
| 286 |
\newdimen\overschot \overschot=.75mm |
| 287 |
|
| 288 |
\def\doalltheway |
| 289 |
#1#2#3{#3{#1}\relax |
| 290 |
\ifnum#1=#2\relax\else |
| 291 |
\tempcount=#1 \advance\tempcount by 1 |
| 292 |
\expandafter\doalltheway\expandafter |
| 293 |
{\number\tempcount}{#2}{#3}\fi} |
| 294 |
|
| 295 |
\def\centimeterruler{\Stap=1cm \leftrulerfalse |
| 296 |
\vollebreedte=1cm\relax |
| 297 |
\def\rulename{centimeter}% |
| 298 |
\let\ruledigitfont=\rm |
| 299 |
\alltheway=10 \doruler{cm}} |
| 300 |
\def\inchruler{\Stap=1in \leftrulertrue |
| 301 |
\vollebreedte=1cm\relax |
| 302 |
\def\rulename{inch}% |
| 303 |
\let\ruledigitfont=\rm |
| 304 |
\alltheway=8 \doruler{inch}} |
| 305 |
\def\picaruler{\Stap=12pt \leftrulerfalse |
| 306 |
\vollebreedte=1cm\relax |
| 307 |
\def\rulename{pica}% |
| 308 |
\let\ruledigitfont=\tiny |
| 309 |
\alltheway=6 \doruler{pica}} |
| 310 |
\def\rulerpiece |
| 311 |
#1{\vbox to \stapje{\vfil \rulerhalfline \vfil \rulerline{#1}}} |
| 312 |
\def\rulerline %% streepje over aantal mm; halfweg volle breedte |
| 313 |
#1{\ifnum#1=\halfway \tempskipb=\vollebreedteplus |
| 314 |
\else \tempskipb=#1\hstapje |
| 315 |
\advance\tempskipb by \overschot \fi |
| 316 |
\hbox to \vollebreedteplus |
| 317 |
{\maybeleft \vrule width\tempskipb height\linewidth |
| 318 |
\mayberight }} |
| 319 |
\def\rulerhalfline |
| 320 |
{\tempskipb=.5\hstapje \advance\tempskipb by \overschot |
| 321 |
\hbox to \vollebreedteplus |
| 322 |
{\maybeleft\vrule width\tempskipb height\linewidth |
| 323 |
\mayberight}} |
| 324 |
\def\rulerbox %% #1=label |
| 325 |
#1{\vbox to 0cm{\kern.75mm\relax %was .5\stapje |
| 326 |
\hbox to \vollebreedteplus |
| 327 |
{\mayberight |
| 328 |
\kern.75mm\ruledigitfont |
| 329 |
#1\kern.75mm |
| 330 |
\maybeleft} |
| 331 |
\vss} |
| 332 |
\copy\onerulerbox} |
| 333 |
\def\makerulerbox{\global\setbox\onerulerbox= |
| 334 |
\vbox to \Stap{\vbox to 0cm |
| 335 |
{\hbox{\ifleftruler\kern\overschot\fi |
| 336 |
\kern.5\vollebreedte |
| 337 |
\vrule depth \Stap width\linewidth} |
| 338 |
\vss} |
| 339 |
\doalltheway1{\alltheway}{\rulerpiece} |
| 340 |
\vss}} |
| 341 |
\def\doruler %% #1=unit name #2=length #3=storage box |
| 342 |
#1#2#3{\ifleftruler \let\maybeleft\relax \let\mayberight\hfil |
| 343 |
\else \let\maybeleft\hfil \let\mayberight\relax |
| 344 |
\fi |
| 345 |
\bgroup \halfway=\alltheway \divide\halfway by 2\relax |
| 346 |
\stapje=\Stap \divide\stapje by \alltheway |
| 347 |
\hstapje=\vollebreedte \divide\hstapje by \alltheway |
| 348 |
\vollebreedteplus=\vollebreedte |
| 349 |
\advance\vollebreedteplus by \overschot |
| 350 |
\makerulerbox |
| 351 |
\setbox\ruler=\vbox{\hrule width \vollebreedteplus height\linewidth}% |
| 352 |
\doruleri 0{#2}\relax |
| 353 |
\global\setbox\ruler= |
| 354 |
\hbox{\ifleftruler\else\vrule width\linewidth\fi |
| 355 |
\box\ruler |
| 356 |
\ifleftruler \vrule width\linewidth \fi}% |
| 357 |
\xdef\tcs{{#1}{\box\ruler}}\egroup |
| 358 |
\setbox#3\expandafter\headedbox\tcs} |
| 359 |
\def\doruleri |
| 360 |
#1#2{\ifnum#1>#2 \let\next=\gobbletwo \def\tcs{0}% |
| 361 |
\else \setbox\ruler= |
| 362 |
\vtop{\unvbox\ruler\rulerbox{#1}}% |
| 363 |
\let\next=\doruleri |
| 364 |
\tempcount=#1\relax \advance\tempcount by 1 |
| 365 |
\edef\tcs{{\number\tempcount}}\fi |
| 366 |
\expandafter\next\tcs{#2}} |
| 367 |
|
| 368 |
%%%%%%%%%%%%%%%%%%%%%%%%%% paper size %%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 369 |
\def\papersize#1#2{\vtop |
| 370 |
{\kern0cm\vbox to #2{ |
| 371 |
\vbox to #1{\vfil\hrule width 2mm height 0cm depth \linewidth} |
| 372 |
\vfil\hrule width 2mm height 0cm depth \linewidth}}} |
| 373 |
|
| 374 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 375 |
%%%%%%%%%%%%%%%%%%%%%%%%% rule thickness %%%%%%%%%%%%%%%%%%%%%%%%%% |
| 376 |
\newdimen\rulelength \rulelength=.75\scalewidth |
| 377 |
\newdimen\interruleskip \interruleskip=.5\scalewidth |
| 378 |
|
| 379 |
\def\ruleboxh %% #1=rule thickness #2=label |
| 380 |
#1#2{\setbox\tempbox= |
| 381 |
\vbox{\hsize=\rulewidth |
| 382 |
\vfill \vskip10pt \hbox{\tiny \rulenum{#2}} |
| 383 |
\vskip1pt \hrule height #1 width \rulewidth}% |
| 384 |
\ifdim\ht\tempbox<\ruleboxheight |
| 385 |
\vbox to \ruleboxheight{\unvbox\tempbox}% |
| 386 |
\else\box\tempbox\fi} |
| 387 |
\def\ruleboxv %% #1=rule thickness #2=label |
| 388 |
#1#2{\vtop{\kern0cm |
| 389 |
\hbox{\hbox to 5mm{\tiny \hfil \rulenum{#2}\kern1mm}% |
| 390 |
\vrule height \rulelength width #1} |
| 391 |
\kern \interruleskip}} |
| 392 |
\let\rulebox=\ruleboxv |
| 393 |
\def\rulestackhead %% #1=minimal label #2=label step |
| 394 |
%% #3=minimal dimen #4=dimen step |
| 395 |
%% #5=maximal label #6=storage box #7=header |
| 396 |
#1#2#3#4#5#6#7{\setbox\scale=\vbox{}% |
| 397 |
\rulestacki{#1}{#2}{#3}{#4}{#5}% |
| 398 |
\setbox#6=\headedbox{#7}{\box\scale}} |
| 399 |
\def\rulestack %% #1=minimal label #2=label step |
| 400 |
%% #3=minimal dimen #4=dimen step |
| 401 |
%% #5=maximal label #6=storage box |
| 402 |
#1#2#3#4#5#6{\setbox\scale=\vbox{}% |
| 403 |
\rulestacki{#1}{#2}{#3}{#4}{#5}% |
| 404 |
\setbox#6=\box\scale} |
| 405 |
\def\rulestacki %% #1=curr label #2=label step |
| 406 |
%% #3=curr dimen #4=dimen step #5=total dimen |
| 407 |
#1#2#3#4#5{\ifnum#1>#5% |
| 408 |
\setbox\scale= |
| 409 |
\vtop{\unvbox\scale \setbox0=\lastbox}% |
| 410 |
\let\next=\gobblefive \def\tcs{0}% |
| 411 |
\else \setbox\scale= |
| 412 |
\vtop{\unvbox\scale |
| 413 |
\rulebox{#3}{#1}}% |
| 414 |
\tempskip=#3\relax \advance\tempskip by #4\relax |
| 415 |
\tempcount=#1\relax \advance\tempcount by #2\relax |
| 416 |
\let\next=\rulestacki |
| 417 |
\edef\tcs{{\number\tempcount}}\fi |
| 418 |
\expandafter\next\tcs{#2}{\tempskip}{#4}{#5}} |
| 419 |
|
| 420 |
|
| 421 |
%%%%%%%%%%%%%%%%%%%%%%%%%% conversion table %%%%%%%%%%%%%%%%%%%%%%%% |
| 422 |
\def\num{\ss\enspace\hfill} |
| 423 |
\def\me#1{\ifcase#1\relax\or pt\or pc\or dd\or cc\or bp\or mm\or in\fi} |
| 424 |
\def\table{\halign{\strut\hbox to 1cm{\tt##\hfil}\vrule\enspace |
| 425 |
&\num##&\num##&\num##&\num##&\num##&\num##&\num##\cr |
| 426 |
\hfill&\tt \me1&\tt \me2&\tt \me3&\tt \me4&\tt \me5&\tt \me6&\tt \me7\cr |
| 427 |
\noalign{\hrule} |
| 428 |
\me1&1&.0833&&&&.351&.0138\cr |
| 429 |
\me2&12&1&&&&4.218&.166\cr |
| 430 |
\me3&&&1&.0833&&.376&.0148\cr |
| 431 |
\me4&&&12&1&&4.513&.1777\cr |
| 432 |
\me5&&&&&1&.383&.0139\cr |
| 433 |
\me6&2.845&.237&2.659&.222&2.835&1&.0394\cr |
| 434 |
\me7&72.27&6.0225&67.54&5.628&72&25.4&1\cr |
| 435 |
}} |
| 436 |
%%%%%%%%%%%%%%%%%%%%%%%%%% the whole sheet %%%%%%%%%%%%%%%%%%%%%%%%% |
| 437 |
|
| 438 |
\def\opskip{\vskip.5mm\relax} |
| 439 |
\let\neerskip\opskip |
| 440 |
|
| 441 |
\output{} |
| 442 |
|
| 443 |
\begingroup\hsize=12cm \vsize=8in |
| 444 |
\parindent=0pt \parskip=6pt |
| 445 |
\rightskip=0cm plus 5cm \normalbaselines |
| 446 |
|
| 447 |
\hbox{}\vskip3cm |
| 448 |
\big The \TeX\ ruler |
| 449 |
|
| 450 |
\manual |
| 451 |
This is the \TeX\ ruler, a measuring device for |
| 452 |
typographical designers working with \TeX. It includes ordinary |
| 453 |
rulers in inches, centimeters, and picas. |
| 454 |
It can be used to measure font sizes, baseline distances, |
| 455 |
and rule weights. The design is based on a ruler |
| 456 |
by Inge~Eijkhout, implementation in \TeX\ is by |
| 457 |
Victor~Eijkhout. |
| 458 |
|
| 459 |
The \TeX\ ruler is shareware, distributed under the GNU Public License. |
| 460 |
If you want to show your appreciation, send a contribution |
| 461 |
to the address below. |
| 462 |
|
| 463 |
How to format and print this file |
| 464 |
|
| 465 |
This file will give you three pages. Most likely the second one |
| 466 |
cannot be handled by your printer, but I've included it for |
| 467 |
completeness. At the top of the source file, 3 fonts are |
| 468 |
declared. Please change the CM fonts to something more pretty, |
| 469 |
eg Helvetica. |
| 470 |
|
| 471 |
How to use the \TeX\ ruler |
| 472 |
|
| 473 |
Rulers. Use them like ordinary rulers. It is suggested |
| 474 |
that you print the \TeX\ ruler on transparent plastic and |
| 475 |
cut the edges along the rulers. |
| 476 |
|
| 477 |
Baseline distances. Put the top line along the baseline |
| 478 |
of some line of text. Then see in what column the other |
| 479 |
lines of text line up. |
| 480 |
|
| 481 |
Font sizes: cap height. Take an uppercase letter |
| 482 |
such as `K' or `H'. Find the line with its font name, |
| 483 |
or use the first line. See what box on that line |
| 484 |
it fits in best, with the character completely between |
| 485 |
the lines. Read out the magnification and size of the |
| 486 |
font. Alternately check on all lines which box fits |
| 487 |
best, then read out the size. |
| 488 |
|
| 489 |
General remark: all lines have a width of .05 millimeter. |
| 490 |
This is less than the dot width of a 300dpi |
| 491 |
laser printer, so beware of some inaccuracies. |
| 492 |
Also your printer driver may introduce |
| 493 |
inaccuracies. |
| 494 |
|
| 495 |
\leavevmode |
| 496 |
{\obeylines \parskip=0pt % |
| 497 |
Victor Eijkhout |
| 498 |
Department of Computer Science |
| 499 |
University of Tennessee |
| 500 |
Knoxville, TN 37996 |
| 501 |
USA\par {\tt [email protected]}} |
| 502 |
|
| 503 |
\vfil |
| 504 |
Copyright 1990-99 by Victor Eijkhout |
| 505 |
\eject |
| 506 |
\endgroup |
| 507 |
|
| 508 |
\endlinechar-1 |
| 509 |
|
| 510 |
\def\BigSheet{\leavevmode |
| 511 |
\leftrulertrue \inchruler{11}{\storea} |
| 512 |
\box\storea |
| 513 |
\papersize{8.5in}{11in} |
| 514 |
% |
| 515 |
\vtop{ |
| 516 |
\baselinegrid{18}\storea \box\storea |
| 517 |
\kern1mm |
| 518 |
\moveright2mm |
| 519 |
\vbox{\hbox{\ss Baseline distances} |
| 520 |
\neerskip \hrule} |
| 521 |
\kern5mm |
| 522 |
% |
| 523 |
\moveright2mm |
| 524 |
\hbox{ |
| 525 |
\vtop{\vbox{\hrule \opskip \hbox{\ss Cap heights}} |
| 526 |
\kern-3mm |
| 527 |
\def\a{\kern2mm} |
| 528 |
\magrow{cmr10\\cmbx10\\cmss10\\cmmi10}{250}{36}{1pt}{10}\storec |
| 529 |
\magrow{cmtt10\\cmff10}{220}{36}{1pt}{10}\stored |
| 530 |
\magrow{cmr7\\cmbx7\\cmmi7}{175}{36}{1pt}7\storee |
| 531 |
\magrow{cmr5\\cmbx5\\cmmi5}{125}{36}{1pt}5\storef |
| 532 |
\vbox{\a\box\storec \a\box\stored |
| 533 |
\a\box\storee \a\box\storef} |
| 534 |
% |
| 535 |
\gmagrow{cmr10}{25}{36}{1pt}51{14}\storec |
| 536 |
\gmagrow{cmr10}{25}{36}{1pt}{15}1{24}\stored |
| 537 |
\gmagrow{cmr10}{25}{36}{1pt}{26}2{44}\storee |
| 538 |
\gmagrow{cmr10}{25}{36}{1pt}{46}2{64}\storef |
| 539 |
\vbox{\a\box\storec \a\box\stored |
| 540 |
\a\box\storee \a\box\storef} |
| 541 |
% |
| 542 |
\leftrulertrue \picaruler{19}{\storea} |
| 543 |
\setbox\storeb=\vtop{\kern0cm |
| 544 |
\def\a{}%{\moveright1cm} |
| 545 |
\a\vbox{\hrule \opskip |
| 546 |
\hbox{\strut\ss Conversion of units}} |
| 547 |
\kern2mm |
| 548 |
\halign{\vrule height8pt depth3pt width0pt |
| 549 |
\ss##\ &${}={}$\hfil\ \ss##&$\,$##\cr |
| 550 |
1{\tt in}& 72.27&{\tt pt}\cr |
| 551 |
1{\tt in}& 72&{\tt bp}\cr |
| 552 |
1{\tt in}& 25.4&{\tt mm}\cr |
| 553 |
1157{\tt dd}& 1238&{\tt pt}\cr |
| 554 |
1{\tt pt}& 65536&{\tt sp}\cr} |
| 555 |
\kern2mm \table |
| 556 |
\kern8mm |
| 557 |
\hbox{\hskip1cm \big The \TeX\ Ruler} |
| 558 |
\kern2pt |
| 559 |
\hbox{\hskip1cm \tiny Design:\ {} |
| 560 |
Inge and Victor Eijkhout 1990--96}} |
| 561 |
\kern4mm |
| 562 |
\hbox{\box\storea \kern2mm \box\storeb} |
| 563 |
}%end of \vtop |
| 564 |
\kern-1cm |
| 565 |
\vtop{\vbox{\hrule \opskip \hbox{\ss Rule weights}} |
| 566 |
\kern5mm |
| 567 |
\let\rulenum=\decimalb |
| 568 |
\rulestackhead{5}{5}{0.05mm}{0.05mm}{100}\storeg{mm} |
| 569 |
\rulestack {100}{25}{1mm}{0.25mm}{525}\storeh |
| 570 |
\let\rulenum=\decimala |
| 571 |
\rulestackhead{5}{5}{.5pt}{.5pt}{151}\storei{pt} |
| 572 |
\hbox{\box\storeg \kern3mm \box\storeh \kern3mm \box\storei} |
| 573 |
}%end of second \vtop |
| 574 |
}%end of \hbox |
| 575 |
} |
| 576 |
% |
| 577 |
\kern2mm\relax |
| 578 |
\leftrulerfalse \centimeterruler {29}{\storea} |
| 579 |
\papersize{21cm}{29.7cm} |
| 580 |
\box\storea |
| 581 |
} |
| 582 |
|
| 583 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 584 |
\def\smallsheet{\leavevmode |
| 585 |
\leftrulertrue \inchruler{9}{\storea} |
| 586 |
\box\storea \kern2mm |
| 587 |
% |
| 588 |
\vtop{ |
| 589 |
\baselinegrid{18}\storea \box\storea |
| 590 |
\kern1mm |
| 591 |
\moveright2mm |
| 592 |
\vbox{\hbox{\ss Baseline distances} |
| 593 |
\neerskip \hrule} |
| 594 |
\kern5mm |
| 595 |
% |
| 596 |
\moveright2mm |
| 597 |
\hbox{ |
| 598 |
\vtop{\vbox{\hrule \opskip \hbox{\ss Cap heights}} |
| 599 |
\kern-3mm |
| 600 |
\def\a{\kern2mm} |
| 601 |
\magrow{cmr10\\cmbx10\\cmss10\\cmmi10}{250}{36}{1pt}{10}\storec |
| 602 |
\magrow{cmtt10\\cmff10}{220}{36}{1pt}{10}\stored |
| 603 |
\magrow{cmr7\\cmbx7\\cmmi7}{175}{36}{1pt}7\storee |
| 604 |
\magrow{cmr5\\cmbx5\\cmmi5}{125}{36}{1pt}5\storef |
| 605 |
\vbox{\a\box\storec \a\box\stored |
| 606 |
\a\box\storee \a\box\storef} |
| 607 |
% |
| 608 |
\leftrulertrue \picaruler{19}{\storea}%\showbox\storea |
| 609 |
\setbox\storeb=\vtop{\kern0cm |
| 610 |
\def\a{}%{\moveright1cm} |
| 611 |
\a\vbox{\hrule \opskip |
| 612 |
\hbox{\strut\ss Conversion of units}} |
| 613 |
\kern2mm |
| 614 |
\halign{\vrule height8pt depth3pt width0pt |
| 615 |
\ss##\ &${}={}$\hfil\ \ss##&$\,$##\cr |
| 616 |
1{\tt in}& 72.27&{\tt pt}\cr |
| 617 |
1{\tt in}& 72&{\tt bp}\cr |
| 618 |
1{\tt in}& 25.4&{\tt mm}\cr |
| 619 |
1157{\tt dd}& 1238&{\tt pt}\cr |
| 620 |
1{\tt pt}& 65536&{\tt sp}\cr} |
| 621 |
\kern2mm \table |
| 622 |
\kern8mm |
| 623 |
\hbox{\hskip1cm \big The \TeX\ Ruler} |
| 624 |
\kern2pt |
| 625 |
\hbox{\hskip1cm \tiny Design:\ {} |
| 626 |
Inge and Victor Eijkhout 1990--96}} |
| 627 |
\kern4mm |
| 628 |
\hbox{\box\storea \kern2mm \box\storeb} |
| 629 |
}%end of \vtop |
| 630 |
\kern-1cm |
| 631 |
\vtop{\vbox{\hrule \opskip \hbox{\ss Rule weights}} |
| 632 |
\kern5mm |
| 633 |
\let\rulenum=\decimalb |
| 634 |
\rulestackhead{5}{5}{0.05mm}{0.05mm}{50}\storeg{mm} |
| 635 |
\rulestack {50}{10}{.5mm}{0.1mm}{160}\storeh |
| 636 |
\let\rulenum=\decimala |
| 637 |
\rulestackhead{5}{5}{.5pt}{.5pt}{101}\storei{pt} |
| 638 |
\hbox{\box\storeg \kern3mm \box\storeh \kern3mm \box\storei} |
| 639 |
}%end of second \vtop |
| 640 |
}%end of \hbox |
| 641 |
} |
| 642 |
% |
| 643 |
\kern2mm\relax |
| 644 |
\leftrulerfalse \centimeterruler {23}{\storea} |
| 645 |
\box\storea |
| 646 |
} |
| 647 |
|
| 648 |
|
| 649 |
\count0=2 |
| 650 |
\BigSheet |
| 651 |
\vfill\eject |
| 652 |
\count0=3 |
| 653 |
\smallsheet |
| 654 |
|
| 655 |
\end |
| 656 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |