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.
-
What sort of border? Somthing like openclipart.org/tags/Borders%20and%20Frames ? – John Kormylo Dec 6 '17 at 3:32
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@pt\PageFrameLeftMargin,\strip@pt\PageFrameTopMargin){
\framebox(\strip@pt\Page@FrameWidth, \strip@pt\Page@FrameHeight){}}}
\makeatother
\begin{document}
\section{Test}
\end{document}
It produces the following result.
You can change the values for \PageFrameTopMargin
, \PageFrameBottomMargin
, \PageFrameLeftMargin
and \PageFrameRightMargin
in the preamble as needed.
-
Is there a way to modify this if the background of the page is colored? It seems that the color overrides the border. – R. B. Jawad Apr 23 '20 at 22:23
-
@Matthias Please tell me, How to increase the width of the frame or line?? – limlian Dec 1 '20 at 16:11