TransWikia.com

Adding a border on each page

TeX - LaTeX Asked by Abrar Mungi on August 24, 2020

I want to add page border in each of my project’s report page. If there is any command in sharelatex then let me know about it or else just give me some solution for it.

One Answer

Here is a possible solution based on the packages eso-pic and calc.

documentclass{article}

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}

AddToShipoutPicture{
  thinlines
  setlength{Page@FrameHeight}{paperheight-PageFrameTopMargin-PageFrameBottomMargin}
  setlength{Page@FrameWidth}{paperwidth-PageFrameLeftMargin-PageFrameRightMargin}
  put(strip@ptPageFrameLeftMargin,strip@ptPageFrameTopMargin){
    framebox(strip@ptPage@FrameWidth, strip@ptPage@FrameHeight){}}}

makeatother

begin{document}

section{Test}

end{document}

It produces the following result.

Output of the MWE.

You can change the values for PageFrameTopMargin, PageFrameBottomMargin, PageFrameLeftMargin and PageFrameRightMargin in the preamble as needed.

Answered by Matthias on August 24, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP