# Replace Page Numbers in TOC with String

I am trying to set the page number for my last page as "End Page" because that is a thesis requirement for my university. This is what I have:

\chapter*{ABOUT THE AUTHOR}
\label{ch:author}
\setcounter{page}{End Page}


I get an error on line 3 that a number is missing and it is treated as 0. The number shows up as 0 in the TOC.

• Welcome! \setcounter sets a counter, i.e. a number. Depending on which document class and styles you use, there are different you use, there are different options. One of them is to use fancyhdr and to play with \chead etc. But for people really to give you specific answers, you may want to specify the document classes and the relevant style files. – user121799 Nov 25 '17 at 3:15
• So if I used \chead it would change the page number on the final page and the TOC, but how would I change the TOC, and not the final page? To be specific, I want to completely suppress the page number on the final page, and just have it labeled in the TOC as "End Page." – Bex Nov 25 '17 at 3:45
• Well, as I wrote above, you need to provide more input concerning document class and styles before others can help you. Another suggestion is to make use of the search of this site, you'll be surprised how many suggestions you find. – user121799 Nov 25 '17 at 3:54
• @Bex: Depending on the content towards the last page of your thesis, it might suffice to use \AtEndDocument{\renewcommand{\thepage}{End Page}}. – Werner Nov 25 '17 at 6:36

This is one possible solution. It is quite possible that the question is a duplicate to this question.

\documentclass[12pt]{article}
\usepackage{fancyhdr}
\usepackage{lipsum}
\pagestyle{fancy}
\begin{document}
\tableofcontents
\clearpage
\section{blabla}
\lipsum{1}
\section{blablabla}
\lipsum{2}

• I attempted this \chapter*{ABOUT THE AUTHOR} \label{ch:author} \thispagestyle{empty} \addtocontents{toc}{% \protect\contentsline{chapter}{About the Author}{End Page}} \addcontentsline{toc}{chapter}{About the Author} But under the line in the TOC it outputs chapterAbouttheAuthor14chapter*.13 and I'm not sure why. If I eliminate \addcontentsline{toc}{chapter}{About the Author}, it does not print the desired line in the TOC at all. – Bex Nov 25 '17 at 16:49
• Well, given the format in comments, I can't tell if there is an issue because of the % sign. More precisely, the the stuff \protect.. needs to go in a new line, or you need to drop the % sign. (Also, \label does not make much sense in \chapter*.) The best way to go is if you include something similar to my code in your question, of course adapted to your needs, and then post this as a real question with real MWE. See also @Werner's comment. – user121799 Nov 25 '17 at 17:14