[Tex/LaTex] way to make math mode subscripts automatically non-italic

math-modesubscripts

I'm currently working on a report where the majority of subscripts will be non-italic. The way I know how to do this currently is via \mathrm{}, which is an absolute horror when you have to do it many times per equation. Any ways around this? I do have the mtpro2 package, but not sure if there is an option I'm overlooking.

Best Answer

Are the subscript materials you have in mind the names of variables? If so, the variable names should probably be set in upright mode regardless of their position relative to the math baseline. However, other subscript material, such as the letters i and t that serve to index elements of sequences, should probably continue to be set in italics. Thus, an approach that typesets all subscript material in upright-roman mode isn't entirely desirable, right?

Fortunately, typesetting all variable names in upright-roman letters can be achieved easily by taking the following two-step approach:

  1. Set up a macro named (say) \V in the preamble to denote that its argument is a variable name:

    \usepacakge{amsmath} % loads 'amstext' package, which redefines \textup to be scalable
    \newcommand{\V}[1]{\textup{#1}}
    % Next, define various freqently-used variable names using the \V macro:
    \newcommand\Initial{\V{Initial}}
    \newcommand\Final{\V{Final}}
    
  2. In the body of the document, you might then write something like

    \begin{equation}
    F_{\Final} = 3F_{\Initial} + 2F_{\V{Intermediate}}
    \end{equation}
    

Note that this approach lets you inform LaTeX on the fly, with a minimum of fuss, that certain strings are variable names.

Another important virtue of this two-step approach is that if you change your mind later on and decide that variable names should be typeset differently -- e.g., in text-italics instead of text-upright roman -- all you'll need to do to accomplish this is to change the definition of the \V macro.

Related Question