Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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:

123

\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:
\begin{equation}
x^2 + y^2 := (x+y)(x-y) := (1+2)(3+4) := (3*7)
= 21
= 42/2
\nonumber
\end{equation}
\end{defn}


\end{document}
share|improve this question
add comment

1 Answer 1

up vote 6 down vote accepted

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

enter image description here

\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.

share|improve this answer
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
show 6 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.