2

My MWE generates "One" for the chapter number. I want the "One" to be "ONE". I tried everything I could think of including \renewcommand{\thechapter}{\MakeUppercase{\Numberstring{chapter}}} and {\MakeUppercase{\thechapter}} but nothing is working for me.

\documentclass[12pt]{memoir}
\usepackage[explicit]{titlesec}

\titleformat{\chapter}[display]
    {\huge\filcenter}
    {\thechapter}
    {1em}
    {\Huge #1}
\titleformat{\subsection}[display]{}
    {\thesubsubsection}
    {}
    {#1}

\let\ordinal\relax
\usepackage{fmtcount}
\renewcommand{\thechapter}{\Numberstring{chapter}}

\begin{document}
\chapter{The First Chapter}
This is some text in the first chapter.
\end{document}

enter image description here

4
  • Possibly related to expansion. I have seen references to requiring \expandafter twice, as in \expandafter\MakeUppercase{\expandafter\SomeMacro} but it did not work for me. What happens if you try \MakeUppercase{One} ? That will resolve whether the problem is related to expansion, or MakeUppercase itself.
    – user287367
    Mar 12, 2023 at 14:20
  • You wrote, "I tried everything I could think of...". Did that include reading the user guide of the fmtcount package? :-)
    – Mico
    Mar 12, 2023 at 14:31
  • @Mico I observe that the MWE does not load fmtcount. So why would the OP look at that package documentation?
    – user287367
    Mar 12, 2023 at 14:34
  • 1
    @Mico Actually, I was missing something. :(
    – user287367
    Mar 12, 2023 at 15:46

1 Answer 1

1

The fmtcount package provides a macro called \NUMBERstring. You should be using this macro instead of \Numberstring to generate the all-uppercase string "ONE".


enter image description here

\documentclass[12pt]{memoir}
\let\ordinal\relax
\usepackage{fmtcount}

\begin{document}
\setcounter{chapter}{1}
\arabic{chapter} \numberstring{chapter} \Numberstring{chapter} \NUMBERstring{chapter}
\end{document}

You must log in to answer this question.

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