vscode编写latex的方法

 更新时间:2021年07月21日 10:34:49   作者:Nightmare004  
这篇文章主要介绍了vscode编写latex的方法,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下

假设你已经装了texlive

打开cmd输入

latex --version

应该能输出

打开vscode,安装这几个插件

设置->Settings

点击右上角的Open Settings(JSON)

打开应该是这样的(也许你还配置过其他的东西,反正是个json)

{
    "editor.suggestSelection": "first",
    "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue"
}

添加以下这些(就按json那么添加)

 // Latex configuration
    "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"
            ]
        }
    ],
    "latex-workshop.latex.tools": [
        {
        // 编译工具和命令
        "name": "xelatex",
        "command": "xelatex",
        "args": [
            "-synctex=1",
            "-interaction=nonstopmode",
            "-file-line-error",
            "-pdf",
            "%DOCFILE%"
        ]
        },
        {
        "name": "pdflatex",
        "command": "pdflatex",
        "args": [
            "-synctex=1",
            "-interaction=nonstopmode",
            "-file-line-error",
            "%DOCFILE%"
        ]
        },
        {
        "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"
    ]

比如上面那个添加完应该如下

{
    "editor.suggestSelection": "first",
    "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
    // Latex configuration
    "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"
            ]
        }
    ],
    "latex-workshop.latex.tools": [
        {
        // 编译工具和命令
        "name": "xelatex",
        "command": "xelatex",
        "args": [
            "-synctex=1",
            "-interaction=nonstopmode",
            "-file-line-error",
            "-pdf",
            "%DOCFILE%"
        ]
        },
        {
        "name": "pdflatex",
        "command": "pdflatex",
        "args": [
            "-synctex=1",
            "-interaction=nonstopmode",
            "-file-line-error",
            "%DOCFILE%"
        ]
        },
        {
        "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"
    ]
}

然后重启

新建一个文件夹(文件夹,不是文件)

写点latex

点右上角第一个编译,然后看看problems

众所周知,警告,相当于没有,所以,没有问题

第二个查看pdf

到此这篇关于vscode编写latex的文章就介绍到这了,更多相关vscode编写latex内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!

相关文章

  • c#显示当前在线人数示例

    c#显示当前在线人数示例

    这篇文章主要介绍了c#显示当前在线人数的示例,需要的朋友可以参考下
    2014-02-02
  • C#中comboBox实现三级联动

    C#中comboBox实现三级联动

    给大家分享了C#中comboBox实现三级联动的全部代码,代码经过测试,有兴趣的朋友跟着做一下。
    2018-03-03
  • c#使用linq把多列的List转化为只有指定列的List

    c#使用linq把多列的List转化为只有指定列的List

    这篇文章主要介绍了c#使用linq把多列的List转化为只有指定列的List,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
    2019-12-12
  • C# WPF上位机实现和下位机TCP通讯的方法

    C# WPF上位机实现和下位机TCP通讯的方法

    这篇文章主要介绍了C# WPF上位机实现和下位机TCP通讯的方法,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
    2019-03-03
  • C#调用js库的方法小结

    C#调用js库的方法小结

    本文主要介绍了C#调用js库的方法小结,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
    2023-04-04
  • C#把UNICODE编码转换为GB编码的实例

    C#把UNICODE编码转换为GB编码的实例

    下面小编就为大家带来一篇C#把UNICODE编码转换为GB编码的实例。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧
    2017-01-01
  • Unity实现虚拟摇杆效果

    Unity实现虚拟摇杆效果

    这篇文章主要为大家详细介绍了Unity实现虚拟摇杆效果,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
    2020-04-04
  • Unity实现倒计时组件

    Unity实现倒计时组件

    这篇文章主要介绍了Unity实现倒计时组件的使用方法,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
    2020-05-05
  • C#图像处理之图像目标质心检测的方法

    C#图像处理之图像目标质心检测的方法

    这篇文章主要介绍了C#图像处理之图像目标质心检测的方法,可实现C#计算图像质心的相关技巧,需要的朋友可以参考下
    2015-04-04
  • C#获取网页源代码的方法

    C#获取网页源代码的方法

    这篇文章主要介绍了C#获取网页源代码的方法,涉及C#基于自定义函数读取网页html代码的方法,具有一定参考借鉴价值,需要的朋友可以参考下
    2015-09-09

最新评论