I am a physics student and we have been told that indices that abbreviate some descriptive word or indices that are just to distinguish between say different objects like the mass of two objects A and B shouldn't be in italics in an equation. An example for that would be $m_\text{tot} = m_\text{A} + m_\text{B}$.
For physical constants, or any non made up index for that matter, the indices should be in italics as the rest of the equation. Here an example would be the mass of an electron $m_e$.
Since basically every index is for things you make up, for almost every index I have to write out _\text{...}. This just clutters my equations so much that I tried to find a way to automate a switch into text mode after a _ character, but found nothing. So here I am asking you people: Do you know a way?
Thanks in advance for your answers.
EDIT: See also Is there a way to make math mode subscripts automatically non-italic?



\textotherwise you will get the current font from before the math, eg italic in theorems. usem_{\mathrm{tot}}– David Carlisle Jan 16 '22 at 12:38\newcommand\z[1]{_{\mathrm{#1}}then you can usem\z{tot}which is only one character more thanm_{tot}– David Carlisle Jan 16 '22 at 12:40