0

I tried using the answer from Adding a border on each page to create a page border, and it works, but I'm wondering if there's a way to remove the page border from certain pages?

I would ask this in a comment, but unfortunately I don't have 50 reputation :(

Thanks.

0

The following is an expanded version of the answer you quote.

% noborderprob.tex SE 559677

% the following code mainly from SE 404749
\documentclass{article}

% PW added the folowing code
\usepackage{lipsum} 
\usepackage{ifthen}
\newboolean{borderon} 
\newcommand{\borders}{\setboolean{borderon}{true}}    % have borders
\newcommand{\noborders}{\setboolean{borderon}{false}} % no borders
\borders
% end of addition

\usepackage{calc}
\usepackage{eso-pic}

\newlength{\PageFrameTopMargin}
\newlength{\PageFrameBottomMargin}
\newlength{\PageFrameLeftMargin}
\newlength{\PageFrameRightMargin}

\setlength{\PageFrameTopMargin}{1cm}
\setlength{\PageFrameBottomMargin}{1cm}
\setlength{\PageFrameLeftMargin}{1cm}
\setlength{\PageFrameRightMargin}{1cm}

\makeatletter

\newlength{\Page@FrameHeight}
\newlength{\Page@FrameWidth}

% PW modified the \AddToShipoutPicture to output nothing for borderon=false
\AddToShipoutPicture{
  \ifthenelse{\boolean{borderon}}{%
  \thinlines
  \setlength{\Page@FrameHeight}{\paperheight-\PageFrameTopMargin-\PageFrameBottomMargin}
  \setlength{\Page@FrameWidth}{\paperwidth-\PageFrameLeftMargin-\PageFrameRightMargin}
  \put(\strip@pt\PageFrameLeftMargin,\strip@pt\PageFrameTopMargin){
    \framebox(\strip@pt\Page@FrameWidth, \strip@pt\Page@FrameHeight){}}}
{}}

\makeatother

\begin{document}

\section{Test}

% PW added the following code

\lipsum 

\lipsum 

\noborders % stop page borders

\lipsum

\borders % start page borders

\lipsum

\end{document}

This starts off with pages having borders. To stop the bordering put \noborders on the page which you want to be borderless. Put \borders on the page where you want bordering to start again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.