windows安装vscode+latex
windows安装vscode+latex
主要介绍安装vscode和latex配置
安装和卸载latex
tex拥有多个版本,我们这里选择安装 TexLive
sudo apt-get purge texlive*
rm -rf /usr/local/texlive and rm -rf ~/.texlive*
rm -rf /usr/local/share/texmf
rm -rf /var/lib/texmf
rm -rf /etc/texmf
sudo apt-get remove tex-common --purge
rm -rf ~/.texlive*
安装和配置vscode
- 安装继续参考上述链接;
- 安装好VScode之后需要再配置一下setting.json,添加下列文本到json文件中。
{
"latex-workshop.latex.tools": [
{
"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.message.update.show": false,
"latex-workshop.latex.recipes": [
{
"name": "xelatex ➞ bibtex ➞ xelatex × 2",
"tools": [
"xelatex",
"bibtex",
"xelatex",
"xelatex"
]
},
{
"name": "latexmk 🔃",
"tools": [
"latexmk"
]
},
{
"name": "latexmk (latexmkrc)",
"tools": [
"latexmk_rconly"
]
},
{
"name": "latexmk (lualatex)",
"tools": [
"lualatexmk"
]
},
{
"name": "pdflatex ➞ bibtex ➞ pdflatex × 2",
"tools": [
"pdflatex",
"bibtex",
"pdflatex",
"pdflatex"
]
},
{
"name": "Compile Rnw files",
"tools": [
"rnw2tex",
"latexmk"
]
},
{
"name": "Compile Jnw files",
"tools": [
"jnw2tex",
"latexmk"
]
},
{
"name": "tectonic",
"tools": [
"tectonic"
]
}
],
"latex-workshop.latex.recipe.default": "lastUsed",
"git.ignoreMissingGitWarning": true,
"latex-workshop.view.pdf.viewer": "tab"
}
Ubuntu18.04下如何添加latex宏包
- 下载宏包 下载网址:https://ctan.org/ 在搜索栏里搜索对应的latex宏包,点击下载。 需要注意的是搜索是可以选择文件名搜索方便快速找到对应文件。
- 将下载的.sty文件或者压缩包解压后移动到/usr/share/texmf/tex/latex目录下。
- 终端中运行:sudo texhash