# Keep getting “aux file” error with the lastpage package

Keep getting "aux file" error with the lastpage package. The same code is working in another file but not in this one (code furnished here). Please help! Thank you!

\documentclass[margin, 11pt]{res}
\setlength{\textwidth}{5.1in}
\usepackage{helvet}                  % Default font is the helvetica postscript font
\usepackage{lastpage}

\usepackage{fancyhdr}                % http://ctan.org/pkg/fancyhdr
\pagestyle{fancy}                  % Set default page style to fancy
\renewcommand{\headrulewidth}{0pt} % Remove header rule
\fancyhead{}                       % Remove all header contents
\cfoot{Parul Gupta\\ Page \thepage\ of \pageref{LastPage}}
% Page X of Y in the footer (centered)

\begin{document}
%----------------------------------------------------------------------------------------
%   NAME AND ADDRESS SECTION
%----------------------------------------------------------------------------------------
%\cfoot{\thepage\ of \pageref{LastPage}}
\moveleft.5\hoffset\centerline{\large\bf Parul Gupta} % Your name at the top

\moveleft\hoffset\vbox{\hrule width\resumewidth height 0.25pt}\smallskip % Horizontal line after name; adjust line thickness by changing the '1pt'

\moveleft.5\hoffset\centerline{add line 1 } % Your address
\moveleft.5\hoffset\centerline{add line 2}
%\moveleft.5\hoffset\centerline{}
%----------------------------------------------------------------------------------------
\begin{resume}

\end{resume}
\end{document}

• Welcome to TeX.SX! A tip: If you indent lines by 4 spaces, they'll be marked as a code sample. You can also highlight the code and click the "code" button (with "{}" on it). – karlkoeller Aug 12 '13 at 19:12
• Please make your code compilable, starting with \documentclass{...} and ending with \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to help you. Help them help you: remove that one hurdle between you and a solution to your problem. – karlkoeller Aug 12 '13 at 19:14
• Have only included the preamble here, so didn't write \end{document}. \documentclass{} is already here. – PGupta Aug 12 '13 at 19:26
• Actually, this problem is similar to *.aux file not generated. – Werner Aug 12 '13 at 19:32

## 1 Answer

As part of the res.cls document class, it executes:

\nofiles         % resume's don't need .aux files


This avoid the creation of auxiliary files, needed when using references (which lastpage requires). So, add

\let\nofiles\relax


before loading the document class.

• Worked!! Thank you so much! Had been breaking my head over this for the past one hour! – PGupta Aug 12 '13 at 19:32
• @Parul: Consider using a more modern resume package, like moderncv, for example. – Werner Aug 12 '13 at 19:34