- TeX Live的安装参考之前的博客:win10安装TeXLive2019
1. 安装Sublime Text 3
① 下载Sublime Text 3
- 官网下载地址:Sublime Text 3 Download
- 根据系统版本选择对应的安装包,点击即可下载。
② 安装Sublime Text 3
- 安装方式很傻瓜,一路next就行了,也可以根据需要选择对应的安装目录。
- 以下内容,我进行了勾选:
③ 安装Package Control
- 网上好多都说的是通过console进行安装,我不知为啥没成功。
- 解决办法: 在菜单栏,选择
Tools --> Install Package Control
,成功安装Package Control
。
- 验证方法:
Preferences
菜单下看到Package Control
,代表安装成功。
③ 安装LaTeXTools 插件
- 使用快捷键
Ctrl+Shift+P
打开命令框,输入Install Package
,在列表中选择Package Control: Install Package
。注意: 也可以在 菜单栏中选择Preferences ---> Package Control
。
- 在弹出的窗口中输入
LaTeXTools
,选择安装。
- 安装成功,会有提示:
2. 安装SumatraPDF
- 官网下载安装包:
- 点击应用程序进行安装,可以点击
选项
自定义安装目录。
SumatraPDF
的界面超级有趣,是我见过的非常cute的安装界面。
3. LatexTools 配置
- 在 Sublime 中依次选择
Preferences > Package Settings > LatexTools > Settings - User
。将会打开这样一个文件:
- 快捷键
Ctrl + F
,打开搜索窗口,并输入windows
作为关键字,查找到以下内容:
- 对内容进行配置,本人的配置内容如下。注意: 文件路径中
\
一定是双斜杠\\
,表示转义字符。
"windows": {
// Path used when invoking tex & friends; "" is fine for MiKTeX
// For TeXlive 2011 (or other years) use
// "texpath" : "C:\\texlive\\2011\\bin\\win32;$PATH",
"texpath" : "D:\\texlive\\2019\\bin\\win32",
// TeX distro: "miktex" or "texlive"
"distro" : "texlive",
// Command to invoke Sumatra. If blank, "SumatraPDF.exe" is used (it has to be on your PATH)
"sumatra": "D:\\SumatraPDF\\SumatraPDF.exe",
// Command to invoke Sublime Text. Used if the keep_focus toggle is true.
// If blank, "subl.exe" or "sublime_text.exe" will be used.
"sublime_executable": "",
// how long (in seconds) to wait after the jump_to_pdf command completes
// before switching focus back to Sublime Text. This may need to be
// adjusted depending on your machine and configuration.
"keep_focus_delay": 0.5
},
4. 配置SumatraPDF,实现反向搜索
① 进行反向搜索配置
- 将
SumatraPDF
的路径加入到环境变量中:
- 打开cmd,输入以下命令,其中
E:\SublimeText 3\sublime_text.exe
需要替换成自己对应的位置。
sumatrapdf.exe -inverse-search "\"E:\SublimeText 3\sublime_text.exe" \"%f:%l\""
② 检验
- 在
Sublime Text 3
中新建tex文件,内容如下:
\documentclass{article}
\title{Title}
\author{Your Name}
\begin{document}
\maketitle{}
\section{Introduction}
This is where you will write your content.
\end{document}
- 保存后,通过快捷键
Ctrl + B
进行编译,编译成功后,会在SumatraPDF
中展示编译好的PDF文件。
- 双击pdf文件的任意一处,会打开对应tex文件。(反向搜索打开的,原本
Sublime Text 3
已经被关闭)
参考链接: