What's the usual, standard way to write text in math mode?

Based on David's answer, but with the fonts set up in a way to reveal as much about the commands as possible.

  • \text just uses the text mode from "outside" with all the formatting.
  • \textup is similar, only upright.
  • \textnormal sets its content back to the normal document font without any other formatting.
  • \textrm keeps all the text formatting, it only resets the font family.
  • \mathrm behaves differently, I think of it as upright math mode, which is shown in my example text with the CM font, the minus sign, gobbled space and square root without the compiler complaining about switching into math mode—it already is.

There is no definitive answer in my mind. Depending on how much formatting you want to keep, choose your command among the \text... commands. Text mode is sans-serif italic in my example.

\documentclass{article}
\usepackage{amsmath} % for \text
\usepackage{newtxtext} % Times-like font
\obeylines % automatic linebreaks
\begin{document}

default textmode
\sffamily\itshape
current textmode
\(\text{text}\)
\(\textup{textup}\)
\(\textnormal{textnormal}\)
\(\textrm{textrm}\)
\(\mathrm{m ath rm-\sqrt{f}}\)

\end{document}

MWE


The usual and standard way to write text in math mode is using \hbox{ text }. Only this solution is format independent, so only this solution will work outside LaTeX (for example). You didn't specify the format of TeX you are using, so this is recommended solution for you.