The answer to your question depends on what behaviour of the subscript you expect. What TeX does by default is that it gives the subscript a lower position if there's also a superscript; see this question. If that's OK for you then you can use Harald's solution. If not then you can use the following hack. Beware, this \Piminus
accepts '
or nothing as an argument, but nothing else.
\documentclass{article}
\newdimen\savedxvi
\newdimen\savedxvii
\makeatletter
\newcommand*\Piminus{%
\@ifnextchar'{\print@pi'\@gobble}
{\print@pi\relax\relax}}
\def\print@pi#1#2{%
\savedxvi=\fontdimen16\textfont2
\savedxvii=\fontdimen17\textfont2
\mbox{%
$\fontdimen16\textfont2=0pt
\fontdimen17\textfont2=0pt
\Pi_{\smash-}#1$}%
\fontdimen16\textfont2=\savedxvi
\fontdimen17\textfont2=\savedxvii
#2}
\makeatother
\begin{document}
$\Piminus \Piminus' \Pi_-$
\end{document}
Short explanation: \fontdimen16
is the amount the subscript is lowered when there is no superscript, \fontdimen17
is used when there is a superscript. They have to be restored since they aren't local to the group.
EDIT:
To explain a bit more: Not only are the changes of the \fontdimen
parameters global, you also have to keep in mind that it's of no use to change the value of a \fontdimen
parameter within one math list $ ... $
several times. Only the values valid at the end of the math list will be used for the whole list. This is the reason why in my above solution I used \mbox{$ ... $}
.
Here's a slightly more elaborate version that allows multiple primes, and also e.g. '^2
. It hacks into TeX's ingenious definition of '
. One could also implement that \Piminus^2
works as is should, but this I leave as an exercise.
\documentclass{article}
\newdimen\savedxvi
\newdimen\savedxvii
\makeatletter
\newcommand*\restoredimen{%
\fontdimen16\textfont2=\savedxvi
\fontdimen17\textfont2=\savedxvii}
\newcommand*\qwe{$\egroup\restoredimen}
\newcommand*\Piminus{%
\@ifnextchar'{\expandafter\Pi@minus\@gobble}
{\print@pi\qwe}}
\def\Pi@minus{\print@pi{^\bgroup\aftergroup\qwe\prim@s}}
\def\print@pi#1{%
\savedxvi=\fontdimen16\textfont2
\savedxvii=\fontdimen17\textfont2
\hbox\bgroup%
$\fontdimen16\textfont2=0pt
\fontdimen17\textfont2=0pt
\Pi_{\smash-}#1}
\makeatother
\begin{document}
$\Piminus \Piminus' \Piminus'' \Pi_- \Piminus'^2$
\end{document}