虚线作者重复和 apalike

虚线作者重复和 apalike

我使用 bibtex、natbib(作者年份)和 apalike 样式。如果同一作者在一年内发表了两篇出版物,例如作者(1999a)和作者(1999b),那么是否可以选择在文档末尾的参考文献列表中用破折号替换作者?

最好的 F。

答案1

我们可以从中窃取虚线名称的代码IEEEtran.bst

“dahsed”功能的核心是函数

FUNCTION {name.or.dash}
{ 's :=
   oldname empty$
     { s 'oldname := s }
     { s oldname =
         { "---" }
         { s 'oldname := s }
       if$
     }
   if$
}

每次调用打印条目主名称的函数之后都需要添加对该函数的调用。

需要进行apalike.bst以下改变apalike-dashed.bst

--- apalike.bst 2010-12-10 10:19:51.000000000 +0100
+++ apalike-dashed.bst  2019-01-28 17:29:20.877333300 +0100
@@ -1,3 +1,9 @@
+%% apalike-dashed.bst
+%% https://tex.stackexchange.com/q/472240/35864
+%% 2019-01-28 MW
+%% modification of apalike.bst with dashed functionality from IEEEtran.bst
+%% original header follows
+%% --------------------------------------------------------------------------
 % BibTeX `apalike' bibliography style (version 0.99a, 8-Dec-10), adapted from
 % the `alpha' style, version 0.99a; for BibTeX version 0.99a.
 %
@@ -76,7 +82,7 @@
   #3 'after.block :=
 }

-STRINGS { s t }
+STRINGS { s t oldname }

 FUNCTION {output.nonnull}
 { 's :=
@@ -479,9 +485,22 @@
   " \cite{" * crossref * "}" *
 }

+FUNCTION {name.or.dash}
+{ 's :=
+   oldname empty$
+     { s 'oldname := s }
+     { s oldname =
+         { "---" }
+         { s 'oldname := s }
+       if$
+     }
+   if$
+}
+
 FUNCTION {article}
 { output.bibitem
   format.authors "author" output.check
+  name.or.dash
   author format.key output                              % special for
   output.year.check                                     % apalike
   new.block
@@ -504,9 +523,11 @@
 { output.bibitem
   author empty$
     { format.editors "author and editor" output.check
+      name.or.dash
       editor format.key output
     }
     { format.authors output.nonnull
+      name.or.dash
       crossref missing$
         { "author and editor" editor either.or.check }
         'skip$
@@ -537,6 +558,7 @@
 FUNCTION {booklet}
 { output.bibitem
   format.authors output
+  name.or.dash
   author format.key output                              % special for
   output.year.check                                     % apalike
   new.block
@@ -553,9 +575,11 @@
 { output.bibitem
   author empty$
     { format.editors "author and editor" output.check
+      name.or.dash
       editor format.key output
     }
     { format.authors output.nonnull
+      name.or.dash
       crossref missing$
         { "author and editor" editor either.or.check }
         'skip$
@@ -588,6 +612,7 @@
 FUNCTION {incollection}
 { output.bibitem
   format.authors "author" output.check
+  name.or.dash
   author format.key output                              % special for
   output.year.check                                     % apalike
   new.block
@@ -615,6 +640,7 @@
 FUNCTION {inproceedings}
 { output.bibitem
   format.authors "author" output.check
+  name.or.dash
   author format.key output                              % special for
   output.year.check                                     % apalike
   new.block
@@ -644,6 +670,7 @@
 FUNCTION {manual}
 { output.bibitem
   format.authors output
+  name.or.dash
   author format.key output                              % special for
   output.year.check                                     % apalike
   new.block
@@ -660,6 +687,7 @@
 FUNCTION {mastersthesis}
 { output.bibitem
   format.authors "author" output.check
+  name.or.dash
   author format.key output                              % special for
   output.year.check                                     % apalike
   new.block
@@ -676,6 +704,7 @@
 FUNCTION {misc}
 { output.bibitem
   format.authors output
+  name.or.dash
   author format.key output                              % special for
   output.year.check                                     % apalike
   new.block
@@ -690,6 +719,7 @@
 FUNCTION {phdthesis}
 { output.bibitem
   format.authors "author" output.check
+  name.or.dash
   author format.key output                              % special for
   output.year.check                                     % apalike
   new.block
@@ -706,6 +736,7 @@
 FUNCTION {proceedings}
 { output.bibitem
   format.editors output
+  name.or.dash
   editor format.key output                              % special for
   output.year.check                                     % apalike
   new.block
@@ -724,6 +755,7 @@
 FUNCTION {techreport}
 { output.bibitem
   format.authors "author" output.check
+  name.or.dash
   author format.key output                              % special for
   output.year.check                                     % apalike
   new.block
@@ -740,6 +772,7 @@
 FUNCTION {unpublished}
 { output.bibitem
   format.authors "author" output.check
+  name.or.dash
   author format.key output                              % special for
   output.year.check                                     % apalike
   new.block

您可以下载apalike-dashed.bst从下载https://gist.github.com/moewew/fe37f610e010abb45ac14f4f318393f3

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{natbib}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{appleby:a,
  author  = {Humphrey Appleby},
  title   = {On the Importance of the Civil Service I},
  year    = {1980},
  publisher = {Oxford University Press},
}
@book{appleby:b,
  author  = {Humphrey Appleby},
  title   = {On the Importance of the Civil Service II},
  year    = {1980},
  publisher = {Clarendon Press},
}
\end{filecontents}

\begin{document}
\cite{appleby:a,appleby:b}
\bibliographystyle{apalike-dashed}
\bibliography{\jobname}
\end{document}

Appleby, H. (1980a)。《论公务员的重要性》I。牛津大学出版社。//— (1980b)。《论公务员的重要性》II。克拉伦登出版社。


如果您只希望同一作者和同一年份使用破折号,则可以使用

FUNCTION {name.or.dash}
{ 's :=
   oldname empty$
     { s 'oldname :=
       year 'oldyear :=
       s }
     { s oldname =
       year oldyear =
       and
         { "---" }
         { s 'oldname :=
           year 'oldyear :=
           s }
       if$
     }
   if$
}

而不是上面的定义,你必须声明新的变量oldyear

STRINGS { s t oldname oldyear }

我从未见过只替换同一年份的作者的风格,所以我不建议这样做。

答案2

答案很简单,不是。官方的 APA 样式不使用该格式,因此符合 ( apacitebiblatex-apa) 或半符合 ( apalike) 的 APA 样式均不支持该格式。假设您使用是apalike因为您需要基本的作者年份样式,则可能需要切换到biblatex,其中选项[style=authoryear]默认实现此样式。样式之间会有细微的差异,但可以轻松修复。有关更多信息,请参阅:

相关内容