Writing two right hand sides in an equation in latex

1,356

Remarks

For detailed information on the mathmode and other neat tricks with mathematics in LaTeX, consult the amsmath guide and Herbert Voß' excellent mathmode manual.

Implementation

\documentclass{article}
\pagestyle{empty}% remove page number for cropping
\usepackage{amsmath}
\begin{document}
\begin{align*}
    A &= B + C \\
      &= 2 + 3
\end{align*}
\end{document}

Output

enter image description here

Share:
1,356

Related videos on Youtube

user1921843
Author by

user1921843

Updated on July 15, 2020

Comments

  • user1921843
    user1921843 almost 2 years

    I want to write LATeX code whose output should look like this:

    A = B + C
      = 2 + 3
    

    I'm trying to write the following code in LATeX:

    \begin{equation}
    A &= B + C \\
      &= 2 + 3
    

    But the output of this code is:

    A = B + C = 2 + 3
    

    How to change the latex code to achieve the required output?

    • cmhughes
      cmhughes over 8 years
      use the align environment from the amsmath package
    • Manuel
      Manuel over 8 years
      And don't forget \end{align} (or whatever you use).
    • Qrrbrbirlbel
      Qrrbrbirlbel over 8 years
    • Sigur
      Sigur over 8 years
      for unnumbered equations use the stared version align*.
  • egreg
    egreg over 8 years
    Possibly equation with split if a number is wanted
  • Henri Menke
    Henri Menke over 8 years
    @egreg Of course you are right, but there are tons of ways to write a multiline equation, so that I just pointed out one way and linked the documentation. If I was missing any important things, feel free to add them.