3

How do I do this? How can I keep "and" on the far left like that? enter image description here

Ingmar
  • 6,690
  • 5
  • 26
  • 47

4 Answers4

4

Here is the solution:

\documentclass{article}
\usepackage{mathtools} % or \usepackage{amsmath}

\begin{document} \begin{flalign} && Z\cap W &= { y \in W: g_1(y) = 0, \ldots, g_l(y) = 0 } & \ \text{and} && X\cap W &= { y \in W: g_1(y) = 0, \ldots, g_m(y) = 0 }, \end{flalign} \end{document}

which gives you

result

Some additional information can be found here if you wish possibly some changes. In brief, the & next to = is the main equation we want to be aligned. The && on the left part creates an empty column that is essential to the alignment of the text. The & on the right ensures the main equation sits in the center.

3

Here's a different solution idea: (a) place "and" on a line between the two equations (using the \shortintertext macro) and (b) employ an alignat*{2} to take care of aligning all = symbols vertically.

If you really do want to place the "and" particle on the second row instead of between the rows, I wouldn't move the word all the way to the left-hand margin; a separation by \qquad ("double \quad") seems more natural. In the code below, I use \llap{and\qquad} to make sure that the presence of the word "and" doesn't affect the (horizontal) centering of the equations -- after all, you've stated the requirement "keeping lines centered" in the title of your query. :-)

enter image description here

\documentclass{article}
\usepackage{mathtools}           % for \shortintertext macro
\usepackage{newtxtext,newtxmath} % optional (Times Roman text and math font)
\begin{document}

\begin{alignat}{2} Z \cap W &= { y \in W : g_1(y) = 0, \dots, & g_l(y) &= 0 } \ \shortintertext{and} X \cap W &= { y \in W : g_1(y) = 0, \dots,{} & g_m(y) &= 0 } ,, \end{alignat}

\begin{alignat}{2} Z \cap W &= { y \in W : g_1(y) = 0, \dots, & g_l(y) &= 0 } \ \llap{and\qquad} X \cap W &= { y \in W : g_1(y) = 0, \dots,{} & g_m(y) &= 0 } ,, \end{alignat}

\end{document}

Mico
  • 506,678
2

Another possibility with the fleqn environment from nccmath:

    \documentclass{article}
    \usepackage{nccmath} % loads amsmath
    \usepackage{lipsum}
\begin{document}

\lipsum[11]
\begin{fleqn}
\begin{align*}
               && Z\cap W &= \{ y \in W: g_1(y) = 0, \ldots, g_l(y) = 0 \} \\
     & \text{and} & X\cap W &= \{ y \in W: g_1(y) = 0, \ldots, g_m(y) = 0 \},
\end{align*}
\end{fleqn}

\end{document} 

enter image description here

Bernard
  • 271,350
0

Thanks for all the responses. I think they are better than what I did. Because what if I wanted to \tag something on the right side also. But I just used a left tag. \newcommand{\leqnos}{\tagsleft@true\let\veqno\@@leqno}

{ 
\leqnos
\begin{align*}
&{Z} \cap  {W}= \{ {y} \in  {W} :  {g}_{1}({y})={0}  ,  \ldots, {g}_{l({y})={0}  \} 
\\
\tag*{and}
&{X} \cap  {W}=\{ {y} \in  {W} :  {g}_{1}({y})={0}   ,     \ldots, {g}_{m}({y})={0} \}
,
\end{align*}
}