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

Add xeCJKVerbAddon to default fvset config for Chinese documents #9419

Merged
merged 1 commit into from Jul 10, 2021
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
4 changes: 4 additions & 0 deletions doc/latex.rst
Expand Up @@ -531,6 +531,10 @@ Keys that don't need to be overridden unless in special cases are:
Changed default for ``'pdflatex'``. Previously it was using
``'\\fvset{fontsize=\\small}'``.

.. versionchanged:: 4.1.0
Changed default for Chinese documents to
``'\\fvset{fontsize=\\small,formatcom=\\xeCJKVerbAddon}'``

Keys that are set by other options and therefore should not be overridden are:

``'docclass'``
Expand Down
3 changes: 3 additions & 0 deletions sphinx/builders/latex/constants.py
Expand Up @@ -198,6 +198,9 @@
'polyglossia': '',
'babel': '\\usepackage{babel}',
'fontenc': '\\usepackage{xeCJK}',
# set formatcom=\xeCJKVerbAddon to prevent xeCJK from adding extra spaces in
# fancyvrb Verbatim enviroment.
'fvset': '\\fvset{fontsize=\\small,formatcom=\\xeCJKVerbAddon}',
},
('xelatex', 'el'): {
'fontpkg': XELATEX_GREEK_DEFAULT_FONTPKG,
Expand Down