一些 bib 条目之间存在无法解释的垂直空间?

一些 bib 条目之间存在无法解释的垂直空间?

我正在使用带有 natbib 的 APA6 包,我注意到我的一些 bib 条目有垂直空格。我认为这与条目末尾有一个特别长的“单词”(例如 URL 或 doi)有关。

它看起来是这样的:

以下是 MWE:

\documentclass[a4paper,man,natbib]{apa6}
\usepackage{mathptmx}% http://ctan.org/pkg/mathptmx
\usepackage{underscore}
\usepackage[hyphens]{url}
\usepackage[hidelinks]{hyperref}
\hypersetup{breaklinks=true}    

\title{Title}
\shorttitle{Short Title}
\author{Author Name}
\affiliation{Author Affiliation}
\abstract{Abstract}

\begin{document}

\citep{Baron2004,Foster1965a,eibach2006free,ElectionsCanada,trivers2000elements,VonNeumann1944,VanLange1999b,VanLange1997a}

\urlstyle{same}
\bibliography{bib}

\end{document}

以下是围兜条目:

@article{trivers2000elements,
author = {Trivers, Robert},
doi = {10.1111/j.1749-6632.2000.tb06619.x},
journal = {Annals of the New York Academy of Sciences},
number = {1},
pages = {114--131},
publisher = {Wiley Online Library},
title = {{The elements of a scientific theory of self-deception}},
volume = {907},
year = {2000}
}

@misc{ElectionsCanada,
author = {{Elections Canada}},
title = {{Voter turnout at federal elections and referendums}},
url = {http://www.elections.ca/content.aspx?section=ele\&dir=turn\&document=index\&lang=e},
year = {2013}
}

@article{Baron2004,
author = {Baron, Jonathan and Kemp, Simon},
doi = {10.1016/S0167-4870(03)00064-3},
file = {:C$\backslash$:/Users/Tyler/Documents/Mendeley Desktop/Baron, Kemp - 2004 - Support for trade restrictions, attitudes, and understanding of comparative advantage.pdf:pdf},
issn = {01674870},
journal = {Journal of Economic Psychology},
month = oct,
number = {5},
pages = {565--580},
title = {{Support for trade restrictions, attitudes, and understanding of comparative advantage}},
volume = {25},
year = {2004}
}

@article{eibach2006free,
  title={Free at last? Social dominance, loss aversion, and White and Black Americans' differing assessments of racial progress.},
  author={Eibach, Richard P and Keegan, Thomas},
  journal={Journal of Personality and Social Psychology},
  volume={90},
  number={3},
  pages={453},
  year={2006},
  publisher={American Psychological Association}
}

@book{VonNeumann1944,
address = {Princeton},
author = {{Von Neumann}, J and Morgenstern, O},
chapter = {1},
isbn = {0691003629},
issn = {00280836},
publisher = {Princeton University Press},
series = {Princeton Classic Editions},
title = {{Theory of games and economic behavior}},
year = {1944}
}

@article{VanLange1997a,
author = {{Van Lange}, P.A.M. and {De Bruin}, E. and Otten, W and Joireman, J.A.},
doi = {10.1037//0022-3514.73.4.733},
file = {:C$\backslash$:/Users/Tyler/Documents/Mendeley Desktop/Van Lange et al. - 1997 - Development of prosocial, individualistic, and competitive orientations theory and preliminary evidence.pdf:pdf},
issn = {0022-3514},
journal = {Journal of Personality and Social Psychology},
mendeley-groups = {OLD/Fall 2012/Loosely Sorted/PhD/Thesis/Prosocial,OLD/Fall 2012/Loosely Sorted/PhD/Thesis/Prosocial/Measurement,social value orientation,Thesis BibteX},
month = oct,
number = {4},
pages = {733},
publisher = {American Psychological Association},
title = {{Development of prosocial, individualistic, and competitive orientations: theory and preliminary evidence.}},
volume = {73},
year = {1997}
}

@article{VanLange1999b,
author = {{Van Lange}, P.A.M.},
doi = {10.1037//0022-3514.77.2.337},
file = {:C$\backslash$:/Users/Tyler/Documents/Mendeley Desktop/Van Lange - 1999 - The pursuit of joint outcomes and equality in outcomes An integrative model of social value orientation(2).pdf:pdf},
issn = {0022-3514},
journal = {Journal of Personality and Social Psychology},
number = {2},
pages = {337--349},
title = {{The pursuit of joint outcomes and equality in outcomes: An integrative model of social value orientation}},
volume = {77},
year = {1999}
}

@article{Foster1965a,
author = {Foster, GM},
doi = {10.1525/aa.1965.67.2.02a00010},
file = {:C$\backslash$:/Users/Tyler/Documents/Mendeley Desktop/Foster - 1965 - Peasant society and the image of limited good.pdf:pdf},
journal = {American Anthropologist},
number = {2},
pages = {293--315},
title = {{Peasant society and the image of limited good}},
volume = {67},
year = {1965}
}

我可以告诉它添加换行符或者其他内容吗?

答案1

如果不需要反向引用,则apacite.sty类加载的包会错误地定义。\PrintBackRefs

确实,它将其定义为与相同\@gobble,但生成的文件中条目的结尾.bbl就像

\APACjournalVolNumPages{Journal of Economic Psychology}{25}{5}{565--580}.
\newblock
\begin{APACrefDOI} \doi{10.1016/S0167-4870(03)00064-3} \end{APACrefDOI}
\PrintBackRefs{\CurrentBib}

这就是问题:此处可以看到空格,从最后两个行尾开始,\par自动提供的空格只会删除一个。如果最后一个单词的结尾非常靠近右边缘,则这样的空格可以“转到下一行”,从而创建一个新行。

您可以通过添加来解决问题

\makeatletter
\AtBeginDocument{%
  \@ifpackageloaded{backref}{}{\renewcommand{\PrintBackRefs}[1]{\@bsphack\@esphack}}%
}
\makeatother

到文档序言中。这是在 LaTeX 中制作命令的标准方法透明的如果它不执行任何操作并且可以在前面加上空格。

完整代码

\documentclass[a4paper,man,natbib]{apa6}
\usepackage{mathptmx}% http://ctan.org/pkg/mathptmx
\usepackage{underscore}
\usepackage[hyphens]{url}
\usepackage[hidelinks]{hyperref}
\hypersetup{breaklinks=true}    

%%% fix the issue in apacite.sty
\makeatletter
\AtBeginDocument{%
  \@ifpackageloaded{backref}{}{\renewcommand{\PrintBackRefs}[1]{\@bsphack\@esphack}}%
}
\makeatother


\title{Title}
\shorttitle{Short Title}
\author{Author Name}
\affiliation{Author Affiliation}
\abstract{Abstract}

\begin{document}

\citep{Baron2004,Foster1965a,eibach2006free,ElectionsCanada,trivers2000elements,VonNeumann1944,VanLange1999b,VanLange1997a}

\urlstyle{same}
\bibliography{bib}

\end{document}

在此处输入图片描述

相关内容