So, I've got this command that I use to format variable names in my homework:
\newcommand*{\var}[1]{\ensuremath{\mathord{\mathtt{#1}}}}
The problem is that it doesn't handle subscripts smoothly. I end up typing this frequently:
\var{Something}_{\var{SomethingElese}}
Which is a bit cumbersome. Can I make it work with:
\var{Something_SomethingElse}
or at least:
\var{Something}_\var{SomethingElse}