header=bibintoc 在 Overleaf 中可以运行,但在我的 PC 上却不行

header=bibintoc 在 Overleaf 中可以运行,但在我的 PC 上却不行

我遇到了一个不寻常的问题。我注意到它heading=bibintoc在 Overleaf 上可以工作,但在我的 PC 上却不行。请参阅下面的 MWE-

\documentclass{scrreprt}
\usepackage{hyperref}
\usepackage{lipsum}

\usepackage{filecontents}
\begin{filecontents}{references.bib}
@article{einstein05,
    author  = {Albert Einstein},
    title   = {{Zur Elektrodynamik bewegter K{\"o}rper. (German) [On the electrodynamics of moving bodies]}},
    journal = {Annalen der Physik},
    volume  = {322},
    number  = {10},
    pages   = {891--921},
    year    = {1905},
    DOI     = {http://dx.doi.org/10.1002/andp.19053221004}
}

@book{goossens93,
    author    = {Michel Goossens and Frank Mittelbach and Alexander Samarin},
    title     = {{The \LaTeX\ Companion}},
    year      = {1993},
    publisher = {Addison-Wesley},
    address   = {Reading, Massachusetts}
}

@misc{knuthwebsite,
    author = {Donald Knuth},
    title  = {{Knuth: Computers and Typesetting}},
    url    = {http://www-cs-faculty.stanford.edu/\~{}uno/abcde.html}
}
\end{filecontents}

\usepackage[backend=biber]{biblatex}
\addbibresource{references.bib}

\begin{document}
\tableofcontents
\clearpage

\chapter{My Chapter}
All of these citations~\cite{einstein05,goossens93,knuthwebsite} are kept inside references.bib file.
\lipsum[2-4]

\printbibliography[heading=bibintoc,title={References}]
\end{document}

请查看我的电脑生成的目录(与 Overleaf 相比)-

在此处输入图片描述

显然,我们可以看到在我的 PC 上编译时“参考文献”未添加到目录中。以下是我 PC 上的信息-

ravi@home:~$ pdflatex --version
pdfTeX 3.14159265-2.6-1.40.19 (TeX Live 2018)
kpathsea version 6.3.0
Copyright 2018 Han The Thanh (pdfTeX) et al.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.34; using libpng 1.6.34
Compiled with zlib 1.2.11; using zlib 1.2.11
Compiled with xpdf version 4.00

ravi@home:~$ biber --version
biber version: 2.11

ravi@home:~$ cat /etc/os-release 
NAME="Ubuntu"
VERSION="14.04.6 LTS, Trusty Tahr"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 14.04.6 LTS"
VERSION_ID="14.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"

ravi@home:~$ uname -a
Linux home 4.4.0-148-generic #174~14.04.1-Ubuntu SMP Thu May 9 08:17:37 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

下面是我编译文件时执行的命令序列:

  1. pdflatex 主要.tex
  2. 比伯主
  3. pdflatex 主要.tex

PS:我也分享了 Overleaf 项目,可以编辑。请参阅这里

答案1

pdflatex之后必须执行两次biber。下面是正确的编译文件的命令序列

  1. pdflatex 主要.tex
  2. 比伯主
  3. pdflatex 主要.tex
  4. pdflatex 主要.tex

相关内容