Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

When I use the wallpaper package to put a background behind a slide or document, and then use fancyhdr to try and paginate the document the page numbers dont show up. Am I doing something wrong, or is there a process for bringing the page numbers back? Thanks

\documentclass[landscape]{article}
\usepackage[top=0.75in, bottom=0.75in, left=0.7in, right=2in]{geometry} 
\usepackage{microtype,lipsum}
\geometry{letterpaper}
\usepackage{wallpaper} 
\ULCornerWallPaper{1.0}{pillar.pdf} \topmargin=0.25in \headheight=1in \headsep=0.1in 
\usepackage{fancyhdr}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\rfoot{\thepage}
\pagestyle{fancy}

\begin{document}

\lipsum[1-5]

\end{document}

Image for background of MWE attached below... pillar.pdf

share|improve this question
3  
\topmargin=0.25in \headheight=1in \headsep=0.1in is moving the text body down and so the page number is outside the page. Setup the layout only with geometry to get consistent and senseful values. –  Ulrike Fischer Sep 3 '12 at 12:36
    
Thanks @UlrikeFischer that solved the immediate problem and showed me why I was doing wrong. –  Tahnoon Pasha Sep 3 '12 at 22:00

1 Answer 1

up vote 4 down vote accepted

You may try the xwatermark package. Read the user guide.

\documentclass[final,showpagenos]{article}
\usepackage[printwatermark]{xwatermark}
\usepackage[svgnames]{xcolor}
\makeatletter
% Redefining \xwm@f@ncypagenos for a reason:
\robust@redef*\xwm@f@ncypagenos{%
  \def\pgn@textmark{%
    \begingroup
    \fboxrule\pgn@framerule\fboxsep\pgn@framesep\relax
    \pgn@format{\normalfont\pgn@style}%
    \endgroup
  }%
  \cptswitchtrue{xwm@fancy}%
  \xwm@textbox{pgn}%
  \cptswitchfalse{xwm@fancy}%
}
\watermarkpaths[.](/){{}{/graphics}} % your path may be different
\newwallpaper*[
  page=1,picangle=0,tile-xoffset=0pt,tile-yoffset=0pt,square-tiles,
  text-on-top-picture,boxalign=center,pic-bounding-box=125 551 340 668,
  picscale=.5,picfile=advanceknowledge,picfileext=pdf,
  %number-of-tiles=8,top-left
]{}

\fancypagenos[
  textalign         = center,
  show-page-numbers = true,
  show-on-page-one  = true,
  textcolor         = red,
  y-position        = -.42\paperheight,
  x-position        = 0,
  scale             = 2,
  angle             = 0,
  style             = \textsc{Page~\thepage~of~\pageref{xwmlastpage}}
]
\makeatother

\begin{document}
x
\end{document}

enter image description here

share|improve this answer
    
Thanks @AhmedMusa. This is a new and interesting approach for me. Why are you redefining \xwm@fancypagenos? –  Tahnoon Pasha Sep 3 '12 at 22:02
    
The command \cptswitchtrue used to be called \switchtrue in the catoptions package. The public version of xwatermark still uses the old command. So without redefinition, you'll get the error 'undefined control sequence ...'. –  Ahmed Musa Sep 3 '12 at 23:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.