0

I wish to define a superscript that is adaptive to the height of the character before it. Just like using the \dagger offered by latex. For example, for the following code:

\[    
  \sqrt{p^\top \mathcal{E}_u^\top \, p^x \mathcal{E}_u^x \, {p^\dagger} \mathcal{E}_u^\dagger}
\]

I get the following result

enter image description here

Notice how the height of the superscript \top and x are the same for characters of different sizes, but the \dagger superscript is properly placed. How can I get the similar behavior as \dagger?

1 Answers1

3

\dagger has no special rules here, it is just rather taller and deeper than the other symbols, and so with the default superscript raise in the (cramped) style in the sqrt, there would not be sufficient room for the subscript u so it is raised more. If you increase the amount subscripts are raised in cramped style you can see it acts the same as other characters.

enter image description here

\documentclass{article}

\usepackage{amsmath}

\begin{document}

[ \fontdimen15\textfont2=5pt
\sqrt{p^\top \mathcal{E}_u^\top , p^x \mathcal{E}_u^x , {p^\dagger} \mathcal{E}_u^\dagger} ]

\end{document}

See

What do different \fontdimen<num> mean

Faheem Mitha
  • 7,778
David Carlisle
  • 757,742
  • This solves my doubt about the \dagger behaviour. It seems there is no simple way to automatically adjust superscript height then. – Jiaan Qi Jun 14 '21 at 03:16