当前位置:网站首页>论文神器 VS Code + LaTex + LaTex Workshop
论文神器 VS Code + LaTex + LaTex Workshop
2022-07-28 05:24:00 【我有两颗糖】
1. 安装 Texlive
直接在 aliyun mirror 中下载 texlive.iso:
以 管理员方式 运行 iso 文件中的 install-tl-windows.bat 批处理文件,接着根据需求设置安装路径:
安装好后,可以在环境变量中看到 D:\Tools\texlive\2022\bin\win32,或者在命令行执行命令 latex --helplatex --help 有输出
2. 安装 VSCode
直接在官网下载即可:VSCode,并安装好
3. LaTex Workshop
在 vscode 用快捷键 shift+commad+X,安装插件 LaTex Workshop,下图中的 Atom One Dark 是暗色主题
安装好后配置 json 文件:
如果安装了 Atom One Dark 主题,会显示下面几行:
{
"workbench.colorTheme": "Atom One Dark",
}
在其中添加下面的设置:
{
// theme setting
"workbench.colorTheme": "Atom One Dark",
// zoom with mouse
//"editor.mouseWheelZoom": true,
// opacity
//"winopacity.opacity": 232,
// LATEX settings
"editor.minimap.enabled": true,
"latex-workshop.latex.tools": [
{
"name": "pdflatex",
"command": "pdflatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOCFILE%"
]
},
{
"name": "xelatex",
"command": "xelatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOCFILE%"
]
},
{
"name": "bibtex",
"command": "bibtex",
"args": [
"%DOCFILE%"
]
}
],
"latex-workshop.latex.recipes": [
{
"name": "xelatex",
"tools": [
"xelatex"
],
},
{
"name": "pdflatex",
"tools": [
"pdflatex"
]
},
{
"name": "xe->bib->xe->xe",
"tools": [
"xelatex",
"bibtex",
"xelatex",
"xelatex"
]
},
{
"name": "pdf->bib->pdf->pdf",
"tools": [
"pdflatex",
"bibtex",
"pdflatex",
"pdflatex"
]
}
],
"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"
],
//tex文件浏览器,可选项为"none" "browser" "tab" "external"
"latex-workshop.view.pdf.viewer": "tab",
//自动编译tex文件
"latex-workshop.latex.autoBuild.run": "onFileChange",
//显示内容菜单:(1)编译文件;(2)定位游标
"latex-workshop.showContextMenu": true,
//显示错误
"latex-workshop.message.error.show": false,
//弹窗显示警告
"latex-workshop.message.warning.show": false,
//从使用的包中自动补全命令和环境
"latex-workshop.intellisense.package.enabled": true,
//设置为never,为不清除辅助文件
"latex-workshop.latex.autoClean.run": "never",
//设置vscode编译tex文档时的默认编译链
"latex-workshop.latex.recipe.default": "lastUsed",
// 用于反向同步的内部查看器的键绑定。ctrl/cmd +点击(默认)或双击
// ctrl-click 代表 ctrl + 左键单击
// double-click 代表左键双击反向定位
"latex-workshop.view.pdf.internal.synctex.keybinding": "double-click",
}
接着重启 VS Code,打开后可以看到侧边栏有 TEX 图标,创建 xxx.tex,内容如下:
\documentclass{
article}
\usepackage{
ctex}
\title{
这里是题目}
\author{
Embers}
\date{
\today}
\begin{
document}
\maketitle \end{
document}
点击侧边栏的 TEX 按钮,依次编译和查看 pdf,结果如下:
此时,编译后会提示三个代码的错误,这是因为我们之创建了 tex,缺少一些文件导致的,正常!
如果编译失败并报错 Use of uninitialized value $ver in scalar chomp at,则在 CMD 执行下面的命令:
fmtutil-sys --all
等待三四分钟,重新编译 tex 文件,就能成功了!
4. 其它
A: LaTex Workshop 具有自动补全的功能,比如输入 \equa,就会自动提示,按下回车就会自动匹配 \equation:
B: 在 setting 中我们设置了双击 pdf 内容反向定位 Latex 代码:

C: 使用 VS Code 查看 pdf 时,保存代码后自动更新 pdf
REFERENCE:
1 . https://blog.csdn.net/Ruins_LEE/article/details/123555016
2 . VS Code 美化
边栏推荐
- 关于Fusion on Apple Silicon的谨慎猜测
- Web滚动字幕(MARQUEE示例)
- Nanjing University of Posts and Telecommunications CTF topic writeup (I) including topic address
- Perl入门学习(十一)文件操作
- ESXi 7.0 Update 1c中加入的systemMediaSize启动选项
- (PHP graduation project) obtain the campus network repair application management system based on PHP
- Research on threat analysis and defense methods of deep learning data theft attack in data sandbox mode
- ConNeXt
- EfficientNET_V1
- set_ case_ analysis
猜你喜欢

怎么看SIMULINK直接搭的模块的传递函数

Reversible digital watermarking method based on histogram modification

Agilent Agilent e5071 test impedance and attenuation are normal, except crosstalk ng--- Repair plan

Fluke fluke aircheck WiFi tester cannot configure file--- Ultimate solution experience

电快速脉冲群(EFT)设计-EMC系列 硬件设计笔记4

AEM online product promotion conference - Cable certification tester

Triode design, understanding saturation, linear region and cut-off region

Learning notes on hardware circuit design 2 -- step-down power circuit

ESXi 社区版网卡驱动

IMS-FACNN(Improved Multi-Scale Convolution Neural Network integrated with a Feature Attention Mecha
随机推荐
短跳线DSX-8000测试正常,但是DSX-5000测试无长度显示?
8类网线测试仪AEM testpro CV100 和FLUKE DSX-8000哪些事?
ICC2(一)Preparing the Design
ICC2(四)Routing and Postroute Optimization
DSX-PC6跳线模块,何时更换JACK插座?
ESXi on ARM v1.2 (2020年11月更新)
How does fluke dtx-1800 test cat7 network cable?
Detailed explanation of creepage distance and electrical clearance
Beta分布(概率的概率)
A NOVEL DEEP PARALLEL TIME-SERIES RELATION NETWORK FOR FAULT DIAGNOSIS
Communication between DSP and FPGA
(PHP graduation project) obtained based on PHP novel website management system
set_case_analysis
dsp和fpga的通讯
针对大量数据,MATLAB生成EXCEL文件并进行排版处理的源码
开关电源电路EMI设计在layout过程中注意事项
PT 基于Multi Voltage的Physical Aware
一个票据打印实例
ESXi 社区版网卡驱动
硬件电路设计学习笔记1--温升设计