Skip to content

Commit

Permalink
LaTeX: Use the babel LaTeX package by default for 'lualatex' with F…
Browse files Browse the repository at this point in the history
…rench (sphinx-doc#12557)

Previously ``polyglossia`` was used by default.
  • Loading branch information
jfbu authored Jul 13, 2024
1 parent 469a809 commit e49e293
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ Bugs fixed
* #12380: LaTeX: Footnote mark sometimes indicates ``Page N`` where ``N`` is
the current page number and the footnote does appear on that same page.
Patch by Jean-François B.
* #12410: LaTeX: for French and ``'lualatex'`` as :confval:`latex_engine`
``polyglossia`` and not ``babel`` is used (contrarily to ``'xelatex'``).
Patch by Jean-François B.
* #12416: Ensure that configuration setting aliases are always synchronised
when one value or the other is modified.
Patch by Bénédikt Tran.
Expand Down
17 changes: 5 additions & 12 deletions doc/latex.rst
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ Keys that you may want to override include:
build repertory before next PDF build, else left-over auxiliary
files are likely to break the build.

Default: ``'\\usepackage{babel}'`` (``''`` for Japanese documents)
Default: ``'\\usepackage{babel}'`` (for Japanese documents)

.. versionchanged:: 1.5
For :confval:`latex_engine` set to ``'xelatex'``, the default
Expand All @@ -158,18 +158,11 @@ Keys that you may want to override include:
``'lualatex'`` uses same default setting as ``'xelatex'``

.. versionchanged:: 1.7.6
For French with ``xelatex`` (not ``lualatex``) the default is to use
``babel``, not ``polyglossia``. To let ``lualatex`` use ``babel``,
use this:
For French with ``'xelatex'`` (not ``'lualatex'``) the default is to
use ``babel``, not ``polyglossia``.

.. code-block:: python
latex_elements = {
'polyglossia': '',
'babel': r'\usepackage{babel}',
}
in file :file:`conf.py`.
.. versionchanged:: 7.4.0
For French with ``'lualatex'`` the default is to use ``babel``.

``'fontpkg'``
Font package inclusion. The default is::
Expand Down
5 changes: 5 additions & 0 deletions sphinx/builders/latex/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,11 @@
},

# special settings for latex_engine + language_code
('lualatex', 'fr'): {
# use babel instead of polyglossia by default
'polyglossia': '',
'babel': '\\usepackage{babel}',
},
('xelatex', 'fr'): {
# use babel instead of polyglossia by default
'polyglossia': '',
Expand Down

0 comments on commit e49e293

Please sign in to comment.