Please tell me how to design a page (to be coded in the \pagestyle design code) in which only "text area" is boxed. Margins, header and footer must of out of this box. Plus i want to control the thickness and colour of the box.
Thanks, Satyendra
The following borrows the mechanism to place the frame from the showframe
package. The \pagestyle
mechanism isn't really necessary, but just because you asked for it I added it to this. The framedpage
style doesn't change anything from the current page style (but you could add code that does), but just sets \myframetrue
so that the frame is displayed. You can control the colour and thickness by redefining \myframecolor
and \myframethickness
.
\documentclass[]{memoir}
\usepackage{xcolor}
\usepackage{eso-pic}
\usepackage{etoolbox}
\makeatletter
\newcommand*\myframecolor{\color{purple}}
\newcommand*\myframethickness{.4pt}
\newif\ifmyframe
\pretocmd\pagestyle{\myframefalse}{}{\GenericError{}{Patching failed}{}{}}
\newcommand*\mypageframe
{%
\begingroup
\myframecolor
\linethickness{\myframethickness}%
\AtTextLowerLeft
{\framebox(\LenToUnit{\textwidth},\LenToUnit{\textheight}){}}%
\endgroup
}
\newcommand*\ps@framedpage{\myframetrue}
\AddToShipoutPictureFG{\ifmyframe\mypageframe\fi}
\makeatother
\usepackage{duckuments} % only for dummy text
\begin{document}
\duckument
\cleardoublepage
\pagestyle{framedpage}
\duckument
\cleardoublepage
\pagestyle{plain}
\duckument
\end{document}