Skip to content

Commit

Permalink
Add xeCJKVerbAddon to default fvset config for Chinese documents
Browse files Browse the repository at this point in the history
make xeCJK not add extra spaces in fancyvrb Verbatim enviroment.

Fixes: sphinx-doc#9414

Signed-off-by: Shengjing Zhu <i@zhsj.me>
  • Loading branch information
zhsj committed Jul 8, 2021
1 parent b09acab commit baec13f
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}',
# sed formatcom=\xeCJKVerbAddon to make xeCJK not add 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 baec13f

Please sign in to comment.