# How to give a two sided (top and bottom of the page) border in selected pages in LaTeX?

I am making an article document and want to give two sided border in some pages ( top and bottom of the pages). \hrule doesn't work in the \chapter pages. Please help.

• Welcome to Tex.Se! Which border are you looking for? Please provide the Minimal Working Example (MWE)? – Mishra S Aug 23 '17 at 8:35
• As the article class does not provide the \chapter macro there are no \chapter pages. Perhaps you should look at the reported errors for your document before coming here. – Peter Wilson Aug 23 '17 at 18:14

\documentclass{book}

\usepackage{lipsum}

\usepackage{fancyhdr}

\fancyhf{}
\cfoot{\thepage}
\renewcommand{\footrulewidth}{2.0mm}

\begin{document}

% Bordered pages start here
\chapter{This Chapter with Top and Bottom Borders}
\thispagestyle{fancy}
\pagestyle{fancy}

\section{Bordered Pages}

\lipsum[1-10]

\clearpage

% Un-bordered pages start here

\pagestyle{plain}
\section{Un-Bordered Pages}

\lipsum[11-20]

\clearpage

% Bordered pages start here
\pagestyle{fancy}
\section{Bordered Pages Again}
\lipsum[21-30]

\end{document}


• But my page numbers are gone now. – Vivek Sharma Aug 23 '17 at 9:10
• @VivekSharma That is because you did not tell us where you whether and where you want the page numbers. See the updated solution. And I will stress on the point, adapt. Please see the documentation of fancyhdr for the tweaking options. – Masroor Aug 23 '17 at 9:49