I tried anything I could to obtain something like the right image where the dots reach the page numbers. But, I always get the left image.
Is there any option to control this? Any suggestions would be greatly appreciated.
I tried anything I could to obtain something like the right image where the dots reach the page numbers. But, I always get the left image.
Is there any option to control this? Any suggestions would be greatly appreciated.
Your document class is built on top of the standard class report.cls. The behavior you describe is hard-wired into this class (in fact into the macro \@dottedtocline of LaTeX itself). The following patch probably works for most document classes that build on the standard classes.
Add the following lines after the \documentclass{...} command.
\usepackage{xpatch}
\makeatletter
\xpatchcmd\@dottedtocline{\hb@xt@\@pnumwidth}{}{}{}
\makeatother
Here is an example using the report class, but it also works for your class (see the end of the answer).
\documentclass{report}
\usepackage{xpatch}
\makeatletter
\xpatchcmd\@dottedtocline{\hb@xt@\@pnumwidth}{}{}{}
\makeatother
\begin{document}
\tableofcontents
\chapter{Test 1}
\section{A}
\subsection{a}
\clearpage
\setcounter{page}{10}
\section{B}
\clearpage
\setcounter{page}{100}
\subsection{a}
\chapter{Test 2}
\end{document}
Compare the output of the patched version
with the unpatched standard behavior.
If you replace report by your class USF, you obtain
which is what you asked for (as I understand it).