1

The goal of my document is to have a date in the following format <AAAA> <month> le <JJ>, so I use the following code:

\documentclass[a4paper,12pt,oneside]{article}
\usepackage{fontspec}
\usepackage[latin,russian,greek,french,francais]{babel}
\usepackage{fontenc}
\usepackage[nodayofweek]{datetime}

\newdateformat{fauvedate}{\THEYEAR{} \shortmonthname[\THEMONTH]{} le {\THEDAY}}

\begin{document}

  \fauvedate\today

\end{document}

And I correctly get:

2015 novembre le 17

But, when I add polyglossia like in the following code:

\documentclass[a4paper,12pt,oneside]{article}
\usepackage{fontspec}
\usepackage[latin,russian,greek,french,francais]{babel}
\usepackage{fontenc}
\usepackage[nodayofweek]{datetime}

\usepackage{polyglossia}
\setmainlanguage{french}

\newdateformat{fauvedate}{\THEYEAR{} \shortmonthname[\THEMONTH]{} le {\THEDAY}}

\begin{document}

  \fauvedate\today

\end{document}

I get the date like if I don’t use \fauvedate:

17 novembre 2015

So, how can I have in the same time polyglossia and my special date style?

1

First of all you should not load both babel and polyglossia.

It's a bit unfortunate that, due to how polyglossia sets a definition for \today, you need to set the language before loading datetime.

\documentclass[a4paper,12pt,oneside]{article}

\usepackage{fontspec}
\usepackage{polyglossia}
\setmainlanguage{french}

\usepackage[nodayofweek]{datetime}

\newdateformat{fauvedate}{\THEYEAR{} \shortmonthname[\THEMONTH]{} le {\THEDAY}}

\begin{document}

\fauvedate\today

\end{document}

enter image description here

1
  • I just ran into same problem. Loading babel after datetime destroys the date adjustment, including "\newdateformat". Appears to me that anybody who uses datetime should be urged to always put \usepackage{babel} right before that. Or polylossia.
    – pauljohn32
    Feb 25 '18 at 22:06

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.