LaTeX forum ⇒ Page LayoutChanging background color of just 1 page

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
martacl
Posts: 2
Joined: Fri Feb 27, 2009 5:57 pm

Changing background color of just 1 page

Postby martacl » Fri Feb 27, 2009 6:00 pm

Hi,

I would like to change the background color of one page of my document. I thought I would do by creating a minipage and defining its background color, but I don't know how to do it.
I've tried by definint a box (mbox, fbox, makebox,...) but all of them define a box "inside" the page but leave the margins de same color as the rest of the document.
Anybody can help me?

User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Postby gmedina » Fri Feb 27, 2009 7:32 pm

Hi,

you can use the \pagecolor command provided by the xcolor package; please refer to the package documentation for further information. A little example:
  1. \documentclass{article}
  2. \usepackage{xcolor}
  3. \usepackage{lipsum}%just to generate some text
  4.  
  5. \begin{document}
  6.  
  7. \lipsum[1-4]
  8. \newpage
  9.  
  10. \pagecolor{purple!30}
  11. \lipsum[1-4]
  12.  
  13. \newpage
  14. \pagecolor{white}
  15. \lipsum[1-4]
  16.  
  17. \end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...

martacl
Posts: 2
Joined: Fri Feb 27, 2009 5:57 pm

Postby martacl » Fri Feb 27, 2009 7:45 pm

Thanks! It works fine!


Return to “Page Layout”

Who is online

Users browsing this forum: No registered users and 3 guests