[Tex/LaTex] Only name of section in header + underlined

header-footer

I'm now trying to tweak the headers of my book document. I only need the name of the section in the header and I want it to be underlined and no uppercase letters!

\documentclass{book} 
\usepackage[german]{babel}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{booktabs,dcolumn}
\usepackage[figureposition=bottom]{caption}
\usepackage{fancyhdr}
\usepackage{underlin}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[L]{\fontsize{10}{12} \selectfont Personal Statement}
\renewcommand{\headrulewidth}{0pt} 
\fancyhead[L]{\nouppercase{\leftmark}}
\fancyhead[R]{\thepage}
\newcolumntype{d}[1]{D{.}{.}{#1}}
\newcommand*{\mc}[1]{\multicolumn{1}{c}{#1}}
\newcommand*{\mcTwo}[1]{\multicolumn{2}{c}{#1}}
\linespread{1.8}
\setlength\parindent{0pt}
\begin{document} 
\chapter {Einleitung} 
\section{Motivation}  
     zz
\clearpage
    zz
\end{document}

So, I just need it to be underlined. And to remove Kapitel 1 so just the name of the section.

enter image description here

Best Answer

Note the image in your question does not use the same text as the headings in the source which makes testing a bit difficult, but I think you want something like this. You had loaded fancyhdr but were not using it as you had specified an underline page style defined by a different package. I removed all packages not relevant to the question to make a more _M_inimal example.

enter image description here

\documentclass{book} 
\usepackage[german]{babel}
\usepackage[utf8]{inputenc}

\usepackage{fancyhdr}

\fancyhf{}
\fancyhead[EC]{\leftmark}
\fancyhead[ER]{\thepage}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0.4pt}


\renewcommand{\chaptermark}[1]{
 \markboth{#1}{}}

\begin{document} 
\chapter {Einleitung} 
\section{Motivation} 
zz
\clearpage
zz
\end{document}
Related Question