vs code + latex使用攻略

1.环境配置

latex使用texlive,安装完成texlive后,在系统环境变量中添加texlive路径,并在vs code里加入json字段。同时,为了方便使用,在vs code里添加latex workshope插件,可以看到目录,以及添加公式和特殊符号。

python 复制代码
    "latex-workshop.latex.tools": [
        {
            "name": "pdflatex",
            "command": "pdflatex",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "%DOCFILE%"
            ]
        },
        {
            "name": "xelatex",
            "command": "xelatex",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "%DOCFILE%"
            ]
        },
        {
            "name": "biber",
            "command": "biber",
            "args": [
                "%DOCFILE%"
            ]
        },
        {
            "name": "bibtex",
            "command": "bibtex",
            "args": [
                "%DOCFILE%"
            ]
        }
    ],
    "latex-workshop.latex.recipes": [
        {
            "name": "XeLaTeX + Biber (推荐)",
            "tools": [
                "xelatex",
                "biber",
                "xelatex",
                "xelatex"
            ]
        },
        {
            "name": "XeLaTeX 单次编译",
            "tools": [
                "xelatex"
            ]
        },
        {
            "name": "PDFLaTeX + BibTeX",
            "tools": [
                "pdflatex",
                "bibtex",
                "pdflatex",
                "pdflatex"
            ]
        },
        {
            "name": "PDFLaTeX 单次编译",
            "tools": [
                "pdflatex"
            ]
        }
    ],
    "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",
        "*.synctex.gz",
        "*.run.xml"  // 新增Biber生成的辅助文件
    ],
    "latex-workshop.view.pdf.viewer": "tab",
    "latex-workshop.latex.autoBuild.run": "onSave",  // 改为保存时自动编译(减少频繁编译)
    "latex-workshop.showContextMenu": true,
    "latex-workshop.message.error.show": true,  // 恢复错误提示(便于排查问题)
    "latex-workshop.message.warning.show": true,  // 恢复警告提示(便于排查问题)
    "latex-workshop.intellisense.package.enabled": true,
    "latex-workshop.latex.autoClean.run": "onSuccessfulBuild",  // 编译成功后自动清理辅助文件
    "latex-workshop.latex.recipe.default": "XeLaTeX + Biber (推荐)",  // 默认使用XeLaTeX+Biber编译
    "latex-workshop.view.pdf.internal.synctex.keybinding": "double-click",
    "latex-workshop.latex.compile.trigger": "onSave"  // 明确编译触发时机为保存

2.使用攻略

2.1 latex换行:

1.换行(三个方法)

\newline

另起一段是空一行

\

2.分段

\par

3.换页

\newpage

2.2 vs code编译器自动换行

在设置中选择 Word Wrap

相关推荐
我的golang之路果然有问题5 天前
word中latex插入矩阵的语法问题
笔记·学习·矩阵·word·latex·template method·分享
钱彬 (Qian Bin)7 天前
从零开始发表SCI论文—第1篇:安装Latex写作工具
latex·vs code·sci论文·环境准备
他来自江湖11 天前
西南科技大学,研究生开题报告latex模板
科技·latex·开题报告·西南科技大学
Invinc-Z12 天前
LaTeX 个人简历模板
latex
嘿嘻哈呀21 天前
MaxTex下载及LaTex环境配置
latex·maxtex·latex workshop
喝凉白开都长肉的大胖子1 个月前
比较 main.tex 的两个不同版本(例如旧版和新版),并生成一个带有修改标记(如删除线、高亮、修订注释)的 PDF 或文本输出。
pdf·latex
麻雀无能为力1 个月前
LaTeX基础使用
latex
Invinc-Z1 个月前
国内外期刊和学位论文等LaTeX模板编译报错如何解决
latex
Invinc-Z1 个月前
一份简短的LaTeX相关术语的介绍
latex