Following up this answer, the first run of compilation results in the following error:
Undefined control sequence. This exam contains \textbf{\NAMEquestions}
which has to be eliminated by running it for the second time. So, how can I get rid of the error at the first run in order to be able to use arara?
% arara: lualatex: { options: [ '-synctex=1', '-shell-escape','-interaction=nonstopmode' ]}
% arara: lualatex: { options: [ '-synctex=1', '-shell-escape','-interaction=nonstopmode' ]}
\documentclass[addpoints]{exam}
\usepackage{fmtcount,etoolbox}
\makeatletter
\let\NAMEquestions\numquestions
\patchcmd{\NAMEquestions}{\exam@numquestions}{{\NUMBERstringnum\exam@numquestions} question\ifnum\exam@numquestions>1 s\fi}{}{}
\let\NAMEpages\numpages
\patchcmd{\NAMEpages}{\exam@lastpage}{{\NUMBERstringnum\exam@lastpage} page\ifnum\exam@lastpage>1 s\fi}{}{}
\let\NAMEpoints\numpoints
\patchcmd{\NAMEpoints}{\exam@numpoints}{{\NUMBERstringnum\exam@numpoints} mark\ifnum\exam@numpoints>1 s\fi}{}{}
\makeatother
\begin{document}
This exam contains \textbf{\NAMEquestions} in \textbf{\NAMEpages} (including the cover) for a total of \textbf{\NAMEpoints}.
\begin{questions}
\question[10] single question
\end{questions}
\end{document}
Is your question also how to get rid of the error?Yes, I have asked for a solution to be able to use arara :) – Diaa Oct 31 '19 at 22:47