[texhax] modifying \overline

Michael Doob mdoob at ccu.umanitoba.ca
Mon Aug 17 19:49:13 CEST 2009


On Monday 17 August 2009 10:47 am, Phil Parker wrote:
> \overline does not behave wull with math italics. For example, look at
> $\overline{H}$ or $\overline{\partial}$ -- the overline sticks out too far to
> the left. If I understand correctly, it is not respecting the \skewchar of the
> math italic font.
> 
> What I would like to do is create a "modified \overline" command that would
> place an overline of the appropriate length "italic centered" on math italic
> fonts. It looks as if all that needs changing is the left starting point of
> the overline (hence its length, too) as the right ending point appears to be
> in the correct place. If I understand the TeX book correctly, that's what
> \skewchar is for; I just don't understand how to use it here.
> 
> Perhaps this has already been done, but I've been unable to find it or
> construct my own. I've looked in the TeX book, Voss's mathmode, and the UK
> FAQ. Probably there's something about \overline I don't understand so that I
> can't figure out how to make a new version that "italic centers" the overline.
> 
> Any and all help is greatly appreciated.
> 

TeX works with boxes while not knowing anything about the glyphs that will eventually
be rendered. In many cases the boxes correspond quite closely to the bounding boxes
of the characters, and then overline more or less matches. With italic characters,
the glyphs may extend beyond the character heights and widths defined in the tfm
file. You're stuck here.

What you could do is make a virtual font where the overlines are included on a
character by character basis. There are underline fonts that do this so that
descenders are not overwritten, and an analogous overline font would be pretty easy
to construct.

Cheers,
Michael

-- 
------------------------------------------------------------------
Michael Doob                    Telephone: (204) 474-9796
Department of Mathematics       Fax: (204) 474-7606
University of Manitoba          email: Michael_Doob at umanitoba.ca
Winnipeg, MB, Canada R3T 2N2
------------------------------------------------------------------


More information about the texhax mailing list