1

it's me again. My advisor looked through my first drafts for my thesis and was overall very pleased but pointed out that she wants to see the edition of a work (@book or @collection) in superscript before the author in every citation like this:

"Very smart quote." (Dürscheid ⁵2016: 13)

Thank you in advance!

\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}
  • What do you do for @incollection or @inbook entries? Do they still get the edition superscript even though, strictly speaking, it refers to their booktitle and not title. – moewe Oct 14 '18 at 4:04
  • Just in case you really use that entry in your document, please double check the publisher field. The publisher in Göttingen is called Vandenhoeck \& Ruprecht with a V. – moewe Oct 14 '18 at 6:38
3

We just need to tell the citation macros to copy what the bibliography does

\renewbibmacro*{cite:labeldate+extradate}{%
  \iffieldundef{labelyear}
    {}
    {\printtext[bibhyperref]{%
       \ifboolexpr{test {\iffieldnum{edition}}
                   and test {\iflabeldateisdate}}
         {\printfield[superedition]{edition}}
         {}%
       \printlabeldateextra}}}

If you are still using an outdated pre-3.8 version of biblatex (I think you used to use 3.6, cf. the discussion below the answer in Citing two authors/Journals: Issue(Number)), replace cite:labeldate+extradate with cite:labelyear+extrayear, see https://github.com/plk/biblatex/wiki/Name-Changes.

"Another example sentence (Dürscheid <sup>5</sup>2016: 16)." The 5 appears in superscript position directly before the year.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.