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}
\usepackage{helvet}                  % Default font is the helvetica postscript font

\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)

%\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}

  • 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). Aug 12, 2013 at 19:12
  • 2
    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. Aug 12, 2013 at 19:14
  • Have only included the preamble here, so didn't write \end{document}. \documentclass{} is already here.
    – PGupta
    Aug 12, 2013 at 19:26
  • Actually, this problem is similar to *.aux file not generated.
    – Werner
    Aug 12, 2013 at 19:32

1 Answer 1


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


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, 2013 at 19:32
  • 3
    @Parul: Consider using a more modern resume package, like moderncv, for example.
    – Werner
    Aug 12, 2013 at 19:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .