# \hat Causes double superscript

I have the following:

 {{\hat{\pi}}^a}^b


Everything is grouped, so it should behave fine, but it causes a double superscript error, same is true for {\hat{\pi}^a}^b. if I remove the \hat every thing works, even if I add a \bar:

{{\hat{\bar{\pi}}}^a}^b


Everything works. Removing the last superscript {{\hat{\pi}}^a} also works. Cant find the reason the first line breaks. Any help would be appreciated.

You can use

\documentclass{article}

\begin{document}

${{}\hat{\pi}^a}^b$
\end{document}


This is caused by an primitive feature of tex's treatment of math lists that just consist of an accent node essentially losing one level of grouping.

• Thanks! works now. – Dinari Sep 23 at 7:12