使用 APA 格式书目编号文内引用

使用 APA 格式书目编号文内引用

我正在尝试创建一个使用 APA 格式但带有编号的文内引文(例如 [#] )的参考书目。目前,我的文内引文采用更传统的形式(作者,年份)。我在下面附上了此 MWE。

\documentclass[a4paper,12pt]{report}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage[a4paper,top=2.5cm,bottom=3cm,left=3cm,right=3cm]{geometry}
\usepackage{apacite}  
\usepackage{amsmath}

\begin{document}
Example \cite{kearon1998noninvasive}.
\interlinepenalty=10000
\bibliography{References.bib}
\bibliographystyle{apacite}
\end{document}

在此处输入图片描述

References.bib 示例如下

@article{kearon1998noninvasive,
  title={Noninvasive diagnosis of deep venous thrombosis},
  author={Kearon, Clive and Julian, Jim A and Math, M and Newman, Toni E and Ginsberg, Jeffrey S},
  journal={Annals of internal medicine},
  volume={128},
  number={8},
  pages={663--677},
  year={1998},
  publisher={American College of Physicians}
}

在此处输入图片描述

我已阅读了 apacite 软件包手册,但不确定如何实现这一点。这可能吗?

答案1

使用 可以很容易地做到这一点biblatex。但是,我不会使用实际apa样式,因为它不是设计用来这样使用的。而是使用更通用的author-year样式。在这里,我使用了ext-authoryear允许对默认样式进行一些简单调整的样式author-year。这实现了我对您的问题的评论中的选项 B,其中编号反映了参考文献的字母顺序而不是引用顺序,我认为这是此类参考书目最合理的组合。

强大的解决方案

正如 moewe 在评论中指出的那样,我最初的快速而肮脏的解决方案实际上伪造了参考书目行相对于文本中参考文献的编号,因为它们之间没有实际联系。虽然这在很多情况下都有效,但它并不完全可靠,因此正确的方法是使用numeric.bbx中的代码提供的实际格式biblatex。所以这是正确的做法:

\documentclass{article}
\usepackage[citestyle=numeric,bibstyle=ext-authoryear,articlein=false]{biblatex}
\addbibresource{biblatex-examples.bib}

\defbibenvironment{bibliography}
  {\list
     {\printtext[labelnumberwidth]{%
        \printfield{labelprefix}%
        \printfield{labelnumber}}}
     {\setlength{\labelwidth}{\labelnumberwidth}%
      \setlength{\leftmargin}{\labelwidth}%
      \setlength{\labelsep}{\biblabelsep}%
      \addtolength{\leftmargin}{\labelsep}%
      \setlength{\itemsep}{\bibitemsep}%
      \setlength{\parsep}{\bibparsep}}%
      \renewcommand*{\makelabel}[1]{\hss##1}}
  {\endlist}
  {\item}
\DeclareFieldFormat[article]{pages}{#1}%
\DeclareFieldFormat{labelnumberwidth}{\mkbibbrackets{#1}}
\begin{document}
\cite{yoon,aksin}
\printbibliography
\end{document}

快速而肮脏的解决方案

对于适用于许多情况的快速而肮脏的解决方案,您可以使用这个问题用于参考书目的编号。

\documentclass{article}
\usepackage[citestyle=numeric,bibstyle=ext-authoryear,articlein=false]{biblatex}
\addbibresource{biblatex-examples.bib}
\usepackage{enumitem}
\defbibenvironment{bibliography}
{\enumerate[label={[\arabic*]}]}
{\endenumerate}
{\item}
\DeclareFieldFormat[article]{pages}{#1}%
\begin{document}
\cite{yoon,aksin}
\printbibliography
\end{document}

代码输出

答案2

在过去(我的意思是:在 biblatex 之前),您必须bst用纯 BAFLL(BibTeX 的匿名 Forth 类语言)编写您自己的(参考书目样式)文件,以便使用 BibTeX 处理您的参考书目,这很麻烦,因为......嗯,它是一个 FLL。

幸运的是,有一个很好的小包叫做定制围兜其中包括一个很好的小型 TeX 程序makebst,用于生成 TeX 批处理文件(dbj)以生成自定义bst文件以满足您的期望。

因此,基本上,你运行

tex makebst

在您的终端中,程序会引导您通过一个交互式界面,您可以在其中选择生成样式所需的选项。在流程结束时,程序会生成一个dbj文件,这是另一个 TeX 文件,您可以运行它来生成bst具有书目样式的最终文件。这样,如果您改变主意(或者发现您搞砸了),您可以编辑该dbj文件,注释掉/注释掉您选择的选项,然后bst通过运行生成另一个文件

tex yourstyle.dbj

您可能仍会对最终bst文件进行一些修改/拼凑;但同样,如果您不习惯,用纯 BAFLL 进行编程可能会非常痛苦。makebst很好地完成了您的任务,调整副产品是相对地简单的。

考虑到系统对答案的限制,并遵循 Alan Munn 在评论中的建议,我在这里发布了一个链接,以满足您的需求:批处理文件和生成的参考书目样式发布在 GitHub 上。

https://gist.github.com/jarnosz/931d6eb5ae1eef2c58407f8d3f9ec5ff

书目样式会尝试实现您的要求。

 %-------------------------------------------------------------------
 % This bibliography style file is intended for texts in ENGLISH
 % This is a numerical citation style, and as such is standard LaTeX.
 % It requires no extra package to interface to the main text.
 % The form of the \bibitem entries is
 %   \bibitem{key}...
 % Usage of \cite is as follows:
 %   \cite{key} ==>>          [#]
 %   \cite[chap. 2]{key} ==>> [#, chap. 2]
 % where # is a number determined by the ordering in the reference list.
 % The order in the reference list is alphabetical by authors.
 %---------------------------------------------------------------------

只要记住声明你的\bibliographystyle{plainad}:正如注释所说,既不apacite.sty需要任何其他宏接口;所以这个 bibstyle 甚至可以在 Plain TeX 中工作。

结果如下:

引文

比本特利

相关内容