4

background package defines a background with absolute position in preamble, but how to set two independent backgrounds at different positions? Consider we have two backgrounds as

\SetBgColor{red}
\SetBgPosition{0,0}
\SetBgContents{content1}

\SetBgColor{blue}
\SetBgPosition{1cm,5cm}
\SetBgContents{content2}
Googlebot
  • 4,035

1 Answers1

9

The background material can be pretty much anything; in particular, it can be a tikzpicture environment, and inside this environment you can use two independent \nodes to place your material:

\documentclass{article}
\usepackage{background}
\usepackage{lipsum}

\SetBgAngle{0}
\SetBgScale{3}
\SetBgOpacity{1}
\SetBgContents{%
\begin{tikzpicture}[remember picture,overlay]
\node[text=red] at (0,0) {content1};
\node[text=blue] at (2,-2) {content2};
\end{tikzpicture}}

\begin{document}

\lipsum[1-10]

\end{document}

enter image description here

Gonzalo Medina
  • 505,128
  • This method does not apply to simple text, but resolved my problem as I'm using tikz too. I wanna take the chance to thank you for your excellent package. It's very flexible, and I am using it for various purposes. This is the reason that I need more than one :) – Googlebot Apr 20 '12 at 06:35
  • Just for sake of clarification! Your codes did not work for me until setting a value for SetBgPosition. – Googlebot Apr 20 '12 at 07:12