我有以下tex文件:
\documentclass[a4paper,11pt,oneside]{book} \usepackage[usenames,dvipsnames]{color} \usepackage[T1]{fontenc} \usepackage[utf8x]{inputenc} \usepackage{lipsum} \usepackage[left=2cm,top=3cm,right=1.5cm,bottom=2cm]{geometry} \renewcommand{\chaptermark}[1]{\markboth{#1}{}} \renewcommand{\sectionmark}[1]{\markright{#1}{}} \renewcommand{\subsectionmark}[1]{\markright{\thesubsection}{}} \usepackage[Lenny]{fncychap} \usepackage{thumbpdf} \usepackage[colorlinks]{hyperref} \setlength\marginparwidth{1cm} \usepackage{fancyhdr} \pagestyle{fancy} \fancyhead[LO,L]{Book template} \fancyhead[RO,R]{\rightmark} \fancyfoot[CO,C] {\thepage} \begin{document} \chapter{Chapter Intro} \lipsum \chapter{Chapter with subsections} \section{section foo} \lipsum \subsection{subsection bar} \lipsum \end{document}
http://www.mediafire.com/?0m5mnka32kj
在右上方:
谢谢
下面的两个标记应该可以做到这一点:
\renewcommand{\chaptermark}[1]{\markright{#1}{}} \renewcommand{\sectionmark}[1]{\markright{#1}{}}
一定要把它们移到某个位置 \pagestyle{fancy} . 还要确保删除自定义项 \subsectionmark
\pagestyle{fancy}
\subsectionmark