[OS X TeX] Default rule thickness

Bruno Voisin bvoisin at me.com
Thu Aug 7 11:35:14 CEST 2008


Le 6 août 08 à 12:39, Oliver Buerschaper a écrit :

>> My feeling is that TeX uses the same default rule thickness for all  
>> rules (in \overline, \underline, \over, \sqrt, \footnote, ...) and  
>> that it is the thickness given at the beginning of chapter 21  
>> "Making Boxes":
>>
>> \hrule width=<depends on contest>, height=0.4pt, depth=0.0pt
>> \vrule width=0.4pt, height=<depends on contest>, depth=<depends on  
>> contest>
>
> I also stumbled upon this and I guess its a reasonable value to  
> assume for the standard font size.
>
> But do you know how TeX (or LaTeX that is) scale this value with  
> increasing global font size?

Actually I was silly yesterday: you can just ask TeX the question and  
it will return the answer.

In plain TeX you would use something like

\scrollmode
\parindent=0pt
\newbox\rulebox \newdimen\ruledimen
\setbox\rulebox=\vbox{\hrule width1cm}
\ruledimen=\ht\rulebox \showthe\ruledimen
Default rule height is \the\ruledimen.
\ruledimen=\dp\rulebox \showthe\ruledimen
Default rule depth is \the\ruledimen.
\bye

which will print the height and depth of the default rule to the  
console, and also write it in the PDF output for good measure.

In LaTeX you can get a bit more with

\documentclass{article}
\scrollmode
\setlength{\parindent}{0pt}
\setlength{\parskip}{0.7em}
\newsavebox{\rulebox}
\newlength{\ruledimen}
\begin{document}
\normalsize We are in normal size.
\sbox{\rulebox}{\makebox[1cm]{\hrulefill}}%
\settoheight{\ruledimen}{\usebox{\rulebox}}%
\typeout{\the\ruledimen}%
Default rule height is \the\ruledimen.
\settodepth{\ruledimen}{\usebox{\rulebox}}%
\typeout{\the\ruledimen}%
Default rule depth is \the\ruledimen.
\par
\large We are in \verb+\large+ size.
\sbox{\rulebox}{\makebox[1cm]{\hrulefill}}%
\settoheight{\ruledimen}{\usebox{\rulebox}}%
\typeout{\the\ruledimen}%
Default rule height is \the\ruledimen.
\settodepth{\ruledimen}{\usebox{\rulebox}}%
\typeout{\the\ruledimen}%
Default rule depth is \the\ruledimen.
\end{document}

which will do the same as before for both normal and large size.

In this way you verify the default rule thickness does not vary with  
font size.

Bruno Voisin


More information about the macostex-archives mailing list