为什么在引用时要加倍((Smith, 1998);(Berrnet, 2001))

为什么在引用时要加倍((Smith, 1998);(Berrnet, 2001))

当我尝试使用 MWE 上给出的答案时,我感到很困惑,之前是可以的。不知道为什么现在不行了。

我正在使用答案在此处输入链接描述

在此处输入图片描述 \RequirePackage{文件内容} \begin{文件内容}{\作业名称.bib}

@article{journal1,
  title={journal123},
  author={McIntosh, Gerald C and Brown, Susan H and Rice, Ruth R and Thaut, Michael H},
  journal={Journal of Neurology, Neurosurgery \& Psychiatry},
  volume={62},
  number={1},
  pages={22--26},
  year={1997},
}

@article{journal2,
  title={journal123456},
  author={Abc, Def, GhI},
  journal={Journal of Neurology, Neurosurgery \& Psychiatry},
  volume={62},
  number={1},
  pages={22--26},
  year={1997},
}


\end{filecontents}


\documentclass[british]{article}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}

\usepackage{csquotes}
\usepackage[%
  style=authoryear, 
  backend=biber, 
  maxcitenames=2,
  giveninits
]{biblatex}
\addbibresource{\jobname.bib} % \jobname to use the bib file created with filecontents

\DeclareNameAlias{sortname}{family-given}
\DeclareDelimFormat{nameyeardelim}{\addcomma\space}

\usepackage[unicode,colorlinks,citecolor=blue]{hyperref}
\renewcommand*{\nameyeardelim}{\addcomma\space}

\newcommand{\mycite}[1]{\citeauthor{#1}'s \citeyear{#1}}

\DeclareCiteCommand{\citeauthor}
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{prenote}}
  {\ifciteindex
     {\indexnames{labelname}}
     {}%
   \printtext[bibhyperref]{\printnames{labelname}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareCiteCommand{\citeyear} % <======================================
    {}
    {(\bibhyperref{\printdate})}
    {\multicitedelim}
    {}

\DeclareCiteCommand{\parencite}[\mkbibparens]
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \printtext[bibhyperref]{(\usebibmacro{cite}})}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\makeatletter
\let\abx@macro@textciteOrig\abx@macro@textcite
\renewbibmacro{textcite}{% <============================================
   \bibhyperref{%
   \let\bibhyperref\relax\relax%
   \abx@macro@textciteOrig%
   }%
}%
\makeatother


\begin{document}

The table these definition \parencite{journal1, journal2}

\printbibliography
\end{document}

答案1

我不确定我是否可以发布我的答案。我发现了我的错误:

\DeclareCiteCommand{\parencite}[\mkbibparens]
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \printtext[bibhyperref]{\usebibmacro{cite}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

在下面:

 \printtext[bibhyperref]{\usebibmacro{cite}}}

原文是

   \printtext[bibhyperref]{(\usebibmacro{cite}})}

相关内容