Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LaTeX: use \small fontsize in code-blocks with xelatex and lualatex #5768

Merged
merged 1 commit into from
Dec 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 8 additions & 12 deletions doc/usage/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2301,20 +2301,16 @@ information.
index is full of long entries.

``'fvset'``
Customization of ``fancyvrb`` LaTeX package. Currently, Sphinx uses
this key to set the fontsize in code-blocks according to the
:confval:`latex_engine`.

- ``'pdflatex'`` uses ``'fvset': '\\fvset{fontsize=\\small}'``,
to mitigate the size difference between the default monospaced font
(Courier) and the default text font (Times). You may need to modify
this if you use custom fonts.

- ``'xelatex'`` and ``'lualatex'`` use ``'\\fvset{fontsize=auto}'``,
as there is no size difference between the regular and the
monospaced fonts used by default by Sphinx with these engines.
Customization of ``fancyvrb`` LaTeX package. Sphinx does by default
``'fvset': '\\fvset{fontsize=\\small}'``, to adjust for the large
character width of the monospace font, used in code-blocks.
You may need to modify this if you use custom fonts.

.. versionadded:: 1.8
.. versionchanged:: 2.0
Due to new default font choice for ``'xelatex'`` and ``'lualatex'``
(FreeFont), Sphinx does ``\\fvset{fontsize=\\small}`` also with these
engines (and not ``\\fvset{fontsize=auto}``).

* Keys that are set by other options and therefore should not be overridden
are:
Expand Down
2 changes: 0 additions & 2 deletions sphinx/writers/latex.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@
'textgreek': '',
'utf8extra': ('\\catcode`^^^^00a0\\active\\protected\\def^^^^00a0'
'{\\leavevmode\\nobreak\\ }'),
'fvset': '\\fvset{fontsize=auto}',
},
'lualatex': {
'latex_engine': 'lualatex',
Expand All @@ -213,7 +212,6 @@
'textgreek': '',
'utf8extra': ('\\catcode`^^^^00a0\\active\\protected\\def^^^^00a0'
'{\\leavevmode\\nobreak\\ }'),
'fvset': '\\fvset{fontsize=auto}',
},
'platex': {
'latex_engine': 'platex',
Expand Down