3

I type equivalent equations using \align environment and so, I have to write the word "or" besides the second, third and fourth equations. I want to align the word "or" in the three lines. I use

\begin{align*}
\phi\left(\sum_{j=1}^{r}c^{j}(e)t_{j}(p) \right) 
&=  \phi\left(\sum_{j=1}^{r} \left(b^{j}\circ\pi  \right)(e)t_{j}(p)\right), 
\\
\text{or}\qquad \sum_{j=1}^{r}c^{j}(e)\phi(t_{j}(e)) 
&=  \sum_{j=1}^{r} \left(b^{j}\circ\pi \right)(e)\phi(t_{j}(p)),
 \\
 \text{or}\qquad  \sum_{j=1}^{r}c^{j}(e)(p,e_{j}) 
 &= \sum_{j=1}^{r}  \left(b^{j}\circ\pi \right)(e)(p,e_{j}) ,
 \\
 \text{or}\qquad \left(p, \sum_{j=1}^{r}c^{j}(e)e_{j}  \right) 
  &= \left(p, \sum_{j=1}^{r}\left(b^{j}\circ\pi \right)(e)e_{j} \right).
 \end{align*}

Here is what this produces

enter image description here

I hope that my question is clear.

  • Can you make your code fragment compilable? – user36296 Dec 6 '16 at 21:45
  • I can't understand what you mean ! – Hussein Eid Dec 6 '16 at 21:47
  • Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – user36296 Dec 6 '16 at 21:51
5

Use another alignment point; I show two ways, one with align, the other one with alignat.

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{align*}
&&          \phi\biggl(\,\sum_{j=1}^{r}c^{j}(e)t_{j}(p) \biggr) 
            &= \phi\biggl(\,\sum_{j=1}^{r} (b^{j}\circ\pi)(e)t_{j}(p)\biggr), 
\\
&\text{or}& \sum_{j=1}^{r}c^{j}(e)\phi(t_{j}(e)) 
            &=  \sum_{j=1}^{r} (b^{j}\circ\pi)(e)\phi(t_{j}(p)),
\\
&\text{or}& \sum_{j=1}^{r}c^{j}(e)(p,e_{j}) 
            &= \sum_{j=1}^{r} (b^{j}\circ\pi)(e)(p,e_{j}) ,
\\
&\text{or}& \biggl(p, \sum_{j=1}^{r}c^{j}(e)e_{j}  \biggr) 
            &= \biggl(p, \sum_{j=1}^{r} (b^{j}\circ\pi)(e)e_{j} \biggr).
\end{align*}

\begin{alignat*}{2}
&&\qquad    \phi\biggl(\,\sum_{j=1}^{r}c^{j}(e)t_{j}(p) \biggr) 
            &= \phi\biggl(\,\sum_{j=1}^{r} (b^{j}\circ\pi)(e)t_{j}(p)\biggr), 
\\
&\text{or}& \sum_{j=1}^{r}c^{j}(e)\phi(t_{j}(e)) 
            &=  \sum_{j=1}^{r} (b^{j}\circ\pi)(e)\phi(t_{j}(p)),
\\
&\text{or}& \sum_{j=1}^{r}c^{j}(e)(p,e_{j}) 
            &= \sum_{j=1}^{r} (b^{j}\circ\pi)(e)(p,e_{j}) ,
\\
&\text{or}& \biggl(p, \sum_{j=1}^{r}c^{j}(e)e_{j}  \biggr) 
            &= \biggl(p, \sum_{j=1}^{r} (b^{j}\circ\pi)(e)e_{j} \biggr).
\end{alignat*}

\end{document}

