# \fancypagestyle does not affect the first page of the chapter. Why? How to modify that? [duplicate]

\fancypagestyle{myfancy}{
\fancyhf{}
\fancyfoot[LE,RO]{\tikz[baseline={(0,0)},anchor=center] \node[label={center:\thepage}]{\includegraphics[scale=.25]{apple}};}%
\renewcommand{\footrulewidth}{0.4pt}
}


The above code generates the following output for chapters and sections (if needed):

First is header and second is footer

However, when initializing a new chapter, these setting don't appear. I don't want the header to appear but the footer is compulsory. How do I add the footer when starting a new chapter as shown?

Since the first page of a chapter uses (by design) the plain style, you need to redefine this style:

\documentclass{book}
\usepackage[explicit]{titlesec}
\usepackage{graphicx}
\usepackage{tikz}
\usepackage{fancyhdr}
\usepackage{lipsum}

\fancypagestyle{plain}{
\fancyhf{}
\fancyfoot[LE,RO]{\tikz[baseline={(0,0)},anchor=center]
\node[label={center:\thepage}]{\includegraphics[scale=.25]{apple}};}%
\renewcommand{\footrulewidth}{0.4pt}
}

\fancypagestyle{myfancy}{
\fancyhf{}
\fancyfoot[LE,RO]{\tikz[baseline={(0,0)},anchor=center]
\node[label={center:\thepage}]{\includegraphics[scale=.25]{apple}};}%
\renewcommand{\footrulewidth}{0.4pt}
}
\pagestyle{myfancy}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}

\titleformat{\chapter}[display]
{\bfseries\Large}
{}
{1ex}
{\titlerule\vspace{1ex}\filleft#1}
[\vspace{1ex}\titlerule]

\begin{document}

\chapter{Install Backtrack on an Android Device}
\section{What is Backtrack?}
\lipsum[1-40]

\end{document}

• There is a horizontal line at the top , how to remove it? – subham soni Feb 1 '14 at 15:37
• @subhamsoni Sorry about that. Please see my updated answer. – Gonzalo Medina Feb 1 '14 at 15:39