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}
I, in fact, would use a tabular
environment for the title and the text; for the text, a p{<length>}
column (and @{}
to remove the extra space); inside the tabular
, the title can be centered using \multicolumn
:
\documentclass{scrartcl}
\usepackage{showframe}
\usepackage{lipsum}
\begin{document}
\hfill\begin{tabular}{@{}p{.5\linewidth}@{}}
\multicolumn{1}{@{}c@{}}{Some title} \\
\lipsum[4]
\end{tabular}
\end{document}
If this structure will be used several times, an environment can be defined; in the following example, the newly defined myenv
environment has one mandatory argument (the title) and an optional argument (the width used to typeset the text with a default value of 0.5\linewidth
):
\documentclass{scrartcl}
\usepackage{showframe}
\usepackage{lipsum}
\newenvironment{myenv}[2][.5\linewidth]
{\par\hfill\tabular{@{}p{#1}@{}}
\multicolumn{1}{@{}c@{}}{#2} \\ }
{\endtabular\par}
\begin{document}
\begin{myenv}{Some title}
\lipsum*[4]
\end{myenv}
\begin{myenv}[.8\linewidth]{Some title}
\lipsum*[4]
\end{myenv}
\end{document}
If the title spans more than one line, one could load the array
package in the preamble:
\usepackage{array}
and then say
\newenvironment{myenv}[2][.5\linewidth]
{\par\hfill\tabular{@{}p{#1}@{}}
\multicolumn{1}{@{}>{\centering}p{#1}@{}}{#2} \\ }
{\endtabular\par}
Best Answer
Just for fun (pdf only):