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}
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 they
s. 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).As Sam Carter suggested, it might be better to align at
where
instead of the second=
. Alternatively, if the secondn
was a wider symbol/longer expression than the firstn
, then you can align at bothwhere
and=
. It wont make a difference in this case though.