【软件工具使用】【Latex快速上手】VSCode + MiKTeX + SmutraPDF(含正向搜索+反向搜索)

本文详细介绍了如何在VScode中配置LaTeX环境,包括设置公式编译、工作区信任、自动清理、正反向搜索,以及使用MikTeX和Visio图的插入技巧。适合新手与进阶者调整编辑器以提升效率。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

文章目录

  • 引用公式没有出现标号时,再试试编译一次!

VSCODE setting.json配置



{
    "editor.tabSize": 4,
    
    "workbench.editor.enablePreview": false,
    "python.defaultInterpreterPath": "F:\\ProgramData\\Miniconda3\\envs\\d2l-zh\\python.exe",
    "security.workspace.trust.untrustedFiles": "open",
    "workbench.colorTheme": "Visual Studio Dark",


    // "latex-workshop.latex.autoBuild.run": "never",
    "latex-workshop.latex.recipes": [
      {
    "name": "xelatex",
    "tools": [
        "xelatex"
    ]
  }, 
  {
    "name": "latexmk",
    "tools": [
        "latexmk"
    ]
  },
  {
    "name": "xelatex -> bibtex -> xelatex*2",
    "tools": [
        "xelatex",
        "bibtex",
        "xelatex",
        "xelatex"
    ]
  },
  {
    "name": "pdflatex -> bibtex -> pdflatex*2",
    "tools": [
        "pdflatex",
        "bibtex",
        "pdflatex",
        "pdflatex"
    ]
  }
  ],
  "latex-workshop.latex.tools": [
    {
  "name": "xelatex",
  "command": "miktex-xelatex",
  "args": [
    "-synctex=1",
    "-interaction=nonstopmode",
    "-file-line-error",
    "%DOC%"
  ]
  }, {
    "name": "latexmk",
  "command": "miktex-latexmk",
  "args": [
    "-synctex=1",
    "-interaction=nonstopmode",
    "-file-line-error",
    "-pdf",
    "%DOC%"
  ]
  }, {
  "name": "pdflatex",
  "command": "miktex-pdflatex",
  "args": [
    "-synctex=1",
    "-interaction=nonstopmode",
    "-file-line-error",
    "%DOC%"
  ]
  }, {
  "name": "bibtex",
  "command": "miktex-bibtex",
  "args": [
    "%DOCFILE%"
  ]
  }
  ],
  
  // //清除辅助文件
  // "latex-workshop.latex.autoClean.run": "onBuilt",
  // "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",
  // ], 
  

  "latex-workshop.showContextMenu":true,   //右键菜单

  // "latex-workshop.view.pdf.viewer": "external",
  // "latex-workshop.view.pdf.external.viewer.command": "C:/Users/reccl/AppData/Local/SumatraPDF\\SumatraPDF.exe",
  // "latex-workshop.view.pdf.external.viewer.args": [
  //   "-forward-search",
  //   "%TEX%",
  //   "%LINE%",
  //   "-reuse-instance",
  //   "-inverse-search",
  //   "\"F:\\Microsoft VS Code\\Code.exe\" \"F:\\Microsoft VS Code\\resources\\app\\out\\cli.js\" -r -g \"%f:%l\"",
  //   "%PDF%"
  // ],

  // 设置预览方式
  "latex-workshop.view.pdf.viewer":"external",
  "latex-workshop.view.pdf.ref.viewer":"external",
  // 设置外部PDF预览器
  "latex-workshop.view.pdf.external.viewer.command": "C:/Users/reccl/AppData/Local/SumatraPDF\\SumatraPDF.exe",
  "latex-workshop.view.pdf.external.viewer.args": [
      "%PDF%"
  ],
  // 配置Syntex的正向搜索(这是官网的)
  "latex-workshop.view.pdf.external.synctex.command": "C:/Users/reccl/AppData/Local/SumatraPDF\\SumatraPDF.exe",
  "latex-workshop.view.pdf.external.synctex.args": [
      "-forward-search",
      "%TEX%",
      "%LINE%",
      "-reuse-instance",
      "-inverse-search",
      // "D:/ProgramFiles/Coding/VSCode/code D:/ProgramFiles/Coding/VSCode/resources/app/out/cli.js -r -g %f:%l",
      "\"F:\\Microsoft VS Code\\Code.exe\" \"F:\\Microsoft VS Code\\resources\\app\\out\\cli.js\" -gr \"%f\":\"%l\"",
      "%PDF%"
  ],
  "editor.wordWrap": "on",

}

smutraPDF 配置

InverseSearchCmdLine = "F:\Microsoft VS Code\Code.exe" "F:\Microsoft VS Code\resources\app\out\cli.js" --ms-enable-electron-run-as-node -r -g "%f:%l"

参考

如何在Latex中插入visio图

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

ReCclay

如果觉得不错,不妨请我喝杯咖啡

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值