通過VS CODE+LaTeX 雙向搜索機制 提高論文書寫、排版效率


VScode中\(\LaTeX\)編譯環境配置留檔。

  • ctrl + shift + p \(\rightrightarrows\) Preferences :open settings(json)
{
  "latex-workshop.showContextMenu":true,                //右鍵菜單
  "latex-workshop.intellisense.package.enabled": true,  //根據加載的包,自動完成命令或包  
  "latex-workshop.latex.autoBuild.run": "never",        //禁止保存文件時自動build  
  "latex-workshop.latex.recipes": [  
    {  
      "name": "xelatex",  
      "tools": [  
        "xelatex"  
      ]  
    }, 
    {  
      "name": "latexmk",  
      "tools": [  
        "latexmk"  
      ]  
    },  
    {  
      "name": "PDFlatex",  
      "tools": [  
        "pdflatex"  
      ]  
    },    
    {  
      "name": "xelatex -> bibtex -> xelatex",  
      "tools": [  
        "xelatex",  
        "bibtex",  
        "xelatex",  
      ]  
    },
    {  
      "name": "pdflatex ->žž bibtex ->žž pdflatex2",  
      "tools": [  
        "pdflatex",  
        "bibtex",  
        "pdflatex",  
        "pdflatex"  
      ]  
    }  
  ],  
  "latex-workshop.latex.tools":[  
    {  
      "name": "xelatex",  
      "command": "xelatex",  
      "args": [  
        "-synctex=1",  
        "-interaction=nonstopmode",  
        "-file-line-error",  
        "%DOC%"  
      ],  
      "env": {}  
      }, 
    {  
      "name": "latexmk",  
      "command": "latexmk",  
      "args": [  
        "-synctex=1",  
        "-interaction=nonstopmode",  
        "-file-line-error",  
        "-pdf",  
        "-outdir=%OUTDIR%",  
        "%DOC%"  
      ],  
      "env": {}  
      },  
      {  
      "name": "pdflatex",  
      "command": "pdflatex",  
      "args": [  
        "-synctex=1",  
        "-interaction=nonstopmode",  
        "-file-line-error",  
        "%DOC%"  
      ],  
      "env": {}  
      },   
      {  
      "name": "bibtex",  
      "command": "bibtex",  
      "args": [  
        "%DOCFILE%"  
      ],  
      "env": {}  
      }  
  ],  
  "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",  
    "*.nav",  
    "*.snm",  
    "*.synctex.gz"  
  ],  
   // 設置預覽方式
   "latex-workshop.view.pdf.viewer":"external",
   "latex-workshop.view.pdf.ref.viewer":"external",
   // 設置外部PDF預覽器
   "latex-workshop.view.pdf.external.viewer.command": "D:/SumatraPDF/SumatraPDF.exe",
   "latex-workshop.view.pdf.external.viewer.args": [
       "%PDF%"
   ],
   // 配置Syntex的正向搜索(這是官網的)
   "latex-workshop.view.pdf.external.synctex.command": "D:/SumatraPDF/SumatraPDF.exe",
   "latex-workshop.view.pdf.external.synctex.args": [
       "-forward-search",
       "%TEX%",
       "%LINE%",
       "-reuse-instance",
       "-inverse-search",
       "D:/Microsoft VS Code D:/Microsoft VS Code/resources/app/out/cli.js -r -g %f:%l",
       "%PDF%"
   ],
    "workbench.colorTheme": "Eva Dark",
}
  • SumatraPDF端設置
  1. "EnableTeXEnhancements = true" in "SumatraPDF-settings.txt";
  2. "D:\Program Files\Microsoft VS Code\Code.exe" "D:\Program Files\Microsoft VS Code\resources\app\out\cli.js" -g "%f":"%l".


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM