In some contexts, I see the \text command used as follows:
$ A_\text B $ , which renders correctly as italics A subscripted by a roman B. However, I recall that I "read somewhere" that the proper usage is $A_\text{B}$ or even $A_{\text{B}}$. In particular, I note that importing packages like breqn introduces errors in the first and second cases.
What is correct, and why?
$A_{\text{B}}$, and all others work by “accident” – Phelype Oleinik Nov 05 '20 at 11:35mathrmrather thantext– Nov 05 '20 at 11:41\textshould never even be used for this, it is the wrong command,\textdoes not do what you think it does, here use$A_{\mathrm{B}}ifBis suppose to be upright. Never\textfor this – daleif Nov 05 '20 at 11:42\textdoes what I think it does. Why is\mathrmpreferred? This command preserves math spacing rules, and that looks really odd if the subscript is a phrase, name or similar, and not a mathematical symbol. – Jas Ter Nov 06 '20 at 11:34\textit{test $A_{\text{B}}$ text}that that is why either\mathrmor even\textrmis preferred over\text. The output of\textcorresponds to the text out side math, so if that text is italic, so is the outout of\text. Ergo ifBis suppose to he upright in all contexts,\textcannot be used and generally newer should be used for anything by textual commetns in displayed math. What you are doing here is more of a textual index (like in$A_{\textrm{max}}$, since there it is a phrase, I would use\textrmnot\mathrm) – daleif Nov 06 '20 at 11:41\textrmis preferred in cases where the subscript is a phrase. – Jas Ter Nov 06 '20 at 11:52\textfor year now. Whether one uses\mathrmor\textrmor even\textnormaldepends a bit on your language. Say I want to mark the radius of a circular lake in Danish, I'd write$R_{\textrm{sø}}$becauseøcannot be used in math mode and thus is not usable for\mathrm. If you're writing in English, it might be irrelevant whether one used\mathrmor\textrm– daleif Nov 06 '20 at 13:06