如何强制对两个 .bib 条目进行特定排序?

如何强制对两个 .bib 条目进行特定排序?

因此,我在论文中引用了两篇文章,以下是它们的 BibTeX 条目:

@incollection{ShapiroSI,
    Author = {Stewart Shapiro},
    Booktitle = {Identity and Modality},
    Date-Added = {2014-01-21 01:26:30 +0000},
    Date-Modified = {2014-01-21 01:27:50 +0000},
    Pages = {109 -- 145},
    Publisher = {Oxford University Press},
    Title = {Structure and Identity},
    Year = {2006}}

@incollection{ShapiroGI,
    Author = {Stewart Shapiro},
    Booktitle = {Identity and Modality},
    Date-Added = {2014-01-21 04:24:06 +0000},
    Date-Modified = {2014-01-21 04:24:54 +0000},
    Pages = {164 -- 173},
    Publisher = {Oxford University Press},
    Title = {The Governance of Identity},
    Year = {2006}}

现在,标题为“结构与身份”的文章实际上是按时间顺序排列的第一篇,而文章“治理与身份”是对一篇批评“结构与身份”的文章的回应。鉴于此,我希望“结构与身份”被列为 Shapiro 2006a(即排在“治理与身份”之前),即使它在字母顺序上排在“治理与身份”之后。

如何在不向打印的参考文献中添加额外信息的情况下实现此目的(例如,我不想指定出版月份;只要这些信息不会打印在我的参考文献部分中,显然可以在 .bib 条目中添加更多信息)?

编辑:这是一个完整的 MWE,(你可以找到phil_review.bst 这里

\begin{filecontents}{test.bib}

@incollection{ShapiroSI,
    Author = {Stewart Shapiro},
    Booktitle = {Identity and Modality},
    Date-Added = {2014-01-21 01:26:30 +0000},
    Date-Modified = {2014-01-21 01:27:50 +0000},
    Pages = {109 -- 145},
    Publisher = {Oxford University Press},
    Title = {Structure and Identity},
    Year = {2006}}

@incollection{ShapiroGI,
    Author = {Stewart Shapiro},
    Booktitle = {Identity and Modality},
    Date-Added = {2014-01-21 04:24:06 +0000},
    Date-Modified = {2014-01-21 04:24:54 +0000},
    Pages = {164 -- 173},
    Publisher = {Oxford University Press},
    Title = {The Governance of Identity},
    Year = {2006}}

\end{filecontents}


\documentclass{article}
\usepackage{natbib}
\setcitestyle{aysep={}}
\bibpunct{(}{)}{,}{a}{}{,}

\begin{document}

Some text \citep{ShapiroSI} and another citation \citep{ShapiroGI}


\bibliographystyle{phil_review}
\bibliography{test}
\end{document}

答案1

旧的 BibTeX 技巧在这里有效。我们使用

\newcommand{\noop}[1]{}

定义一个实际上不打印任何内容的命令。然后我们将其放在两个.bib条目的标题中,因为它们是我们想要消除歧义的点。没有打印任何内容,但 BibTeX 现在将按照您可以强制的顺序对这些条目进行排序。这是一个完整的示例,与您的示例略有不同。

\RequirePackage{filecontents}% <-- allows the filecontents to be re-written each run.
\begin{filecontents*}{test.bib}

@incollection{ShapiroSI,
    Author = {Stewart Shapiro},
    Booktitle = {Identity and Modality},
    Date-Added = {2014-01-21 01:26:30 +0000},
    Date-Modified = {2014-01-21 01:27:50 +0000},
    Pages = {109 -- 145},
    Publisher = {Oxford University Press},
    Title = {\noop{aaa}Structure and Identity},
    Year = {2006}}

@incollection{ShapiroGI,
    Author = {Stewart Shapiro},
    Booktitle = {Identity and Modality},
    Date-Added = {2014-01-21 04:24:06 +0000},
    Date-Modified = {2014-01-21 04:24:54 +0000},
    Pages = {164 -- 173},
    Publisher = {Oxford University Press},
    Title = {\noop{zzz}The Governance of Identity},
    Year = {2006}}

\end{filecontents*}


\documentclass{article}
\usepackage{natbib}
\setcitestyle{aysep={}}     % <-- note this is set twice; here 
\bibpunct{(}{)}{,}{a}{}{,}  %     and in this line.

\begin{document}

Some text \citep{ShapiroSI} and another citation \citep{ShapiroGI}

\bibliographystyle{phil_review}
\bibliography{test}
\end{document}

请注意,如果您希望将其保存\noop为随时可用,因为您可能希望将其用于多文档,那么@preambleBibTeX 命令就是您的好帮手。您可以将其添加到您的.bib文件中:

@preamble{ "\providecommand{\noop}[1]{}" }

相关内容