[Tex/LaTex] \leftmark header without chapter name

chaptersheader-footer

I have a twoside document book and I want just to show on the even pages the number of the chapter and the chapter without chapter word. I want it to apper: 6. ¿QUE ES LA NORMA ISO 27001?

header figure

My code is this one:

   \fancyhf{}

    \fancyhead[LE]{\textsl{\slshape{\leftmark}}}

    \fancyhead[RO]{\textsl{PROYECTO FIN DE MASTER}}

    \fancyfoot[LE,RO]{\thepage}

    \renewcommand{\headrulewidth}{0.4pt}

    \renewcommand{\footrulewidth}{0.4pt}

Best Answer

You could just patch \chaptermark to remove the inserted \@chapapp\ :

enter image description here

\documentclass[twoside]{book}
\usepackage[spanish]{babel}
\usepackage{fancyhdr,lipsum}
\fancyhf{}
\fancyhead[LE]{\slshape \leftmark}
\fancyhead[RO]{\slshape PROYECTO FIN DE MASTER}
\fancyfoot[LE,RO]{\thepage}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
\pagestyle{fancy}

\usepackage{etoolbox}
\makeatletter
%\ patchcmd{<cmd>}{<search>}{<replace>}{<success>}{<failure>}
\patchcmd{\chaptermark}{\@chapapp\ }{}{}{}
\makeatother

\begin{document}

\chapter{A chapter}
\lipsum[1-50]

\end{document}
Related Question