What I want to do is to show a "progress bar" in the header to show how far you are in the document, by making a rule with width pagenumber divided by total pages times the paper width.
This is what I have:
\usepackage{fancyhdr,lastpage}
\pagestyle{fancy}
\lhead{\rule{\value{page}/\value{\pageref{LastPage}}*120mm}{2mm}}
but obviously it doesn't work.
Best Answer
Solving this kind of problem is the raison d'ĂȘtre of the
refcount
package. Here's one way to use it: