![2d0d36678ffa310cda9883daa54e954d.png](https://i-blog.csdnimg.cn/blog_migrate/14c839701c804e4dfc8b9dc441f09ddb.jpeg)
I. VSCode+Latex安装
- VSCode+Git安装
![d945ccc85ac4aaf269bfee65b175d75d.png](https://i-blog.csdnimg.cn/blog_migrate/140a82092e6ef25240b378094eebb308.jpeg)
- Latex安装
或
Marvey:使用VSCode编写LaTeXzhuanlan.zhihu.com![67b379befeff42ea58cfaef02bbce894.png](https://i-blog.csdnimg.cn/blog_migrate/d906f54cee2afaa20f86a5d82f6d17d8.jpeg)
II. VSCode配置
2.1 英文配置
- 下载Latex Workshop并安装
![665a61e7cb60abc81083b52df4e48d3a.gif](https://i-blog.csdnimg.cn/blog_migrate/d9828e70eea295d9e044f0afd7ea3555.gif)
此时已经满足英文的编译要求
- 编译 Ctrl+Alt+B
- PDF预览 Ctrl+Alt+V
- 反向搜索 Ctrl+单击
![f747b2c6b5e94b0370f2e3dbd4655d82.gif](https://i-blog.csdnimg.cn/blog_migrate/843e84eb57365714c097b41b49fc1a80.gif)
2.2 中文配置
- 打开 Latex Workshop 的 setting.json - 键入Ctrl + , 或执行
![32bdd5e1e66f7a86068fd2cacdd0aefb.gif](https://i-blog.csdnimg.cn/blog_migrate/73115fe765c2bb94429206d217705e8c.gif)
- 在{}中复制如下代码并保存,此处参考
// Latex workshop
"latex-workshop.latex.tools": [
{
"name": "latexmk",
"command": "latexmk",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-pdf",
"%DOC%"
]
},
{
"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%"
]
}
],
"latex-workshop.latex.recipes": [
{
"name": "xelatex",
"tools": [
"xelatex"
]
},
{
"name": "latexmk",
"tools": [
"latexmk"
]
},
{
"name": "pdflatex -> bibtex -> pdflatex*2",
"tools": [
"pdflatex",
"bibtex",
"pdflatex",
"pdflatex"
]
}
],
"latex-workshop.view.pdf.viewer": "tab",
"latex-workshop.latex.clean.enabled": true,
"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"
],
"latex-workshop.latex.autoClean.run": "onBuilt",
- 效果
![4fda1739dfc5dc418b90ce18c7653fe6.gif](https://i-blog.csdnimg.cn/blog_migrate/ebedf318c834ae3200ddbb74636ddced.gif)
III. 常用指令
- 注释&取消注释
Ctrl + K 接着 Ctrl + C
Ctrl + K 接着 Ctrl + U
- 点击超链接后,返回原位置 键入
Alt + 左箭头
- Tex live 命令行安装宏包
tlmgr install <package-name> % 安装某个宏包
tlmgr remove <package-name> % 卸载某个宏包
tlmgr update --all --self % 更新所有宏包(包括 tlmgr 本身)
tlmgr update --list % 列出所有可更新的宏包
tlmgr repository set http://.../CTAN/systems/texlive/tlnet % 指定更新源(CTAN)地址
tlmgr info <package-name> % 查看宏包信息
% 加 --list 参数可列出宏包的所有文件
IV. 本文制作工具
- 录屏gif制作软件
关于作者
目前电气工程硕士在读,平常喜欢琢磨有限元仿真、Matlab、Latex、三维建模等一切有趣的东西
一些成果会放在 Github 或者 知乎,也欢迎通过邮箱联系我 dongweihao514@sina.com