0

I would like to get the page count in my LaTeX document such that I do not need to do manaually do it. Pseudocode

\documentclass{article}
\usepackage{hyperref}
\begin{document}

Page count: % TODO here

\end{document}

Doing the thing with \usepackage{lastpage} ... \ref{LastPage} puts a hyperlink (blue) there, output in Fig. 1. I want it without the hyperlink and in black.

Fig. 1

enter image description here

Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036
  • 2
    Package \usepackage{lastpage} and then in the document body: Page count: \pageref{Lastpage} –  Mar 03 '17 at 06:07
  • This is similar in nature to How can I add "page # of ##" on my document? In the link, you'll see a host of option on how to identify the last page (count). – Werner Mar 03 '17 at 06:08
  • 3
    @LéoLéopoldHertz준영: use \pageref*{LastPage} –  Mar 03 '17 at 06:15
  • 1
    @LéoLéopoldHertz준영: This is an often asked question and Werner linked one of them, with a bunch of answers, so it is a clear duplicate also –  Mar 03 '17 at 06:20
  • 1
    You should not completely change the question. Originally it was a question about how to get the number of pages. Now it is a question about how to use references without links. And you should not answer the question in the question. Questions should be questions and answers should be answers. – Schweinebacke Mar 03 '17 at 07:58
  • @Schweinebacke Yes, but I closed the question already so this is a compromise because comments can be deleted. And it is not completely changed. History always remains. – Léo Léopold Hertz 준영 Mar 03 '17 at 07:59

0 Answers0