2

numname is a package that allows you to write out (e.g.) chapter titles in words. It's basically some code taken out of memoir.cls apparently.

There appears to be something wrong with the code, however.

I tried to make an option to have enumerate's with word labels like so:

\documentclass{article}
\usepackage{enumitem}

\usepackage{numname}
\makeatletter
\newcommand*{\nthwords}[1]{%
  \expandafter\@nthwords\csname c@#1\endcsname}
\newcommand*{\@nthwords}[1]{%
  \ordinaltoName{#1}}
\AddEnumerateCounter{\nthwords}{\@nthwords}{eleven}

\makeatother

\newcounter{tctr}
\setcounter{tctr}{12}

\begin{document}
\nthwords{tctr}

% \begin{enumerate}[label=\nthwords*]
% \item Boo
% \item Far
% \item Faz\label{fz}
% \end{enumerate}
% \ref{fz}

\end{document}

This works fine, but uncommenting out the enumerate environment makes it complain about an "incomplete \iffalse" at the line with the first \item.

Now, commenting out \usepackage{numname} and changing the documentclass to memoir fixes things.

So something has gone wrong. Any clues as to what that might be? Or should I email the author of numname? [I ask because I know we have some memoir experts who might be able to spot the problem...]

1 Answer 1

2

It doesn't really work with memoir and you'll see it by adding a \label to the second item and a \ref to it.

You can get it to work by

\usepackage{numname}
\makeatletter
\newcommand*{\nthwords}[1]{%
  \expandafter\@nthwords\csname c@#1\endcsname}
\newcommand*{\@nthwords}[1]{%
  \protect\ordinaltoName{\number#1}}
\AddEnumerateCounter{\nthwords}{\@nthwords}{eleven}
\makeatother

The reason why memoir doesn't give an error is because \ordinaltoName is robust in that class and it isn't for numname.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .