# \mathrm{} in LaTeX

Can I use \mathrm{} without putting it again when I go to another line? For example, I write:

\mathrm{x+2 = 2 \Rightarrow } \\\ \mathrm{\Rightarrow x = 0}


Which means:

$$\mathrm{x+2 = 2} \\ \\ \mathrm{\Rightarrow x = 0}$$


But I would like to write.

\mathrm{x+2 = 2 \\\ \Rightarrow x = 0} (to use \mathrm{} one single time)


Is this possible?

• I do not see any reason why one would use mathrm here in the first place. Please explain – daleif Jun 13 '19 at 10:30
• no, every alignment cell is a group, so & or \\  separates groups as if they were }{ – David Carlisle Jun 13 '19 at 10:35
• @daleif Because it looks better :) – Dan Avrămescu Jun 13 '19 at 10:39
• @DanAvrămescu nope, tradition for a long time, don't change it, you'll confuse your readers. – daleif Jun 13 '19 at 10:40
• Welcome to TeX.SE!! – manooooh Jun 13 '19 at 10:59

With unicode-math (needs lualatex or xelatex) you could force all variables to use upright style:

\documentclass{article}
\usepackage{amsmath}
\usepackage[math-style=upright]{unicode-math}
\begin{document}
\begin{align}
x+2 &= 2 \Rightarrow  \\
\Rightarrow x &= 0
\end{align}
\end{document} Each alignment cell is a group so you can not have { starting a group in one cell that matches a } in another.

If you need upright variable names then the markup should be

\begin{align}
\mathrm{x}+2 &= 2 \Rightarrow  \\
\Rightarrow \mathrm{x} &= 0
\end{align}


with the \mathrm just around the variable, however if this is conventional mathematics (as opposed to for example referring to variables in some computer program) then it is highly unusual to use upright Roman for variable names.