# 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

### Tufte-book with tikz-timing resulting in alignment problems

0  Asked on October 1, 2020 by eedude

### Too many alphabets, how to avoid this error?

4  Asked on October 1, 2020 by alba-crespo-prez

### TikZ does not draw functions anymore

2  Asked on September 30, 2020 by puserr

### Creating a Feynman loop diagram with feynmf

1  Asked on September 30, 2020

### I want to have an arc at point A and B ,and two intersecting arcs at point D for the two parallel lines

2  Asked on September 30, 2020 by kaziba-stephen

### LaTeX listings package JSON formatting

0  Asked on September 30, 2020

### How to shrink the headers / chapters in dissertation?

1  Asked on September 29, 2020 by red-shoes

### Matrix with top just top indexes

2  Asked on September 28, 2020 by zarathustra

### Document without title

3  Asked on September 28, 2020 by yrodro

### hyperlink item in list with corresponding part in (svg) image

0  Asked on September 28, 2020 by saitama

### fonts / siunitx: Understanding how “detect-all” and “detect-inline-family=math” work

1  Asked on September 28, 2020

### How and where can I access old versions of autoinst?

1  Asked on September 28, 2020

### Can one display the word count of a specific paragraph using texcount?

1  Asked on September 27, 2020

### How to adjust the height of subfigures of different sizes?

1  Asked on September 27, 2020 by javaccess

### Problems with page layout dimensions in the memoir class

1  Asked on September 27, 2020

### Text alignment after wrapped figure

1  Asked on September 27, 2020

### Can someone help with pstricks formatting for my title page?

1  Asked on September 26, 2020 by michael-alisky

### cellcolor overwrites table lines (hhline)

3  Asked on September 26, 2020 by bhamza

### How can I mark and label certain regions in the margin with ConTeXt?

1  Asked on September 26, 2020 by flyx

### Create new environment for graphics with list of graphics

0  Asked on September 26, 2020 by hind-dev