[Tex/LaTex] Change textwidth for 1 line only

line-spacingresumetext-decorations

I am writing a resume. I have a line with my email, ph etc below my name. I want this line to start at same margin as the Objective below and similarly stop where the text below stops. I figured i will need some command that changes textwidth for my address line, but i am not able to find the same. Pls let me know the solution for this.

\documentclass[margin]{res}
\usepackage{amsmath}
\setlength{\textwidth}{6in} % set width of text portion
\addtolength{\textheight}{1.8in}
\addtolength{\voffset}{-0.75in}
\addtolength{\hoffset}{-0.5in}
\setlength{\parskip}{0.1in }
\usepackage[hidelinks]{hyperref}
\begin{document}

% Center the name over the entire width of resume:
\moveleft.6\hoffset\centerline{\Large\bf Ajjhjghf Dkjggi}
\smallskip
%address line
\moveleft.6\hoffset\centerline{\underline{\href{mailto:blahblah.edu}{blahblha.edu} $\bullet$ Ph.:+kjhghjkjhg $\bullet$ \href{www.blahblah.com}{blahblha.com} $\bullet $bhak bhak bahkrd rd, \#poi, bibibi xxxxx}}

\begin{resume}

\section{OBJECTIVE}  Seeking an jkhasjkdh jhasd ah jlkahds lalkhkljahd kjahd akjh dalkjh lakjh kjhda ajklhsd ajkshd alkjdsh aljkhd ajkshd ajkshd lajkdh alkjshd alskjdh alkjshd lakjsdh.

\section{EDUCATION} 
    {\bf University of XXXXXX} \hfill   (2012 - 2014) \\
    {\sl blbl, blblbl Engineering  {\bf GPA: } }


\end{resume}
\end{document}

Best Answer

As an aside, I think you should rather use package geometry for setting the page layout dimensions.

Anyway, according to res.cls the length \sectionwidth is used for the stuff in the margin. So:

\documentclass[margin]{res}
\usepackage{amsmath}
\setlength{\textwidth}{6in} % set width of text portion
\addtolength{\textheight}{1.8in}
\addtolength{\voffset}{-0.75in}
\addtolength{\hoffset}{-0.5in}
\setlength{\parskip}{0.1in }
\usepackage[hidelinks]{hyperref}
\begin{document}

\newcommand*{\desicenteredline}[1]{%
    \ifhmode\expandafter\\\else\noindent\fi
    \hspace*{-\sectionwidth}%
    \hbox to \dimexpr\sectionwidth+\linewidth\relax{\hss #1\hss}\hskip0pt\relax}

% Center the name over the entire width of resume:
%\moveleft.6\hoffset\centerline{\Large\bf Ajjhjghf Dkjggi}

\desicenteredline{\Large\bf Ajjhjghf Dkjggi}

\smallskip
%address line
%\moveleft.6\hoffset\centerline{\underline{\href{mailto:blahblah.edu}{blahblha.edu} $\bullet$ Ph.:+kjhghjkjhg $\bullet$ \href{www.blahblah.com}{blahblha.com} $\bullet $bhak bhak bahkrd rd, \#poi, bibibi xxxxx}}

remove me (test)\desicenteredline{\underline{\href{mailto:blahblah.edu}{blahblha.edu} $\bullet$ Ph.:+kjhghjkjhg $\bullet$ \href{www.blahblah.com}{blahblha.com} $\bullet $bhak bhak bahkrd rd, \#poi, bibibi xxxxx}}remove me (test)


% adding a line accross the full page
\desicenteredline{\hrulefill}


\begin{resume}

\section{OBJECTIVE}  Seeking an jkhasjkdh jhasd ah jlkahds lalkhkljahd kjahd akjh dalkjh lakjh kjhda ajklhsd ajkshd alkjdsh aljkhd ajkshd ajkshd lajkdh alkjshd alskjdh alkjshd lakjsdh.

\section{EDUCATION} 
    {\bf University of XXXXXX} \hfill   (2012 - 2014) \\
    {\sl blbl, blblbl Engineering  {\bf GPA: } }


\end{resume}
\end{document}

centered stuff