![格式化页码(fancyhdr?)](https://linux22.com/image/260921/%E6%A0%BC%E5%BC%8F%E5%8C%96%E9%A1%B5%E7%A0%81%EF%BC%88fancyhdr%EF%BC%9F%EF%BC%89.png)
谁能告诉我如何获取此页码格式:
答案1
我希望代码应该有良好的注释。
\documentclass{book}
\usepackage[usenames]{xcolor}
\usepackage{fancyhdr}
\usepackage[vmargin=1in,hmargin={1in,1.5in},headsep=0.3in,headheight=1in]{geometry}
\usepackage{lastpage}
\fancyhf{}
\fancyhead[LE,RO]{{\ooalign{%
\color{black!60!white}% background box color
\rule[0.05in]{0.8in}{1in}% background box raise, width, height
\cr
\hfil\strut\raisebox{0.25in}{% number raise
\sffamily\bfseries\color{white}% number color
\Huge% number fontsize
\thepage
\kern0.1em% distance number-bar
\rule{1pt}{1.4ex}% bar size
\kern0.15em% distance bar-totalnumber
\Large% totalnumber fontsize
\pageref{LastPage}}\hfil
}}}
\fancyheadoffset[LE,RO]{1.2in}% protrusion
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\usepackage{lipsum}% just for dummy text
\begin{document}
\lipsum[1-35]
\newpage
\lipsum[1-35]
\end{document}