\thepage가 정의되지 않았는지 어떻게 감지하나요?

\thepage가 정의되지 않았는지 어떻게 감지하나요?

그만큼sig-alternate클래스는 기본적으로 페이지 번호를 비활성화합니다. 이는 mparhack특히 페이지 번호를 깨뜨립니다.

\thepage올바르게 정의된 경우에만 tex 코드를 어떻게 포함할 수 있나요 ? \ifcsname\ifcsempty을 시도했지만 etoolbox둘 다 작동하지 않았습니다.

MWE:

\documentclass{sig-alternate}

%\pagenumbering{arabic}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{mparhack}

\begin{document}

\title{A Sample {\ttlit ACM} SIG Proceedings Paper in LaTeX}

\numberofauthors{1} 
\author{
\alignauthor
Ben Trovato\titlenote{Dr.~Trovato insisted his name be first.}\\
       \affaddr{Institute for Clarity in Documentation}\\
       \affaddr{1932 Wallamaloo Lane}\\
       \affaddr{Wallamaloo, New Zealand}\\
       \email{[email protected]}
}
\date{30 July 1999}

\maketitle

\section{Introduction}

The \textit{proceedings} are the records of a conference.
\end{document}

답변1

사용 \@ifundefined:

\documentclass{sig-alternate}
%\pagenumbering{arabic}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{mparhack}

\makeatletter
\@ifundefined{thepage}{\def\thepage{\arabic{page}}}{}%
\makeatother

\begin{document}
\title{A Sample {\ttlit ACM} SIG Proceedings Paper in LaTeX}

\numberofauthors{1}
\author{
\alignauthor
Ben Trovato\titlenote{Dr.~Trovato insisted his name be first.}\\
       \affaddr{Institute for Clarity in Documentation}\\
       \affaddr{1932 Wallamaloo Lane}\\
       \affaddr{Wallamaloo, New Zealand}\\
       \email{[email protected]}
}
\date{30 July 1999}

\maketitle

\section{Introduction}

The \textit{proceedings} are the records of a conference.
\end{document}

와 함께 또는 없이 작동합니다 \pagenumbering{arabic}.

관련 정보