Discussion:
fancyhdr and babel
(too old to reply)
François Patte
2025-01-11 11:32:44 UTC
Permalink
Bonjour,

I try to write a bilingual document (french and sanskrit). Defining an
environment to have the sanskrit text in devanagari script, this one
modify the fancyhdr configuration and I don't understand why.

Here is a minimal (I hope) working example:

<-----------------------------------------MWE
documentclass[a4paper,11pt,twoside]{report}
\usepackage{fontspec}

\newenvironment{velthuisdev}{%
\selectlanguage{sanskrit}%
\newfontfamily\fontdev[%
Mapping=velthuis-sanskrit,%
Script=Devanagari,%
UprightFeatures={Language=Sanskrit},%
AutoFakeSlant=0.2,%
WordSpace=1.2,%
]{%
FreeSerif%
}%
\fontdev%
}%
{\selectlanguage{french}}

\setmainfont{FreeSerif}[%
Mapping=tex-text,%
]
\usepackage[sanskrit,french,provide+=*]{babel}
\usepackage{datetime}
\renewcommand{\timeseparator}{:~}

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}%
\fancyfoot[LO,RE]{%
\tiny\today~--~\currenttime%
}
\usepackage{lipsum}

\begin{document}
\lipsum[1]
\newpage
\begin{velthuisdev}
\lipsum[2]
\end{velthuisdev}
\newpage
\lipsum[3]
\end{document}
-----------------------------------------------------------> MWE

Once I use the velthuisdev environment, the fancyfoot configuration does
not diplay the date but: ?today? on the following pages...

I tried what is suggested by babel style:
Package babel Warning: \today not set for 'french'. Please,
(babel) define it after the language has been loaded
(babel) (typically in the preamble) with:
(babel) \setlocalecaption{french}{today}{..}

without any success!

Why? What is wrong in my environment definition and how can I change this?

Thank you.

F.P.
Pieter van Oostrum
2025-01-11 16:32:23 UTC
Permalink
Post by François Patte
Bonjour,
I try to write a bilingual document (french and sanskrit). Defining an
environment to have the sanskrit text in devanagari script, this one
modify the fancyhdr configuration and I don't understand why.
[snip]
Post by François Patte
Once I use the velthuisdev environment, the fancyfoot configuration does
not diplay the date but: ?today? on the following pages...
Package babel Warning: \today not set for 'french'. Please,
(babel) define it after the language has been loaded
(babel) \setlocalecaption{french}{today}{..}
without any success!
Why? What is wrong in my environment definition and how can I change this?
I tried this document, and it just works (compiled with xelatex). And in the footer there is 11 janvier 2025 on all pages even after the sanskrit text.

Also I don't get the babel warning.
So maybe something need to be updated in your LaTeX installation.
--
Pieter van Oostrum <***@vanoostrum.org>
www: http://pieter.vanoostrum.org/
PGP key: [8DAE142BE17999C4]
François Patte
2025-01-11 17:33:43 UTC
Permalink
Post by Pieter van Oostrum
Post by François Patte
Bonjour,
I try to write a bilingual document (french and sanskrit). Defining an
environment to have the sanskrit text in devanagari script, this one
modify the fancyhdr configuration and I don't understand why.
[snip]
Post by François Patte
Once I use the velthuisdev environment, the fancyfoot configuration does
not diplay the date but: ?today? on the following pages...
Package babel Warning: \today not set for 'french'. Please,
(babel) define it after the language has been loaded
(babel) \setlocalecaption{french}{today}{..}
without any success!
Why? What is wrong in my environment definition and how can I change this?
I tried this document, and it just works (compiled with xelatex). And in the footer there is 11 janvier 2025 on all pages even after the sanskrit text.
Also I don't get the babel warning.
So maybe something need to be updated in your LaTeX installation.
Thank you for answering. You are right, I just updated my texlive and
babel has changed on 01/01/2025 and fancyhdr on 06/01/2025!

Thank you.

F.P.

Loading...