4

I'm want to put a repeated short text on the whole page as watermark... I've read the xwatermark guide but didn't find anything helpful.

Any idea how to handle that?

Werner
  • 603,163
anton
  • 51

2 Answers2

5

How's this for starters?

\documentclass{article}
\usepackage{xwatermark}
\usepackage{xcolor}
\usepackage{calc}
\newlength\testh
\newlength\testw
\newcommand{\shorttextwatermark}{draft }
\setlength{\testh}{\heightof{\shorttextwatermark}}
\setlength{\testw}{\widthof{\shorttextwatermark}}
\newwallpaper[allpages,tilexsize=10\testw,tileysize=10\testh,boxalign=left]{\shorttextwatermark}
\begin{document}
    hello
\end{document}

enter image description here

azetina
  • 28,884
  • thanx azetina thats exactly what im talking about... i actually got an error: no pagespecifier in watermark attributes:||allpages, tilexsize... I will have to read the manual. Thanx again you helped alot:) – anton Nov 08 '12 at 22:30
  • OK i took a look at xwatermark package docu... it works when i replace "allpages" with "firstpage"... looks goooooooooood:) – anton Nov 08 '12 at 22:40
  • is there any manual where took all this from... i would like to bring some space between the lines and displace the lines... – anton Nov 08 '12 at 22:48
  • @anton: To achieve the spacing, add an option like tileyoffset=1cm, to the \newwallpaper options. All the options are described in the package documentation, but the example I made more or less by trial and error..! Once you feel your question has been suitably answered, consider accepting it. – cyberSingularity Nov 08 '12 at 22:59
  • for IEEEtran class, the allpages paramter doesn't seem to work, its always only on the first page. Does anyone know a workaround? – bonanza Mar 15 '15 at 12:12
  • @bonanza: I am unable to reproduce your problem at the moment. Changing the example to use the IEEEtran class, and adding appropriate new pages and dummy content gives the correct result for me. Can you clarify whether these steps work for you, and precisely what steps you have tried that don't work? – cyberSingularity Mar 18 '15 at 09:36
2

If you want the text in the background, then you can use xwatermark package.

\documentclass{article}
\usepackage[printwatermark]{xwatermark}
\usepackage[svgnames]{xcolor}
\usepackage{lipsum}
\thispagestyle{empty}
% This is all you need for the wallpaper:
\newwallpaper[%
  page=1,fontfamily=put,textcolor=blue,fontsize=1cm,textscale=1,
  textalign=center,textangle=0,tilexoffset=0pt,
  tileyoffset=0pt,squaretiles,boxalign=center,
]{Draft}

% Let me add a box at the center of page 1:
\def\boxa{%
  \xwmcolorbox[framesep=4pt,innerframerule=4pt,outerframerule=2.5pt,
    fillcolor=black,innerframecolor=white,
    outerframecolor=red,height=0mm,
    textalign=center,width=.25\paperheight
  ]{%
    \scalebox{1.0}{\textcolor{white}{Draft Box}}%
  }%
}
\newwatermark[page=1]{\boxa}

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

enter image description here

Ahmed Musa
  • 11,742