How to make the text in \text to be automatically upright in a theorem environment?
For example, I want to use these codes to get the following effect:
\documentclass{article}
\usepackage{amsmath}
\newtheorem{theorem}{Theorem}
\begin{document}
\begin{theorem}
This is a theorem.
\[ F_\text{left}=F_\text{right} \]
\end{theorem}
\end{document}
(Actually, I use \textup to get this effect here.)
Update: The question Which command should I use for textual subscripts in math mode? may be helpful.

\upshape, but this is untested – Jul 12 '17 at 16:09\textcommand. It should be used for textual comments in displayed math, nothing else. Sadly many users misuse it like this.\textupor\textnormalis this correct choice in this case. – daleif Jul 12 '17 at 16:36F_\text{left}can have the same effect withF_\text{\upshape left}. – stone-zeng Jul 12 '17 at 16:53\textupis exactly what you should use; or, even better,\mathrmfor single words. – egreg Jul 12 '17 at 19:28\text? – stone-zeng Jul 13 '17 at 03:05\textis allowed to be italic when the context is italic, thus should clearly not be used for textual indices. – daleif Jul 13 '17 at 05:28f(x) =1 \qquad\text{for all $x>5$}. Here for all should match the surrounding text it should not be always upright. The fact that it follows the surrounding text also explains why you should not use\text{Log}for a function name. – daleif Jul 13 '17 at 05:34