VSCode + Latex 配置
1. 安裝VSCode
VSCode下載
next,next就安裝好了。
2. 配置VSCode
2.1 安裝LaTeX Workshop插件
install,安裝LaTeX Workshop插件
2.2 修改 user setting
點(diǎn)擊左下角,進(jìn)入用戶(hù)設(shè)置
點(diǎn)擊上圖標(biāo)記的部分,選擇
打開(kāi)settings.json
具體配置文件如下:
{"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"],}重啟VSCode。
3. 測(cè)試
(1)新建并打開(kāi)文件夾,之后所有產(chǎn)生的文件都在此文件夾下
(2)新建tex文件
擴(kuò)展名是 .tex
(3)編寫(xiě)tex文檔
在 test.tex 中輸入:
\documentclass{article} \begin{document} hello,world \end{document}單擊"Recipe:xelatex",使用xelatex編譯,
預(yù)覽可以選擇在VSCode的標(biāo)簽頁(yè)中打開(kāi),也可以選擇在瀏覽器中打開(kāi)。或者點(diǎn)擊右上角的預(yù)覽按鈕。
注意:當(dāng)你更改了tex文檔的時(shí)候,需要先進(jìn)行編譯,然后才能預(yù)覽,否則內(nèi)容還是修改之前的內(nèi)容
在vs界面中的預(yù)覽效果:
在瀏覽器上的預(yù)覽效果:
4. 使用 texlive 編輯tex 文檔
Windows系統(tǒng)下latex:texlive2016和texstudio
texstudio 相當(dāng)于編程時(shí)的IDE,可以使用這個(gè)經(jīng)驗(yàn)貼安裝texstudio,然后在texstudio中編寫(xiě)tex文檔。所以如果你準(zhǔn)備用VSCode來(lái)編寫(xiě)tex文檔的話(huà),可以不用安裝texstudio。
總結(jié)
以上是生活随笔為你收集整理的VSCode + Latex 配置的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: NIO网络编程实战之简单多人聊天室
- 下一篇: CentOS 7 + Hadoop3 伪