因为CTeX套装自带WinEdt编辑器难用、收费且不能实时编译显示pdf效果,本笔记主要记录如何在VSCode中编辑Tex文件,实现代码自动补全及实时查看文本编辑效果等功能。
1、软件下载
CTEX下载地址:http://www.ctex.org/HomePage,建议下载完整版套装。
VSCode下载地址:https://code.visualstudio.com/
2、软件配置
在VSCode中安装对应的插件
更改配置文件
在file >> preferences >> setting >> User Setting >> Extensions >> LaTex Workshop configuration >> active
中,打开 Edit in setting.json
文件。在文件中添加如下字段:
1 | "latex-workshop.latex.recipes": [{ |
1 | "latex-workshop.latex.tools": [{ |
1 | "latex-workshop.view.pdf.viewer": "tab", |
1 | "latex-workshop.latex.clean.fileTypes": ["*.aux", "*.bbl", "*.blg", "*.idx", "*.ind", "*.lof", "*.lot", "*.out", "*.toc", "*.acn", "*.acr", "*.alg", "*.glg", "*.glo", "*.gls", "*.ist", "*.fls", "*.log", "*.fdb_latexmk"], |
1 | "latex-workshop.latex.clean.enabled": false, |
添加后的效果如下图所示:
3、开启自动保存,实时查看编辑效果
在 file
中将 auto saved
勾选上即可。效果如下图: