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).
Post Reply
martacl
Posts: 2
Joined: Fri Feb 27, 2009 5:57 pm

Changing background color of just 1 page

Post by martacl »

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?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

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

Changing background color of just 1 page

Post by gmedina »

Hi,

you can use the \pagecolor command provided by the xcolor package; please refer to the package documentation for further information. A little example:

Code: Select all

\documentclass{article}
\usepackage{xcolor}
\usepackage{lipsum}%just to generate some text

\begin{document}

\lipsum[1-4]
\newpage

\pagecolor{purple!30}
\lipsum[1-4]

\newpage
\pagecolor{white}
\lipsum[1-4]

\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

Re: Changing background color of just 1 page

Post by martacl »

Thanks! It works fine!
Post Reply