# Positioning of equations

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:

\documentclass[11pt,a4paper]{report}
\usepackage{amsmath,amsfonts,amssymb,amsthm,epsfig,epstopdf,titling,url,array}

\theoremstyle{plain}
\newtheorem{thm}{Theorem}[chapter] % reset theorem numbering for each chapter
\newtheorem{lem}[thm]{Lemma}
\newtheorem{prop}[thm]{Proposition}
\newtheorem*{cor}{Corollary}

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

\theoremstyle{remark}
\newtheorem*{rem}{Remark}
\newtheorem*{note}{Note}

\title{My Thesis Title}
\author{My Name}
\date{\today}
\renewcommand\labelenumi{(\theenumi)}
\renewcommand\theenumi{\roman{enumi}}

\begin{document}
\tableofcontents

\chapter{Addition}
\section{Basics}

\begin{defn}
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 \nonumber$$
\end{defn}

\end{document}

-

## 1 Answer

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

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

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


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
%...
\begin{align*}
... &\coloneqq ...
\end{align*}


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

-
Of course the math is wrong. :) And * as the multiplication symbol is frowned upon in math circles. – egreg Mar 3 '12 at 16:03
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
@egreg: I was too quick with the draw there, focussing on \phantom{:}=. :-| – Werner Mar 3 '12 at 16:05
@Gary If $x^2+y^2=(x+y)(x-y)$ students would be very happy. – egreg Mar 3 '12 at 17:34
@egreg: Please accept my felicitations or, alternatively, my condolences. – Mico Mar 3 '12 at 17:49