I'm writing a document class that uses the datetime2
package to write a month-year date in the title of the document. Here is a MWE:
\begin{filecontents}[overwrite]{customclass.cls}
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{customclass}[2014/12/16 Custom class]
\LoadClassWithOptions{article}
\RequirePackage{babel}
\RequirePackage[useregional]{datetime2}
\DTMlangsetup*{showdayofmonth=false}
\renewcommand{\maketitle}[0]{\today}
\end{filecontents}
\documentclass[<language>]{customclass}
\begin{document}
\maketitle
\end{document}
I have run into the problem that many languages don't capitalize month names, whereas the desired behavior would be to capitalize them since it is a title (e.g. "Marzo de 2022" instead of "marzo de 2022").
I have tried using \expandafter\MakeUppercase
and also the mfirstuc
package as explained here, but none of those work (I assume it's because the \today
command is pretty complex so it's not easy to expand?). I also cannot hard-code month names because I expect this class to work independently of language, and because I regularly use four languages to typeset documents (French, Italian, Spanish and English, three of which display this issue).
I would love a bit of help with this!