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).
相关推荐
weixin_402278458 小时前
解决打开vscode编辑器ctrl+鼠标左键不能跳转定义问题 环境C++
vscode·编辑器·计算机外设
Gene_202218 小时前
ubuntu22.04安装Claude Code及其在vscode跑通
ide·vscode·arcgis
#君君#1 天前
ros2 下VSCode 中显示波浪线(找不到定义)原因
ide·vscode·编辑器
芋头莎莎1 天前
ESP32 +VSCode与搭建开发环境教程
vscode·单片机
HeeRiver2 天前
VSCode调用deepseek-v4-pro/flash api的方法
ide·vscode·api·deepseek-v4
H Journey2 天前
Windows + VSCode + CMake 编译
windows·vscode·cmake
三品吉他手会点灯2 天前
STM32 VSCode 开发-与STM32CubeMX协同开发环境搭建
vscode·stm32·单片机·嵌入式硬件
克拉拉KLARA2 天前
vscode禁用在git提交中插入ai coauthor copilot
git·vscode·copilot
三品吉他手会点灯2 天前
STM32 VSCode 开发-C语言程序运行后,终端中文乱码
c语言·ide·笔记·vscode·stm32·学习·编辑器