![如何将两个年份放在一起引用。例如 Smith (1992 & 1993)?](https://linux22.com/image/478543/%E5%A6%82%E4%BD%95%E5%B0%86%E4%B8%A4%E4%B8%AA%E5%B9%B4%E4%BB%BD%E6%94%BE%E5%9C%A8%E4%B8%80%E8%B5%B7%E5%BC%95%E7%94%A8%E3%80%82%E4%BE%8B%E5%A6%82%20Smith%20(1992%20%26%201993)%EF%BC%9F.png)
我想将作者的两个年份放在一起作为内容引用。
我想:
Smith (1992 & 1993)
但是:我用过:
ABC studies is done by \textcite{journal1} and \textcite{journal2}.
\RequirePackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{journal1,
title={title ABC},
author={Smith, Bether},
journal={Behavior Research Methods, Instruments, \& Computers},
volume={24},
number={2},
pages={258--264},
year={1992},
publisher={Springer}
}
@article{journal2,
title={title CBD},
author={Smith, Bether},
journal={Behavior Research Methods, Instruments, \& Computers},
volume={25},
number={2},
pages={242--249},
year={1993},
publisher={Springer}
}
@article{journal2,
title={journal123456},
author={Abc, Def, GhI},
journal={Journal of Neurology, Neurosurgery \& Psychiatry},
volume={62},
number={1},
pages={22--26},
year={1999},
}
\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]
\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}
ABC studies is done by \textcite{journal1} and \textcite{journal2}.
\printbibliography
\end{document}
答案1
使用\textcite{journal1,journal2}
and authoryear-comp
。这几乎可以满足您的要求,只需\renewcommand{\compcitedelim}{\space\&\space}
将逗号替换为 &
\RequirePackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{journal1,
title={title ABC},
author={Smith, Bether},
journal={Behavior Research Methods, Instruments, \& Computers},
volume={24},
number={2},
pages={258--264},
year={1992},
publisher={Springer}
}
@article{journal2,
title={title CBD},
author={Smith, Bether},
journal={Behavior Research Methods, Instruments, \& Computers},
volume={25},
number={2},
pages={242--249},
year={1993},
publisher={Springer}
}
@article{journal2,
title={journal123456},
author={Abc, Def, GhI},
journal={Journal of Neurology, Neurosurgery \& Psychiatry},
volume={62},
number={1},
pages={22--26},
year={1999},
}
\end{filecontents}
\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[%
style=authoryear-comp,
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}
\renewcommand{\compcitedelim}{\space\&\space}
\begin{document}
ABC studies is done by \textcite{journal1,journal2}.
\printbibliography
\end{document}