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

相关推荐
weixin_4166600712 小时前
豆包公式转Word,乱码解决
word·latex·豆包
lijfrank3 天前
MacOS 下 VS Code + LaTeX + Skim 双向同步配置
vscode·macos·pdf·latex·mactex
爱叨叨的小嘟4 天前
Latex公式 转 word可编辑公式
word·typora·latex
weixin_4166600714 天前
原创分享:Markdown 转 Word 工具,一键导出Word/PDF文档
pdf·word·latex·deepseek
伟贤AI之路23 天前
为什么AI里的公式复制到Word格式会乱?
人工智能·word·latex
weixin_4166600724 天前
从标记语言到 Word 文档:AI 生成的 Mermaid 与 LaTeX 自动化转换的技术方案解析
word·latex·数学公式·deepseek
记录无知岁月1 个月前
【LaTeX】入门和使用拾遗
数学建模·教程·latex·论文写作·texlive·texsudio
微小冷1 个月前
用Latex画思维导图:Forest
latex·思维导图·脑图·tikz·forest·树形图
热爱生活的五柒1 个月前
如何将word中latex公式复制到另一个文档中
word·latex
Sakuraba Ema1 个月前
从零理解 MoE(Mixture of Experts)混合专家:原理、数学、稀疏性、专家数量影响与手写 PyTorch 实现
人工智能·pytorch·python·深度学习·数学·llm·latex