VSCode+Latex
由於忍不了原生TexStudio過於簡陋的界面,之前一直用線上工具overleaf排版,但最近overleaf的網絡實在不佳,經常掉線,決定還是用個人最常用的編程IDE VSCode配一個。
以下是超簡易教程:
-
下載VSCodel
鏈接:https://code.visualstudio.com/ -
下載TexLive
鏈接:http://tug.org/texlive/
1,2順序隨意 -
VSCode下載latex workshop擴展
-
配置VSCodel
文件—首選項—設置—右上角打開設置文件
設置文件中添加以下代碼:
// Latex配置
"latex-workshop.latex.recipes": [{
"name": "xelatex",
"tools": [
"xelatex"
]
}, {
"name": "latexmk",
"tools": [
"latexmk"
]
},
{
"name": "pdflatex -> bibtex -> pdflatex*2",
"tools": [
"pdflatex",
"bibtex",
"pdflatex",
"pdflatex"
]
}
],
"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.view.pdf.viewer": "tab",
"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"
],
// 自動換行設置
"editor.wordWrap": "on",
保存,完成。
打開.tex文件
圖中是在VSCode中顯示的效果,非常清爽,編輯時如果沒有用到bibtex可以直接 ctrl+s 保存+顯示最新的效果,如果用了bibtex就按圖中位置編譯。
希望更詳細的教程可以轉到:
知乎教程