# Hrule spacing between header and

I have a question regarding spacing between title and line using \hrule.

My command goes like this:

\section*{Education\hrule height 2pt}

....

\section*{Peer-reviewed Publications\hrule height 2pt}

....

\section*{Book chapter\hrule height 2pt}
....


Strangely despite using the same command for the different sections, I have a nice space between "book chapter" and the line and no space for the other two. What can I do there? I would be grateful for help!

• Very strange way to produce horizontal lines after section titles. Jul 23, 2017 at 15:21

The reason is that Book chapter has a character that extends below the baseline (the p) whereas the other two titles don't. Consider the following MWE, where the spacing is equal for the tree lines:

\documentclass{article}
\usepackage{currvita}
\usepackage{ragged2e}
\usepackage[margin=1in]{geometry}
\thispagestyle{empty}

\begin{document}
\section*{Edupation\hrule height 2pt}
abc
\section*{Peer-previewed Publications\hrule height 2pt}
abc
\section*{Book chapter\hrule height 2pt}
abc
\end{document}


Result:

There are other ways to get a line below each section title, for example with the titlesec package (from How can I make a bold horizontal rule under each section title?). Here the spacing is somewhat larger, which looks better than the original example for all three lines.

\documentclass{article}
\usepackage{currvita}
\usepackage{ragged2e}
\usepackage[margin=1in]{geometry}
\usepackage{titlesec}
\thispagestyle{empty}

\titleformat{\section}
{\normalfont\Large\bfseries}{\thesection}{1em}{}[{\titlerule[2pt]}]

\begin{document}
\section*{Education}
abc
\section*{Peer-reviewed Publications}
abc
\section*{Book chapter}
abc
\end{document}


Result:

• Dear Marijn! You are amazing! You totally find the problem and I also like your recommendation to change it with \titlesec! But I have one new problem when doing this: For "Peer-reviewed Publications" and all longer headings is now one part on the left hand side and the other part jumped to the right hand side of the page. How can I keep that together? Jul 24, 2017 at 18:03
• @Steinschlag91 glad to assist :) for this new problem it would be better to post a new question, with a minimal working example (a complete, small document), that shows the problem. It could be the case that the new question is already answered somewhere on this site, so with a but of searching you may find a solution, but if not then you're most welcome to post a new question! Jul 24, 2017 at 19:06