Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm writing a resume and want to add a line under each section name:

\documentclass[line]{res}

\begin{document}
\renewcommand{\namefont}{\LARGE \bf}

\name{Tianlun Zhang}
\address{owenzhang1990@gmail.com}
\address{86-15921814184}
\address{ifthiskills.me}


\begin{resume}

\section{OBJECTIVE} 
{\rule[3pt]{\textwidth}{1pt}}} \\
...
\end{resume}
\end{document}

But the line has a indentation which I can't suppress with \noindent, any ideas?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

You need to compensate for the length \sectionwidth:

\documentclass[line]{res}

\renewcommand{\namefont}{\LARGE\bfseries}
\newcommand\Hrule{%
  \par\hspace*{-\sectionwidth}\rule[3pt]{\dimexpr\textwidth+\sectionwidth\relax}{1pt}\par
}

\begin{document}

\name{Tianlun Zhang}
\address{owenzhang1990@gmail.com}
\address{\parbox[t]{3cm}{86-15921814184 \\ ifthiskills.me}}

\begin{resume}
\section{OBJECTIVE}
\Hrule
\section{ANOTHER SECTION}
\Hrule
\end{resume}

\end{document}

enter image description here

According to res.cls, \address can be used only twice, so the third time you use it overrides the second call; to have more than two lines in the address, you can use a \parbox of the proper width as I did in my example.

By the way, \bf should be replaced with \bfseries in modern LaTeX documents.

share|improve this answer
    
Out of curiosity, why \bf has been replaced with \bfseries –  manuzhang Sep 16 '12 at 1:39
1  
@manuzhang One reason is that \bf and all the other two letter commands (\it, \sc) internally use \normalfont, so. for example, combinations such as {\it\bf text} won't produce italicized boldface but just boldface; the new declarative commands \bfseries, \itshape, etc. (or their counterparts with arguments \textbf, \textit, etc.) will produce the desired result in combinations: {\bfseries\itshape text}. –  Gonzalo Medina Sep 16 '12 at 1:54
    
any ideas why only two of the three addresses get displayed? –  manuzhang Sep 16 '12 at 3:28
    
@manuzhang according to res.cls, \address can be used only twice, so the third time you use it overrides the second call; let me think of a possible solution. –  Gonzalo Medina Sep 16 '12 at 4:23
    
@manuzhang I updated my answer with a solution allowing more than two lines in the address. –  Gonzalo Medina Sep 16 '12 at 5:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.