# Vector frame on all pages

I would like a regular frame about 0.5cm outside the text margin for every page in a report. I have checked different options such as the Wallpaper package, Showframe package and the showframe option of Geometry. I've also seen one-page only solutions using Tikz.

I have an unspecified number of pages in the document, and I would like the frame on every page, enclosing the all the text of the page (including page numbers, headers and footers). I'd also like some choice in the line style (such as double line, dashed, or dotted).

I have a hunch that this could be done with Pstricks or with Tikz, but my knowledge of either of these is marginal...any help would be appreciated.

You can use the backgound package; in the contents= option you can place your frame using TikZ and give it the desired look; a simple example:

\documentclass{article}
\usepackage{background}
\usetikzlibrary{calc}
\usepackage{lipsum}

\backgroundsetup{
color=black,
scale=1,
opacity=1,
angle=0,
contents={\tikz\draw[line width=1pt,rounded corners,olive]
( $(current page.south east) + (-3,5)$ ) rectangle ( $(current page.north west) + (2,2)$ );}
}

\begin{document}

\lipsum[1-40]

\end{document}


An image of the first two pages:

If the latest version of background is not yet available in your system, you can use the old syntax:

\SetBgColor{black}
\SetBgScale{1}
\SetBgOpacity{1}
\SetBgAngle{0}
\SetBgContents{\tikz\draw[line width=1pt,rounded corners,olive]
( $(current page.south east) + (-3,5)$ ) rectangle ( $(current page.north west) + (2,2)$ );}


(the old syntax still works in the new version.)

As a personal note, I don't know if using this kind of frame in a document is a good idea.

• Works great! Thanks very much!<br> I had to manually install the Background package (I was using the Ubuntu version of TexLive, which didn't have it). However, I didn't how how to do a manual install, and the whole thing took longer than I expected. A valuable learning, nevertheless. <br> Also, I completely agree with you on the aesthetics of the frame...I don't like it personally either.<br> – Sierra Bravo Aug 26 '12 at 15:45
• Ooops...sorry for the typos (didn't know about 5-minute limits on editing either). – Sierra Bravo Aug 26 '12 at 15:52
• @SierraBravo No problem. I am glad I could help. Please consider accepting the answer (by clicking on the check-mark to the left of it). – Gonzalo Medina Aug 26 '12 at 15:58