LaTeX: for French language and lualatex engine polyglossia and not babel is used contrarily to Sphinx documentation
Describe the bug
At our doc for 'babel' key of 'latex_elements', it is said:
Changed in version 1.7.6: For French, xelatex and lualatex default to using babel, not polyglossia.
This is true for 'xelatex' but not for 'lualatex' value of latex_engine.
How to Reproduce
index.rst
test
===
nothing
conf.py
language = 'fr'
latex_engine = 'lualatex'
Then make latex and the LaTeX file will contain \usepackage{polyglossia}.
Environment Information
Sphinx 7.3.7
Sphinx extensions
No response
Additional context
The discrepancy between 'xelatex' and 'lualatex' has been there ever since v1.7.6. There is a code comment # for xelatex+French, don't use polyglossia in sphinx/writers/latex.py but no explanation for why 'xelatex' only. But the documentation mentions the two so is buggy.
(edited) The faulty commit was 8a23ad1f44894afefe722fbf43b3ce05d3fa1de0. It followed on #5178 fixing #4272.
Either
- fix the documentation to explain
'lualatex'uses polyglossia, - or examine if the polyglossia xelatex issues mentioned in #4272 are fixed (but Sphinx users sometime have old LaTeX installations) and revert #5178 so as to let xelatex and lualatex use polyglossia also with French,
- or let
'lualatex'also usebabelwith French language.
Note that there are quite a few differences between babel and polyglossia for French language in output PDF, particularly regarding lists.
Hoping for comments by LaTeX experts.
My current opinion is that lualatex should by default use same as xelatex for French i.e. babel not polyglossia because the former more completely implements French typographical rules. In the past I would have pushed the change to a branch for major releases as this is breaking change (I do not believe it matters really in that case because French users either do not care and will not notice the change or they do care and already have suitable conf.py). Ping @AA-Turner about what is policy. As said in my parenthetical remark I think we can do the change on master but what about "more breaking" changes in some other situation, should it arise?