Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

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

2 Answers 2

up vote 3 down vote accepted

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}
share|improve this answer
    
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}
% ========= local address left | permanent address right
\noindent\begin{varwidth}{0.5\linewidth} % local address
  Local Address\par
  123 Main Street\par
  Anytown, XXX\par
  Email: foo@bar.com
\end{varwidth} \hfill
\begin{varwidth}{0.5\linewidth}% permanent address
  Permanent Address\par
  656 Somewhere\par
  Some Other Town, YYY\par
  Phone 555-555-1212
\end{varwidth}

\bigskip

% ========= local left | permanent middle
\noindent\begin{minipage}{0.5\linewidth} % local address
  Local Address\par
  123 Main Street\par
  Anytown, XXX\par
  Email: foo@bar.com
\end{minipage}%
\begin{varwidth}{0.5\linewidth}% permanent address
  \raggedleft
  Permanent Address\par
  656 Somewhere\par
  Some Other Town, YYY\par
  Phone 555-555-1212
\end{varwidth}
\end{document}

enter image description here

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.