Here is a the beginning of my code :
\documentclass[twoside,a4paper,11pt]{scrbook}
\usepackage[UTF8]{inputenc} %encodage clavier
\usepackage[T1]{fontenc} %encodage police
\usepackage[francais]{babel} %langue
\usepackage{scrpage2} %head-foot koma
\deftripstyle{fancy}[0pt][0.4pt]
{\leftmark}{}{\thepage}
{Nom du document}{}{Lieu} %page style for right pages (odd)
\pagestyle{fancy}
…which works like a charm, header/footer respect the twoside
option by changing the display on odd/even pages.
Question :
As I have a lot of sections and chapters in my document, and both are useful to situate the page, I'd like to have both of them displayed on the inner header, on 2 lines, how can I do that?
I have tried this: (which doesn't work)
\documentclass[twoside,a4paper,11pt]{scrbook}
\usepackage[UTF8]{inputenc} %encodage clavier
\usepackage[T1]{fontenc} %encodage police
\usepackage[francais]{babel} %langue
\usepackage{scrpage2} %head-foot koma
\deftripstyle{fancy}[0pt][0.4pt]
{\leftmark \newline \rightmark}{}{\thepage}
{Nom du document}{}{Lieu} %page style for right pages (odd)
\pagestyle{fancy}
Best Answer
Here is a solution.
First of all, if you have an up-to-date KOMA-script bundle, use
scrlayer-scrpage
instead ofscrpage2
.Instead of using
\deftripstyle
we will use\defpagestyle
:The line
is to increase a little the room for the header.
MWE (replace
scrlayer-scrpage
withscrpage2
if you have an old KOMA/script bundle)Output: