Biblatex:文本的作者年份 参考书目的作者标题

Biblatex:文本的作者年份 参考书目的作者标题

我正处于不幸的境地,不得不引用标题中描述的情况。

只要不存在两个具有相同作者和相同年份的不同书目条目,那就没有问题。在这种情况下,我在文本中得到的条目类似于(Author 2012a)和,(Author 2012b)但在参考文献中应该附加一个条目,其形式应类似于(cited as: 2012a)

我不擅长重新定义 biblatex 中的内容来处理这个问题。理想情况下,需要以下解决方案:

If there are multiple citations of the same author and year, then append "(cited as: <year><year_label>)", if not, do whatever you would normally do.

目前这是我的最小工作示例:

\documentclass{article}
\usepackage[maxcitenames=3,style=authortitle,citestyle=authoryear,dashed=false,backend=biber]{biblatex}
\DeclareNameAlias{sortname}{last-first}
\newbibmacro*{publisher+location+date}{%
      \printlist{publisher}%
      \iflistundef{location}
        {\setunit*{\addcomma\space}}
        {\setunit*{\addcolon\space}}%
      \printlist{location}%
      \setunit*{\space}%
      \usebibmacro{date}%
      \newunit
    }

\begin{filecontents}{\jobname.bib}
  @article{JoeDoe2012,
    Author = {Joe Doe},
    Title = {My article's title},
    Journal = {My journal's title},
    Editor = {Ben Editor},
    URL = {http://webpage.com},
    Year = {2012},
  }

  @article{JoeDoe20121,
    Author = {Joe Doe},
    Title = {Same author same year},
    Journal = {My journal's title},
    Editor = {Ben Editor},
    URL = {http://webpage.com},
    Year = {2012},
  }
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}
  We cite \autocite{JoeDoe2012} and \autocite{JoeDoe20121}
  \printbibliography
\end{document}

目前看起来像这样:

在此处输入图片描述

尽管我被迫这样做:

在此处输入图片描述

addendum = {(cited as: 2012a)}(在屏幕截图中,我通过手动插入“ )”解决了该问题

我希望有人能按照我描述的条件方式帮助我实现这一点。

答案1

重命名 de bibmacro{finentry}。部分 'a' 是 intoextrayear字段和2012intolabelyear字段。然后添加一个逻辑,如果extrayear未定义则不打印任何内容。另一方面,如果它已定义,则打印括号之间的labelyear和字段。entrayear

梅威瑟:

\documentclass{article}
\usepackage[maxcitenames=3,style=authortitle,citestyle=authoryear,dashed=false,backend=biber]{biblatex}
\DeclareNameAlias{sortname}{last-first}
\newbibmacro*{publisher+location+date}{%
      \printlist{publisher}%
      \iflistundef{location}
        {\setunit*{\addcomma\space}}
        {\setunit*{\addcolon\space}}%
      \printlist{location}%
      \setunit*{\space}%
      \usebibmacro{date}%
      \newunit
    }

\renewbibmacro{finentry}{%
\usebibmacro{citeas}%
\finentry}

\newbibmacro*{citeas}{%
\iffieldundef{extrayear}
  {}
  {\setunit{\adddot\space}
  \newunit\newblock
  \printtext[citeas]{%
  \printfield{labelyear}%
  \printfield{extrayear}}}}

\DeclareFieldFormat{citeas}{\mkbibparens{Cite as:\space#1}}

\begin{filecontents}{\jobname.bib}
  @article{JoeDoe2012,
    Author = {Joe Doe},
    Title = {My article's title},
    Journal = {My journal's title},
    Editor = {Ben Editor},
    URL = {http://webpage.com},
    Year = {2012},
  }

  @article{JoeDoe20121,
    Author = {Joe Doe},
    Title = {Same author same year},
    Journal = {My journal's title},
    Editor = {Ben Editor},
    URL = {http://webpage.com},
    Year = {2012},
  }

    @article{Moe2013,
      Author = {Moe Doe},
      Title = {Other author},
      Journal = {My journal's title},
      Editor = {Ben Editor},
      URL = {http://webpage.com},
      Year = {2010},
    }
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}
  We cite \parencite{JoeDoe2012} and \parencite{JoeDoe20121}.

  Other author \parencite{Moe2013}
  \printbibliography
\end{document}

在此处输入图片描述

相关内容