这个问题与Biblatex-nature \textcite 带上标参考编号,展示如何让 \textcite 使用上标数字。
但当我引用同一作者的多篇参考文献时,它不起作用。
这是一个 MWE(结果类似于作者1 -3)
\documentclass{report}
\usepackage[citestyle=numeric-comp]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{ABib.bib}
@article {a1,
AUTHOR = {Author},
TITLE = {A sample paper},
JOURNAL = {Sample journal},
VOLUME = {1},
YEAR = {2013},
NUMBER = {1},
PAGES = {1--2}}
@misc{a2,
AUTHOR = {Author},
TITLE = {A sample paper},
YEAR = {2013}}
@misc{a3,
AUTHOR = {Author},
TITLE = {A sample paper},
YEAR = {2013}}
\end{filecontents}
\addbibresource{ABib.bib}
%%%%%%%%
\makeatletter
\renewbibmacro*{textcite}{%
\iffieldequals{namehash}{\cbx@lasthash}
{\usebibmacro{cite:comp}}
{\usebibmacro{cite:dump}%
\ifbool{cbx:parens}
{\bibclosebracket\global\boolfalse{cbx:parens}}
{}%
\iffirstcitekey
{}
{\textcitedelim}%
\usebibmacro{cite:init}%
\ifnameundef{labelname}
{\printfield[citetitle]{labeltitle}}
{\printnames{labelname}}%
\addspace
\ifnumequal{\value{citecount}}{1}
{\usebibmacro{prenote}}
{}%
\mkbibsuperscript{\usebibmacro{cite:comp}}%
\stepcounter{textcitecount}%
\savefield{namehash}{\cbx@lasthash}}}
\makeatother
\begin{document}
\textcite{a1,a2,a3}
\end{document}
ps 原始问题是很久以前提出的,而且我太新了,没有足够的声誉在那里发表评论,所以我在这里提出这个新问题。