Note that the outer \left( and \right) should better be \biggl( and \biggr). Add\,after\biggl(in order not to hit the subscript. The inner\leftand\right` are wrong.

enter image description here

An alternative without alignment at the equals signs.

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{align*}
 & \phi\biggl(\,\sum_{j=1}^{r}c^{j}(e)t_{j}(p) \biggr)
           = \phi\biggl(\,\sum_{j=1}^{r} (b^{j}\circ\pi)(e)t_{j}(p)\biggr),
\\
\text{or}\quad
 & \sum_{j=1}^{r}c^{j}(e)\phi(t_{j}(e))
   =  \sum_{j=1}^{r} (b^{j}\circ\pi)(e)\phi(t_{j}(p)),
\\
\text{or}\quad
 & \sum_{j=1}^{r}c^{j}(e)(p,e_{j})
   = \sum_{j=1}^{r} (b^{j}\circ\pi)(e)(p,e_{j}) ,
\\
\text{or}\quad
 & \biggl(p, \sum_{j=1}^{r}c^{j}(e)e_{j}  \biggr)
   = \biggl(p, \sum_{j=1}^{r} (b^{j}\circ\pi)(e)e_{j} \biggr).
\end{align*}

\end{document}

enter image description here

  • This is cool, but what does the parameter (2) refer to ? – Hussein Eid Dec 6 '16 at 21:56
  • @HusseinEid Within alignat you have to tell LaTeX how many pairs of right-left columns you want. – egreg Dec 6 '16 at 21:58
3

you don't need to do any special spacing, just add a couple of &s to each line to take advantage of the fact that align* can handle multiple side-by-side equations (or other components).

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
& &\phi\left(\sum_{j=1}^{r}c^{j}(e)t_{j}(p) \right) 
 &=  \phi\left(\sum_{j=1}^{r} \left(b^{j}\circ\pi  \right)(e)t_{j}(p)\right), 
\\
&\text{or} &\sum_{j=1}^{r}c^{j}(e)\phi(t_{j}(e)) 
&=  \sum_{j=1}^{r} \left(b^{j}\circ\pi \right)(e)\phi(t_{j}(p)),
 \\
& \text{or} & \sum_{j=1}^{r}c^{j}(e)(p,e_{j}) 
 &= \sum_{j=1}^{r}  \left(b^{j}\circ\pi \right)(e)(p,e_{j}) ,
 \\
& \text{or} &\left(p, \sum_{j=1}^{r}c^{j}(e)e_{j}  \right) 
  &= \left(p, \sum_{j=1}^{r}\left(b^{j}\circ\pi \right)(e)e_{j} \right).
 \end{align*}
\end{document}

output of example code

  • This is fine, but I see that the horizontal gap between the word "or" and the equation on the same line is too much. Can this gab be decreased a little ? – Hussein Eid Dec 6 '16 at 21:53
  • @HusseinEid -- i was about to give a version with alignat*, but (as usual), egreg got there first. – barbara beeton Dec 6 '16 at 22:00
  • I appreciate your help so. Thanks for your comment. – Hussein Eid Dec 6 '16 at 22:03
3

You can do that with alignat. I also propose a solution with the \ArrowBetweenLines command, from mathtools, which looks nicer, in my opinion:

\documentclass{article}
\usepackage{mathtools}
\newcommand\OrBetweenLines{\ArrowBetweenLines[\text{or}]}

\begin{document}

\begin{alignat*}{2}
    & & ϕ\biggl(∑_{j=1}^{r}c^{j}(e)t_{j}(p) \biggr)
  &= ϕ\biggl(∑_{j=1}^{r} \left(b^{j} ∘ \pi \right)(e)t_{j}(p)\biggr),
  \\
    & \text{or} & ∑_{j=1}^{r}c^{j}(e)ϕ(t_{j}(e))
  &= ∑_{j=1}^{r} \left(b^{j} ∘ \pi \right)(e)ϕ(t_{j}(p)),
  \\
    & \text{or} & ∑_{j=1}^{r}c^{j}(e)(p,e_{j})
  &= ∑_{j=1}^{r} \left(b^{j} ∘ \pi \right)(e)(p,e_{j}) ,
  \\
    & \text{or}\quad & \biggl(p, ∑_{j=1}^{r}c^{j}(e)e_{j} \biggr)
  &= \biggl(p, ∑_{j=1}^{r}\left(b^{j} ∘ \pi \right)(e)e_{j} \biggr).
\end{alignat*}

\begin{alignat*}{2}
    & & ϕ\biggl(∑_{j=1}^{r}c^{j}(e)t_{j}(p)\biggr)
  &= ϕ\biggl(∑_{j=1}^{r} \left(b^{j} ∘ \pi \right)(e)t_{j}(p)\biggr),
  \\
  \OrBetweenLines
    & & ∑_{j=1}^{r}c^{j}(e)ϕ(t_{j}(e))
  &= ∑_{j=1}^{r} \left(b^{j} ∘ \pi \right)(e)ϕ(t_{j}(p)),
  \\
  \OrBetweenLines
    & & ∑_{j=1}^{r}c^{j}(e)(p,e_{j})
  &= ∑_{j=1}^{r} \left(b^{j} ∘ \pi \right)(e)(p,e_{j}) ,
  \\
  \OrBetweenLines
    & & \biggl(p, ∑_{j=1}^{r}c^{j}(e)e_{j} \biggr)
  &= \biggl(p, ∑_{j=1}^{r}\left(b^{j} ∘ \pi \right)(e)e_{j} \biggr).
\end{alignat*}

\end{document} 

enter image description here

0

How about using an array environment, such as described here. You could put & after each or as well as after =

  • Your link is not inserted correctly... – CarLaTeX Dec 7 '16 at 5:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.