You can redefine \@tablebox
used internally by res.cls
to typeset the name and address; the original definition is
\def\@tablebox#1{\begin{tabular}[t]{@{}l@{\extracolsep{\fill}}}#1\end{tabular}}
and he'res the necessary redefinition:
\documentclass[margin]{res}
\makeatletter
\def\@tablebox#1{\begin{tabular}[t]{@{}c@{}}#1\end{tabular}}
\makeatother
\name{\LARGE \bf MY NAME\\[12pt]} % the \\[12pt] adds a blank line after name
\address{ADDRESS STREET APT NUMBER\\ CITY, STATE ZIPCODE \\
PHONE-NUMBER }
\begin{document}
\begin{resume}
test
\end{resume}
\end{document}
Perhaps you should consider using a more modern class to typeset your CV? The moderncv
class is one of the classes available (you can get templates and examples here
); other possibilitiescan be explored in CTAN: Writing Applications for a JOB/CV
.
If you want the entire \opening
to be centred, then the following redefinition of \@tablebox
works:
\makeatletter
\def\@tablebox#1{\begin{tabular}[t]{@{}c@{\extracolsep{\fill}}}#1\end{tabular}}
\makeatother
The original \@tablebox
used a l
eft-aligned column:
%\let\latexnofiles\nofiles % If you're using references in your resume
%\let\nofiles\relax % See https://tex.stackexchange.com/a/94528/5764
\documentclass[11pt]{res} % default is 10 pt
%\usepackage{helvetica} % uses helvetica postscript font (download helvetica.sty)
%\usepackage{newcent} % uses new century schoolbook postscript font
\usepackage{latexsym} % to get the \Box symbol
\setlength{\textheight}{10in} % increase text height to fit resume on 1 page
\topmargin=-0.5in % start text higher on the page
\makeatletter
\def\@tablebox#1{\begin{tabular}[t]{@{}c@{\extracolsep{\fill}}}#1\end{tabular}}
\makeatother
\begin{document}
\name{ANDREW J.\ MALONE}
\address{739 Mill Grove Drive \\ Audubon, PA 19403 \\ (215) 555-2216}
\opening
\end{document}
Alternatively, if you wish to have a left-aligned address with your name, use
\makeatletter
\def\@tablebox#1{%
\setbox9=\hbox{\namefont\@name}%
\begin{tabular}[t]{@{}p{\wd9}@{\extracolsep{\fill}}}#1\end{tabular}}
\makeatother
This is a very particular solution to your current setup. A more general solution would be required where the name length and font size could vary. However, without more detail, this should be sufficient.
%\let\latexnofiles\nofiles % If you're using references in your resume
%\let\nofiles\relax % See https://tex.stackexchange.com/a/94528/5764
\documentclass[11pt]{res} % default is 10 pt
%\usepackage{helvetica} % uses helvetica postscript font (download helvetica.sty)
%\usepackage{newcent} % uses new century schoolbook postscript font
\usepackage{latexsym} % to get the \Box symbol
\setlength{\textheight}{10in} % increase text height to fit resume on 1 page
\topmargin=-0.5in % start text higher on the page
\makeatletter
\def\@tablebox#1{%
\setbox9=\hbox{\namefont\@name}%
\begin{tabular}[t]{@{}p{\wd9}@{\extracolsep{\fill}}}#1\end{tabular}}
\makeatother
\begin{document}
\name{ANDREW J.\ MALONE}
\address{739 Mill Grove Drive \\ Audubon, PA 19403 \\ (215) 555-2216}
\opening
\end{document}
On a side note: res
removes the capability to use references within your document. See Problem using etaremune
(reversing the labels of items in a list) for an associated problem and fix for this.
Also, there is no particular need to use the res
class for creating a resume. It is possible to use the default article
class to replicate the layout, yet have some additional freedom in terms of the layout. Moreover, moderncv
provides a stylish take on resumes as well.
Best Answer
You can do this by enabling the
centered
option on the document:\documentclass[margin,centered]{resume}
This centers your name on a line by itself, and uses both sides of the next few lines for your address.
If you'd like your name to be on the same line in between the two addresses, you can modify the
printcentername
method to be this: