목차는 로마숫자, 바닥글 본문은 아라비아 숫자

목차는 로마숫자, 바닥글 본문은 아라비아 숫자

목차(및 초록, 감사의 메모 등)에 로마 숫자를 사용하고 1페이지부터 본문을 아라비아 숫자로 시작하려고 합니다. 기사 문서 클래스를 사용하고 있으며 제목 페이지에 페이지 번호를 원하지 않습니다. 동시에 바닥글에 y페이지의 x페이지를 표시하고 싶습니다.

즉 내가 원한다

제목 페이지: 번호 없음
목차 첫 페이지: 페이지 i/ii
목차 두 번째 페이지: 페이지 ii/ii [ii는 이 예에서 선택됨]
문서의 첫 번째 페이지: x의 1페이지
문서의 두 번째 페이지: 2페이지 x의

코드는 목차에 대해 잘 작동합니다. ii의 i페이지, ii의 ii페이지 등이 표시됩니다. 그러나 문서의 나머지 부분에서는 ii의 1페이지, ii의 2페이지가 표시됩니다. 실제로 원인이 무엇인지 알 수 있습니다. 실수( a 사용 \label{lastromanpage})가 발생했지만 이를 해결하는 방법을 모르겠습니다.

\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}
\lhead{\AuthorName}
\chead{\Class}
\rhead{\Title}

\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

답변1

를 사용하여 문서 내부의 바닥글을 변경할 수도 있습니다 \rfoot. 마지막 페이지 번호의 라벨은 더 복잡합니다.\label ~ 후에마지막 페이지는 파일에 아무것도 쓰지 않습니다 .aux. 예를 들어 package는 와 함께 사용할 수 있는 lastpage레이블을 제공합니다 .LastPage\pageref

전체 예:

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

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

\pagestyle{fancy}
\lhead{\AuthorName}
\chead{Class}
\rhead{\Title}

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

관련 정보