我想将作者的两个年份放在一起作为内容引用。
我想:
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}