Should subscripts in math mode be upright?

In one-letter subscripts, like $x_i$, the subscript is usually typeset italic.

Is this the typographically right thing to do? Consider this case:

The Boltzmann constant is often written as $k_B$, which is short for $k_{Boltzmann}$. But the lengthy Boltzmann looks strange if typeset all italic. So I usually write $k_{\mathrm{Boltzmann}}$.

But shouldn't then, for consistency, the B in $k_B$ also be upright? And how about the i in $x_i$?

-
You might be interested in a TUG2010 talk by Johannes Küster called "Math never seen", which gives examples starting approximately at 14:20. – morbusg Oct 31 '11 at 16:03

Using "all italics" is unfortunately an often committed sin. You should italicize only variables.

Everything else should be upright. For example:

• function names (sin, cos, log, ln etc...)
• dimensionless numbers (Re, Pr, Ra...)
• exact infinitesimal increments (dx, dy et... in BOTH integrals and differentials)
• descriptive text
• all descriptive variable indices (unless they are also variables)

Exceptions to this rule may still apply, i.e. the Euler-number $e$ is no variable, but still traditionally written in italics.

Some of the above was stolen from the "Please Make A Note" blog. More detailed information can be found in "Typefaces" from NIST.

-
The ISO on this says that e, pi, etc. should also be upright (see for example en.wikipedia.org/wiki/ISO_31-11). – Joseph Wright Oct 30 '11 at 15:04
Correct. Although in the scientific community this is mostly ignored. See tug.org/TUGboat/Articles/tb18-1/tb54becc.pdf Example: physicists run into trouble if they have elementary charge (upright e) and euler's constant (also upright e) in the same article. Furthermore it is custom or tradition to do so. I'd say it is up to personal taste; and I, personally, ignore the ISO here. – Boffin Oct 30 '11 at 15:24
@Boffin, in my opinion the elementary charge is not upright 'e', but italic. Unless it is used as subindex (ublabel) for an electron-related quantity (such as electron mass $m_\mathrm{e}$). This makes a stronger case for upright 'e' for Euler constant. – alfC Apr 22 at 4:34

\text is not the right command to use, as its argument will be typeset in the current font, which may be italics.

\usepackage{amsmath} % for extended version of \textup
\newcommand*{\Boltzmann}{k_\textup{B}}

$\vec{F}_\textup{in}+\vec{F}_\textup{out}=\vec{0}$


What subscripts are to be set in upright font and what in italics is well explained by Boffin. (I disagree about the d for the differential, though, but that's another story: be consistent, that's all for this particular aspect.)

-

For me it depends on the context. Using your example, I would agree that you should use $k_{\text{B}}$ since it is short for $k_{\text{Boltzmann}}$. Note the use of \text{...} from the amsmath package, that does a decent job of sticking to the math mode font size, depending on the context.

On that note, $k_{Boltzmann}$ "looks strange" because (La)TeX typesets it like it does regular math, which in this case is the variable B, followed by the variable o, followed by the variable l, and so on. My use of the term "variable" may be incorrect. The point I'm trying to make is that each letter is treated on it's own in math mode, rather than combining them like is done in text mode. The spacing is correct as-is in math mode, it just doesn't look like text.

With this discussion in mind, I hope you agree that $x_i$ should remain $x_i$. Of course, if you are referring to i in your text somewhere (instead of $i$), then it should be upright. IMHO, it is all (mostly?) driven by context.

-

This is matter of personal style. In my own documents, I follow similar rules: if subscript stands for people's name I type it using \text command (defined in amsmath package), e.g. $\varepsilon_\text{F}$ (the Fermi energy), $a_\text{B}$ (the Bohr radius), $r_\text{D}$ (Debye's radius), etc. Russian indexes are usially typed upright: $P_\text{т.и}$ (power of bremsstrahlung).

-