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
CJK render issue in latexpdf code block #9414
Comments
Probably the root cause is at xeCJK 🤔 |
It seems this issue came from the combination of the JSON lexer of pygments and xeCJK package. I can reproduce it with the following command (it does not use Sphinx at all):
It seems whitespace appears just after the opening quote. But it's not reproduced if I use python lexer.
I don't know this bug is either pygments or xeCJK. But this is not related to Sphinx itself, I believe. Could you report this to their project, please? |
Thanks for narrowing down the issue. |
https://tex.stackexchange.com/questions/374469/extra-spaces-when-using-fancyvrb-with-xecjk \documentclass{article}
\usepackage{fancyvrb}
\usepackage[utf8]{inputenc}
\usepackage{xeCJK}
\begin{document}
{
\CJKsetecglue{}
\begin{Verbatim}
"你好"
\end{Verbatim}
}
{
\begin{Verbatim}
"你好"
\end{Verbatim}
}
\end{document}
the output is Any suggestion to create a local env and add |
I miss a better solution in the tex.stackexchange.com, Adding So for sphinx, it's adding @tk0miya could sphinx workaround this by adding above line to default preamble when xeCJK is used? |
A better solution: % Preamble
\fvset{formatcom=\xeCJKVerbAddon} or % Locally
\begin{Verbatim}[formatcom=\xeCJKVerbAddon]
"你好"
\end{Verbatim} |
CTeX-org/ctex-kit#331 is written in Chinese, in summary, it's not easy to fix on xeCJK side. |
I can confirm adding |
Checking how they are defined, |
Fixes: sphinx-doc#9414 Signed-off-by: Shengjing Zhu <i@zhsj.me>
Fixes: sphinx-doc#9414 Signed-off-by: Shengjing Zhu <i@zhsj.me>
Fixes: sphinx-doc#9414 Signed-off-by: Shengjing Zhu <i@zhsj.me>
make xeCJK not add extra spaces in fancyvrb Verbatim enviroment. Fixes: sphinx-doc#9414 Signed-off-by: Shengjing Zhu <i@zhsj.me>
Prevent xeCJK from adding extra spaces in fancyvrb Verbatim enviroment. Fixes: sphinx-doc#9414 Signed-off-by: Shengjing Zhu <i@zhsj.me>
Describe the bug
Some extra spaces are inserted in the code block if there are CJK characters.
How to Reproduce
Create a simple project with 3 files.
Built with the docker
Expected behavior
No extra spaces.
Your project
none
Screenshots
There are some extra space between
"
and the first CJK character.OS
Linux
Python version
3.9.6
Sphinx version
4.0.3
Sphinx extensions
No response
Extra tools
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: