TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

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:


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




An image of the first two pages:

enter image description here

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

\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.

share|improve this answer
+1 for personal note ;-) – Marco Daniel Aug 23 '12 at 17:00
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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.