0

I want my Header in this style like the Screenshot.enter image description hereI use this dokumentclass \documentclass[a4paper,12pt,oneside, BCOR5mm, DIV=12]{scrreprt} and use the\usepackage{fancyhdr} package and if I set the \pagestyle{}nothing happens.

How can set this Header style ?

  • Where should the page number be on chapter pages? What should be in the header if there is no section entry yet? If more than one section start on a page - which one should go to the header, the first or the last one? – esdd Dec 15 '16 at 11:51
3

Here is a suggestion using package scrlayer-scrpage which is part of the KOMA-Script bundle.

\documentclass[a4paper,12pt,oneside, BCOR=5mm, DIV=12]{scrreprt}

\usepackage[headsepline]{scrlayer-scrpage}
\automark{chapter}
\automark*{section}
\renewcommand\sectionmarkformat{\thesection\autodot\quad}
\clearmainofpairofpagestyles
\addtokomafont{pagehead}{\normalfont}
\ihead{\rightmark}
\ohead{\pagemark}

\usepackage{lipsum}
\begin{document}
\chapter{Chapter}
\lipsum[1-13]
\section{Section One}
\lipsum[1]
\section{Section Two}
\lipsum
\end{document}

enter image description here


Version using fancyhdr:

\documentclass[a4paper,12pt,oneside, BCOR=5mm, DIV=12]{scrreprt}

\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]
    {\markboth
        {\ifnumbered{chapter}{\chapappifchapterprefix{~}\thechapter\quad}{} #1}
        {\ifnumbered{chapter}{\chapappifchapterprefix{~}\thechapter\quad}{} #1}%
    }
\renewcommand{\sectionmark}[1]
    {\markright{\ifnumbered{section}{\thesection\quad}{}#1}}
\fancyhf{}
\fancyhead[L]{\ifstr{\rightmark}{}{\leftmark}{\rightmark}}
\fancyhead[R]{\pagemark}

\usepackage{lipsum}
\begin{document}
\chapter{Chapter}
\lipsum[1-13]
\section{Section One}
\lipsum[1]
\section{Section Two}
\lipsum
\addsec{Unnumbered Section}
\lipsum
\end{document}

Result:

enter image description here

  • Thank you, I forget to say, that I have to using the package fancyhdr because it is a default template from my university, but I want to change the header style and is allowed. – kwin Dec 15 '16 at 12:50
  • See my updated answer. – esdd Dec 15 '16 at 13:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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