異なる記事で同じ著者を引用する (biblatex-aer)

異なる記事で同じ著者を引用する (biblatex-aer)

同じ著者の2つの論文を引用biblatexスタイルbiblatex-aerhttps://github.com/dmsul/biblatex-aer)。しかし、 を使用すると\textcite{key1,key2}、例えば

ガーリーとショー(1955)、1966

の代わりに

ガーリーとショー(1955、1966)

のコードを見てみるとbiblatex-aer、次のコード スニペットになります。

\renewbibmacro*{textcite}{%
  \ifboolexpr{
    ( not test {\iffieldundef{prenote}} and
      test {\ifnumequal{\value{citecount}}{1}} )
    or
    ( not test {\iffieldundef{postnote}} and
      test {\ifnumequal{\value{citecount}}{\value{citetotal}}} )
  }
    {\DeclareFieldAlias{textcitehyperref}{noformat}}
    {}%
  \printtext[textcitehyperref]{%
    \restorebibmacro{textcite}%
    \usebibmacro{textcite}}}

これらの行を削除すると、正しい引用が表示されますが、hyperref名前全体が色付けされなくなり、発行年のみが表示されます。

これを修正する方法を知っていますか?

答え1

使用されているコードhttps://github.com/dmsul/biblatex-aer/blob/master/biblatex-aer.tex引用の完全なリンクを取得するには、Audreyの回答から取得しましたbiblatex authoryear を使用したハイパーリンク名 (biblatex 1.4b)style=authoryear,この回答は を念頭に置いて書かれています(他のスタイルにも適用できます)が、のスタイルbiblatex-aerに基づいています。これは、より複雑な に似ています(さらに、自体もbiblatex-chicagoauthordatestyle=authoryear-comp,biblatex-chicagoとても複雑な)。

これは、リンクに対して異なる戦略が必要であることを意味します。次のバリエーションは、Audreyのコードからヒントを得たものです。biblatex authoryear を使用したハイパーリンク名 (biblatex 1.4b)そして私の答えによって引用の括弧の前半の色を変更するにはどうすればいいですか?

また、太字部分のコードも更新し、biblatex-aer.tex以下の前文を次のように完全に置き換えましたbiblatex-aer.texhttps://github.com/dmsul/biblatex-aer/blob/master/biblatex-aer.tex

\documentclass[american]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[authordate, backend=biber, uniquename=false, noibid]{biblatex-chicago}
\usepackage[colorlinks]{hyperref}

\makeatletter
\newrobustcmd{\blx@imc@transparentprinttext}[2][]{%
  \ifblank{#2}
    {}
    {\ifblank{#1}
       {\let\blx@theformat\@firstofone}
       {\blx@getformat\blx@theformat{ffd}{#1}{}}%
     \ifdefvoid\blx@theformat
       {}
       {\blx@theformat{#2}}}}

\newcommand*{\blx@imc@iffieldequalstr@swap}[2]{\iffieldequalstr{#2}{#1}}

\newcommand*{\blx@imc@iffieldequalsdefstring}[2]{%
  \expandafter\blx@imc@iffieldequalstr@swap\expandafter{#2}{#1}}

\blx@regimcs{\transparentprinttext \iffieldequalsdefstring}
\makeatother

\DeclareFieldFormat{citehyperref}{%
  \DeclareFieldAlias{bibhyperref}{noformat}%
  \bibhyperref{#1}}

\letbibmacro{orig:cite}{cite}

\renewbibmacro*{cite}{%
  \transparentprinttext[citehyperref]{%
    \usebibmacro{orig:cite}}}

\letbibmacro{orig:textcite}{textcite}
\letbibmacro{orig:textcite:postnote}{textcite:postnote}

\renewbibmacro*{textcite:postnote}{}

\renewbibmacro*{textcite}{%
  \transparentprinttext[citehyperref]{%
    \usebibmacro{orig:textcite}%
    \ifnumequal{\value{citecount}}{\value{citetotal}}
      {\usebibmacro{orig:textcite:postnote}}
      {}%
  }%
}

\newcommand\ifmknamebold{%
  \ifboolexpr{test {\ifcurrentname{labelname}}
              or
              test {\iffieldequalsdefstring{labelnamesource}{\currentname}}}}

\DeclareNameWrapperFormat{default}{\ifmknamebold{\mkbibbold{#1}}{#1}}
\DeclareNameWrapperFormat{labelname}{#1}


\addbibresource{biblatex-examples.bib}


\begin{document}
\textcite{knuth:ct:a,knuth:ct:b}

\cite{sigfridsson,gaonkar:in,westfahl:space,westfahl:frontier,companion}

\printbibliography
\end{document}

完全にリンクされた引用と参考文献の一部(太字のラベル名/ソート名付き)。

関連情報