当我使用该wallpaper
软件包将背景放在幻灯片或文档后面,然后尝试对fancyhdr
文档进行分页时,页码没有显示。我做错了什么吗,或者是否有恢复页码的过程?谢谢
\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}
下面是 MWE 的背景图像...
答案1
您可以尝试雙水印包。阅读用户指南。
\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}