Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

The behavior of subscript and supscript operator _ and ^ is like a blackbox to me, I am curious if I could redefine the behavior of them globally for a document.

I searched the forum and found several threads in which partially this question had been addressed:

  • is it possible to change the depth of subscripts?: Joseph said about the {subdepth} package, but it just adjust redefining the subscript behavior when there is no superscript, and it is not customizable.

  • How to raise a subscript?: In this thread a more customizable option is presented in the accepted answer of Harald Hanche-Olsen, in which he defined the a nice newcommand snippet that I am using right now for tuning a specific sub/super-script, the command $\Letter_{\raisemath{2pt}{subscript}}$ would do the trick locally if we add his code snippet into the preamble.

My own solution right now is to define an xsub and an xsup manually like the following:

 \newcommand{\xsub}[3]{{#1}_{\raisebox{#2}{\scriptsize$#3$}}} 

But this is somewhat way too clunky, it makes me wanna micro-adjust every subscript position manually, quite inefficient for me at times.

Here I wonder if we could redefine a document-wide _ behavior such that every time _ is used, the \raisebox{1pt} is gonna be applied, or it is not possible to change the behavior _ and ^ in mathmode at all.

share|improve this question
3  
the superscript positioning is determined by the font parameters, which are set by the font but can be changed after the math fonts have been loaded. –  David Carlisle Mar 2 '12 at 20:14
1  
Hatcher makes global changes to sub- and superscript behavior for Algebraic Topology. The code used to make these changes is described here. –  Z Norwood Mar 3 '12 at 0:01
    
@ZNorwood I believe that you should make this an answer (copy the code from the page you link and include the link as well), because it seems to be what Jon seeks for. –  yo' Mar 3 '12 at 11:35

1 Answer 1

up vote 3 down vote accepted

As described here, Hatcher globally changes the positioning of sub- and superscripts. The code he provides is

\fontdimen16\textfont2=2.5pt
\fontdimen17\textfont2=2.5pt
\fontdimen14\textfont2=4.5pt
\fontdimen13\textfont2=4.5pt 

I think the numbers here might be specific to the font he's using. Perhaps a font expert will comment on this?

share|improve this answer
1  
Math font management in LaTeX is a bit more complex; if one needs math only for the main font size (10pt), then improving that code to \sbox0{$\relax$<the code>} will do. –  egreg Mar 3 '12 at 15:37
    
Thank both of you guys. –  Shuhao Cao Mar 4 '12 at 19:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.