10

enter image description here

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

  • Welcome to TeX.sx! Note that you don't have to add "in/with LaTeX" on this site, because everything here is about LaTeX and TeX, with LaTeX as the default. – Martin Scharrer May 21 '12 at 6:38
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}

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.