# Formatting page number (fancyhdr?)

-
 Welcome to TeX.sx! – texenthusiast Jan 7 at 3:05 Is the 3 the chapter, and 11 the page number? – cmhughes Jan 7 at 16:50 No, 3 is the page number, and 11 is the number of pages. Thanks for your interest. – Khue Jan 7 at 17:36

The code should be well-commented I hope.

\documentclass{book}

\usepackage[usenames]{xcolor}
\usepackage{fancyhdr}
\usepackage{lastpage}

\fancyhf{}
\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
}}}
\pagestyle{fancy}