8

How can I make a black border close to pages edge ?

9

alt text

\documentclass[12pt]{article}
\usepackage[a4paper,margin=20mm]{geometry}
\usepackage{eso-pic,xcolor,lipsum,calc}

\newlength\myborder
\myborder=10pt%please adjust the border width :-)


\pagecolor{red}%please change it back to black :-)

\AddToShipoutPictureBG
{%
    \AtPageLowerLeft
    {%
        \color{white}%
    \hspace{\myborder}%
    \rule[\myborder]{\paperwidth-2\myborder}{\paperheight-2\myborder}%
  }%
}

\begin{document}
\lipsum
\end{document}
2

An alternative is to use TikZ in the following form:

\documentclass[letterpaper]{article}
\usepackage{tikz}
\usepackage{lipsum}

\definecolor{bordercolor}{cmyk}{1,.60,0,.40}

\begin{document}
\tikz[remember picture,overlay] {%
\draw [bordercolor,line width=3mm]
(current page.south west)
rectangle
(current page.north east)
;}
\lipsum[1-3]
\end{document}

enter image description here

TikZ allows us to access all edges and the center of the current page with special node currentpage.

Your Answer

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