隐藏文档第一页的页眉

隐藏文档第一页的页眉

标题中提出的问题与以下代码有关。任何帮助都可以摆脱页眉(和页脚)仅有的从第一页开始就受到高度赞赏。

\documentclass[12 pt, a4paper]{report}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsthm}
\usepackage{amsmath, amssymb}
\usepackage{graphicx}
\usepackage[T1]{fontenc}
\usepackage{enumerate}
\usepackage{calc}
\usepackage{blindtext}
\usepackage{fancyhdr, lastpage, bbding, pmboxdraw}
\usepackage[T1]{fontenc}
\usepackage[usenames,dvipsnames]{color}
\definecolor{darkblue}{rgb}{0,0,.6}
\definecolor{darkred}{rgb}{.7,0,0}
\definecolor{darkgreen}{rgb}{0,.6,0}
\definecolor{red}{rgb}{.98,0,0}
\usepackage[colorlinks,pagebackref,pdfusetitle,urlcolor=darkblue,citecolor=darkblue,linkcolor=darkred,bookmarksnumbered,plainpages=false]{hyperref}
\usepackage{mathtools}
\usepackage{blkarray, bigstrut}
\usepackage{multicol}
\usepackage{arydshln}
\usepackage{longdivision}
\usepackage{tcolorbox}
\renewcommand{\thefootnote}{\fnsymbol{footnote}}
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}{Lemma}
\newtheorem{claim}{Claim}
\newtheorem{proposition}{Proposition}
\newtheorem{corollary}{Corollary}
\newtheorem{fact}[theorem]{Fact}
\newtheorem{example}{Example}
\newtheorem{notation}{Notation}
\newtheorem{observation}[theorem]{Observation}
\newtheorem{conjecture}[theorem]{Conjecture}

\theoremstyle{definition}
\newtheorem{definition}{Definition}

\theoremstyle{remark}
\newtheorem{remark}{Remark}


\renewcommand{\thesection}{\thechapter.\number\numexpr\value{section}\relax}

\setcounter{chapter}{1}
%%%%%%%%%%%% LISTING %%%
\usepackage{listings}
\usepackage{caption}
\DeclareCaptionFont{white}{\color{white}}
\DeclareCaptionFormat{listing}{\colorbox{gray}{\parbox{\textwidth}{#1#2#3}}}
%\captionsetup[lstlisting]{format=listing,labelfont=white,textfont=white}
\usepackage{verbatim} % used to display code
\usepackage{fancyvrb}
\usepackage{acronym}
%\usepackage{amsthm}
\usepackage{setspace}
\VerbatimFootnotes % Required, otherwise verbatim does not work in footnotes!

\DeclarePairedDelimiter\ceil{\lceil}{\rceil}
\DeclarePairedDelimiter\floor{\lfloor}{\rfloor}

\usepackage{lipsum}
\usepackage{geometry}
\geometry{%
  letterpaper,
  lmargin=2 cm ,
  rmargin=1.4 cm,
  tmargin=2 cm,
  bmargin=2 cm,
  footskip=22 pt,
  headheight=12pt}  

\usepackage{fancyhdr}
\pagestyle{fancy}
\lfoot{\footnotesize IEEE 2019}
\rfoot{\footnotesize Engineering Mechanics}
\renewcommand{\headrulewidth}{0 pt}
\renewcommand{\footrulewidth}{0.8 pt}
\fancyfoot[C]{\footnotesize \thepage}



\usepackage{titlesec}
\titlelabel{\thetitle.\quad}

\linespread{1.4}

\begin{document}

\section{bla bla}

\lipsum


\end{document}

答案1

由于您已经加载了fancyhdr包,因此这相当简单。只需定义一个emptyheader页面样式,如下所示:

\fancypagestyle{emptyheader}{
    \fancyhead[]{}
}

然后仅在第一页之后使用它\thispagestyle{emptyheader}\begin{document}请参阅 MWE 的第 89 至 94 行。

\documentclass[12 pt, a4paper]{report}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsthm}
\usepackage{amsmath, amssymb}
\usepackage{graphicx}
\usepackage[T1]{fontenc}
\usepackage{enumerate}
\usepackage{calc}
\usepackage{blindtext}
\usepackage{fancyhdr, lastpage, bbding, pmboxdraw}
\usepackage[T1]{fontenc}
\usepackage[usenames,dvipsnames]{color}
\definecolor{darkblue}{rgb}{0,0,.6}
\definecolor{darkred}{rgb}{.7,0,0}
\definecolor{darkgreen}{rgb}{0,.6,0}
\definecolor{red}{rgb}{.98,0,0}
\usepackage[colorlinks,pagebackref,pdfusetitle,urlcolor=darkblue,citecolor=darkblue,linkcolor=darkred,bookmarksnumbered,plainpages=false]{hyperref}
\usepackage{mathtools}
\usepackage{blkarray, bigstrut}
\usepackage{multicol}
\usepackage{arydshln}
\usepackage{longdivision}
\usepackage{tcolorbox}
\renewcommand{\thefootnote}{\fnsymbol{footnote}}
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}{Lemma}
\newtheorem{claim}{Claim}
\newtheorem{proposition}{Proposition}
\newtheorem{corollary}{Corollary}
\newtheorem{fact}[theorem]{Fact}
\newtheorem{example}{Example}
\newtheorem{notation}{Notation}
\newtheorem{observation}[theorem]{Observation}
\newtheorem{conjecture}[theorem]{Conjecture}

\theoremstyle{definition}
\newtheorem{definition}{Definition}

\theoremstyle{remark}
\newtheorem{remark}{Remark}


\renewcommand{\thesection}{\thechapter.\number\numexpr\value{section}\relax}

\setcounter{chapter}{1}
%%%%%%%%%%%% LISTING %%%
\usepackage{listings}
\usepackage{caption}
\DeclareCaptionFont{white}{\color{white}}
\DeclareCaptionFormat{listing}{\colorbox{gray}{\parbox{\textwidth}{#1#2#3}}}
%\captionsetup[lstlisting]{format=listing,labelfont=white,textfont=white}
\usepackage{verbatim} % used to display code
\usepackage{fancyvrb}
\usepackage{acronym}
%\usepackage{amsthm}
\usepackage{setspace}
\VerbatimFootnotes % Required, otherwise verbatim does not work in footnotes!

\DeclarePairedDelimiter\ceil{\lceil}{\rceil}
\DeclarePairedDelimiter\floor{\lfloor}{\rfloor}

\usepackage{lipsum}
\usepackage{geometry}
\geometry{%
  letterpaper,
  lmargin=2 cm ,
  rmargin=1.4 cm,
  tmargin=2 cm,
  bmargin=2 cm,
  footskip=22 pt,
  headheight=12pt}

\usepackage{fancyhdr}
\pagestyle{fancy}
\lfoot{\footnotesize IEEE 2019}
\rfoot{\footnotesize Engineering Mechanics}
\renewcommand{\headrulewidth}{0 pt}
\renewcommand{\footrulewidth}{0.8 pt}
\fancyfoot[C]{\footnotesize \thepage}



\usepackage{titlesec}
\titlelabel{\thetitle.\quad}

\linespread{1.4}

\fancypagestyle{emptyheader}{
    \fancyhead[]{}
}

\begin{document}
\thispagestyle{emptyheader}
\section{bla bla}

\lipsum


\end{document}

输出结果为

在此处输入图片描述

相关内容