2

I am trying to use \mathrm in gather* environment, but the result is text without any spaces. How can I correct that, please?

\documentclass{article} 
\usepackage{amsmath} 

\begin{document} 
\begin{gather*}
  P(A) = P(B) + P(C) \qquad \mathrm{4-momentum conservation}\\
  P(A) = \left( m_{A}, \vec{0} \right) \qquad \mathrm{in the rest frame of A}\\
  \Downarrow\\
\end{gather*}

\end{document}
Werner
  • 603,163
Suzie
  • 1,289

1 Answers1

3

\mathrm does work in gather* and the output is as expected: it provides a math related roman (upright) font:

enter image description here

\documentclass{article} 
\usepackage{amsmath} 

\begin{document}

\begin{gather*}
  P(A) = P(B) + P(C) \qquad \mathrm{4-momentum conservation} \\
  P(A) = P(B) + P(C) \qquad \textrm{4-momentum conservation} \\
  P(A) = \bigl( m_{A}, \vec{0}\, \bigr) \qquad \text{in the rest frame of $A$} \\
  P(A) = \bigl( m_{A}, \vec{0}\, \bigr) \qquad \mbox{in the rest frame of $A$}
\end{gather*}

\end{document}

In fact, this output is completely unrelated to gather (and friends).

For alternatives to printing textual content in math mode, see Difference between various methods for producing text in math mode.

Werner
  • 603,163