VSCode configure LaTeX

VSCode configure LaTeX

2021-02-01

Install plugin

  • LaTeX Workshop
  • LaTeX language support
  • Unicode LaTeX
image-20210201170852125

Configure Json

Enter settings

image-20210201171123795

配置 reward

"latex-workshop.latex.recipes": [
    {
    
    
        "name": "xelatex",
        "tools": [
            "xelatex"
        ],
    },
    {
    
    
        "name": "pdflatex",
        "tools": [
            "pdflatex"
        ]
    },
    {
    
    
        "name": "xe->bib->xe->xe",
        "tools": [
            "xelatex",
            "bibtex",
            "xelatex",
            "xelatex"
        ]
    },
    {
    
    
        "name": "pdf->bib->pdf->pdf",
        "tools": [
            "pdflatex",
            "bibtex",
            "pdflatex",
            "pdflatex"
        ]
    }
],

settings.json

There is a VSCode path to configure, replace it with your own VSCode path

// LaTeX

"latex-workshop.message.update.show": false,
"latex-workshop.showContextMenu": true, 
"latex-workshop.intellisense.package.enabled": true,  
"latex-workshop.latex.autoBuild.run": "never", 
// 指定使用外部PDF阅读器打开    
// 指定外部阅读器的类型,文件路径

"latex-workshop.view.pdf.external.viewer.command": "D:/software/SumatraPDF/SumatraPDF.exe",

//Forward Searching

"latex-workshop.view.pdf.external.synctex.command": "D:/software/SumatraPDF/SumatraPDF.exe",
"latex-workshop.view.pdf.external.synctex.args": [
    "-forward-search",
    "%TEX%",
    "%LINE%",
    "-reuse-instance",
    "-inverse-search",
    "code \"D:\\software\\Microsoft VS Code\\resources\\app\\out\\cli.js\" -r -g \"%f:%l\"",
    "%PDF%"
],

"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]": {
    
    
    "editor.defaultFormatter": "nickfode.latex-formatter"
},

SumatraPDF

Forward search

//Forward Searching

"latex-workshop.view.pdf.external.synctex.command": "D:/software/SumatraPDF/SumatraPDF.exe",
"latex-workshop.view.pdf.external.synctex.args": [
"-forward-search",
"%TEX%",
"%LINE%",
"-reuse-instance",
"-inverse-search",
"code \"D:\\software\\Microsoft VS Code\\resources\\app\\out\\cli.js\" -r -g \"%f:%l\"",
"%PDF%"
],

Reverse search

image-20210201171531507

"D:\software\Microsoft VS Code\bin\code.cmd" -r -g "%f":%l

Guess you like

Origin blog.csdn.net/weixin_44179485/article/details/113598259