[Tex/LaTex] Center line based on only part of text

horizontal alignment

I'm working off of a resume template I found.
This is what it looks like

header

I want to center the bottom line of text differently. Right now, it is centered based on the whole line of text, but I would like the email address to line up centered under the name and address.

Here's an example that generates the document.

\documentclass[11pt,letterpaper]{article}
\usepackage{fullpage}
\usepackage{amsmath}
\usepackage{amssymb}
\pagestyle{empty}
\raggedright


\newcommand{\lineunder}{\vspace*{-8pt} \\ \hspace*{-18pt} \hrulefill \\}
\newcommand{\contact}[3]{
\vspace*{-8pt}
\begin{center}
{\LARGE \scshape {#1}}\\
    #2 \lineunder 
    #3
\end{center}
\vspace*{-8pt}
}

\begin{document}

\contact{First M. Last}
{ Address, City, State Zip}
{(123) 456-7890 \qquad {email@mail.edu}
\qquad http://www.webaddress.html
}
\end{document}

Best Answer

You can use boxes. A variant using \parboxes in which each one having a width equal to one third of \textwidth:

\documentclass[11pt,letterpaper]{article}
\usepackage{fullpage}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{url}
\pagestyle{empty}
\raggedright


\newcommand{\lineunder}{\vspace*{-8pt}\par\hspace*{-18pt}\hrulefill\par}
\newcommand{\contact}[3]{%
\vspace*{-8pt}
\begin{center}
{\LARGE\scshape #1}\\
    #2 \lineunder 
    #3
\end{center}
\vspace*{-8pt}
}

\begin{document}

\contact{First M. Last}{Address, City, State Zip}
{\parbox[t]{.3333\textwidth}{(123) 456-7890\hfill}%
\parbox[t]{.3333\textwidth}{\hfil\texttt{email@mail.edu}\hfil}%
\parbox[t]{.3333\textwidth}{\hfill\url{http://www.webaddress.html}}%
}
\end{document}

It is not clear to me if the hanging indent of the rule is meant to be the way it is now.

enter image description here

Now a variant using a \makebox and \llap, \rlap centering the email and keeping the \qquad separation:

\documentclass[11pt,letterpaper]{article}
\usepackage{fullpage}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{url}

\pagestyle{empty}
\raggedright


\newcommand{\lineunder}{\vspace*{-8pt}\par\hspace*{-18pt}\hrulefill\par}
\newcommand{\contact}[5]{%
\vspace*{-8pt}
\begin{center}
{\LARGE\scshape #1}\\
    #2 \lineunder 
\makebox[\textwidth][c]{%
\llap{#3\qquad}\texttt{#4}\rlap{\qquad\url{#5}}}
\end{center}
\vspace*{-8pt}
}

\begin{document}

\contact{First M. Last}{Address, City, State Zip}{(123) 456-7890}{email@mail.edu}{http://www.webaddress.html}
\end{document}

enter image description here

Related Question