5

image align

So I want to align this equation such that dx/dt all align in the same line as the picture given for reference.

\begin{equation}
\left.\begin{matrix}
\frac{dx}{dy}=a(y-x)+u\\
\frac{dy}{dt}=-xz+cy \\
\frac{dz}{dt}=xy-bz\\
\frac{du}{dt}=xz+du 
\end{matrix}\right\}
\end{equation}

4 Answers 4

11

You want aligned, rather than matrix.

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{equation}
\left.
\begin{aligned}
  \frac{dx}{dy} &= a(y-x)+u \\
  \frac{dy}{dt} &= -xz+cy \\
  \frac{dz}{dt} &= xy-bz \\
  \frac{du}{dt} &= xz+du
\end{aligned}
\right\}
\end{equation}

\end{document}

enter image description here

6

I want to align this equation such that dx/dt all align in the same line

I suggest you load the mathtools package and use a drcases environment.

enter image description here

\documentclass{article}
\usepackage{mathtools} % for 'drcases' environment
\begin{document}
\begin{equation}
\begin{drcases}
  \frac{dx}{dy}=a(y-x)+u \\
  \frac{dy}{dt}=-xz+cy   \\
  \frac{dz}{dt}=xy-bz    \\
  \frac{du}{dt}=xz+du 
\end{drcases}
\end{equation}
\end{document}
3
  • 2
    +1. I've taken the liberty of switching your code to a drcases environment.
    – Mico
    Commented May 1, 2023 at 12:34
  • 1
    I too like this method +1
    – MadyYuvi
    Commented May 1, 2023 at 15:54
  • 1
    @Mico You're always welcome. Thank youuuuuuuuuuuuuuuuuuuuuuuuuu.
    – Sebastiano
    Commented May 1, 2023 at 19:25
2

I had to make some assumptions about document settings, but something like this?

\documentclass{article}
\usepackage{amsmath}

\begin{document}
    \begin{equation}
        \left.
            \begin{matrix}
                \frac{dx}{dy} = &a(y-x)+u\\
                \frac{dy}{dt} = &-xz+cy \\
                \frac{dz}{dt} = &xy-bz\\
                \frac{du}{dt} = &xz+du 
            \end{matrix}
        \right\}
    \end{equation}
\end{document}

enter image description here

1

If you don't care about aligning the equations in the middle of the page you could use the code below. (using the ams math package). (P.S. Use the ampersand character &, to set the points where the equations are vertically aligned.)

\begin{align*} 
   \frac{dx}{dy} &=a(y-x)+u\\
   \frac{dy}{dt} &=-xz+cy \\
   \frac{dz}{dt} &=xy-bz\\
   \frac{du}{dt} &=xz+du
\end{align*}

Here's the result you will get:

enter image description here

2
  • 1
    Judging by the OP's code, it would appear to be desirable to be able to assign a single equation number to the four-line expression. How might your code be adapted to permit achievning this objective?
    – Mico
    Commented May 1, 2023 at 13:24
  • If that's the desirable result, then @egreg 's got correct answer. So we could wrap the code in the align envinormnet, with an equation environment and \left \right\}. Commented May 1, 2023 at 13:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .