2

I'm using:

\begin{minipage}[t]{0.4\columnwidth}
\begin{eqnarray*} 
   x&=&{{x}_{0}} \\ 
  y&=&{{y}_{0}}+t\\ 
  z&=&{{z}_{0}}+{{x}_{0}}t
\end{eqnarray*} 
\end{minipage}
\begin{minipage}[t]{0.4\columnwidth}
\begin{eqnarray*}  
 x&=&{{x}_{0}}+t \\ 
  y&=&{{y}_{0}} \\ 
  z&=&{{z}_{0}}+{{y}_{0}}t
\end{eqnarray*} 
\end{minipage}

which makes what I want, placing those aligned equations in the same line but I'd like to add the text 'or' between those alignments. (The text should be placed in the middle of the minipages and in the same line of the second equations.)


Also, I used the standard way to center but it creates too much space. Is there another way?

Schwale
  • 2,049

2 Answers2

2

Never ever use eqnarray, prefer align from amsmath. See eqnarray vs align for some reasons.

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{align*}
x &= x_{0}        &&           & x &= x_{0}+t \\
y &= y_{0}+t      && \text{or} & y &= y_{0} \\
z &= z_{0}+x_{0}t &&           & z &= z_{0}+y_{0}t
\end{align*}

\end{document}

enter image description here

If you want fine control on the horizontal spacing, use alignat:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{alignat*}{3}
x &= x_{0}        \qquad &&                 & x &= x_{0}+t \\
y &= y_{0}+t      \qquad && \text{or}\qquad & y &= y_{0} \\
z &= z_{0}+x_{0}t \qquad &&                 & z &= z_{0}+y_{0}t
\end{alignat*}

\end{document}

enter image description here

egreg
  • 1,121,712
  • Thank you, exactly what I needed. Just one more thing: how can you reduce the space between the text in the center and the equations? I see you just edited, thanks! – Schwale Jun 23 '15 at 14:03
  • @Oshnaj Avoid those useless braces you have in the original version. – egreg Jun 23 '15 at 14:15
0

Or:

\documentclass[12pt,tikz,border=2mm]{standalone}
    \usepackage{amsmath}

    \begin{document}
\begin{gather*}
    \begin{aligned}
  x &=  x_{0}       \\
  y &=  y_{0} + t   \\
  z &=  z_{0} + x_{0}t
    \end{aligned}
      \qquad\text{or}\qquad  
    \begin{aligned}
  x &= x_{0} + t    \\
  y &= y_{0}        \\
  z &= z_{0} + y_{0}t
    \end{aligned}
\end{gather*}
    \end{document}

Result is similar to @egreg second case in his answer. It also works fine, when you have for example even number of equations ("or" is vertically centered).

Zarko
  • 296,517