I want to set a certain color to the margin areas (which is the region outside the content box of \textwidth by \textheight but inside the paper of course :-) ).

How to change this from within the latex document as opposed to change the geometry.sty?

  • The entire margins or just part thereof? – Joseph Wright Dec 25 '10 at 13:32
  • @Joseph, all pages on the document. – xport Dec 25 '10 at 13:34
  • @Joseph, More precisely, all margins (left,right,top, bottom) for all pages on the document. Margin areas = Paper area minus content area. – xport Dec 25 '10 at 14:40
  • you have to redefine the two/three rule commands from geometry. – user2478 Dec 25 '10 at 17:38

And here an example without pstricks:

| improve this answer | |
  • Thanks, worked for me. To include the footer area, do \rule{\textwidth}{\textheight}. – Richard Hansen Apr 12 '14 at 21:32
  • This exactly answers the question, thank you. – Peter Flynn May 16 at 14:54

In ConTeXt, this can be done using


The first line sets the background color of the entire page to red, and the second line sets the background color of the text area to white.

| improve this answer | |

Here is a variant with pstricks and eso-pic packages:


% ...




It would be better to ask TeX for exact margins (in example above i took exact margins i've provided to geometry package).

On the other hand --- it's possible to make shaded area smaller or like that. Round corner, let's say .-)

| improve this answer | |

Your Answer

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

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