问题:在vscode上安装Latex-workshop插件后,不能支持中文显示。
解决:
步骤1:在latex的主文件main.tex中设置xelatex作为编译引擎。
步骤2:在latex的主文件main.tex中载入xeCJK包。
结果代码如下:
% !TeX encoding = UTF-8
% !TeX program = xelatex
\documentclass{article}
\usepackage{xeCJK} % 须放在\usepackage{}列中足够前的位置
\usepackage{fontspec}
\begin{document}
中文测试
\end{document}
注意:如果 \usepackage{xeCJK} 不放在足够前的位置,有时候编译会出错。
在VSCode上安装LaTeX-workshop插件后无法显示中文,可通过设置xelatex为编译引擎并在主文件中引入xeCJK包来解决。确保usepackage{xeCJK}
1万+

被折叠的 条评论
为什么被折叠?



