当前位置:网站首页>Latex在VSCODE中编译中文,使用中文路径问题解决
Latex在VSCODE中编译中文,使用中文路径问题解决
2022-07-02 06:22:00 【呆呆象呆呆】
latex 编译中文和中文路径
问题1编译中文
\documentclass{article}
\usepackage{CTEX}
\begin{document}
这是一个CTEX的utf-8编码例子,{\kaishu 这里是楷体显示},{\songti 这里是宋体显示},{\heiti 这里是黑体显示},{\fangsong 这里是仿宋显示}。
\end{document}
如上代码需要使用xelatex进行编译,编译结果

如果使用latexmk,就会出现如下报错

我们应该作如下操作进行xelatex编译工具的配置
在VSCODE中按下F1选择首选项 进行环境配置

这里展示部分的配置文件,如果不是想要修改文件而是需要从头进行配置时候可以看到最后有一个链接里面有完整的配置代码
"latex-workshop.latex.tools": [
{
"name": "latexmk",
"command": "latexmk",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-pdf",
"%DOC%"
]
},
// 这里是xelatex工具的定义
{
"name": "xelatex",
"command": "xelatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOC%"
]
},
{
"name": "pdflatex",
"command": "pdflatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOC%"
]
},
{
"name": "bibtex",
"command": "bibtex",
"args": [
"%DOCFILE%"
]
}
],
//设置编译链的时候使用xelatex作为默认的第一个首选编译
"latex-workshop.latex.recipes": [
{
"name": "xelatex",
"tools": [
"xelatex"
]
},
{
"name": "latexmk",
"tools": [
"latexmk"
]
},
{
"name": "pdflatex -> bibtex",
"tools": [
"pdflatex",
"bibtex"
]
},
// {
// "name": "pdflatex -> bibtex -> pdflatex*2",
// "tools": [
// "pdflatex",
// "bibtex",
// "pdflatex",
// "pdflatex"
// ]
// },
{
"name": "xelatex -> bibtex -> xelatex*2",
"tools": [
"xelatex",
"bibtex",
"xelatex",
"xelatex"
]
}
],
问题2 中文路径无法编译
解决方案1
向上面一样只使用xelatex进行编译(在没有参考文献的时候是可行的哈)

解决方案2
但是在工具链路中有使用其他工具 比如 bibtex等 还需要修改一下配置 把工具定义中间的参数"%DOC%"改成"%DOCFILE%"因为bibtex识别不了中文路径
修改之前的失败案例

修改之后就可以顺利通过了

最后文件
如下连接中会分享一下我全部的latex配置 可以直接复制了放进去
VSCODE 安装LATEX环境,参数配置,常见问题解决_呆呆象呆呆的博客-CSDN博客
参考文献
边栏推荐
- Sentinel 阿里开源流量防护组件
- Win10网络图标消失,网络图标变成灰色,打开网络设置闪退等问题解决
- Render minecraft scenes into real scenes using NVIDIA GPU
- CUDA user object
- 数据科学【八】:SVD(一)
- pytest(2) mark功能
- Redis - big key problem
- Pytest (1) case collection rules
- 找到页面当前元素z-index最高的数值
- Error "list" object is not callable in Web automatic switching window
猜你喜欢

Learn about various joins in SQL and their differences

Win10网络图标消失,网络图标变成灰色,打开网络设置闪退等问题解决

Code skills - Controller Parameter annotation @requestparam

Uploading attachments using Win32 in Web Automation

Latex 报错 LaTeX Error: The font size command \normalsize is not defined问题解决

Distributed transactions: the final consistency scheme of reliable messages

阿里云MFA绑定Chrome浏览器

Latest CUDA environment configuration (win10 + CUDA 11.6 + vs2019)

Warp shuffle in CUDA

Redis - grande question clé
随机推荐
The intern left a big hole when he ran away and made two online problems, which made me miserable
Redis - big key problem
web自动中利用win32上传附件
Is there a really free applet?
Sublime Text 配置php编译环境
代码技巧——Controller参数注解@RequestParam
重载全局和成员new/delete
Data science [9]: SVD (2)
默认google浏览器打不开链接(点击超链接没有反应)
[self cultivation of programmers] - Reflection on job hunting Part II
Dynamic global memory allocation and operation in CUDA
Alibaba cloud MFA binding Chrome browser
2020-9-23 use of QT timer qtimer class.
Redis——Cluster数据分布算法&哈希槽
Fe - weex uses a simple encapsulated data loading plug-in as the global loading method
When requesting resttemplate, set the request header, request parameters, and request body.
数据科学【九】:SVD(二)
Uploading attachments using Win32 in Web Automation
apt命令报证书错误 Certificate verification failed: The certificate is NOT trusted
Golang--map扩容机制(含源码)