TheNetAdmin / zjuthesis

Zhejiang University Graduation Thesis LaTeX Template
https://thenetadmin.github.io/zjuthesis
MIT License
2.7k stars 639 forks source link

关于vscode编译出现无法显示参考文献的问题之解决办法 #338

Closed zjuls closed 1 year ago

zjuls commented 1 year ago

可改进的内容

step1:在content.tex中运行xelatex->biber命令; step2:在zjuthesis.tex中再运行一次xelatex->biber命令。 即可解决上述问题。 关于vscode配置xelatex->biber,可参考vscode修改config文件,步骤相同。

代码与步骤

No response

预期结果

No response

HangX-Ma commented 1 year ago

补充,在用户的 settings.json 中加入如下配置,直接使用 latexmk 编译即可解决问题。参考文献中出现文献信息的前提是在正文中引用过相关的文献。

    "latex-workshop.latex.recipes": [
        {
            "name": "xelatex -> biber -> xelatex*2",
            "tools": [
            "xelatex",
            "biber",
            "xelatex",
            "xelatex"
            ]
        },
        {
            "name": "xelatex",
            "tools": [
                "xelatex"
            ]
        },
        {
            "name": "latexmk",
            "tools": [
                "latexmk"
            ]
        },
        {
            "name": "xelatex -> biber",
            "tools": [
                "xelatex",
                "bibtex"
            ]
        },
        {
            "name": "pdflatex -> bibtex -> pdflatex*2",
            "tools": [
                "pdflatex",
                "bibtex",
                "pdflatex",
                "pdflatex"
            ]
        }
    ],
    "latex-workshop.latex.tools": [
        {
            "name": "latexmk",
            "command": "latexmk",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "-xelatex",
                "-outdir=%OUTDIR%",
                "-cd",
                "%DOCFILE%"
            ],
            "env": {}
        },
        {
        "name": "pdflatex",
        "command": "pdflatex",
        "args": [
            "-synctex=1",
            "-interaction=nonstopmode",
            "-file-line-error",
            "%DOCFILE%"
        ]
        },
        {
            "name": "bibtex",
            "command": "bibtex",
            "args": [
                "%DOCFILE%"
            ]
        },
        {
            "name": "xelatex",
            "command": "xelatex",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "-pdf",
                "-outdir=%OUTDIR%",
                "-cd",
                "%DOCFILE%"
            ],
            "env": {}
        },
        {
            "name": "biber",
            "command": "biber",
            "args": [
                "%DOCFILE%"
            ],
            "env": {}
        }
    ],
TheNetAdmin commented 1 year ago

原有的FAQ里也有提到如何用vscode,不需要重新设置latex workshop的settings.json,我刚测试过,还是可以用的。

https://github.com/TheNetAdmin/zjuthesis/blob/124ce4f0b2c05077690b0c16a2cd1e25b7c803bd/docs/FAQ.md?plain=1#L107

TheNetAdmin commented 1 year ago

不过我认为可以考虑在本repo的根目录提供一个 .vscode/settings.json 以便新用户使用