
Usando scrlayer-scrpage en la clase de documento scrreprt, me gustaría que la palabra "Capítulo 1" (o 2 o el capítulo que sea) aparezca en el encabezado exterior de las páginas pares y en el título del capítulo, sin "Capítulo 1" antes. en el encabezado exterior de las páginas impares (ver imagen). EDITAR: En capítulos sin numerar, el encabezado debe estar vacío. ¿Cómo logro eso?
Mi 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}
Respuesta1
Pregunta: ¿Qué debería estar en el encabezado de las páginas pares si el capítulo no está numerado?
Aquí hay una sugerencia, donde el título del capítulo se usaría en páginas pares en capítulos sin numerar:
\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}
o sin paquete 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}
Si el encabezado de la página par debe estar vacío para los capítulos no numerados, puede usar
\renewcommand*\chaptermark[1]{%
\markboth{\ifnumbered{chapter}{\chaptermarkformat}{}}{#1}%
}
Además, debe cambiar a marcas manuales y configurar manualmente las marcas para el TOC, etc.:
\manualmark% or option manualmark for package `scrlayer-scrpage`
\AfterTOCHead[toc]{\markboth{}{\contentsname}}
%\AfterTOCHead[lof]{\markboth{}{\listfigurename}}
%\AfterTOCHead[lot]{\markboth{}{\listfigurename}}
Ejemplo:
\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}
o sin paquete 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}
Respuesta2
Puedes redefinir \chaptermark
y \sectionmark
para lograrlo.
\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}