1

The question stated in the title comes with the following code. Any help in getting rid of the header (and footer) only from the first page is much appreciated.

\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
  • Thank you for posting a working example! At the same time, much of your code does not seem to be relevant to the question you're asking here. Please limit the example to only the code required for your issue to appear. You can have a look at this guide for how to prune your code for this purpose. Apr 17, 2020 at 8:07

1 Answer 1

1

Since you have already loaded the fancyhdr package, this is rather simple. Just define an emptyheader pagestyle as follows:

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

and then use it only for the first page with \thispagestyle{emptyheader} right after \begin{document}. See lines 89 to 94 of your MWE.

\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}

The resulting output is

enter image description here

2
  • Thank you. It worked for the header. When I follow a similar thing for the footer, it didn't work. Could you please explain why ? That is to get rid of the footer from the first page as well. Thanks again.
    – Quantas
    Apr 17, 2020 at 8:57
  • If you want no header and no footer on the first page, just use \thispagestyle{empty} Apr 17, 2020 at 12:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .