
\documentclass[12pt,a4paper]{report}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{booktabs}
\usepackage{array}
\usepackage{tabularx}
\usepackage{caption}
\captionsetup[table]{skip=10pt}
\renewcommand{\arraystretch}{1.4}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{adjustbox}
\usepackage{rsc}
\usepackage{graphicx}
\usepackage{setspace}
\linespread{1.25}
\UseRawInputEncoding
\usepackage{geometry}
\geometry{
a4paper,
left=40mm,
right=20mm,
top=40mm,
bottom=50mm
}
%header settings
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\makeatletter
% copy of the original from report.cls with the \MakeUppercase dropped
\renewcommand{\chaptermark}[1]{
\markboth
{\ifnum \c@secnumdepth >\m@ne
\@chapapp\ \thechapter.
\fi
#1}
{}}
\makeatother
\usepackage{etoolbox}
\patchcmd{\tableofcontents}
{\MakeUppercase}
{}
{}{}
\patchcmd{\tableofcontents}
{\MakeUppercase}
{}
{}{}
\patchcmd{\thebibliography}
{\MakeUppercase}
{}
{}{}
\patchcmd{\thebibliography}
{\MakeUppercase}
{}
{}{}
\fancyhead[L]{\itshape\leftmark}
\fancyhead[R]{\itshape Keiran Corbett}
\fancyfoot[C]{\thepage}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0pt}
\setlength{\headheight}{15pt}
\setlength{\footskip}{50pt} %page number spacing
\begin{document}
\tableofcontents
\chapter{Example chapter title}
\newpage
text
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\end{document}
Entonces, con este comando, se ve como me gustaría, pero tengo una tabla de contenido y el encabezado es el Capítulo 0. CONTENIDO
Entonces tengo dos preguntas 1. ¿Cómo hago para que el CONTENIDO no sea mayúscula? 2. ¿Cómo puedo deshacerme del Capítulo (solo para la sección dorsal y de contenido)?
La bibliografía también tiene el mismo problema.
Hay un ejemplo de cómo debería verse en la página 4 del archivo de látex de ejemplo.
Respuesta1
Sugiero un ligero cambio para \chaptermark
que \leftmark
contenga el encabezado completo ("Capítulo 1. Título del capítulo de ejemplo") y no solo el título del capítulo ("Título del capítulo de ejemplo"). Eso lo hace \fancyhead[L]
más simple y menos susceptible a números de capítulo incorrectos.
Para obtener un encabezado agradable en el ToC y la bibliografía, no encontré mejor manera que parchear los comandos directamente. ver por ejemploEncabezados de ToC y fancyhdr.
memoir
o las clases KOMA tendrían interfaces más convenientes para esto.
\documentclass[12pt,a4paper]{report}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\makeatletter
% copy of the original from report.cls with the \MakeUppercase dropped
\renewcommand{\chaptermark}[1]{%
\markboth
{\ifnum \c@secnumdepth >\m@ne
\@chapapp\ \thechapter. %
\fi
#1}
{}}
\makeatother
\usepackage{etoolbox}
\patchcmd{\tableofcontents}
{\MakeUppercase}
{}
{}{}
\patchcmd{\tableofcontents}
{\MakeUppercase}
{}
{}{}
\patchcmd{\thebibliography}
{\MakeUppercase}
{}
{}{}
\patchcmd{\thebibliography}
{\MakeUppercase}
{}
{}{}
\fancyhead[L]{\itshape\leftmark}
\fancyhead[R]{\itshape NAME}
\fancyfoot[C]{\thepage}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0pt}
\setlength{\headheight}{15pt}
\begin{document}
\tableofcontents
\chapter{Example chapter title}
lorem
\newpage
ipsum
\newpage
dolor
\newpage
sit
\newpage
amet.
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\nocite{*}
\bibliographystyle{plain}
\bibliography{xampl}
\end{document}
El rsc
paquete se carga natbib
y, por lo tanto, cambia ligeramente la composición tipográfica del encabezado de la bibliografía. En ese caso necesitas parchear el comando \bibsection
y no \thebibliography
.
Agregar
\patchcmd{\bibsection}
{\MakeUppercase}
{}
{}{}
\patchcmd{\bibsection}
{\MakeUppercase}
{}
{}{}
a su preámbulo.