分别在windows和linux下安装配置vscode+latex

windows安装vscode+latex

主要介绍安装vscode和latex配置

安装和卸载latex

tex拥有多个版本,我们这里选择安装 TexLive

  1. 选择线上安装,参考链接
  2. linux版本的线上安装包链接,安装教程参考
  3. 卸载latex
    sudo apt-get purge texlive*
    rm -rf /usr/local/texlive and rm -rf ~/.texlive*
    rm -rf /usr/local/share/texmf
    rm -rf /var/lib/texmf
    rm -rf /etc/texmf
    sudo apt-get remove tex-common --purge
    rm -rf ~/.texlive*

安装和配置vscode

  1. 安装继续参考上述链接;
  2. 安装好VScode之后需要再配置一下setting.json,添加下列文本到json文件中。
{
    "latex-workshop.latex.tools": [
        {
            "name": "xelatex",
            "command": "xelatex",
            "args": [
              "-synctex=1",
              "-interaction=nonstopmode",
              "-file-line-error",
              "%DOC%"
            ]
        },
        {
            "name": "pdflatex",
            "command": "pdflatex",
            "args": [
              "-synctex=1",
              "-interaction=nonstopmode",
              "-file-line-error",
              "%DOC%"
            ]
        },
        {
            "name": "bibtex",
            "command": "bibtex",
            "args": [
              "%DOCFILE%"
            ]
        }
    ],
    "latex-workshop.message.update.show": false,
    "latex-workshop.latex.recipes": [
        

    
        {
            "name": "xelatex ➞ bibtex ➞ xelatex × 2",
            "tools": [
                "xelatex",
                "bibtex",
                "xelatex",
                "xelatex"
            ]
        },
        {
            "name": "latexmk 🔃",
            "tools": [
                "latexmk"
            ]
        },
        {
            "name": "latexmk (latexmkrc)",
            "tools": [
                "latexmk_rconly"
            ]
        },
        {
            "name": "latexmk (lualatex)",
            "tools": [
                "lualatexmk"
            ]
        },
        {
            "name": "pdflatex ➞ bibtex ➞ pdflatex × 2",
            "tools": [
                "pdflatex",
                "bibtex",
                "pdflatex",
                "pdflatex"
            ]
        },
        {
            "name": "Compile Rnw files",
            "tools": [
                "rnw2tex",
                "latexmk"
            ]
        },
        {
            "name": "Compile Jnw files",
            "tools": [
                "jnw2tex",
                "latexmk"
            ]
        },
        {
            "name": "tectonic",
            "tools": [
                "tectonic"
            ]
        }
    ],
    "latex-workshop.latex.recipe.default": "lastUsed",
    "git.ignoreMissingGitWarning": true,
    "latex-workshop.view.pdf.viewer": "tab"
}

Ubuntu18.04下如何添加latex宏包

  • 下载宏包 下载网址:https://ctan.org/ 在搜索栏里搜索对应的latex宏包,点击下载。 需要注意的是搜索是可以选择文件名搜索方便快速找到对应文件。
  • 将下载的.sty文件或者压缩包解压后移动到/usr/share/texmf/tex/latex目录下。
  • 终端中运行:sudo texhash
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值