Senin, 09 Oktober 2023

Line Break In Equation Using Latex



Remember to \usepackage{amsmath}.

Using Align Environment

If you want to separated between equations by a linebreak \\. You can use the align environment.

For example:

\begin{align*}

1 + 2 &= 3\\

1 &= 3 - 2

\end{align*}

Result:


Notes:

  • The command \\ signifies a line break and within the correct math mode environment, it can start a new equation line.
  • In the align environment, the equations will align at the ampersand &.
  • The asterisk (e.g. equation*) only indicates, that I don’t want the equations to be numbered.

Using Equation And Split Environment

For example:

\begin{equation}

\begin{split}

    1 + 2 & = 3 \\

    1 & = 3 - 2

\end{split}

\end{equation}

Notes:

  • You have to wrap your equation in the equation environment if you want it to be numbered, or you can use equation* (with an asterisk) if you want the equation without number. Inside the equation environment, use the split environment to split the equations into smaller pieces, these smaller pieces will be aligned accordingly.
  • The double backslash (\\) works as a newline character.
  • Use the ampersand character &, to set the points where the equations are vertically aligned.

Using Equation And Aligned Environment

For example:

\begin{equation}

\begin{aligned}

    1 + 2 & = 3 \\

    1 & = 3 - 2

\end{aligned}

\end{equation}

Notes:

  • You have to wrap your equation in the equation environment if you want it to be numbered, or you can use equation* (with an asterisk) if you want the equation without number. Inside the equation environment, use the aligned environment to split the equations into smaller pieces, these smaller pieces will be aligned accordingly.
  • The double backslash (\\) works as a newline character.
  • Use the ampersand character &, to set the points where the equations are vertically aligned.

Bibliography

https://www.overleaf.com/
https://latex-tutorial.com/

Related Post

Tidak ada komentar:

Posting Komentar

Various Other Posts