You should consider using amsmath
:
\documentclass{article}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\begin{document}
\begin{align*}
x^2 + 2x + 1 &= 0 \\
(x+1)^2 &= 0 \\
\llap{$\rightarrow$\hspace{50pt}} x &= -1
\end{align*}
\end{document}
There are probably lots of different ways of doing this- the solution below uses a simple array
environment.
The only subtle thing is that I've used the optional [t]
argument to specify the vertical alignment. I've also used the enumitem
to format the enumerate
environment to have roman
numbers (some might call it overkill).
MWE
\documentclass{article}
\usepackage{enumitem} % for customizing list environments
\begin{document}
\begin{enumerate}[label*=\roman*.]
\item $\begin{array}[t]{r}
2012\\
-1024\\\hline
988\\
-512\\\hline
476\\
-256\\\hline
220\\
-128\\\hline
92\\
-64\\\hline
28\\
-16\\\hline
12
\end{array}$
\item $\begin{array}[t]{c|c|c|c}
11 & 111 & 011 & 100 \\
3 & 7 & 3 & 4
\end{array}$
\end{enumerate}
\end{document}
Putting two such calculations side by side
Following the comment, there are lots of ways to put two such array
s side by side. You could use a minipage
, but that might require some width calculations, so an easy solution is to use a tabular
and then nest the arrays
inside
\documentclass{article}
\usepackage{enumitem} % for customizing list environments
\begin{document}
\begin{enumerate}[label*=\roman*.]
\item \begin{tabular}[t]{ll}
$\begin{array}[t]{r}
2012\\
-1024\\\hline
988\\
-512\\\hline
476\\
-256\\\hline
220\\
-128\\\hline
92\\
-64\\\hline
28\\
-16\\\hline
12
\end{array}$
&
$\begin{array}[t]{r}
2012\\
-1024\\\hline
988\\
-512\\\hline
476\\
-256\\\hline
220\\
-128\\\hline
92\\
-64\\\hline
28\\
-16\\\hline
12
\end{array}$
\end{tabular}
\item $\begin{array}[t]{c|c|c|c}
11 & 111 & 011 & 100 \\
3 & 7 & 3 & 4
\end{array}$
\end{enumerate}
\end{document}
Or, you might prefer to use the aligned
environment from the amsmath
package; the output is the same as the tabular
solution, but it might give you an advantage with 'global' alignment if you have a lot of these calculations- take your pick :)
\item $\begin{aligned}[t]
\begin{array}[t]{r}
2012\\
-1024\\\hline
988\\
-512\\\hline
476\\
-256\\\hline
220\\
-128\\\hline
92\\
-64\\\hline
28\\
-16\\\hline
12
\end{array}
& &
\begin{array}[t]{r}
2012\\
-1024\\\hline
988\\
-512\\\hline
476\\
-256\\\hline
220\\
-128\\\hline
92\\
-64\\\hline
28\\
-16\\\hline
12
\end{array}
\end{aligned}$
Best Answer
There is a difference in the spacing between using a
\biggl(
...\biggr)
and\left(
...\right)
pair. Your choice, although the former is preferred.