# Leftidx problem: upper indices have different height

When using the leftidx package to create the same upper index on both sides of \Bbbk[G], the indices have different height and look ugly. Minimal example:

\documentclass{article}
\usepackage{leftidx}
\usepackage{amssymb}
\begin{document}
$\leftidx{^D}{\Bbbk[G]}{^D}$
\end{document}


I tried wrapping \Bbbk[G] in \left. and \right., which solves the height problem, but it creates undesired spacing on the left. I am opting against negative hspace, hoping that someone knows a good solution for this.

-

\documentclass{article}
\usepackage{leftidx}
\usepackage{amssymb}
\begin{document}
$\leftidx{^D}{\Bbbk[G]}{^D}$
$\leftidx{^D}{{\Bbbk[G]}}{^D}$
\end{document}


The extra {} mean that the base is a single atom that gets measured for the left and right superscript, otherwise the left script goes on the k and the right script goes on the ]

-
@egreg, David Carlisle: You both are my heroes. I flipped a coin and accepted the second answer. –  Jesko Hüttenhain Jan 9 '13 at 12:51

You can simply add a pair of braces, so that TeX will see the subformula as a unit, without adding extra space:

\documentclass{article}
\usepackage{leftidx}
\usepackage{amssymb}
\begin{document}
$\leftidx{^D}{{\Bbbk[G]}}{^D}$
\end{document}


-