Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

changing height\depth of sub- and superscripts

1,671 views
Skip to first unread message

coo...@nospamverizon.net

unread,
Oct 27, 2007, 2:29:22 PM10/27/07
to
I *think* I've seen this discussed in an earlier post, but despite my
better efforts, I can't seem to track it down.

I'm interested in techniques/options for changing the height (for
superscripts) or depth (for subscripts) from the LaTeX defaults - in
other words, change (overrride) the default vertical spacing rules for
sub- and superscripts. I ask because quite often, my students make
mistakes on assignments by confusing what should have been subscripts
as separate variables in an equation.

For example, $\rho\gamma_{PH}$. The PH product should be a subscript
for \gamma, but in \cm font, if you're not paying attention when
reading, it looks a lot like rho * gamma* PH. In other words, the
subscript depth for {PH} isn't 'deep' enough for the reader to
unambiguously see that the {PH} is a subscript. THis would be solved,
I think, if I could make the subscript a bit deeper (same being true
in reverse for superscripts).

Suggestions? Pointers to the obvious?

Thanks in advance...

Enrico Gregorio

unread,
Oct 27, 2007, 3:19:46 PM10/27/07
to
<coo...@NOSPAMverizon.net> wrote:

$\rho\gamma^{}_{PH}$

The fake exponent lowers the subscript.

Ciao
Enrico

Joseph Wright

unread,
Oct 27, 2007, 3:24:21 PM10/27/07
to

Perhaps look at the subdepth package?

Joseph Wright

coo...@nospamverizon.net

unread,
Oct 27, 2007, 4:35:22 PM10/27/07
to

>>
>> Suggestions? Pointers to the obvious?
>
>$\rho\gamma^{}_{PH}$
>
>The fake exponent lowers the subscript.
>
>Ciao
>Enrico


Thanks - I'll give that a try.

coo...@nospamverizon.net

unread,
Oct 27, 2007, 4:36:00 PM10/27/07
to

>Perhaps look at the subdepth package?
>
>Joseph Wright


Ah, yes - forgot about that. I'd seen it mentioned before, but
couldn't recall what this package did.

Thanks - I'll give it a try.

coo...@nospamverizon.net

unread,
Oct 27, 2007, 7:36:17 PM10/27/07
to

>
>Perhaps look at the subdepth package?
>
>Joseph Wright


Actually, subdepth *prevents* the lowering of the subscript when a
superscipt is also in place. So, it does exactly the *opposite* of
what I'm looking for.

coo...@nospamverizon.net

unread,
Oct 27, 2007, 7:47:56 PM10/27/07
to

>
>$\rho\gamma^{}_{PH}$
>
>The fake exponent lowers the subscript.
>
>Ciao
>Enrico


Works fine (and thanks!), but exchanges one fixed subscript depth for
another fixed (although the latter is better than the default, IMO).

I'm wondering if there is something that gives more precise control -
such that you can specify precisely (points, mm, or some unit) the
default height/depth? I have to believe that there is a more elegant
approach, or a package that does same.

I ask because I might have 20-30 sub/superscripts per page, over
hundreds and hundres of pages, and having to do the 'fake exponent'
approach gets cumbersom.


Will Robertson

unread,
Oct 27, 2007, 9:55:12 PM10/27/07
to
On Oct 28, 9:36 am, cooc...@NOSPAMverizon.net wrote:
> Actually, subdepth *prevents* the lowering of the subscript when a
> superscipt is also in place. So, it does exactly the *opposite* of
> what I'm looking for.

Not exactly; it does lower the subscript a little bit.
But I do agree it's not exactly what you're looking for.
I'm slowly working on an update to the package that might help you,
but it's nowhere near ready. In the meantime, you could try reading
the great article "Appendix G Illuminated" by Bogaslaw Jackowski for
the parameters to adjust the subscript/superscript heights, and use
the method in subdepth to apply the changes.

Sorry not to be of more help,
Will

Martin Heller

unread,
Oct 27, 2007, 10:13:23 PM10/27/07
to
coo...@NOSPAMverizon.net skrev:

Try changing \fontdimen16 and \fontdimen17 (maybe only locally).

\documentclass{article}

\everymath{%
\fontdimen16\textfont2=3.0pt
\fontdimen17\textfont2=3.0pt
}

\begin{document}

\(
\rho\gamma_{PH}
\)

\end{document}

coo...@nospamverizon.net

unread,
Oct 28, 2007, 8:10:22 AM10/28/07
to
On Sat, 27 Oct 2007 14:29:22 -0400, coo...@NOSPAMverizon.net wrote:


Found a previous post that helps considerably:

\def\xstrut{\rule{0pt}{2ex}}

$p_{\xstrut X,Y}(x,y) = p_{\xstrut X}(x) p_{\xstrut Y}(y)$


coo...@nospamverizon.net

unread,
Oct 28, 2007, 8:50:05 AM10/28/07
to


So, in my case:

\def\xstrut{\rule{0pt}{2ex}}

