[Tex/LaTex] How to insert address blocks on the left and right side of the page

boxeshorizontal alignmentpositioning

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:

enter image description here

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.

Best Answer

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}
\textbf{Local Address}\par
123 Main Street\par
Anytown, XXX\par
Email: foo@bar.com
\end{minipage}
\hfill
\begin{minipage}{0.35\linewidth}
\textbf{Permanent Address}\par
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}
\textbf{Local Address} & \textbf{Permanent Address}\\
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]{\textbf{Local Address}} \textbf{Permanent Address}\\
\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}{\textbf{Local Address}} \textbf{Permanent Address}\\
\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}