LaTex安装参考教程
TeX Live 在 Sublime Text 中运行参考博文 link
打开 SumatraPDF,进入设置->选项->设置反向搜索命令行
1
| "C:\Program Files\Microsoft VS Code\Code.exe" “C:\Program Files\Microsoft VS Code\resources\app\out\cli.js” -g “%f”:”%l”
|
参考如何配置Visual Studio Code作为LaTeX编辑器
安装
- TeX Live
- Visual Studio Code
- LaTeX Workshop (VS Code 插件)
- SumatraPDF 阅读器(可选,用于预览 PDF)
添加两个环境变量(Path)
1 2
| D:\Program\texlive\2019\bin\win32 | C:\texlive\2019\bin\win32 C:\Program Files\SumatraPDF
|
软件根目录说明
1 2 3 4
| # 我的Code.exe位置 `C:/Program Files/Microsoft VS Code` # 我的扩展安装位置 `C:/Users/chany/.vscode | C:/Users/sunla/.vscode`
|
将SumatraPDF.exe
复制到C:/Users/sunla/.vscode/
设置正向搜索
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| // 设置预览方式 "latex-workshop.view.pdf.viewer":"external", "latex-workshop.view.pdf.ref.viewer":"external", // 设置外部PDF预览器 "latex-workshop.view.pdf.external.viewer.command": "C:/Users/sunla/.vscode/SumatraPDF.exe", "latex-workshop.view.pdf.external.viewer.args": [ "%PDF%" ], // 配置Syntex的正向搜索(这是官网的) "latex-workshop.view.pdf.external.synctex.command": "C:/Users/sunla/.vscode/SumatraPDF.exe", "latex-workshop.view.pdf.external.synctex.args": [ "-forward-search", "%TEX%", "%LINE%", "-reuse-instance", "-inverse-search", "C:/Program Files/Microsoft VS Code/Code.exe C:/Program Files/Microsoft VS Code/resources/app/out/cli.js -r -g %f:%l", "%PDF%" ],
|
反向搜索
打开SumatraPDF,在设置中填入如下代码:
1
| "C:\Program Files\Microsoft VS Code\Code.exe" "C:\Program Files\Microsoft VS Code\resources\app\out\cli.js" -r -g "%f:%l"
|
setting.json
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| {
// 设置预览方式 "latex-workshop.view.pdf.viewer":"external", "latex-workshop.view.pdf.ref.viewer":"external",
// 设置外部PDF预览器 "latex-workshop.view.pdf.external.viewer.command": "C:/Users/sunla/.vscode/SumatraPDF.exe", "latex-workshop.view.pdf.external.viewer.args": [ "%PDF%" ],
// 配置Syntex的正向搜索(这是官网的) "latex-workshop.view.pdf.external.synctex.command": "C:/Users/sunla/.vscode/SumatraPDF.exe", "latex-workshop.view.pdf.external.synctex.args": [ "-forward-search", "%TEX%", "%LINE%", "-reuse-instance", "-inverse-search", "C:/Program Files/Microsoft VS Code/Code.exe C:/Program Files/Microsoft VS Code/resources/app/out/cli.js -r -g %f:%l", "%PDF%" ], }
|