10

enter image description here

I want to generate shading color in background for a single page. How can I implement this?

Martin Scharrer
  • 262,582
manish
  • 9,111

1 Answers1

13

TikZ can do this in its sleep. This is a slightly modified approach to what is given in the tikz documentation (section 2.14 Shading, p 31):

enter image description here

\documentclass{article}
\usepackage{tikz}% http://ctan.org/pkg/pgf
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\begin{document}
\begin{tikzpicture}[remember picture,overlay]
  \shade[left color=white,right color=orange!60]
    (current page.south west) rectangle (current page.north east);
\end{tikzpicture}

\lipsum[1-5]
\end{document}

I've used a full page shading (left-to-right, white to 60% orange), although you can do this with other shapes and sizes as well. For example, a shading similar to the above starting from the middle of the page (horizontally), would be

\begin{tikzpicture}[remember picture,overlay]
  \shade[left color=white,right color=orange!60]
    (current page.south) rectangle (current page.north east);
\end{tikzpicture}
Martin Scharrer
  • 262,582
Werner
  • 603,163