win11 vscode 本地 latex 编译(Elsevier举例)

win11 vscode 本地 latex 编译

    • 准备
    • [1. 安装步骤](#1. 安装步骤)
    • [2. 应用举例(Elsevier)](#2. 应用举例(Elsevier))

准备

名称 版本
操作系统 win11(win10也可以的)
texlive 2025
vscode NaN

1. 安装步骤

  1. 安装Tex Live
    下载连接:https://tug.org/texlive/windows.html
    点击安装(耗时会蛮久的,我等了1个小时)
    安装完成后测试下(正常的话会如下图):
bash 复制代码
tex -v
latex -v
pdflatex -v
  1. VSCode安装必要的插件 LaTeXLaTeX Workshop

    可以先编译下试试,如果不能 直接编译成pdf,可在所在的文件夹在新建 setting.json,内容可以参考下面:
json 复制代码
{
    "latex-workshop.latex.recipes": [
      {
        "name": "xelatex -> biber -> xelatex*2",
        "tools": [
            "xelatex",
            "biber",
            "xelatex",
            "xelatex"
        ]
      },
      {
        "name": "latexmk (biber)",
        "tools": [
          "pdflatex",
          "biber",
          "pdflatex",
          "pdflatex"
        ]
      }
    ],
    "latex-workshop.latex.tools": [
      {
        "name": "pdflatex",
        "command": "pdflatex",
        "args": [
          "-synctex=1",
          "-interaction=nonstopmode",
          "-file-line-error",
          "-output-directory=build",
          "%DOC%"
        ]
      },
      {
        "name": "biber",
        "command": "biber",
        "args": [
          "--output-directory=build", 
          "%DOCFILE%"
        ]
      }
    ],
    "latex-workshop.latex.outDir": "./build",
    "latex-workshop.view.pdf.viewer": "tab"  
  }

elsevier的模板似乎不需要写这个 setting.json 就可以编译。

2. 应用举例(Elsevier)

解压 elsevier 的 latex zip压缩包解压后可以看到:

能编译的只有 .tex 文件,
elsarticle-template-harv.tex
elsarticle-template-num.tex
elsarticle-template-num-names.tex

尾缀就是不同的reference格式。

例如使用 elsarticle-template-harv.tex ,注意 \cite{}\citep{} 的区别。

This is a citation test \cite{lamport94}. This is a citation test \citep{lamport94}.
This is a citation test Lamport (1994). This is a citation test (Lamport, 1994).
相关推荐
嵌入式小站1 小时前
STM32 可移植教程 01:VSCode 环境搭建 + 点亮 LED(实战篇)
vscode·stm32·嵌入式硬件
Mars-xq1 小时前
VSCode 开发 Android 时,类、方法无法跳转
android·ide·vscode
Mars-xq2 小时前
VSCode 开发Android 新手必装插件清单
android·ide·vscode
xskukuku9 小时前
使用VSCode配置C语言运行环境
c语言·ide·vscode
小王C语言15 小时前
vscode智能提示问题、跳转问题
ide·vscode·编辑器
郝亚军21 小时前
如何在vscode上运行python程序
ide·vscode·编辑器
Arvin.Angela21 小时前
VsCode 安装文档
ide·vscode·编辑器
CAir21 天前
copilot配置deepseek和skills
vscode·copilot·skill·deepseek
独隅1 天前
Visual Studio Code 和 Visual Studio 2026 两大开发工具的核心差异
java·vscode·visual studio
芋头莎莎1 天前
window 右键菜单添加 vscode
ide·vscode·编辑器