2

i tried this answer here memoir class but does not work in my case,I managed to remove the header but could not remove the headrule, here is my 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}

Figure

2 Answers 2

4

you can do it by make width=0

\renewcommand{\headrulewidth}{0.0pt}
1
  • 2
    Welcoem to TeX.SE Please for a valid answer show always an compiling code for a fast proof and add a screenshot of the result to your answer ...
    – Mensch
    Commented Mar 17, 2018 at 2:55
2

I manged to solve this issue by playing around and customizing Plain page style with help of the answer from this link

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

In my case i'am using different Odd and Even pages, so do not forget to move page number manually depends on the page before and after.

You must log in to answer this question.

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