Page LayoutAlignment for Equations

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
coachbennett1981
Posts: 274
Joined: Fri Feb 05, 2010 10:15 pm

Alignment for Equations

Post by coachbennett1981 »

Good morning,

I am writing a document and I am having some difficulty with alignment. Each individual equation is aligned at the = sign, but looking down the page the "=" signs are not all aligned. Is there a way to do this so that all signs are aligned. I am enclosing part of the document because the entire document would be large.. Any feedback would be appreciated.


best nick,

Code: Select all

\documentclass[12pt]{exam}

\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{pstricks}
\usepackage{multicol}
\usepackage{pst-func}
\usepackage{pst-poly}
\usepackage{pst-math}
\usepackage{pstricks-add}

\pdfpagewidth 8in
\pdfpageheight 10in

\setlength\topmargin{-0.5in}
\setlength\headheight{-0.25in}
\setlength\headsep{0.25in}
\setlength\textheight{9in}
\setlength\textwidth{7in}
\setlength\oddsidemargin{-0.5in}
\setlength\evensidemargin{-0.5in}
\setlength\parindent{0.25in}
\setlength\parskip{0.25in}


\newcommand{\field}[1]{\mathbb{#1}}
\newcommand{\N}{\field{N}}
\newcommand{\Z}{\field{Z}}
\newcommand{\Q}{\field{Q}}
\newcommand{\R}{\field{R}}
%\newcommand{\frac}{\dfrac}

\parskip 10pt            
\parindent 0pt      
\textheight
\textwidth 

\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{corollary}[theorem]{Corollary}

\newenvironment{proof}[1][Proof]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}]}{\end{trivlist}}
\newenvironment{definition}[1][Definition]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}]}{\end{trivlist}}
\newenvironment{example}[1][Example]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}]}{\end{trivlist}}
\newenvironment{remark}[1][Remark]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}]}{\end{trivlist}}

\newcommand{\qed}{\nobreak \ifvmode \relax \else
      \ifdim\lastskip<1.5em \hskip-\lastskip
      \hskip1.5em plus0em minus0.5em \fi \nobreak
      \vrule height0.75em width0.5em depth0.25em\fi}

\begin{document}

\subsection*{Solving Inequalities}
To solve inequalities, we will use the exact same strategies that we used with solving equations.  There is \textcolor{red}{one} exception! 

		If you divide or multiply both sides on an inequality by a negative number, flip the inequality sign in the opposite direction.  For example, $6>1$ has each side multiplied both sides by -1, then $-6<-1$.  
	
	
		
\paragraph{Example 1}

	Solve $2x+7\geq 5$
		\begin{enumerate}
			\item We see that the two operations in this inequality are addition and multiplication.  Therefore to undo them, (as with equations) we will use subtraction (undoes addition of 7) and division (undoes multiplication of 2) to find $x$.  Since 7 is on the same side as $x$, we will subtract 7 from both sides first.  
				\[
					\begin{aligned}
						2x+7&\geq 5\\
						2x+7-7&\geq 5-7\\
						2x&\geq -2 \\
					\end{aligned}
				\]
			\item To find $x$, we must divide each side by 2.  Since we are dividing each side by a positive 2, the sign \textsc{does not change directio}.  Thus, we get,
				\[
					\begin{aligned}
						2x&\geq-2\\
						\dfrac{2x}{2}&\geq\dfrac{-2}{2} \\
						x&\geq -1 \\
					\end{aligned}
				\]
		\end{enumerate}
The solution tells us that any number that is greater than -1 will be a solution that will make the inequality true.  There are infinitely many choices.  We can prove this by choosing a number that is greater than -1 and substitute it back into the original problem.   Let $x=0$.  We know zero is greater than -1.  Therefore, by substitution, 
	\[
		\begin{aligned}
			2x+7&\geq 5 \\
			2(0)+7\geq 5 \\
			7\geq 5\\
		\end{aligned}
	\]

\rule{7in}{1pt}
 
 \paragraph{Example 2}
 Solve $9-4x>3$
 	\begin{enumerate}
		\item We have a positive 9 and multiplication in this example.  Therefore, we will get rid of 9 by subtracting 9 from both sides. This yields,
			\[
				\begin{aligned}
					9-4x&>3\\
					9-9-4x&>3-9\\
					-4x&>-6\\
				\end{aligned}
			\]
		\item Make sure the sign follows $4x$.  To get $x$ alone, divide both sides of the inequality by -4.  Since we are dividing by a negative number, \textsc{The sign does change direction}.
			\[
				\begin{aligned}
					-4x&>-6\\
					\dfrac{-4x}{-4}&<\dfrac{-4}{-4}\\
					x&<\dfrac{3}{2}\\
				\end{aligned}
			\]
	\end{enumerate}
The solution says that any value that is less than $\frac{3}{2}$ will be a solution to the inequality.  

\rule{7in}{1pt}


Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Alignment for Equations

Post by gmedina »

Hi,

you could use an align environment and the \intertext command provided by amsmath. A little example, using part of your code:

Code: Select all

\documentclass[12pt]{exam}
\usepackage{amsmath}
\usepackage{amssymb}

\begin{document}

\paragraph{Example 2}
Solve $9-4x>3$
\begin{enumerate}
  \item We have a positive 9 and multiplication in this example.  Therefore, we will get rid
  of 9 by subtracting 9 from both sides. This yields,
  \begin{align}
    9-4x&>3\\
    9-9-4x&>3-9\\
    -4x&>-6\\
    \intertext{\item Make sure the sign follows $4x$.  To get $x$ alone, divide both sides of
      the inequality by -4.  Since we are dividing by a negative number, \textsc{The sign
      does change direction}.}
    -4x&>-6\\
    \dfrac{-4x}{-4}&<\dfrac{-4}{-4}\\
    x&<\dfrac{3}{2}\\
  \end{align}
\end{enumerate}
The solution says that any value that is less than $\frac{3}{2}$ will be a solution to the inequality.  

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
coachbennett1981
Posts: 274
Joined: Fri Feb 05, 2010 10:15 pm

Re: Alignment for Equations

Post by coachbennett1981 »

Thanks man.. That works perfectly... Would I have to use that single environment the whole way through the document to ensure all the inequalities align?
coachbennett1981
Posts: 274
Joined: Fri Feb 05, 2010 10:15 pm

Re: Alignment for Equations

Post by coachbennett1981 »

You have been a big help here. This will help me greatly!
Post Reply