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

相关推荐
记录无知岁月5 天前
【LaTeX】入门和使用拾遗
数学建模·教程·latex·论文写作·texlive·texsudio
微小冷6 天前
用Latex画思维导图:Forest
latex·思维导图·脑图·tikz·forest·树形图
热爱生活的五柒17 天前
如何将word中latex公式复制到另一个文档中
word·latex
Sakuraba Ema20 天前
从零理解 MoE(Mixture of Experts)混合专家:原理、数学、稀疏性、专家数量影响与手写 PyTorch 实现
人工智能·pytorch·python·深度学习·数学·llm·latex
简宸~21 天前
VS Code + LaTex + SumatraPDF联合使用指南
java·vscode·latex·sumatrapdf
bu_shuo1 个月前
AI生成的数学公式复制为LaTeX插件
ai·chatgpt·latex·gemini·千问·豆包·数学公式复制
还不秃顶的计科生1 个月前
latex代码裁剪pdf图片
pdf·latex
小哈里2 个月前
【科研】ACM MM 论文 Latex 投稿模板修改(基于sample-sigconf-authordraft-v2.16)
人工智能·llm·科研·latex·cv·overleaf
007张三丰2 个月前
Markdown+Pandoc写论文,完美支持LaTeX公式、Mermaid图表、参考文献
markdown·pandoc·latex·mermaid·mermaid图表·markdown写论文
today__present2 个月前
Latex figure 报错显示 Float lost
latex