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
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7053940296173096, "perplexity": 2028.5288671086762}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2015-48/segments/1448399455473.15/warc/CC-MAIN-20151124211055-00045-ip-10-71-132-137.ec2.internal.warc.gz"}