使用TexLive与VScode排版论文

发布于:2025-08-14 ⋅ 阅读:(26) ⋅ 点赞:(0)

前言

中文稿目前已经完成了,现在要转用latex排版,但我对这方面没有接触过,这里做一个记录。

网页版Overleaf:Overleaf, 在线LaTeX编辑器

TeXWorks:论文神器teXWorks安装与使用记录

这里我还是决定采用Vscode作为TeX编辑器。

安装TexLive

进入镜像地址:Index of /systems/texlive/Images

选择上图中的texlive.iso,安装好后解压此文件到当前文件夹。

进入解压后的文件夹D:\software\tex\texlive中,选择install-tl-windows.bat文件右键选择管理员身份运行。

修改安装的路径与之前一样,然后点击Advanced。选择Customize,语言保留三个即可。

选择好后点击确定,点击安装即可。

安装的时间较长,出现下面的情况就说明完成了

打开cmd,测试下面的指令:

latex -v

xelatex -v

tex -v

只要出现一些版本信息就说明正常,如果有问题,可以从下面的参考文章中找找添加到系统环境变量中。

安装SumatraPDF

安装地址Sumatra PDF reader download page

配置Vscode

我想关于vscode的安装就不用讲了,我们点击扩展,搜索插件Latex workshop安装。

配置如下,一些相关的路径请自行修改:

{
    "latex-workshop.latex.autoBuild.run": "never",
    "latex-workshop.showContextMenu": true,
    "latex-workshop.intellisense.package.enabled": true,
    "latex-workshop.message.error.show": false,
    "latex-workshop.message.warning.show": false,
    "latex-workshop.latex.tools": [
        {
            "name": "xelatex",
            "command": "D:/software/tex/texlive/2025/bin/windows/xelatex.exe",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "%DOC%"
            ]
        },
        {
            "name": "pdflatex",
            "command": "D:/software/tex/texlive/2025/bin/windows/pdflatex.exe",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "%DOC%"
            ]
        },
        {
            "name": "latexmk",
            "command": "D:/software/tex/texlive/2025/bin/windows/latexmk.exe",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "-pdf",
                "-outdir=%OUTDIR%",
                "%DOC%"
            ]
        },
        {
            "name": "bibtex",
            "command": "bibtex",
            "args": [
                "%DOCFILE%"
            ]
        }
    ],
    "latex-workshop.latex.recipes": [
        {
            "name": "pdflatex -> bibtex -> pdflatex*2",
            "tools": [
                "pdflatex",
                "bibtex",
                "pdflatex",
                "pdflatex"
            ]
        },
        {
            "name": "XeLaTeX",
            "tools": [
                "xelatex"
            ]
        },
        {
            "name": "PDFLaTeX",
            "tools": [
                "pdflatex"
            ]
        },
        {
            "name": "BibTeX",
            "tools": [
                "bibtex"
            ]
        },
        {
            "name": "LaTeXmk",
            "tools": [
                "latexmk"
            ]
        },
        {
            "name": "xelatex -> bibtex -> xelatex*2",
            "tools": [
                "xelatex",
                "bibtex",
                "xelatex",
                "xelatex"
            ]
        }
    ],
    "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"
    ],
    "latex-workshop.latex.autoClean.run": "onFailed",
    "latex-workshop.latex.recipe.default": "lastUsed",
    "latex-workshop.view.pdf.internal.synctex.keybinding": "double-click",
    "latex-workshop.view.pdf.viewer": "external",
    "latex-workshop.view.pdf.ref.viewer": "auto",
    "latex-workshop.view.pdf.external.viewer.command": "D:/software/tex/Sumatra/SumatraPDF/SumatraPDF.exe",
    "latex-workshop.view.pdf.external.viewer.args": [
        "%PDF%"
    ],
    "latex-workshop.view.pdf.external.synctex.command": "D:/software/tex/Sumatra/SumatraPDF/SumatraPDF.exe",
    "latex-workshop.view.pdf.external.synctex.args": [
        "-forward-search",
        "%TEX%",
        "%LINE%",
        "-reuse-instance",
        "-inverse-search",
        "\"D:/software/vscode/Microsoft VS Code/Code.exe\" \"D:/software/vscode/Microsoft VS Code/resources/app/out/cli.js\" -r -g \"%f:%l\"",
        "%PDF%"
    ]
}

tex文件编译

然后们从官网上下载下来的模板解压后通过vscode打开。

点击了tex文件后,左侧栏出现了TEX的标识,点击。

TGRS论文一般用这个就好,其余的不需要,bibtex是编译参考文献的,一开始没写参考文献可以只用PDFlatex编译。

完成后可选择View LaTex PDF。

出现的问题

编译后的标题大小比其他的要小一号,这里我始终没法理解是出现了什么问题,折腾了一下午才解决掉,先去Manuscript Templates for Conference Proceedings | IEEE这个网站下载IEEEtran.cls,我将其复制到了D:\software\tex\texlive\texmf-local\tex\latex,并且我还替换了模板当中的IEEEtran.cls。

然后选择通过管理员运行cmd。

然后使用刷新命令:

texhash

验证命令:

kpsewhich IEEEtran.cls

出现上面这样就说明成功了。

参考文章

2025 TexLive+VScode排版IEEE TGRS论文_texlive vscode-CSDN博客

(94 封私信) Visual Studio Code (vscode)配置LaTeX - 知乎

论文神器teXWorks安装与使用记录-CSDN博客

(94 封私信) Overleaf排版IEEE trans.期刊论文 - 知乎

【LaTeX】新手教程:从入门到日常使用

遥感SCI期刊模板下载教程———IEEE TGRS、GRSL、JSTARS_论文阅读_海淀小天-2048 AI社区

(94 封私信) 2025 Testlive+VScode排版IEEE TGRS论文 - 知乎


网站公告

今日签到

点亮在社区的每一天
去签到