[Tex/LaTex] How to make the name centered with addresses on either side in res.cls

horizontal alignmentresume

I am using a resume template here: http://www.rpi.edu/dept/arc/training/latex/resumes/res9b.tex

cls:
http://www.rpi.edu/dept/arc/training/latex/resumes/res.cls

I was wondering how to make the name centered with addresses on either side but I cannot figure out how to use this cls document which seems to have a way to do it but I still cant figure it out. Any suggestions? Here is the code I found in the cls.

% prints a centered name with the address centered
% or the two address on opposite sides of the page
%
\def\@printcentername{\begingroup
  % print the name centered
  \leavevmode\hbox to \textwidth{\hfil\@tablebox{\namefont\@name}\hfil}\par
  \@ifundefined{@addressone}{%
    % do nothing
  }{%
    \@ifundefined{@addresstwo}{
      % only one address
      \leavevmode\hbox to \textwidth{\hfil\@tablebox{\@addressone}\hfil}\par
    }{
      % two addresses
      \leavevmode\hbox to \textwidth{\@tablebox{\@addressone}\hfil
                     \@tablebox{\@addresstwo}}\par
    }%
  }%
\endgroup}

There is also this code I just found, but again how to use it is a mystery to me. I want option 1:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% HEADINGS:
% There are two types of headings:
% 1) one with the name centered and the address centered or
%    in the left and right side if there are two address
% 2) one where the name is in the upper left corner 
%    the a line accross the paper
%    then the address all on one line in the right corner
%    the second address will be directly below the first if defined
%
\let\print@name\relax
\def\ds@centered{\ifx\print@name\relax\let\print@name\@printcentername\fi}
\def\ds@line{\ifx\print@name\relax\let\print@name\@linename\fi}

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:

\def\@printcentername{\begingroup
  % print the name centered
  %\leavevmode\hbox to \textwidth{\hfil\@tablebox{\namefont\@name}\hfil}\par
  \@ifundefined{@addressone}{%
    % do nothing
  }{%
    \@ifundefined{@addresstwo}{
      % only one address
      \leavevmode\hbox to \textwidth{\hfil\@tablebox{\@addressone}\hfil}\par
    }{
      % two addresses
      \leavevmode\hbox to \textwidth{\@tablebox{\@addressone}\hfil
                     \@tablebox{\namefont\@name}\hfil % Center name in between addresses
                     \@tablebox{\@addresstwo}}\par
    }%
  }%
\endgroup}
Related Question