1. 程式人生 > >VS code 中 latex的環境設置同時不影響python

VS code 中 latex的環境設置同時不影響python

sync 程序 command wrap type 現在 cti 影響 ror

  終於解決好了,不得不說 VS code 真的很舒服,反正我用起來很喜歡,但是 Tex Studio 也不錯就是下載太慢了,而且比 VS Code包還大,不過 Tex Studio 的優勢在於當你不知道代碼怎麽敲的時候,可以使用自帶的很多提示方式,軟件直接給你擼一串代碼,你按著填就行了。

  安裝完 VS Code 之後,現在擴展程序中安裝 LaTex Workshop ,這個是 LaTex 的工作平臺,然後 按下 Ctrl + , 或者點擊左下角的齒輪點設置,然後在搜索設置中 搜索 Recipes , 再 點擊 在settings.json 中編輯 ,輸入一下代碼:

{
    
// latex 設置 "editor.wordWrap": "on", "workbench.startupEditor": "newUntitledFile", "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", "*.gz" ],
"latex-workshop.view.pdf.viewer": "tab", "latex-workshop.latex.recipes": [ { "name": "xelatex", "tools": [ "xelatex", "xelatex" ] }, { "name": "xelatexb", "tools": [ "xelatex", "bibtex", "xelatex", "xelatex" ] }, { "name": "latexmk", "tools": [ "latexmk" ] }, { "name": "pdflatex -> bibtex -> pdflatex*2", "tools": [ "pdflatex", "bibtex", "pdflatex", "pdflatex" ] } ], "latex-workshop.latex.tools": [ { "name": "xelatex", "command": "xelatex", "args": [ "-synctex=1", "-interaction=nonstopmode", "-file-line-error", "%DOC%" ] }, { "name": "latexmk", "command": "latexmk", "args": [ "-synctex=1", "-interaction=nonstopmode", "-file-line-error", "-pdf", "%DOC%" ] }, { "name": "pdflatex", "command": "pdflatex", "args": [ "-synctex=1", "-interaction=nonstopmode", "-file-line-error", "%DOC%" ] }, { "name": "bibtex", "command": "bibtex", "args": [ "%DOCFILE%" ] } ], "latex-workshop.latex.autoClean.run": "onBuilt", "latex-preview.command": "xelatex" }

  保存退出,還是老規矩,文件路徑不要有中文,最好全部都是英語,文件名也是英文最好。

  現在你可以新建(或打開)一個文件夾,在裏面建立一個 .tex 文件,軟件會自動識別的,然後你就自己敲吧。

1 \documentclass[11]{ctexart}
2 \begin{document}
3     \title{我就試試}
4     \author{Kikyo}
5     你好,世界!
6 \end{document}

  這就行了,如果要用python ,只要新建一個 .py 文件,然後選擇 python 環境,先裝個Anaconda 吧,吐血推薦,真的好用,現在數據分析基本都用 Jupyter,但是VS Code 的自動補全真的用著超級舒服,感覺很高大上的樣子。

VS code 中 latex的環境設置同時不影響python