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).
相关推荐
9分钟带帽7 小时前
vscode解决终端输出乱码的问题
vscode·cmake
陶瓷好烦9 小时前
智能编码助手:VSCode+Keil+Kilo Code打造自然语言编程环境
vscode·stm32·单片机
DeadPool loves Star12 小时前
新版VSCode登录Old Linux
linux·ide·vscode
小松要进步12 小时前
VSCode
ide·vscode·编辑器
终端鹿12 小时前
VSCode插件Console Ninja详解:把DevTools搬进编辑器,调试效率翻倍
ide·vscode·编辑器
【ql君】qlexcel1 天前
Visual Studio Code的使用,VS code常用扩展
ide·vscode·编辑器·visual studio·扩展
望眼欲穿的程序猿1 天前
Vscode Clangd 无法索引 C++17 或者以上标准
java·c++·vscode
卓小帅的博客1 天前
解决vscode中无法使用特定语言注释的问题
ide·vscode·编辑器·快捷键·无法注释
hello_fengfeng1 天前
VSCode Remote-SSH 连接失败修复(权限问题)
ide·vscode·ssh
赖念安1 天前
在 vscode 的 NPM SCRIPTS 面板点击执行后脚本失败
ide·vscode·npm