2

I built & used a complex command \qd this spring who requires datetime package and therefore fmtcount. I start again to use my command these days, but occurred some changes. I suspect updates of fmtcount package. Problems :

  1. Though I put frenchb option in babel package, results of numberstringnum& ordinalnum commands are in english…
  2. Now, I can't use this form for my command : \numberstringnum{{#1}0}, & it's very troublesome.

I put here a minimal exemple :

% !TEX encoding = UTF-8 Unicode
% !TEX TS-program = arara
\documentclass{scrbook}
\usepackage[frenchb]{babel} 
\usepackage[quiet]{fontspec}                    
\usepackage[automark,headsepline]{scrpage2}         
\usepackage[babel,french=guillemets*]{csquotes}
\usepackage[dayofweek]{datetime}

\setmainfont[Mapping=tex-text, Ligatures={Common, Rare}, Numbers={OldStyle}]{Adobe Garamond Pro}
\addtokomafont{disposition}{\normalfont}
\newcommand{\qd}[1]{années~\numberstringnum{{#1}0}}

\begin{document}
\numberstringnum{300}, \ordinalnum{3}[m], \formatdate{1}{1}{2000}…
%\qd{8}.
\end{document}
% arara: xelatex

And the result :s

enter image description here

I put above the second problem in grey (%\qd{8}.), but if I active the \qd command, error messages in the console are :

! Missing number
…
! Missing = inserted for \ifnum
…
! Package fmtcount error: Out of range

I have the 3.00 version of fmtcount package manual. Thank you for your help.

  • 1
    Load \usepackage[french]{fmtcount} before datetime. – egreg Aug 21 '14 at 11:11
  • @egreg Cool ! it works. – Zouib Aug 21 '14 at 11:15
5

You can either put the french (or frenchb) option as a global option to \documentclass or load

\usepackage[french]{fmtcount}

before datetime. The problem, apparently, is that the fmtcount package doesn't look at the default babel language when it's loaded.

So, either

\documentclass[frenchb]{scrbook}
\usepackage{babel}
\usepackage[quiet]{fontspec}
\usepackage[automark,headsepline]{scrpage2}
\usepackage[babel,french=guillemets*]{csquotes}
\usepackage[dayofweek]{datetime}

%\setmainfont[Mapping=tex-text, Ligatures={Common, Rare}, Numbers={OldStyle}]{Adobe Garamond Pro}
\addtokomafont{disposition}{\normalfont}
\newcommand{\qd}[1]{années~\numberstringnum{{#1}0}}

\begin{document}
\numberstringnum{300}, \ordinalnum{3}[m], \formatdate{1}{1}{2000}…
\qd{8}.
\end{document}

or

\documentclass{scrbook}
\usepackage[french]{babel}
\usepackage[quiet]{fontspec}
\usepackage[automark,headsepline]{scrpage2}
\usepackage[babel,french=guillemets*]{csquotes}
\usepackage[french]{fmtcount}
\usepackage[dayofweek]{datetime}

%\setmainfont[Mapping=tex-text, Ligatures={Common, Rare}, Numbers={OldStyle}]{Adobe Garamond Pro}
\addtokomafont{disposition}{\normalfont}
\newcommand{\qd}[1]{années~\numberstringnum{{#1}0}}

\begin{document}
\numberstringnum{300}, \ordinalnum{3}[m], \formatdate{1}{1}{2000}…
\qd{8}.
\end{document}

(I commented the font selection as I don't have that font.)

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.