[texhax] Accents

Nelson H. F. Beebe beebe at math.utah.edu
Thu May 8 10:43:29 CEST 2003


Michael Doob writes over his first cuppa java:

>> I would think that it is not true that \strut does not print nothing.

Double negatives make our brains whirl... :^)

Compare these two cases:

	% cat strut.tex
	\strut\let\folio=\relax\bye

	% tex strut.tex

	% dv2dt strut.dvi
	variety sequences-5
	pre 2 25400000 473628672 1000 27 ' TeX output 2003.05.08:0918'
	bop 1 0 0 0 0 0 0 0 0 0 -1
	[
	d3 -917504
	]
	d4 42152922
	[
	d4 -41497562
	]
	d3 1572864
	eop
	post 42 25400000 473628672 1000 43725786 30785863 2 1
	post_post 110 2 223 223 223 223 223 223 223

	% cat strut-dot.tex
	\strut.\let\folio=\relax\bye

	% tex strut-dot.tex

	% dv2dt strut-dot.dvi
	variety sequences-5
	pre 2 25400000 473628672 1000 27 ' TeX output 2003.05.08:0919'
	bop 1 0 0 0 0 0 0 0 0 0 -1
	[
	d3 -917504
	]
	d4 42152922
	[
	d4 -41497562
	[
	r3 1310720
	fd1 0 11374260171 655360 655360 0 5 'cmr10'
	fn0
	(.)
	]
	]
	d3 1572864
	eop
	post 42 25400000 473628672 1000 43725786 30785863 2 1
	fd1 0 11374260171 655360 655360 0 5 'cmr10'
	post_post 139 2 223 223 223 223 223

In the first case, the \strut produced movement on the page, but no
marks, and no fonts.  In the second case, a single mark from character
`.' in cmr10, was produced.

>From plain.tex:

	\newbox\strutbox
	\setbox\strutbox=\hbox{\vrule height8.5pt depth3.5pt width\z@}
	\def\strut{\relax\ifmmode\copy\strutbox\else\unhcopy\strutbox\fi}

Thus, \strut is just a zero-width box of a specified height and depth:
8.5pt + 3.5pt = 12pt, the normal value of \baselineskip for 10pt type.

Interestingly, Mike Spivak in AmSTeX chose

	\setbox\strutbox@\hbox{\vrule height8\p@ depth3\p@ width\z@}

It is exactly one point shorter than Don Knuth's in plain TeX.

Leslie Lamport in LaTeX 2.09's lplain.tex uses the same definition
as Don did.

The LaTeX-2e developers made yet another choice:  in latex.ltx
in the definition of f\set at fontsize, they have

        \setbox\strutbox\hbox{%
          \vrule\@height.7\baselineskip
                \@depth.3\baselineskip
                \@width\z@}%

In a 10pt type on 12pt baseline, this produces a box of height
8.4pt and depth 3.6pt.

AmSLaTeX in amstex.sty makes the same choice as LaTeX-2e.

A strut is sometimes claimed to be a zero-width box of the height and
depth of the font's parenthesis.  Let's see what that is:

	% cat paren.tex
	\setbox0=\hbox{(}
	\showthe\wd0
	\showthe\ht0
	\showthe\dp0
	\bye

	% tex paren.tex
	This is TeX, Version 3.1415 (C version 6.1)
	(paren.tex
	> 3.8889pt.
	l.2 \showthe\wd0

	? 
	> 7.5pt.
	l.3 \showthe\ht0

	? 
	> 2.5pt.
	l.4 \showthe\dp0

	? 
	 )

The parenthesis definition of a strut would give us a box of 
0pt x (7.5pt + 2.5pt), which is 2pt shorter than that in plain.tex.

Actually, this is a \mathstrut, which Raymond Seroul in Le Petit Livre
de TeX says should not be confused with \strut: a \mathstrut is
smaller.

I guess this is a case of one of the finer *points* of typography :^).


-------------------------------------------------------------------------------
- Nelson H. F. Beebe                    Tel: +1 801 581 5254                  -
- Center for Scientific Computing       FAX: +1 801 581 4148                  -
- University of Utah                    Internet e-mail: beebe at math.utah.edu  -
- Department of Mathematics, 110 LCB        beebe at acm.org  beebe at computer.org -
- 155 S 1400 E RM 233                       beebe at ieee.org                    -
- Salt Lake City, UT 84112-0090, USA    URL: http://www.math.utah.edu/~beebe  -
-------------------------------------------------------------------------------



More information about the texhax mailing list