在windows环境下,使用ctex就好,但放在ubuntu下,不知为何不行了.于是在网上搜索答案,改用xeLatex引擎,使用xeCJK包.
\documentclass[10.5pt, a4paper]{article} % A4大小,五号字体=10.5pt,四号=14pt
\usepackage{xeCJK} %新加入的包
\usepackage[UTF8]{ctex} %中文支持
\begin{document}
中文latex
\end{document}
为了使用xeLatex引擎,在设置中加入
“latex-workshop.latex.tools”: [{
“name”: “latexmk”,
“command”: “latexmk”,
“args”: [
“-xelatex”,
“-synctex=1”,
“-interaction=nonstopmode”,
“-file-line-error”,
“%DOC%”
]
}],
https://stackoverflow.com/questions/56109128/enable-xelatex-in-latex-workshops-for-visual-studio-code