6

A minimal example of my issue is T_a T_b vs T_a T_{\dot b}.

In the second, I want the b subscript to align with the a subscript irrespective of the overset. I know there probably hacky ways to create negative space on the second subscript, but I want something that can scale with the math.

Maybe something along the lines of making the box of \dot b the same size as just a regular b somehow?

EDIT: MWE

\documentclass{article}

\begin{document}
$T_a T_b$ vs $T_a T_{\dot b}$
\end{document}
3
  • 1
    Welcome into the site TeX.SE.
    – Sebastiano
    Jan 16, 2020 at 16:58
  • 1
    Could you add a minimum working example? Jan 16, 2020 at 17:04
  • One could do something like T\strut_a T\strut_{\dot b} which aligns the subscripts but moves them to an unnaturally low location.
    – NoWayHaze
    Jan 16, 2020 at 17:08

2 Answers 2

12

The common approach here is to use a \vphantom of the larger object, or \smash the larger next to a \vphantom of the smaller:

enter image description here

\documentclass{article}

\begin{document}

$T_a T_b$ vs 
  $T_a T_{\dot{b}}$ vs
  $T_{\vphantom{\dot{b}}a} T_{\dot{b}}$ vs
  $T_a T_{\vphantom{a}\smash{\dot{b}}}$

\end{document}
1
  • Yes, \smash is probably all I need here.
    – NoWayHaze
    Jan 19, 2020 at 19:16
7

Borrowing from Hendrik's answer here: Redefine underscore to produce roman subscript without breaking file names

NOT recommended!

\documentclass{article}

\begingroup
  \catcode`\_=\active
  \gdef_#1{\ensuremath{\sb{\smash{#1}}}}
\endgroup
\mathcode`\_=\string"8000
\catcode`\_=12

\begin{document}
$T_a T_b$ vs $T_a T_{\dot b}.$
\end{document}

enter image description here

If one wanted the subscripts universally lower, a variation of the suggestion of NoWayHaze would be this:

\documentclass{article}

\begingroup
  \catcode`\_=\active
  \gdef_#1{\ensuremath{\sb{\strut#1}}}
\endgroup
\mathcode`\_=\string"8000
\catcode`\_=12

\begin{document}
$T_a T_b$ vs $T_a T_{\dot b}.$
\end{document}

enter image description here


As an alternative, you could sacrifice another character, here a !, to specifically mean a subscript in which the height of the element is ignored. Then, you can still use _ in the normal cases.

\documentclass{article}

\begingroup
  \catcode`\!=\active
  \gdef!#1{\ensuremath{\sb{\smash{#1}}}}
\endgroup
\mathcode`\!=\string"8000
\catcode`\!=12

\begin{document}
$T_a T_{\dot b}.$ vs $T_a T!{\dot b}.$
\end{document}

enter image description here

5
  • 1
    Then can I not vote your answer? :)
    – Sebastiano
    Jan 16, 2020 at 17:10
  • @Sebastiano With my edit, I feel more comfortable allowing you to upvote ;^) Jan 16, 2020 at 17:12
  • 1
    I have done before (the upvote)...excuse me very very much :-)
    – Sebastiano
    Jan 16, 2020 at 17:13
  • I feel like the alternative answer this probably is good enough for my uses for now. Luckily, as far as I can tell, this issue doesn't affect superscripts.
    – NoWayHaze
    Jan 16, 2020 at 17:17
  • +1! it is very close what i imagine to be solution to my question tex.stackexchange.com/questions/297754/…
    – Zarko
    May 21, 2020 at 19:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .