
我有一本twoside
文檔書,我只想在偶數頁上顯示章節號和沒有章節字的章節。我希望它顯示為:6. ¿ QUE ES LA NORMA ISO 27001?
我的程式碼是這樣的:
\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}
答案1
您只需修補即可\chaptermark
刪除插入的\@chapapp\
:
\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}