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:
\makeatletter \renewcommand\chi{\@ifnextchar_\sub@chi\latexchi} \newcommand{\sub@chi}[2]{% #1 is _, #2 is the subscript \@ifnextchar^{\subsup@chi{#2}}{\latexchi^{}_{#2}}% } \newcommand{\subsup@chi}[3]{% #1 is the subscript, #2 is ^, #3 is the superscript \latexchi_{#1}^{#3}% } \makeatother