# Page Borders on Specific Pages, followup to an answer from another question

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.

TeX - LaTeX Asked by Computer Crafter on February 15, 2021

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

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{[email protected]}
newlength{[email protected]}

% PW modified the AddToShipoutPicture to output nothing for borderon=false
ifthenelse{boolean{borderon}}{%
thinlines
setlength{[email protected]}{paperheight-PageFrameTopMargin-PageFrameBottomMargin}
setlength{[email protected]}{paperwidth-PageFrameLeftMargin-PageFrameRightMargin}
put([email protected],[email protected]){
framebox([email protected]@FrameWidth, [email protected]@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.

Correct answer by Peter Wilson on February 15, 2021

## Related Questions

### Jewish and Muslim holidays formula

0  Asked on September 26, 2021

### Print a list of selected enumerated list labels

2  Asked on September 26, 2021

### Height filling minipages in Beamer

1  Asked on September 26, 2021 by bconic

### Histogram with multiple plots of same data

1  Asked on September 26, 2021 by user221282

### Circle above a letter

4  Asked on September 26, 2021

### PDF output works in an embedded window, but not in the separate window

0  Asked on September 26, 2021 by koval-boris

### How do I define a new function juse

1  Asked on September 26, 2021

### Putting two images beside each other

6  Asked on September 26, 2021 by simplicity

### Description list items: selective misbehaviour with Ligatures=TeX, fonts, xeLaTeX, and luaLaTeX

2  Asked on September 26, 2021 by brent-longborough

### ConTeXt: SyncTeX and interactivity features (hyperlinks) not working in TeXworks pdf viewer

0  Asked on September 26, 2021

### How to make a background picture transparent?

2  Asked on September 25, 2021

### Best practice for plots (pgfplots, gnuplot, etc.)

2  Asked on September 25, 2021 by burny

### Letter formatting in Latex main and input files

1  Asked on September 25, 2021

### MiKTeX Error: Can’t install koma-script Package “Transferred a partial file”

1  Asked on September 25, 2021 by aorstab

### How can I draw this Feynman diagram?

3  Asked on September 25, 2021

### 3 Figures in a column in LaTeX document

1  Asked on September 25, 2021

### How to abbreviate author’s firstname in bibliography

5  Asked on September 25, 2021 by mcandril

### Was given .bbl file from website and need to generate pdf

2  Asked on September 25, 2021 by arun-k

### Multiple editions under one author in bibliography

1  Asked on September 25, 2021 by lata-deokar