4

I'm using \ordinalnum with datetime package (the same with fmtcount package), but in french, the height & the size of the superscript using \ordinalnum are different from those of (for exemple) \formatdate, or using classical \up{} or \ieme.

I'd like to use something like \ordinalnum for personal commands, because it's very convenient, but with the result like \up{ème} for ordinal numbers different of 1 (in french : 1er, 2ème, 3ème…) : good height, good size of superscript & with de diacritic ème.

So, I imagine two solutions :

  • order a change for the \ordinalnum fonction to these standards (2ème)
  • find another convenient fonction for ordinal numbers…

Thanks for your help

% !TEX encoding = UTF-8 Unicode
\documentclass{scrbook}
\usepackage[frenchb]{babel}
\usepackage[quiet]{fontspec}                    
\usepackage[dayofweek]{datetime}        %\usepackage{fmtcount}
\setmainfont[Numbers={OldStyle}]{Adobe Garamond Pro}
\begin{document}
2\up{ème}, \ordinalnum{2}, \formatdate{1}{4}{2014}. 
\end{document}

enter image description here

2
  • 1
    Comment aside: in French the correct abbreviation for 2ème, 3ème, &c. should be 2\textsuperscript{e}, 3\textsuperscript{e}, &c., (for which frenchb from babel has shortcut commands, but certainly not \textup{eme/ème}. Take a look at the Règles typographiques de L'Imprimerie nationale.
    – Bernard
    Apr 20 '14 at 15:22
  • @Bernard Thank you for your advise, it's true, & I like this very useful book. But for some publication, they ask these kind of superscript…
    – Zouib
    Apr 21 '14 at 10:51
3

\ordinalnum uses \textsuperscript; you can easily change it so that \up is used instead. There's also a mistake, because for masculine ordinals “ème” should be used as well as for feminine ordinals.

\documentclass{scrbook}
\usepackage[frenchb]{babel}
\usepackage[quiet]{fontspec}
\usepackage[dayofweek]{datetime}

% use \up instead of \textsuperscript
\renewcommand{\fmtord}[1]{\up{#1}}
\usepackage{etoolbox}
\makeatletter
% fix a glitch in `fmtcount` that has “eme”
% for masculine ordinals, instead of ème
\patchcmd{\@ordinalMfrench}{eme}{ème}{}{}
\makeatother

\setmainfont[Ligatures=TeX,Numbers={OldStyle}]{Linux Libertine O} 

\begin{document}
2\up{ème}, \ordinalnum{2}, \formatdate{1}{4}{2014}.
\end{document}

enter image description here

If, according to Bernard's advice, you want abbreviated superscripts, just set the relevant option.

\documentclass{scrbook}
\usepackage[frenchb]{babel}
\usepackage[quiet]{fontspec}
\usepackage[dayofweek]{datetime}

\fmtcountsetoptions{abbrv}

% use \up instead of \textsuperscript
\renewcommand{\fmtord}[1]{\up{#1}}
\usepackage{etoolbox}
\makeatletter
% fix a glitch in `fmtcount` that has “eme”
% for masculine ordinals, instead of ème
\patchcmd{\@ordinalMfrench}{eme}{ème}{}{}
\makeatother

\setmainfont[Ligatures=TeX,Numbers={OldStyle}]{Linux Libertine O}

\begin{document}
2\up{e}, \ordinalnum{2}, \formatdate{1}{4}{2014}.
\end{document}

enter image description here

1
  • Excellent ! Thank you very much for this complete answer.
    – Zouib
    Apr 21 '14 at 10:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.