Skip to content

Commit

Permalink
Merge pull request #9419 from zhsj/fancyvrb-zh
Browse files Browse the repository at this point in the history
Add xeCJKVerbAddon to default fvset config for Chinese documents
  • Loading branch information
tk0miya committed Jul 10, 2021
2 parents f65955c + 92c9cab commit 7e3e152
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
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

0 comments on commit 7e3e152

Please sign in to comment.