【问题标题】:Print bibliography: Empty bibliography打印参考书目:空参考书目
【发布时间】:2021-09-19 11:42:30
【问题描述】:

这几天我一直在寻找一个有效的解决方案,但它从来没有奏效。

最小的可重现示例如下:

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{csquotes}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[authordate,autocite=inline,backend=biber,sorting=nyt,]{biblatex-chicago}
\addbibresource{Test.bib}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\DeclareUnicodeCharacter{202F}{\,}
\begin{document}

Test citing \citep{sanborn_learning_2014}

\printbibliography
\end{document} 

Test.bib:

@article{sanborn_learning_2014,
    title = {Learning Democracy: Education and the Fall of Authoritarian Regimes},
    volume = {44},
    issn = {0007-1234, 1469-2112},
    url = {https://www.cambridge.org/core/product/identifier/S0007123413000082/type/journal_article},
    doi = {10.1017/S0007123413000082},
    shorttitle = {Learning Democracy},
    abstract = {Studies on what causes a state to democratize have focused on economic, social, and international factors. Many of them argue that higher levels of education should promote democracy. However, few articulate clearly how education affects democratization, and fewer still attempt to test the supposed link across time and space. This article fills that gap by considering how different levels of education influence democratization, and the conditions under which education is most likely to promote democracy. Analyses of eighty-five authoritarian spells from 1970 to 2008 find that higher levels of mass, primary, and tertiary education are robustly associated with democratization. Secondary analyses indicate that education is most effective in promoting democratization when both males and females are educated. An illustration from Tunisia follows.},
    pages = {773--797},
    number = {4},
    journaltitle = {British Journal of Political Science},
    shortjournal = {Brit. J. Polit. Sci.},
    author = {Sanborn, Howard and Thyne, Clayton L.},
    urldate = {2021-09-18},
    date = {2014-10},
    langid = {english},

Test.blg:

[0] Config.pm:304> INFO - This is Biber 2.14 (beta)
[0] Config.pm:307> INFO - Logfile is 'Test.blg'
[38] biber:322> INFO - === dim. sept. 19, 2021, 14:47:26
[48] Biber.pm:415> INFO - Reading 'Test.bcf'
[128] Biber.pm:943> INFO - Found 0 citekeys in bib section 0
[131] Utils.pm:293> WARN - The file 'Test.bcf' does not contain any citations!
[136] bbl.pm:652> INFO - Writing 'Test.bbl' with encoding 'UTF-8'
[136] bbl.pm:755> INFO - Output to Test.bbl
[136] Biber.pm:128> INFO - WARNINGS: 1

文中未引用时的警告信息为LaTeX Warning: Empty bibliography on input line 16.

在文中引用时的错误和警告信息是: 第 14 行: ! Undefined control sequence. ! Missing $ inserted. ! Extra }, or forgotten $. 第 15 行: ! Missing $ inserted. 第 16 行: LaTeX Warning: Empty bibliography on input line 16.

我在 Linux、Texlive2019(安装了那个,而不是更新的)和 texmaker 上运行 Ubuntu 20.04。

谁有解决办法?

【问题讨论】:

  • 您的最小工作示例不完整。您实际上在您的文档中有 \cite 吗?你在编译期间运行 biber 吗?
  • @samcarter_is_at_topanswers.xyz 是 Ido 引用,但是当我引用时出现以下错误:! Undefined control sequence.! Missing $ inserted.! You can't use \spacefactor' in math mode.LaTeX Warning: Citation on page 1 undefined on input line 17.。尽管如此,我想要 .bib 文件中的所有条目,即使它们没有在文本中引用。我确实在编译期间运行 biber。
  • 这听起来像是您的 .bib 文件中的一些错误代码。请发送minimal reproducible example 以便我们重现问题。
  • (要获取您的参考书目中显示的 .bib 文件中的所有条目,您可以使用\nocite{*},但只要您仍然要调试此错误,请先关注一个条目,以便添加全部)
  • @samcarter_is_at_topanswers.xyz 我用最小的可重现示例更新了主要问题。非常感谢您的帮助!

标签: latex bibliography latex-environment biblatex


【解决方案1】:

两个问题:

  • 您的围兜条目末尾的 } 丢失了

  • \citep{} 默认情况下 biblatex 不提供。您可以使用 biblatex 的 \parencite{}instead or thenatbib=true` 选项


\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{csquotes}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[authordate,autocite=inline,backend=biber,sorting=nyt,natbib=true]{biblatex-chicago}


\begin{filecontents*}[overwrite]{\jobname.bib}
@article{sanborn_learning_2014,
    title = {Learning Democracy: Education and the Fall of Authoritarian Regimes},
    volume = {44},
    issn = {0007-1234, 1469-2112},
    url = {https://www.cambridge.org/core/product/identifier/S0007123413000082/type/journal_article},
    doi = {10.1017/S0007123413000082},
    shorttitle = {Learning Democracy},
    abstract = {Studies on what causes a state to democratize have focused on economic, social, and international factors. Many of them argue that higher levels of education should promote democracy. However, few articulate clearly how education affects democratization, and fewer still attempt to test the supposed link across time and space. This article fills that gap by considering how different levels of education influence democratization, and the conditions under which education is most likely to promote democracy. Analyses of eighty-five authoritarian spells from 1970 to 2008 find that higher levels of mass, primary, and tertiary education are robustly associated with democratization. Secondary analyses indicate that education is most effective in promoting democratization when both males and females are educated. An illustration from Tunisia follows.},
    pages = {773--797},
    number = {4},
    journaltitle = {British Journal of Political Science},
    shortjournal = {Brit. J. Polit. Sci.},
    author = {Sanborn, Howard and Thyne, Clayton L.},
    urldate = {2021-09-18},
    date = {2014-10},
    langid = {english},
}
\end{filecontents*}

\addbibresource{\jobname.bib}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\DeclareUnicodeCharacter{202F}{\,}


\begin{document}

Test citing \citep{sanborn_learning_2014}

\printbibliography
\end{document} 

【讨论】:

  • 它工作正常,非常感谢!我真的不明白为什么它现在可以工作,因为 .bib 文件末尾的} 问题只是由于堆栈上的复制和粘贴错误,而参考书目不需要\parencite{}无论如何都要打印?所以我不确定出了什么问题......但无论如何还是谢谢你
  • @Louis.vgn 不客气!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2019-03-24
  • 2020-06-07
  • 2017-10-01
  • 2013-06-26
  • 1970-01-01
  • 1970-01-01
  • 2012-07-12
相关资源
最近更新 更多