\myTileWallPaper is defined in the classfile like this

\whiledo{\lengthtest{\tileY < \paperheight}}{% 
  \whiledo{\lengthtest{\tileX < \paperwidth}}{% 

When I use two \AddToShipoutPictures, LaTeX throws an error.

\ifthenelse{\isodd{\thepage}}% Wenn ungerade Seitenzahl, dann Bild 1, sonst Bild 2.
    {\myTileWallPaper{\paperwidth}{\paperheight}{wallpaper1}}% ungerade Seite
    {\myTileWallPaper{\paperwidth}{\paperheight}{wallpaper2}}% gerade Seite

The error is as follows :

! Missing number, treated as zero.
<to be read again>
l.73 \end{document}
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)

If I remove the 2nd \AddToShipoutPicture, everything seems to work fine. If I remove the 2nd \AddToShipoutPicture and put it ahead of the first one, everything seems to work fine -- although it doesn't work since the wall-paper then covers the logo.


The following tiling isn't exactly correct, but it is precisely what you would have had if your code compiled. Use, eg, xwatermark package instead.


    \tileX=0pt \tileXoffset\wpXoffset


Here is the correct solution. Now you use keys in place of parameters.

  viewport/00 00 100 100;
  \edef\ffileext{\ifpdf pdf\else eps\fi}%

\def\wpspec{[viewport=20 21 590 400,xtilenr=4,ytilenr=4,

enter image description here

  • Thanks Musa for your efforts and patience. I had problems compiling the first code. I am jus checking the 2nd code. Coming back to my initial issue.. I didn't have problem with the wallpaper part of my code -- it was only when i added the 2nd AddToShipoutPicture for providing the logo at the left hand corner of the page, did i run into all the issues. \newline I actually am looking to learn tex/Latex a bit more indepth, not just having a solution , so I was curious about why Latex threw an error message . \newline I would anyway go ahead and test the new. Thanks once again for your patience. – Asif Dec 2 '11 at 1:58
  • The code doesn't compile at --> \pathkeys{wallpaper/asif/define*: .. The error is Package ltxkeys Error : The above keys are undefined and couldn't be set. – Asif Dec 2 '11 at 2:04
  • @Asif: Everything works fine at my end. Please update your ltxkeys package from CTAN. – Ahmed Musa Dec 2 '11 at 3:21

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.