I'd like to do the same thing that is been done to the greek letter \chi in this post to the letter g. In particular I'd like to redefine g in mathmode to work as \chi here:

   \newcommand{\sub@chi}[2]{% #1 is _, #2 is the subscript
   \newcommand{\subsup@chi}[3]{% #1 is the subscript, #2 is ^, #3 is the superscript

You can do better than six years ago.

I define a generic macro for lowering the subscript as if a superscript is present.

For g, one needs to make it math active and supply a definition for it, with the common \lowercase trick. In order to save the standard math g, we need to copy its math code.


\linespread{1.1} % high subscripts and low subscripts

    \IfNoValueF{#2}{^{}}% neither ^ nor _, do nothing; if no ^ but _, add ^{}
    ^{#1}% add superscript if present
  \IfNoValueF{#2}{_{#2}}% add subscript if present
% chi
% g
\begingroup\lccode`~=`g \lowercase{\endgroup\def~}{\latexmathg\movedownsub}










$g_{A}\quad g_{A}^{2}\quad g^{2}_{A}\quad g^{2}\quad g$


enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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