I am trying to position my equations as in the image below, but I cant seem to get it to work (mainly because I cant get the line breaks to work). How would I position my equation like in the image below? My latex code is below:



\newtheorem{thm}{Theorem}[chapter] % reset theorem numbering for each chapter

\newtheorem{defn}[thm]{Definition} % definition numbers are dependent on theorem numbers
\newtheorem{exmp}[thm]{Example} % same for example numbers


\title{My Thesis Title}
\author{My Name}



Let $x, y$ be some unknowns, we let:
x^2 + y^2 := (x+y)(x-y) := (1+2)(3+4) := (3*7)
= 21
= 42/2


Use amsmath's align* environment, since you already load it:

enter image description here

\usepackage{amsmath,amsthm}% http://ctan.org/pkg/{amsmath,amsthm}
\newtheorem{defn}{Definition} % definition numbers are dependent on theorem numbers

Let $x, y$ be some unknowns, we let:
  x^2 - y^2 &:= (x+y)(x-y) \\
    &:= (5+3)(5-3) \\
    &:= (8\times 2) \\
    &\phantom{:}= 16 \\
    &\phantom{:}= 32/2

Alignment is ensured using &, and using \phantom{:} you can obtain the correct spacing around the alignment "operator". That is, your = signs line up horizontally.

If you're interested in a more vertically aligned colon, use \coloneqq of the mathtools package (an extension to amsmath):

\usepackage{mathtools}% http://ctan.org/pkg/mathtools
  ... &\coloneqq ...

However, you would need to perform some magic to correctly align the = signs if you plan on doing that.

  • 1
    Of course the math is wrong. :) And * as the multiplication symbol is frowned upon in math circles. – egreg Mar 3 '12 at 16:03
  • 3
    I like the nice vertical centring of \coloneqq from the mathtools package. tex.stackexchange.com/q/4216/9043 – qubyte Mar 3 '12 at 16:05
  • 1
    @egreg: I was too quick with the draw there, focussing on \phantom{:}=. :-| – Werner Mar 3 '12 at 16:05
  • 3
    @Gary If $x^2+y^2=(x+y)(x-y)$ students would be very happy. – egreg Mar 3 '12 at 17:34
  • 1
    @egreg: Please accept my felicitations or, alternatively, my condolences. – Mico Mar 3 '12 at 17:49

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.