![引用中作者前的上标版本](https://linux22.com/image/384198/%E5%BC%95%E7%94%A8%E4%B8%AD%E4%BD%9C%E8%80%85%E5%89%8D%E7%9A%84%E4%B8%8A%E6%A0%87%E7%89%88%E6%9C%AC.png)
又是我。我的导师看了我的论文初稿,总体上非常满意,但她指出,她希望在每个引文中看到作者前面的上标是作品的版本(@book 或 @collection),如下所示:
“非常聪明的引言。”(Dürscheid ⁵2016:13)
先感谢您!
\documentclass[paper=a4,12pt,numbers=endperiod]{scrartcl}
\usepackage[backend=biber,style=authoryear]{biblatex}
\addbibresource{TransAlph.bib}
\DefineBibliographyStrings{english}{references={Bibliography}}
\DeclareFieldFormat{editortype}{\mkbibparens{#1}}
\renewbibmacro*{byeditor+others}{%
\ifnameundef{editor}
{}
{\printnames[byeditor]{editor}%
\setunit{\addspace}%
\usebibmacro{byeditor+othersstrg}%
\clearname{editor}%
\newunit}%
\usebibmacro{byeditorx}%
\usebibmacro{bytranslator+others}}
\renewbibmacro*{byeditor+othersstrg}{\usebibmacro{editor+othersstrg}}
\renewbibmacro*{bytranslator+othersstrg}{\usebibmacro{translator+othersstrg}}
\renewbibmacro*{bytypestrg}[2]{%
\iffieldundef{#1type}
{\bibstring{#2}}
{\ifbibxstring{\thefield{#1type}}
{\bibstring{\thefield{#1type}}}
{\printtext{\thefield{#1type}}}}}
\renewcommand*{\multinamedelim}{/}
\renewcommand*{\finalnamedelim}{\multinamedelim}
\renewcommand*{\labelnamepunct}{\addcolon\space}
\renewcommand*{\postnotedelim}{\addcolon\space}
\DeclareFieldFormat{postnote}{#1}
\DeclareFieldFormat{multipostnote}{#1}
\DeclareFieldFormat{superedition}{\textsuperscript{#1}}
\providecommand*{\iflabeldateisdate}{%
\ifboolexpr{%
not test {\iffieldundef{labeldatesource}}
and
(test {\iffieldequalstr{labeldatesource}{}}
or test {\iffieldequalstr{labeldatesource}{year}})}}
\renewbibmacro*{date+extrayear}{%
\iffieldundef{labelyear}
{}
{\usebibmacro{origdate}%
\setunit*{\addspace}%
\printtext[parens]{%
\iflabeldateisdate
{\iffieldnum{edition}
{\printfield[superedition]{edition}%
\global\clearfield{edition}}
{}%
\printdateextra}
{\printlabeldateextra}}}}
\newbibmacro*{origdate}{%
\iffieldundef{origyear}
{}
{\printtext[brackets]{\printorigdate}}}
\renewcommand*{\bibpagespunct}{\addcolon\space}
\DeclareFieldFormat{pages}{#1}
\DeclareNameAlias{sortname}{family-given}
\DeclareFieldFormat[article,periodical]{number}{\mkbibparens{#1}}
\renewbibmacro*{volume+number+eid}{%
\printfield{volume}%
%\setunit*{\adddot}%<- comment this
\printfield{number}%
\setunit{\addcomma\space}%
\printfield{eid}}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@Book{durscheid2016a,
Title = {Einführung in die Schriftlinguistik \textup{(UTB\,3740)}},
Author = {Dürscheid, Christa},
Keywords = {sek},
Location = {Göttingen},
Publisher = {Andenhoeck \& Ruprecht},
Year = {2016},
Edition = {5},
Origyear = {2002} }
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
Another example sentence \parencite[][16]{durscheid2016a}.
\printbibliography
\end{document}
答案1
我们只需要告诉引用宏复制参考书目所做的操作
\renewbibmacro*{cite:labeldate+extradate}{%
\iffieldundef{labelyear}
{}
{\printtext[bibhyperref]{%
\ifboolexpr{test {\iffieldnum{edition}}
and test {\iflabeldateisdate}}
{\printfield[superedition]{edition}}
{}%
\printlabeldateextra}}}
如果你仍在使用过时的 3.8 之前的版本biblatex
(我认为你曾经使用过 3.6,请参阅下面的讨论引用两位作者/期刊:期刊(编号)),替换cite:labeldate+extradate
为cite:labelyear+extrayear
,参见https://github.com/plk/biblatex/wiki/Name-Changes。