$\rho\gamma_{\xstrut PH}


which IMO looks *much* better* (less prone to misread) than

$\rho\gamma_{PH}$


I do note that this problem seems most acute with Computer Modern as
the font (among the few fonts I've tried).

coo...@nospamverizon.net

unread,
Oct 28, 2007, 11:26:29 AM10/28/07
to

Neat idea - I'll give it a try. Thanks!

coo...@nospamverizon.net

unread,
Oct 28, 2007, 9:05:11 PM10/28/07
to
Thanks for the reference to Jackowski. I'll dig it out.

On Sat, 27 Oct 2007 18:55:12 -0700, Will Robertson <wsp...@gmail.com>
wrote:

Will Robertson

unread,
Oct 29, 2007, 2:45:09 AM10/29/07
to
On Oct 28, 10:50 pm, cooc...@NOSPAMverizon.net wrote:
>
> which IMO looks *much* better* (less prone to misread) than
>
> $\rho\gamma_{PH}$
>
> I do note that this problem seems most acute with Computer Modern as
> the font (among the few fonts I've tried).

Agreed; I've avoided caps subscripts in the past for this very reason.
(Reminds me of Knuth's redesign of \delta when he realised that he was
avoiding using that character in his maths because he subconsciously
found it ugly. Or so the story goes.)

W

StevieD83

unread,
Oct 29, 2007, 4:30:08 AM10/29/07
to
On Oct 27, 10:13 pm, Martin Heller <mr_hel...@yahoo.dk> wrote:
> cooc...@NOSPAMverizon.net skrev:

This doesn't work, because \textfont2 is not defined the way it would
be in plain TeX. On a side note, what is the name of math font 2 in
LaTeX (it is not \textfont2 or \tensy).

Steve

Dan

unread,
Oct 29, 2007, 12:22:54 PM10/29/07
to

The above example works for me. Unfortunately, \everymath
is one of those things, like \everypar, that LaTeX takes hold
of from time to time.

> because \textfont2 is not defined the way it would
> be in plain TeX. On a side note, what is the name of math font 2 in
> LaTeX (it is not \textfont2 or \tensy).

In LaTeX it is also \textfont2. Except that it is done symbolically,
using \symsymbols instead of 2.

LaTeX delays the definition of \textfont2 until the first actual use
of math mode. Thus, \textfont2 may be \nullfont until then.

I am not quite sure when \textfont2 comes into existence, but I
have never had any trouble invoking it inside macros that produce
actual mathematical symbols.

(The purpose of LaTeX's delayed scheme seems to be to avoid
using up TeX's limited number of math families if they are not
actually to be used.)


Dan

Enrico Gregorio

unread,
Oct 29, 2007, 11:41:52 AM10/29/07
to
Dan <luec...@uark.edu> wrote:

Every assignment to a \fontdimen is global; but if we use math at
various sizes, the assignment must be repeated after having checked
the fonts.

There is a token list that can help, \frozen@everymath, which is used
to restore the default value of \everymath: therefore

\makeatletter
\frozen@everymath={\check@mathfonts
\fontdimen16 \textfont2=\fontdimen17 \textfont2
\the\everymath}
\makeatother

should accomplish the task of putting every subscript at the same
level as in display math. I wouldn't use explicit values like 3pt,
which are surely wrong when large fonts are used. Probably expressing
the dimension in ex units is better, if you want settings different
from the above one.

Ciao
Enrico

StevieD83

unread,
Oct 29, 2007, 4:48:32 PM10/29/07
to

Yes, it compiles, but on my system at least, it doesn't change
anything. \the\fontdimen16\textfont2
is 1.5pt when the document starts, and within the math environment.
Am I missing something?

Steve

StevieD83

unread,
Oct 29, 2007, 5:07:46 PM10/29/07
to

Never mind, changing everymath to everydisplay did the trick.

Steve

coo...@nospamverizon.net

unread,
Nov 19, 2007, 8:33:43 PM11/19/07
to
On Sat, 27 Oct 2007 18:55:12 -0700, Will Robertson <wsp...@gmail.com>
wrote:

>On Oct 28, 9:36 am, cooc...@NOSPAMverizon.net wrote:

\


Yeah, given that you put in all the work to make a package that will
help stiffs like me, you should appologize. ;-)

Not. Thanks! I'll look forward to the 'improved' package when its
ready.

Will Robertson

unread,
Nov 20, 2007, 9:06:18 PM11/20/07
to
On Nov 20, 11:33 am, cooc...@NOSPAMverizon.net wrote:
>
> Yeah, given that you put in all the work to make a package that will
> help stiffs like me, you should appologize. ;-)
>
> Not. Thanks! I'll look forward to the 'improved' package when its
> ready.

:)

I'll take that as a nudge that I'm being a bit slow with getting my
package out. Sorry again! Got distracted by another mini-project --
released on CTAN today, so I might be able to get back to the subdepth
thing.

Cheers,
Will

0 new messages