View on GitHub

Babel

The multilingual framework to localize LaTeX, LuaLaTeX, XeLaTeX

What’s new in babel 3.45

2020-06-10

Note. There is a typo in the note on p. 19 of the manual. It should read: “… as a rule of thumb prefer the default renderer, and resort to Harfbuzz only if the former does not work for you.”

Date

The command \localedate admits an optional argument with two keys: calendar and variant. With them you have access to non-Gregorian date formats defined in ini files. The three arguments are those in the corresponding lunisolar calendar. They are not the Gregorian data to be converted (which means 13 is a valid month number with calendar=hebrew).

Note currently babel doesn’t convert dates between calendars, because a general tool for this purpose could be as large as babel itself, and very likely it’s best done by a separate package (or even an external program, see below). [Update. Currently can convert several calendars, although only a few decades. See the manual.]

ini files with strings defined for some non-Gregorian calendar are: ar, ar-*, he, fa, hi. [Update. Currently there a few more.]

Even with a certain calendar there may be variants. In Kurmanji the default variant prints something like ‘‘30. Çileya Pêşîn 2019’’, but with variant=izafa it prints ‘‘31’ê Çileya Pêşînê 2019’’.

Digits

The commands \localenumeral and \localecounter admit the type digits for the native digits (ie, as defined with numbers/digits.native).

Changes in ini files

Kurdish

Thanks to Sina Ahmadi, from Kurdish XeLaTeX Users Group project.

Marathi

New version contributed by Niranja Tambe.

Fixes in Hindi, Macedonian and Ancient Greek

A couple of wrong settings have been fixed: prehyphenchar in Hindi was set to 0 (now the hyphen is not removed), and the OpenType script tag in Ancient Greek is PGR instead of ELL. There are also a few changes in Macedonian (by Stojan Trajanovski).

Fixes

Appendix. Using an external program for dates

[Update. Note hijri is now supported.]

An example with Windows and Powershell. Create a file named hijridate.ps1:

$today = [datetime]::Now

$calendar = New-Object System.Globalization.HijriCalendar

echo "\def\HijriDay{$($calendar.GetDayOfMonth($today))}"
echo "\def\HijriMonth{$($calendar.GetMonth($today))}"
echo "\def\HijriYear{$($calendar.GetYear($today))}"

Then:

PowerShell.exe -WindowStyle hidden ./hijridate.ps1 >today.tex 

and a file is generated with something like:

\def\HijriDay{9}
\def\HijriMonth{10}
\def\HijriYear{1441}

Please, fell free to contribute a Unix version (as an issue or, better, as a pull request), or even to create your own package 🙂.