我尝试在文档中同时添加页眉和页脚,但页眉不应出现在章节的第一页上,并且章节旁边的页眉中不应有一行*。我该如何实现这一点?我还想从页眉中删除“章节”一词。这是我的最小示例:
\documentclass[12pt,twoside]{book}
\usepackage{fancyhdr}
\fancyhead{} % clear all header fields
\fancyhead[LO]{\nouppercase\leftmark}
\fancyhead[RE]{\nouppercase\rightmark}
\fancypagestyle{plain}{%
\fancyhead[LO]{\nouppercase\leftmark}
\fancyhead[RE]{\nouppercase\rightmark}
}
%\renewcommand{\headrulewidth}{0pt} % no line in header area
\fancyfoot{} % clear all footer fields
\fancyfoot[LE,RO]{\thepage} % page number in "outer" position of footer line
\fancyfoot[RE,LO]{\today} % other info in "inner" position of footer line
\fancypagestyle{plain}{%
\fancyfoot[LE,RO]{\thepage} % page number in "outer" position of footer line
\fancyfoot[RE,LO]{\today} % other info in "inner" position of footer line
}
\begin{document}
\chapter*{Contents}
\chapter{Introduction}
This is the first section.
Lorem ipsum dolor sit amet, consectetuer adipiscing
elit. Etiam lobortisfacilisis sem. Nullam nec mi et
neque pharetra sollicitudin. Praesent imperdietmi nec ante.
Donec ullamcorper, felis non sodales...
\end{document}
答案1
该\fancypagestyle{plain}{...}
命令将普通的纯色页面样式(章节的第一页)替换为花哨的页面样式。只需将其删除即可。
\documentclass[12pt,twoside]{book}
\usepackage{fancyhdr}
\fancyhead{} % clear all header fields
\fancyhead[LO]{\nouppercase\leftmark}
\fancyhead[RE]{\nouppercase\rightmark}
%\renewcommand{\headrulewidth}{0pt} % no line in header area
\fancyfoot{} % clear all footer fields
\fancyfoot[LE,RO]{\thepage} % page number in "outer" position of footer line
\fancyfoot[RE,LO]{\today} % other info in "inner" position of footer line
\begin{document}
\chapter*{Contents}
\chapter{Introduction}
This is the first section.
Lorem ipsum dolor sit amet, consectetuer adipiscing
elit. Etiam lobortisfacilisis sem. Nullam nec mi et
neque pharetra sollicitudin. Praesent imperdietmi nec ante.
Donec ullamcorper, felis non sodales...
\end{document}