如何将两个参考文献放在一起示例根据......(Smith,1998;Bennet,2001)

如何将两个参考文献放在一起示例根据......(Smith,1998;Bennet,2001)

我想做这个:

According....(Smith, 1998; Bennet, 2001).

但我最终还是:

According to the table these definition \textcite{journal1}; \textcite{journal2}

在此处输入图片描述

完整的 MWE:

\RequirePackage{filecontents}
\begin{filecontents}{\jobname.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}

\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} % <=====================================
  {\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 \textcite{journal1}; \textcite{journal2}

\printbibliography
\end{document}

答案1

通常正确的方法是将所有引用放入单个命令的同一参数中

\parencite{sigfridsson,geer}

或多引用

\parencites[380]{sigfridsson}[23-25]{geer}

如果您需要所有条目的明确前注或后注。

\parencite但是,如果在 MWE 中重新定义 ,输出结果将低于标准。MWE 中的 重新定义还有另一个问题:尝试\parencite[see][380]{sigfridsson}。括号直接硬编码到宏中,\parencite当涉及多个引用或前后注时,它们无法覆盖 的整个输出。

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

我可以提供以下重新定义,\parencite通过将括号命令移到 cite 命令的预代码中来产生可用的输出,但这不会链接外括号。

\documentclass[british]{article}

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

\usepackage{csquotes}
\usepackage[%
  style=authoryear, 
  backend=biber, 
  maxcitenames=2,
  giveninits,
]{biblatex}

\usepackage[unicode,colorlinks,citecolor=blue]{hyperref}

\DeclareNameAlias{sortname}{family-given}
\DeclareDelimFormat{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

\addbibresource{biblatex-examples.bib}
\begin{document}
The table these definition \parencite{sigfridsson,geer}

The table these definition \parencites[380]{sigfridsson}[23-25]{geer}

\printbibliography
\end{document}

表格这些定义(Sigfridsson and Ryde,1998;Geer,1985)//表格这些定义(Sigfridsson and Ryde,1998,第 380 页;Geer,1985,第 23-25 页)

答案2

我曾经natbib给你找过有用的东西

\RequirePackage{filecontents}
\begin{filecontents}{\jobname.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{natbib}

\begin{document}

Blah \citep{journal1, journal2}

\bibliography{\jobname.bib}
\bibliographystyle{chicago}
\end{document}

相关内容