从特定页面或章节标题页中删除标题行并保留脚注

从特定页面或章节标题页中删除标题行并保留脚注

我在这里尝试过这个答案回忆录课但在我的情况下不起作用,我设法删除了标题,但无法删除标题规则,这是我的 MWE:

\documentclass[10pt,a4paper]{book}
\usepackage{xcolor}
\usepackage{fancyhdr}
\usepackage{etoolbox}
\patchcmd{\chapter}{\thispagestyle{plain}}{\thispagestyle{fancy}}{}{}%to make chapter's first page fancy
\usepackage{fancyhdr}%to add horizental link to header&foofter
\pagestyle{fancy}
\fancyhf{}
\fancyfoot[LE,RO]{\thepage}
\fancyhead[RE]{\footnotesize\itshape header}      
\fancyhead[LO]{\leftmark}
\renewcommand{\footrulewidth}{0.2pt}%the widht of header line
\renewcommand{\headrulewidth}{0.2pt}%the widht of header line
%==========to make chapter title fancy===========
\usepackage{titlesec}
\makeatletter%to make chapter titles fancy
\titleformat{\chapter}[frame]
{\normalfont}{\filright\enspace \@chapapp~\thechapter\enspace}
{20pt}{\Huge\bfseries\filcenter}%20pt the small line that close the box
\titlespacing*{\chapter}
{0pt}{-20pt}{20pt}%{}{between header and box}{space after box}
\makeatother
%====to remove the header====
\fancypagestyle{nofooter}{%
\fancyfoot{}%
}
\fancypagestyle{noheader}{%
\fancyhead{}%
}
\usepackage{lipsum}
\begin{document}
\chapter{Head rule}
\thispagestyle{noheader}%
\lipsum[1]
\section{Head rule}
\lipsum[1]
\end{document}

数字

答案1

你可以通过使 width=0 来实现

\renewcommand{\headrulewidth}{0.0pt}

答案2

我设法通过尝试和自定义纯页面样式来解决此问题,并借助此答案关联

\documentclass[10pt,a4paper]{book}
\usepackage{xcolor}
\usepackage{fancyhdr}
\usepackage{etoolbox}
%\patchcmd{\chapter}{\thispagestyle{plain}}{\thispagestyle{fancy}}{}{}%to make chapter's first page fancy
\usepackage{fancyhdr}%to add horizental link to header&foofter
\pagestyle{fancy}
\fancyhf{}
\fancyfoot[LE,RO]{\thepage}
\fancyhead[RE]{\footnotesize\itshape header}      
\fancyhead[LO]{\leftmark}
\renewcommand{\footrulewidth}{0.2pt}%the widht of header line
\renewcommand{\headrulewidth}{0.2pt}%the widht of header line
%==========to make chapter title fancy===========%

\usepackage{titlesec}
\makeatletter%to make chapter titles fancy
\titleformat{\chapter}[frame]
{\normalfont}{\filright\enspace \@chapapp~\thechapter\enspace}
{20pt}{\Huge\bfseries\filcenter}%20pt the small line that close the box
\titlespacing*{\chapter}
{0pt}{-20pt}{20pt}%{}{between header and box}{space after box}
\makeatother
%==========Custmizing plain page style==========%
\fancypagestyle{plain}{
\fancyhf{} %Clear Everything.
\fancyfoot[L]{\thepage} %Page Number
\renewcommand{\headrule}{\hrule height 0pt \vspace{0mm}\hrule height 0pt}
\renewcommand{\footrulewidth}{1pt}
\fancyfoot[C]{}
\fancyfoot[R]{}
\fancyhead[LE]{}
\fancyhead[RO]{}
}
%%%%%%
%====to remove the header====
\fancypagestyle{nofooter}{%
\fancyfoot{}%
}
\fancypagestyle{noheader}{%
\fancyhead{}%
}
\usepackage{lipsum}
\begin{document}
\chapter{Head rule}
%\thispagestyle{noheader}%
\lipsum[1]
\section{Head rule}
\lipsum[1]
\end{document}

就我而言,我使用不同的奇数页和偶数页,因此不要忘记根据前后页面手动移动页码。

相关内容