# How can I insert address blocks on the left and right side of the page?

I want to insert my local address on the left side of the page and my permanent address on the right side of the page. However, I want both address blocks to be left-aligned. Basically, I want something that looks like this:

I originally rendered this with the res package, which simply asks you to input the address with the \address command and renders it when you use \begin{resume}...\end{resume}. The package is not very flexible with how I can render the rest of the page, which is why I want to manually render this.

How do I emulate this behavior? I've tried fiddling around with boxes (particularly the \makebox and \mbox commands, which apparently don't support newlines) but I haven't had any luck yet.

-
Related question if using letter class: easily aligning from and to address fields in latex letters –  Peter Grill Nov 2 '11 at 0:22

There are many ways to do this. The way I would choose to do it is to use a \minipage and specify the width of the two minipages:

\documentclass{article}
\begin{document}
\begin{minipage}{0.60\linewidth}
123 Main Street\par
Anytown, XXX\par
Email: foo@bar.com
\end{minipage}
\hfill
\begin{minipage}{0.35\linewidth}
656 Somewhere\par
Some Other Town, YYY\par
Phone: 555-555-1212
\end{minipage}
\end{document}


Alternatively, you could also use a tabular environment such and use p{3.5in} to fix the width of the first column:

\documentclass{article}
\begin{document}
\begin{tabular}{p{3.5in}l}
123 Main Street        & 656 Somewhere\\
Anytown, XXX           & Some Other Town, YYY\\
Email: foo@bar.com     & Phone: 555-555-1212
\end{tabular}
\end{document}


If you really want to use the \makebox command, you need to do something like this:

\documentclass{article}
\begin{document}
\noindent
\makebox[3.5in][l]{123 Main Street}        656 Somewhere\\
\makebox[3.5in][l]{Anytown, XXX}           Some Other Town, YYY\\
\makebox[3.5in][l]{Email: foo@bar.com}     Phone: 555-555-1212
\end{document}


The first paramter to \makebox specifies the width to be 3.5in, and the [l] specifies that the text to be placed in that box is to be left aligned. The \noindent was needed so that TeX does not add the usual indentation of the first paragraph. Instead of \\ at the end you could also have used \par\noindent.

Similarily, there is also the \parbox option:

\documentclass{article}
\begin{document}
\noindent
\parbox{3.5in}{123 Main Street}        656 Somewhere\\
\parbox{3.5in}{Anytown, XXX}           Some Other Town, YYY\\
\parbox{3.5in}{Email: foo@bar.com}     Phone: 555-555-1212
\end{document}

-
Dang, you beat me by 20 seconds. I'll delete my answer. –  cmhughes Oct 9 '11 at 3:23

Here is a way to do it using the varwidth package. It provides the varwidth environment that is similar to minipage, but allows for a "natural width" rather than the "fixed width" box of minipage.

Two examples below show how you can (i) align your addresses flush left and right with the page margin, or (ii) right-align (\raggedleft) the second address at 50% of the text block width. Other options, of course, are also available. Although possible, neither of these options are that easy to do in a general way using minipage due to it's fixed width nature.

\documentclass{article}
\usepackage[showframe]{geometry}% http://ctan.org/pkg/geometry
\usepackage{varwidth}% http://ctan.org/pkg/varwidth
\begin{document}
123 Main Street\par
Anytown, XXX\par
Email: foo@bar.com
\end{varwidth} \hfill
656 Somewhere\par
Some Other Town, YYY\par
Phone 555-555-1212
\end{varwidth}

\bigskip

% ========= local left | permanent middle
123 Main Street\par
Anytown, XXX\par
Email: foo@bar.com
\end{minipage}%

geometry with the showframe option was merely used to showcase the page layout boundaries.