如何修改 apalike.bst 以按时间顺序对参考文献进行排序?

如何修改 apalike.bst 以按时间顺序对参考文献进行排序?

我想使用apalike.bst,因为这种顺序在简历中显示起来似乎更自然。我尝试遵循https://tex.stackexchange.com/a/33332/56546但没有成功(我真的不太懂.bst语法)。有没有人能帮我解决如何方便地破解apalike.bst这个任务?

PS. 我知道我可以通过biblatex包来执行此切换,但目前我想在没有包的情况下解决问题,因为我正在使用multibib

编辑:我想要的排序方式是:1) 按出版年份;2) 按作者姓氏的字母顺序。我不在乎 1) 中按月按年排序,但这样做没问题。

答案1

我修改了 的条目,并将(第一个)替换apalike.bst为,内容如下bib.sort.ordersort.labelyear field.or.null sortify

FUNCTION {bib.sort.order}
{ year field.or.null sortify
  "    "
  *
  sort.label
  *
  "    "
  *
  title field.or.null
  sort.format.title
  *
  #1 entry.max$ substring$
  'sort.key$ :=
}

因此,通过以下 MWE,

\documentclass{article}
\usepackage{filecontents}
\begin{filecontents}{junk.bib}
@ARTICLE{bake67,
        TITLE   = "Prediction and scaling of reflected impulse from
                        strong blast waves",
        AUTHOR  = "Baker, W. E.",
        JOURNAL = "International Journal of Mechanical Sciences",
        VOLUME  = "9",
        NUMBER  = "1",
        PAGES   = "45--51",
        YEAR    = "1967"                        }
@ARTICLE{Acme72,
        TITLE   = "Prediction and scaling of reflected impulse from
                        strong blast waves",
        AUTHOR  = "Acme, W. E.",
        JOURNAL = "International Journal of Mechanical Sciences",
        VOLUME  = "9",
        NUMBER  = "1",
        PAGES   = "45--51",
        YEAR    = "1972"                        }
@ARTICLE{cake71,
        TITLE   = "Prediction and scaling of reflected impulse from
                        strong blast waves",
        AUTHOR  = "Cake, W. E.",
        JOURNAL = "International Journal of Mechanical Sciences",
        VOLUME  = "9",
        NUMBER  = "1",
        PAGES   = "45--51",
        YEAR    = "1971"                        }
@ARTICLE{Delta71,
        TITLE   = "Prediction and scaling of reflected impulse from
                        strong blast waves",
        AUTHOR  = "Delta, W. E.",
        JOURNAL = "International Journal of Mechanical Sciences",
        VOLUME  = "9",
        NUMBER  = "1",
        PAGES   = "45--51",
        YEAR    = "1971"                        }
\end{filecontents}
\begin{document}
cite \cite{bake67, Acme72, cake71, Delta71}
\bibliographystyle{apalike}
\bibliography{junk}
\end{document}

我得到以下结果,按年份排序,并在一年内按姓氏排序:

在此处输入图片描述

apalike.bst如果你希望按相反的顺序(按时间顺序降序排列),那么文件末尾附近的行

ITERATE {call.type$}

必须改为

REVERSE {call.type$}

当然,这意味着,在给定的年份内,姓氏也将按相反的顺序排序(按字母顺序向后排序)。


使用原始定义时,

%                               Now that the label is right we sort for real,
%                               on sort.label then year then title.  This is
%                               for the second sorting pass.
FUNCTION {bib.sort.order}
{ sort.label
  "    "
  *
  year field.or.null sortify
  *
  "    "
  *
  title field.or.null
  sort.format.title
  *
  #1 entry.max$ substring$
  'sort.key$ :=
}

结果按姓氏排序为

在此处输入图片描述

相关内容