I am trying to use roman numerals for the table of contents (and abstract, notes of thanks etc.) and then start the main body of the text from page 1 in arabic numerals. I am using the article document class and do not want a page number on the title page. At the same time in the footer I want to show Page x of y.

i.e. I want

Title page: no number
First page of document: page 1 of x
Second page of document: page 2 of x

The code works fine for the table of contents, i do get page i of ii, page ii of ii etc. However, for the rest of the document I then get page 1 of ii, page 2 of ii Actually I can see what causes the mistake (the use of a \label{lastromanpage}), but I do not know how to solve this.

\documentclass{article}

\newcommand{\Title}{Title}
\newcommand{\DueDate}{\today}
\newcommand{\Class}{}
\newcommand{\ClassTime}{}
\newcommand{\ClassInstructor}{}
\newcommand{\AuthorName}{Authorname}

\title{\vspace{2in}\textmd{\textbf{ \Title}}\\\normalsize\vspace{0.1in}\small{Due\ on\ \DueDate}\\\vspace{0.1in}\large{\textit{\ClassInstructor\ \ClassTime}}\vspace{3in}}
\date{}
\author{\textbf{\AuthorName}}

\pagestyle{fancy}

\lfoot{\lastxmark}
\cfoot{}
\rfoot{Page\ \thepage\ of\ \pageref{lastromanpage}}

\begin{document}\begin{spacing}{1.1}

\maketitle\thispagestyle{empty}\newpage
\pagenumbering{roman}\tableofcontents \label{lastromanpage}
\newpage\pagenumbering{arabic}\clearpage

-
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). –  Heiko Oberdiek Apr 12 '13 at 8:09
Issue \rfoot{Page \thepage\ of \pageref{LastPage}} after \pagenumbering{arabic} and load the lastpage package (or \zpageref{LastPage} loading zref-lastpage). –  egreg Apr 12 '13 at 8:16

You can also change the footer inside the document with \rfoot. The label for the last page number is more complicate, because \label after the last page would not write anything in the .aux file. For example, package lastpage provides a label LastPage that can be used with \pageref.

Full example:

\documentclass{article}
\usepackage{fancyhdr}
\usepackage{lastpage}

\newcommand*{\Title}{Title}
\newcommand*{\AuthorName}{John Doe}
\title{\Title}
\date{}
\author{\AuthorName}

\pagestyle{fancy}

\lfoot{}
\cfoot{}
\rfoot{Page\ \thepage\ of\ \pageref{lastromanpage}}

\begin{document}

\maketitle\thispagestyle{empty}
\newpage

\pagenumbering{roman}
\tableofcontents
\label{lastromanpage}
\clearpage

\pagenumbering{arabic}
\rfoot{Page\ \thepage\ of \pageref{LastPage}}
\section{First section}
\newpage
\section{Last section}

\end{document}

-
Thank you for your help, this seems to work just fine ^^ –  Young-il Kim Apr 12 '13 at 10:45