5

I've seen it is not right to use fancyhdr with scrbook, I've got a code with fancyhdr and I want to replace it to scrbook. This is my code:

\usepackage{fancyhdr}

\pagestyle{fancy}
\lhead{TEMA 13}
\rhead{\thepage }
\chead{Polinomios}
\rfoot{Oposiciones}
\rhead{\thepage }
\renewcommand{\footrulewidth}{0.4pt} 
\renewcommand{\headrulewidth}{0.4pt}

1 Answer 1

5

I guess your document is oneside? Then you can use

\documentclass[oneside]{scrbook}

\usepackage[headsepline,footsepline,manualmark]{scrlayer-scrpage}
\clearpairofpagestyles
\ihead{TEMA 13}
\chead{Polinomios}
\ohead{\pagemark}
\ofoot{Oposiciones}
\cfoot[\pagemark]{}
\addtokomafont{pageheadfoot}{\upshape}

\usepackage{blindtext}% dummy text
\begin{document}
\blinddocument
\end{document}

If your document is twoside there are two cases:

  1. TEMA 13 should be on the left hand side on even pages and on the right hand side on odd pages? Then you can use the same code as for the oneside option because the i in \ohead means "inner".

  2. TEMA 13 should be on the right hand side on both the even and the odd pages? Then you have to use \lehead and \lohead (le means left even, lo left odd).

Code for the second case:

\documentclass{scrbook}

\usepackage[headsepline,footsepline,manualmark]{scrlayer-scrpage}
\clearpairofpagestyles
\lehead{TEMA 13}\lohead{TEMA 13}
\chead{Polinomios}
\rehead{\pagemark}\rohead{\pagemark}
\lefoot{Oposiciones}\lofoot{Oposiciones}
\cfoot[\pagemark]{}
\addtokomafont{pageheadfoot}{\upshape}

\usepackage{blindtext}% dummy text
\begin{document}
\blinddocument
\end{document}
2
  • What are the changes if i use twoside?
    – Tobal
    May 5, 2015 at 18:32
  • 1
    @Tobal See my edited answer.
    – esdd
    May 5, 2015 at 19:00

You must log in to answer this question.

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