13

The \today command will print the Latin name of the month with the nynorsk language option. I would like to change this by using the more traditional (and still very commonly used in speech) system of using the ordinal number "first", "second", etc. (abbreviated from "first month", "second month", etc.).

All it requires is to substitute the month names by i X, where i is the preposition "in" and X the ordinal, as seen in the table below. What's the most convenient way of doing that? With the datetime2 package?

\documentclass{article}
\usepackage[nynorsk]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\begin{document}
\today\\

\begin{tabular}{*5{l}}
januar & i fyrste & & juli & i sjuande\\
februar & i andre & & august & i åttande\\
mars & i tredje & & september & i niande\\
april & i fjerde & & oktober & i tiande\\
mai & i femte & & november & i ellevte\\
juni & i sjette & & desember & i tolvte\\
\end{tabular}
\end{document}

enter image description here

For those who wonder - ordinals in Norwegian are definite, so there's no need for a definite article or determiner of any kind, as in English "in the first (month)", "in the second (month)", etc.

Sverre
  • 20,729

2 Answers2

13
\documentclass{article}
\usepackage[nynorsk]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\renewcommand\datenynorsk{%
 \def\today{\number\day.~\ifcase\month\or
    i fyrste\or i andre\or i tredje\or i fjerde\or i femte\or i sjette\or
    i sjuande\or i åttande\or i niande\or i tiande\or i ellevte\or
    i tolvte\fi
    \space\number\year}}

\begin{document}
\today


\end{document}

enter image description here

Ulrike Fischer
  • 327,261
3

Since you asked for datetime2, you just need to redefine the month name macros:

\documentclass{article}
\usepackage[nynorsk]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[useregional]{datetime2}

\renewcommand*{\DTMnorskmonthname}[1]{%
  \ifcase#1
  \or
  i fyrste%
  \or
  i andre%
  \or
  i tredje%
  \or
  i fjerde%
  \or
  i femte%
  \or
  i sjette%
  \or
  i sjuande%
  \or
  i åttande%
  \or
  i niande%
  \or
  i tiande%
  \or
  i ellevte%
  \or
  i tolvte%
  \fi
}

\renewcommand*{\DTMnorskMonthname}[1]{%
  \ifcase#1
  \or
  I fyrste%
  \or
  I andre%
  \or
  I tredje%
  \or
  I fjerde%
  \or
  I femte%
  \or
  I sjette%
  \or
  I sjuande%
  \or
  I åttande%
  \or
  I niande%
  \or
  I tiande%
  \or
  I ellevte%
  \or
  I tolvte%
  \fi
}

\begin{document}
\today

Specific date: \DTMdate{2015-10-26}.
\end{document}

10. i ellevte 2015. Specific date: 26. i tiande 2015.

Nicola Talbot
  • 41,153