This question already has an answer here:



${x_i}^j$ works as expected but not with an hat as in ${\hat{x}_i}^j$.
The way I found to make it work is $\mbox{$\hat{x}_i$}^j$.  Is there
an nicer solution?


marked as duplicate by Peter Grill, Community Dec 17 '15 at 6:43

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Welcome to TeX.SE. Do you perhaps mean $x_i^j$ and ${\hat{x}_i^j}$? – Peter Grill Dec 17 '15 at 5:21
  • No, I mean ${x_i}^j$, so that exponent $j$ appears to the right of $x_i$. – user94293 Dec 17 '15 at 5:29

If you want the hat centered of the "x" and the "j" not too close, the most simple code would be \hat{x}_i{}^{j}. This way the height of the symbol is not taken into account, so is not exactly the same result, but {{}\hat{x}_i}^{j} obtain exactly the same result. Some comparisons:


$\widehat{x_i}^j$ \dotfill{\tiny   \verb|$\widehat{x_i}^j$|}\par
$\hat{x}_i{}^{j}$ \dotfill{\tiny    \verb|$\hat{x}_i{}^{j}$|}\par 
${{}\hat{x}_i}^{j}$ \dotfill{\tiny    \verb|${{}\hat{x}_i}^{j}$|}\par 
${\strut\hat{x}_i}^{j}$ \dotfill{\tiny    \verb|$\strut\hat{x}_i{}^{j}$|}\par 
$\mbox{$\hat{x}_i$}^j$  \dotfill{\tiny  \verb|$\mbox{$\hat{x}_i$}^j$|}\par
$\hat{x_i}^j$ \dotfill{\tiny   \verb|$\hat{x_i}^j$|}\par     
${\hat{x}_i}^j$ \dotfill{\tiny   \verb|${\hat{x}_i}^j$|}\par
  • To get the exact same result as with the \mbox{}, I am now using ${\hat{x}_i{}}^j$. – user94293 Dec 17 '15 at 6:32
  • @user94293 Unfortunately, not the same. I have updated the answer to not misleading, but it is already explained in the linked question. – Fran Dec 17 '15 at 6:50

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