[Tex/LaTex] How to un-italicize text in equations/math

equationsitalic

I have a question about text which is within an aligned equation. I am happy with the way my equations are aligned, I would like to make some of the text not italicized.
In the code, I would like to have "where" unitalicized.
Also, I would like to align the 2nd equals signs with each other, but I'll tackle that later.

(MWE provided by sebastiano)

\documentclass[a4paper]{article}
\usepackage{mathtools}
\begin{document}
Aligning equal signs. Example.
\begin{equation}
\begin{split}
y_{destr} &  = nL\lambda/2d, \text{where}\,\, n= \pm 1, \pm 3, \pm 5, \ldots \\
y_{constr} & = nL\lambda/d, \text{where}\,\, n = 0, \pm1, \pm2, \pm3, \ldots\\
\end{split}
\end{equation}
\end{document}

enter image description here

Best Answer

As mentioned the \text macro is the tool for that. I think you will also want to use \mathrm (or \text) for the subscripts of the ys. And use \dots instead of ....

For the alignment, the alignat environment can help you align at both equals sign.

Further, are the (1) and (2) intended to be equation numbers? If so, don't write them out manually, just use the math environment without a * at the end, they are numbered automatically.

Finally, don't end the last line of align (or similar) with \\, that will give you unwanted vertical space after the math display (and an extra number for numbered equations).

enter image description here

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{alignat}{2}
y_{\mathrm{destr}} &= nL\lambda/2d, \text{ where } & n &= \pm 1, \pm 3, \pm 5, \dots \\
y_{\mathrm{constr}} &= nL\lambda/d, \text{ where} & n &= 0, \pm1, \pm2, \pm3, \dots 
\end{alignat}
\end{document}

As Sam Carter suggested, it might be better to align at where instead of the second =. Alternatively, if the second n was a wider symbol/longer expression than the first n, then you can align at both where and =. It wont make a difference in this case though.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
Align at where:
\begin{alignat}{2}
y_{\mathrm{destr}} &= nL\lambda/2d, &&\text{ where }  n = \pm 1, \pm 3, \pm 5, \dots \\
y_{\mathrm{constr}} &= nL\lambda/d, &&\text{ where }  n = 0, \pm1, \pm2, \pm3, \dots 
\end{alignat}
Align at where and =:
\begin{alignat}{3}
y_{\mathrm{destr}} &= nL\lambda/2d, &&\text{ where } & n &= \pm 1, \pm 3, \pm 5, \dots \\
y_{\mathrm{constr}} &= nL\lambda/d, &&\text{ where } & n &= 0, \pm1, \pm2, \pm3, \dots 
\end{alignat}

\end{document}

enter image description here