Input:
\documentclass[12pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{float}
\usepackage{fancyhdr}
\usepackage{lastpage}
\hypersetup{hidelinks}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\cfoot{\thepage\ of \pageref{LastPage}}
\title{Essay}
\author{Jon}
\begin{document}
\maketitle
\tableofcontents
\pagenumbering{gobble}
\clearpage
\pagenumbering{arabic}
\section{yo}
hello world.
\end{document}
Expected output:
Essay
Jon
yo
hello world.
Real output:
of
Essay
Jon
gobble
arabic
yo
hello world.
The problem:
"of" inside of \cfoot{\thepage\ of \pageref{LastPage}} should not be counted
"gobble" and arabic" inside of \pagenumbering{} should not be counted
Input:
Expected output:
Real output:
The problem:
"of" inside of
\cfoot{\thepage\ of \pageref{LastPage}}should not be counted"gobble" and arabic" inside of
\pagenumbering{}should not be counted