[texhax] Misplaced parentheses

Uwe Lueck uwe.lueck at web.de
Sat Oct 30 12:04:59 CEST 2010

"Donald Arseneau" [, 30.10.2010 01:54:50:
>Michael Barr  writes:
>> $(\widehat d)$
>1) the letter "d" has its high point over on the right, but the 
> accent is centered over the entire letter, extrapolated along the
> slope.  If you take the wide part of the d, follow a sloped line
> up parallel to the stem, you nearly meet the apex of the hat.
> I bet you expect the hat to be aligned with the stem only.
> 2) The character d in computer modern math italic has the wrong
> bounding box. This is a typical Knutian ad-hoc-hack so that 
> "dx" looks like a differential instead of d times x.  Compare
> $d\vrule = \l\vrule$.

Very interesting, and "Philipp Stephani" , 29.10.2010 22:38:54
suggests using a different font for math italic:
>Am 29.10.2010 um 22:09 schrieb Michael Barr:
>> $(\widehat d)$
> I think it's a combination of the limitations of TeX's math 
> typesetting algorithms (using \skewchar and italic correction
> for accent placement etc.) and font design choices.
> For example, I find the result with Cambria Math
>  (compiled with LuaTeX) quite a bit nicer:
> Maybe you just have to switch to a different math font.

Two issues from the former:

(A) Michael Barr  writes:
> I don't expect tex to produce awful-looking output.
But the TeXbook says on p. 167: 

    Chapter 16 says that TeX does automatic spacing 
    of math formulas so that they look right, and this is 
    almost true. But occasionally you must give TeX 
    some help.

(ctan.org/pkg/nath tries to be somewhat smarter.)
I am continuing this issue below for the special case of brackets. 

(B) *Which font could I switch to with Computer Modern to get proper spacing in math??*
(We had this issue much earlier, raised by Michael Barr too.) 
The secret motivation for my question is that actually 
somebody hopes I will create a \mathnormal font 
from Adobe Caslon. This would be my first virtual font or so ...
... just in case somebody can save me from some 
of my own investigations, I do know where to look myself ...

"Donald Arseneau" [ continued:
> 3) Math accents are made invisible to the rest of the layout.
> (viz ${\hat x}^2$).  The overlap on the side is the inevitable
> result when you put a wider accent on a narrower letter

In Michael Barr's expample, the \widehat in $[\widehat d]$ 
somewhat looks like $[\widehat{d]}$, the right bracket is 
beneath the accent, cf. "Reinhard Kotucha" 
<reinhard.kotucha at web.de>, 29.10.2010 22:55:33:
> However, what IMO is incorrect is the output of $[c = d]$.  On the
> other hand, $[\mathrm{c}=\mathrm{d}]$ looks ok.

Brackets/parantheses try to "embrace" their scope really 
tightly, apparently even from top and below. Three aspects:

(C) (Somewhat trivial:) cmex has only *three widths* for \widehat, 
so there is no adjustment to the actual shape of a single character 
in its scope, and it may look "too wide" in certain situations ...

(D) Ends of parentheses/brackets seem to touch 
the bounding box of the scope or even intrude into it 
(this is my impression especially with square brackets). 
This may look fine in something like

    has [a] hat

but I don't like 

   has [a wide] hat

I then tend to prefer 

   has [ a wide ] hat

I think it is for a similar reason that the TeXbook, pp. 174ff., recommends typing 


rather than 


for certain purposes. So one suggestion I have for Michael Barr is 

    $[\,\widehat d\,]$

But there is something else ...

(E) Brackets are designed to be at least as high and deep as the 
bounding box of what they "embrace". This works with simple words, 
but accents ... in math one may think of the automatic scaling 
of delimiters using \left and \right ... I try ... even the `exscale' package ... 
sorry, in this case ... somebody might provide a package that 
*raises* brackets then the scope has no descenders but accents ... 



More information about the texhax mailing list