[PRL] mathit

Richard Cobbe cobbe at ccs.neu.edu
Wed Apr 12 09:44:34 EDT 2006


On Wed, Apr 12, 2006 at 08:49:07AM -0400, Eli Barzilay wrote:
> On Apr 12, Riccardo Pucella wrote:
> > 
> > Yes, but the results (whether or not they *look* the same) also
> > depends on which fonts Dave chose. Thus, if you use times fonts for
> > text and modern for math, then \mathit will use modern-italics and
> > \mbox{\textit{...}} will use times-italics, no?

Riccardo is correct, although with the newer packages for Times New
Roman and Palatino, this is less of a problem.  The situation is a bit
complex and isn't really related to Dave's question.  The short answer:
the times.sty and palatino.sty packages are obsolete; more info
available on request.

> On Apr 12, Dave Herman wrote:

> > That's what I want to know. I want to italicize a name with a hyphen
> > in it, and \mathit treats the hyphen as a subtraction symbol (so
> > actually, the two forms are certainly not equivalent, at least in
> > this sense). But I wasn't sure if switching to \mbox{\textit} looks
> > subtly different. I couldn't tell just by looking, but I'd like to
> > know if purists might balk.
> 
> As far as treating text like text (so `-' is a dash, and you get the
> normal looking `ff' that doesn't look like f times f), \mathit works.

Unfortunately, Dave is right; \mathit doesn't quite do the right thing
for hyphens, as you can see from the following LaTeX file:

    \documentclass{article}
    \begin{document}
    \textit{big-identifier} \qquad $\mathit{big-identifier}$
    \end{document}

You'd like the right-hand one to look like the left-hand one, but it
doesn't.

The \mbox{\textit{...}} solution is good in simple cases, but it has one
annoying limitation: it doesn't do the right thing in subscripts or
superscripts:

    $a_{\mathit{big-identifier}}$ \qquad $a_{\mbox{\textit{big-identifier}}}$

Neither one of those is what you want: the first one gets the hyphen
wrong; the second one sets "big-identifier" at full size, instead of
reducing it to the size for subscripts.

I had to do a usenet search for this, but the answer seems to be:

    \documentclass{article}

    \usepackage{amstext}     %% included in recent teTeX distributions

    \begin{document}

    $a_{\text{\textit{big-identifier}}}$

    \end{document}

Essentially, \text is like \mbox, except that it does scaling right in
superscripts and subscripts.

Richard



More information about the PRL mailing list