我需要将页码移到页面的最底部,这样它就会刮到实际纸张的底部边缘(美国信函)。我们该怎么做?
答案1
\usepackage[includefoot,bottom=0pt]{geometry}
答案2
除了移动页码,您还可以做更多的事情。来自 comp.text.tex:
\documentclass[a4paper]{article}
\makeatletter
\usepackage{xkeyval}
\usepackage{fancyhdr}
\usepackage{xcolor}
\usepackage{picture,graphicx}
\usepackage{atbegshi}
\usepackage{lipsum}
\pagestyle{fancyplain}
\def\tempa{fmt=\fbox,x=.05,y=-.5,color=blue,scale=2.5,angle=90,%
cfoot=,rfoot=,lfoot=,chead=,rhead=,lhead=}
\def\tempd{}
\def\tempc#1=#2\@nil{%
\edef\tempd{%
\unexpanded\expandafter{\tempd}%
\ifx\tempd\@empty\else,\fi#1%
}%
\define@cmdkey[KV]{pagenr}[pgn@]{#1}[#2]{}%
}
\@for\tempb:=\tempa\do{\expandafter\tempc\tempb\@nil}
\begingroup
\edef\x{\endgroup
\noexpand\setkeys[KV]{pagenr}{\unexpanded\expandafter{\tempd}}%
}
\x
\newcommand*\FancyPageNos[1][]{%
\ifx\\#1\\\else\setkeys[KV]{pagenr}{#1}\fi
\cfoot{\pgn@cfoot}\rfoot{\pgn@rfoot}%
\lfoot{\pgn@lfoot}\chead{\pgn@chead}%
\rhead{\pgn@rhead}\lhead{\pgn@lhead}%
\AtBeginShipout{\AtBeginShipoutUpperLeft{%
\textcolor{\pgn@color}{%
\put(\pgn@x\paperwidth,\pgn@y\paperheight)%
{\scalebox{\pgn@scale}{\rotatebox{\pgn@angle}%
{\makebox[0pt][c]{\pgn@fmt{Page \thepage}}}}%
}%
}}}}
\fancyhf{}
\fancyhfoffset[R,L]{\dimexpr\marginparsep+\marginparwidth}
\def\headrule{{\color{blue}%
\hrule height1pt depth.5pt width\headwidth\relax
\vspace{2pt}\hrule height1pt depth.5pt width\headwidth
\vspace{-2pt}}%
}
\def\footrule{{\color{red}%
\hrule height1pt depth.5pt width\headwidth\relax
\vspace{2pt}\hrule height1pt depth.5pt width\headwidth
\vspace{2pt}}%
}
\newcommand*\sstring[1]{{\tt\color{magenta}\detokenize{#1}}}
\begin{document}
\FancyPageNos[fmt=\fbox,x=.05,y=-0.5,color=blue!45!red!75,
scale=5,angle=90,chead=\textcolor{cyan}{From \texttt{xwatermark} package},
cfoot=Specimen fancy page numbers]
\lipsum[1]
\newpage
\FancyPageNos[fmt=\texttt,x=.5,y=-0.15,color=purple,scale=2.5,
angle=0,chead=Sample use of \sstring\FancyPageNos]
\lipsum[2]
\end{document}
语法错误不是我的错。我只是复制了我的解决方案并粘贴在这里。我希望你能正确安排代码。
答案3
写吧:
\setlength{\footskip}{2cm}