I'm working on my resume, and I would like to create a section title called Education where the lines to the left and right of the text extend to the margins. Currently I'm manually typing out all the individual "-"s, which is very inefficient. Also, the actual output is nowhere near perfect. As you can see below, the last "-" is a bit off from the rest.

enter image description here


1 Answer 1


There are many ways to place horizontal lines or rules around a title. Here are some examples taken from here and here.


% First command
\def\myrulefill{\leavevmode\leaders\hrule height .7ex width 1ex depth -0.6ex\hfill\kern\z@}

% Second command
    \leaders\hrule height \dimen0 depth \dimen2\hfill
    \leaders\hrule height \dimen0 depth \dimen2\hfill

\noindent\hrulefill ~Education~\hrulefill
\noindent\myrulefill ~Education~\myrulefill\par

The first example is with an ordinary \hrule, which lies at the bottom of the row. The second and third use some predefined commandsas specified.

enter image description here In the command \textbetweenrules{Education} you can modify the rule widh by putting the parameter between brackets. For example \textbetweenrules[3pt]{Education}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .