[Tex/LaTex] Combining \bar with superscripts

positioningsuperscripts

Easy question here but haven't been able to find the answer online. I am trying to create the following symbol in math mode: an i, with a bar over it, and then an asterisk as a superscript to the entire object.

My initial attempt was the simple $\bar{i}^*$, however, the asterisk seems to fall under the bar. I need the asterisk to look as if it's the superscripts for all of \bar{i}. My other (unsuccessful) attempts have included using the empty group {} to create a gap between the \bar{i} and the superscript, using \mbox{} to delimit the \bar{i} as admitting a superscript, and simply playing around with placement. In all these cases, however, I still end up with an asterisk that looks to be below or at the same height as the bar, not above. Any suggestions?

Best Answer

In my opinion, what is being asked here is just a way to circumvent the rule, stated in The TeXbook, p. 291, l. 16–17, that prevents ${\bar{i}}^{*}$ from having the desired effect; for this, it suffices to say, e.g., ${\bar{i}{}}^{*}$, whereby no extra height is introduced.

Here is a complete, compilable source code:

\documentclass[a4paper]{article}
\usepackage[T1]{fontenc} % comment or uncomment as preferred

\begin{document}
Compare: $\bar{i}^{*}$, ${\bar{i}}^{*}$, ${\bar{i}{}}^{*}$, $\bar{i}\strut^{*}$.
\end{document}

And here is the output it produces:

Output of the above code

Note that, in the fourth case, the asterisk is rised slightly more than in the third one.