# Underline / Overprint Section Header - Memoir Class

I have to write a long report in LaTeX and I'm using the memoir document class.

I figured out how to change the color and make the section headings in upper case but I also would like to have an overprinted doted line that is \textwidth wide.

I've looked into the ulem package documentation and into several other online resources but I didn't manage to find a way to do it.

Here's my MWE of what I have so far :

\documentclass{memoir}
\usepackage{ulem}
\usepackage{lipsum}
\usepackage{xcolor,calc}

\begin{document}

\chapter{A test chapter}
\section{A test section}
\lipsum[4]

\end{document}


Any clue on how to do it ?

Edit :

Visually I'd like it to look like this :

• Welcome to TeX.SX! It's not clear where you'd like this dotted line to appear. – egreg May 16 '15 at 18:15
• I've added a picture to my original post to show how I'd like it to look like – Luc Rebillout May 16 '15 at 18:38

Is this what you like?

\documentclass{memoir}
\usepackage{lipsum}
\usepackage{xcolor,tikz}

\newcommand{\ruledsec}[1]{%
\noindent\tikz\draw[ultra thick,sectionhead,loosely dotted] (0,0) -- + (\textwidth,0);
\vskip 1em

\begin{document}

\chapter{A test chapter}
\section{A test section}
\lipsum[4]

\end{document}


For determining of doted line I use TikZ. Probably it can be defined without it. Form of line is with it easy to determine according to you wish. If distance between dotted line and previous section to big, it can be set by \setbeforesecskip{<skip>}. For details see Memoir manual, pp. 95.

Sorry for big picture, now haven't possibilities to reduce its height.

• That's exactly what I was looking for, thanks ! – Luc Rebillout May 17 '15 at 6:07
• @Luc Rebillout, its my pleasure that I can help you. I see, that you accept my answer, but on another side you didn't gives any point to it (with which you show, that it is useful for you). What should I do to earn it? :-) – Zarko May 17 '15 at 8:22
• My bad ;) I'm not really used to post here ! I upvoted your answer ! – Luc Rebillout May 17 '15 at 12:52