4

How would I shift my whole set of equations/calculations at the left, to be aligned with "Example"?

enter image description here

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


\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}}
\setlength{\parindent}{1em}

\begin{document}

\chapter{Addition}

\begin{exmp} 
Here is an example.
\begin{align} \nonumber
(a+b)^3 &= (a+b)^2(a+b)\\ \nonumber
&=(a^2+2ab+b^2)(a+b)\\ \nonumber
&=(a^3+2a^2b+ab^2) + (a^2b+2ab^2+b^3)\\ \nonumber
&=a^3+3a^2b+3ab^2+b^3 \nonumber
\end{align}
\end{exmp}
\end{document}
7

Change this line:

\usepackage{amsmath,amsfonts,amssymb,amsthm,epsfig,epstopdf,titling,url,array}

To these:

\usepackage[fleqn]{amsmath}
\setlength{\mathindent}{0pt}
\usepackage{amsfonts,amssymb,amsthm,epsfig,epstopdf,titling,url,array}

Strictly speaking, the amsmath package doesn't use \mathindent to control the left indent of displayed equations when the fleqn option is in effect: it uses an internal parameter \@mathmargin instead. However, for compatibility with existing LaTeX documentation, amsmath turns \mathindent into an alias for \@mathmargin. There is a small risk here: In the plain LaTeX implementation, \mathindent is a dimen register, but with amsmath \@mathmargin is a skip register and, by association, so is \mathindent. If any package or documentclass uses \mathindent in a way that depends on it being a dimen register, when used in conjunction with the amsmath package it may be vulnerable to a well-known pitfall having to do with the primitive TeX lookahead for a plus or minus key word. However if the standard LaTeX commands \setlength and \addtolength are used to modify \mathindent then this problem will not arise.

The above can be found at Technical notes on the amsmath package.

  • This works if I change $$...$$ to \[ ... \] – Alec Jacobson Oct 19 '18 at 13:52

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.