# Manually setting the page number of specific pages to an arabic letter

For some pages in a book document, I need to manually set the page number to an arabic alphabet character.

For example, The first page of my document should have آ as its page number, and second page should be ب and third page should be ج.

I don't need the page numbers to be automatically set as the pages with this format are 5 or 6 at most. So manually setting them would work but I can't find any command which allows me to set alphabet characters for a specific page.

Please note that, I don't want to set the page numbers to arabic numbers as suggested here with this command : \renewcommand{\thepage}{\arabic{page}}. I need to set the page number to an arabic alphabet character such as آ or د.

# What I've Tried:

• \setcounter{page}{آ}: this obviously won't work as it excepts a number and not an alphabet character.

So, is there a way to manually set the page number of specific pages to arabic alphabet characters?

• Take a look to the link above (I think it answers your question. Is it?) Sep 2, 2017 at 22:37
• @koleygr, this is different as it need to set the page number to an arabic alphabet character and not a number. Sep 2, 2017 at 22:37
• Ok.. Sorry thought it was a number... And I supposed to know what arabic numbers are ... Sep 2, 2017 at 22:39
• Before the new \renewcommand\thepage use \clearpage. Sep 2, 2017 at 22:40
• Oh, and welcome to TeX.SX! Sep 2, 2017 at 23:19

The following example defines \arabicalph as number formatting command like \arabic or \alph (see latex.ltx). Then, the numbering style can be easily switched by \pagenumbering{arabicalph}:

\documentclass[a5paper]{article}
\usepackage{lipsum}

\usepackage{fontspec}
\setmainfont{FreeSerif}

\makeatletter
\newcommand*{\@arabicalph}[1]{%
\ifcase#1%
\or
آ%
\or
ب%
\or
ج%
% ...
\else
\@ctrerr
\fi
}
\newcommand*{\arabicalph}[1]{%
\expandafter\@arabicalph\csname c@#1\endcsname
}
\makeatother

\begin{document}
\pagenumbering{arabicalph}
\lipsum
\end{document}

• Amazing! This answer also works great in a case when Table of Contents could have multiple pages and you want the page number to go to the next letter in the alphabet on each page. Sep 3, 2017 at 0:15

Just use a \clearpage before the next page begins.

\documentclass[]{article}

\usepackage{blindtext}

\begin{document}
\renewcommand{\thepage}{Z}
\blindtext
\clearpage
\renewcommand{\thepage}{Y}
\blindtext
\clearpage
\pagenumbering{arabic}
\blinddocument
\end{document}

• Although this solution worked perfectly and I didn't ask for anything more in the question, I went with @Heiko's solution as it solved the case when Table of Contents could have multiple pages and you want the page number to go to the next letter in the alphabet on each page. Sep 3, 2017 at 0:14
• @Sobhan don't worry, I prefer his solution, too. Sep 3, 2017 at 12:17