I am having some trouble in displaying characters in LaTeX. Here is what I am doing.
I am performing a binary addition and would like to have all the characters aligned one below the other.
Here is the small example :
1010
1000
----
0010
However, the problem I am facing is that the characters are not aligned in a vertical line. If it was a table, I could align left-edge or right edge, but not here.
I would prefer, here, 1-1-0, 0-0-0, 1-0-1, 0-0-0 are aligned in a single line vertically.
I am trying to give proper spacing, but it does not look elegant in the pdf. It looks misaligned with a long sequence of binary number.
P.S : Attached is the screen shot of the pdf file.

\documentclass[twoside,english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\setcounter{secnumdepth}{2}
\setcounter{tocdepth}{2}
\usepackage{babel}
\begin{document}
\newdimen\digitwidth
\settowidth\digitwidth{0}
\def~{\hspace{\digitwidth}}
\def\divrule#1#2{%
\noalign{\moveright#1\digitwidth%
\vbox{\hrule width#2\digitwidth}}}
\begin{tabular}[b]{@{}r@{}}
%10010
\\ \hline
\big|\begin{tabular}[t]{@{}l@{}}
1010 1111\\
1000 1000 \\
\divrule{0}{10}
~~ 1000 1000 \\
\end{tabular}
\end{tabular}
\end{document}









:-)) – lockstep Sep 29 '11 at 20:10