
Usando scrlayer-scrpage no documentclass scrreprt, gostaria que a palavra "Capítulo 1" (ou 2 ou qualquer capítulo) aparecesse no cabeçalho externo das páginas pares e no título do capítulo - sem "Capítulo 1" antes dele - no cabeçalho externo das páginas ímpares (ver imagem). EDIT: Em capítulos não numerados, o lehead deve estar vazio. Como faço para conseguir isso?
Meu MWE:
\documentclass[twoside, openright, BCOR=1cm, bibliography=totoc,headsepline,chapterprefix=true]{scrreprt}
\usepackage{scrlayer-scrpage}
\pagestyle{scrheadings}
\automark[chapter]{chapter}
\usepackage{lipsum}
\setcounter{secnumdepth}{0}
\begin{document}
\chapter{An interesting title}
\thispagestyle{empty}
\newpage
\section{A slightly less interesting title}
\lipsum[1-5]
\end{document}
Responder1
Pergunta: O que deve constar no cabeçalho das páginas pares, se o capítulo não for numerado?
Aqui está uma sugestão, onde o título do capítulo seria usado em páginas pares em capítulos não numerados:
\documentclass[
twoside, open=right, BCOR=1cm,
bibliography=totoc,
headsepline,
chapterprefix=true
]{scrreprt}
\usepackage{blindtext}% only for dummy text
\usepackage{scrlayer-scrpage}% sets pagestyle scrheadings automatically
\automark{chapter}
\renewcommand*\chaptermark[1]{%
\markboth{\ifnumbered{chapter}{\chaptermarkformat}{#1}}{#1}%
}
\begin{document}
\tableofcontents
\chapter{Numbered Chapter}
\blindtext
\section{Numbered Section}
\Blindtext[10]
\addchap{Unnumbered Chapter}
\blindtext
\addsec{Unnumbered Section}
\Blindtext[10]
\end{document}
ou sem pacote scrlayer-scrheadings
:
\documentclass[
twoside, open=right, BCOR=1cm,
bibliography=totoc,
headsepline,
chapterprefix=true
]{scrreprt}
\usepackage{blindtext}% only for dummy text
\pagestyle{headings}
\renewcommand*\chaptermark[1]{%
\markboth{\ifnumbered{chapter}{\chaptermarkformat}{#1}}{#1}%
}
\renewcommand*\sectionmark[1]{}
\begin{document}
\tableofcontents
\chapter{Numbered Chapter}
\blindtext
\section{Numbered Section}
\Blindtext[10]
\addchap{Unnumbered Chapter}
\blindtext
\addsec{Unnumbered Section}
\Blindtext[10]
\end{document}
Se o cabeçalho da página par estiver vazio para capítulos não numerados, você pode usar
\renewcommand*\chaptermark[1]{%
\markboth{\ifnumbered{chapter}{\chaptermarkformat}{}}{#1}%
}
Além disso, você deve mudar para marcas manuais e definir manualmente as marcas para o TOC, etc.:
\manualmark% or option manualmark for package `scrlayer-scrpage`
\AfterTOCHead[toc]{\markboth{}{\contentsname}}
%\AfterTOCHead[lof]{\markboth{}{\listfigurename}}
%\AfterTOCHead[lot]{\markboth{}{\listfigurename}}
Exemplo:
\documentclass[
twoside, open=right, BCOR=1cm,
bibliography=totoc,
headsepline,
chapterprefix=true
]{scrreprt}
\usepackage{blindtext}% only for dummy text
\usepackage[manualmark]{scrlayer-scrpage}% sets pagestyle scrheadings automatically
\renewcommand*\chaptermark[1]{%
\markboth{\ifnumbered{chapter}{\chaptermarkformat}{}}{#1}%
}
\AfterTOCHead[toc]{\markboth{}{\contentsname}}
%\AfterTOCHead[lof]{\markboth{}{\listfigurename}}
%\AfterTOCHead[lot]{\markboth{}{\listfigurename}}
\begin{document}
\tableofcontents
\chapter{Numbered Chapter}
\blindtext
\section{Numbered Section}
\Blindtext[10]
\addchap{Unnumbered Chapter}
\blindtext
\addsec{Unnumbered Section}
\Blindtext[10]
\Blinddocument\Blinddocument\Blinddocument\Blinddocument
\Blinddocument\Blinddocument\Blinddocument\Blinddocument
\Blinddocument\Blinddocument
\end{document}
ou sem pacote scrlayer-scrheadings
:
\documentclass[
twoside, open=right, BCOR=1cm,
bibliography=totoc,
headsepline,
chapterprefix=true
]{scrreprt}
\usepackage{blindtext}% only for dummy text
\pagestyle{myheadings}
\renewcommand*\chaptermark[1]{%
\markboth{\ifnumbered{chapter}{\chaptermarkformat}{}}{#1}%
}
\AfterTOCHead[toc]{\markboth{}{\contentsname}}
%\AfterTOCHead[lof]{\markboth{}{\listfigurename}}
%\AfterTOCHead[lot]{\markboth{}{\listfigurename}}
\begin{document}
\tableofcontents
\chapter{Numbered Chapter}
\blindtext
\section{Numbered Section}
\Blindtext[10]
\addchap{Unnumbered Chapter}
\blindtext
\addsec{Unnumbered Section}
\Blindtext[10]
\Blinddocument\Blinddocument\Blinddocument\Blinddocument
\Blinddocument\Blinddocument\Blinddocument\Blinddocument
\Blinddocument\Blinddocument
\end{document}
Responder2
Você pode redefinir \chaptermark
e \sectionmark
para conseguir isso.
\documentclass[twoside]{scrreprt}
\usepackage{lipsum} % just for example text
\pagestyle{headings}
\renewcommand*\chaptermark[1]{%
\markboth{Chapter~\thechapter}{#1}%
}
\renewcommand*\sectionmark[1]{}
\begin{document}
\chapter{Some Title}
\lipsum[1-5]
\section{A Section}
\lipsum[6-12]
\section{Another Section}
\lipsum[13-20]
\end{document}