\documentclass{article}
\usepackage{newpxtext,newpxmath}
%\usepackage{color}
\textwidth3in
\begin{document}
\title{Title of article}
\author{My name}
\maketitle
\thispagestyle{empty}

\tableofcontents

\section{A section}\label{sec:ASection}

See section \ref{sec:ASection} on page
\pageref{sec:ASection}.
% the TOC now makes the text full-width;
% no need anymore for the artifice below
%\hfill\textcolor[gray]{0.98}{\rule{1pt}{1pt}}

\subsection{A subsection}
That's all, folks!

\end{document}
