TransWikia.com

BibLaTeX: Edition as superscript in front of year, but year after author(s)

TeX - LaTeX Asked by LajosH on May 18, 2021

There is a similar question (biblatex-verbose: edition as superscript in front of year) that has already an answer, but the solution doesn’t help me. I need a quite strange order in my bibliography:

@Book as: Last Name, First Name (EditionYear): Title. Place: Publisher.

@InBook as: Last Name, First Name (EditionYear): "Title." In: Book, First Name [Editior] Last Name [Editor] (Hrsg.) Place: Publisher, Pages.

I really hope there is a solution to this. If more Information is needed, please feel free to ask!

Edit: my preamble looks like this

documentclass[a4paper,12pt,numbers=endperiod]{scrartcl}
usepackage[utf8]{inputenc}
usepackage[T2A,T1]{fontenc}
usepackage[russian,ngerman]{babel}
usepackage{tipa}
usepackage{graphicx}
usepackage{setspace}
usepackage{caption}
usepackage[footskip=1cm]{geometry}
usepackage[footnote,printonlyused]{acronym}
usepackage{filecontents}
usepackage{lipsum}
usepackage{csquotes}
usepackage{CJKutf8}

usepackage[backend=biber,style=authoryear,sorting=nyt]{biblatex}
addbibresource{graphematik.bib}
DefineBibliographyStrings{ngerman}{references={Bibliographie}}

renewbibmacro*{byeditor+others}{%
  ifnameundef{editor}
    {}
    {printnames[byeditor]{editor}%
     setunit{addspace}%
     usebibmacro{byeditor+othersstrg}%
     clearname{editor}%
     newunit}%
  usebibmacro{byeditorx}%
  usebibmacro{bytranslator+others}}
usepackage{xpatch}
xpatchbibmacro{byeditor+othersstrg}{printtext}{printtext[parens]}{}{}

renewcommand*{multinamedelim}{/}
renewcommand*{finalnamedelim}{/}

setkomafont{disposition}{mdseriesrmfamily}
onehalfspacing
captionsetup[table]{skip=5pt,font=footnotesize}
deffootnote[1.0em]{1.0em}{1.0em}
{textsuperscript{thefootnotemark},enskip}
renewcommand{labelnamepunct}{addcolonspace}
renewcommand*{postnotedelim}{addcolonspace}
DeclareFieldFormat{postnote}{#1}
DeclareFieldFormat{multipostnote}{#1}
DeclareFieldFormat{edition}{ifinteger{#1}{textsuperscript{#1}}{#1isdotsetunit{addcommaspace}}}
renewcommand{baselinestretch}{1.5}

And all this gives me: (Problems in bf)

@Book: Altmann, Hans/Ute Ziegenhain (2010): Prüfungswissen Phonetik, Phonologie und Graphemik. Arbeitstechniken – Klausurfragen – Lösungen. 3. Göttingen: Vandenhoeck & Ruprecht.
–> the 3 should be in front of the 2010 (inside the brackets) (it is already in superscript)

@InBook: Bochmann, Klaus (1989): „Rumänisch: Sprachnormierung und Standardsprache“. In: Lexikon der romanistischen Linguistik. Band III. Die einzelnen romanischen Sprachen und Sprachgebiete von der Renaissance bis zur Gegenwart Rumänisch, Dalmatisch/Istroromanisch, Friaulisch, Ladinisch, Bündnerromanisch. Michael Metzeltin/Günter Holtus/Christian Schmitt (hrsg. von). Tübingen: Niemeyer**,** S. 239–251.
–> it should just say (Hrsg.), the last comma should be a colon and the "S." has to go

@Articel: Borgwaldt, Susanne R./Frauke**,** M. Hellwig/Annette**,** M. B. de Groot (2004): „Word-initial entropy in five languages. Letter to sound, and sound to letter“. In: Written Language & Literacy 7**,** S. 165–184.
–> like before the last comma has to be a colon and the "S." has to leave. also I’ve just noticed that the commas between the last name and the first name(s) for all authors apart from the first are missing, which is of course undesired.

I really hope this helps and is not too much of a mess!

One Answer

The authoryear styles use different macros to print the year, so we have to modify other macros

DeclareFieldFormat{superedition}{textsuperscript{#1}}

renewbibmacro*{date+extradate}{%
  iffieldundef{labelyear}
    {}
    {printtext[parens]{%
       iffieldnum{edition}
         {printfield[superedition]{edition}%
          globalclearfield{edition}}
         {}%
       iflabeldateisdate
         {printdateextra}
         {printlabeldateextra}}}}

should be enough. This prints the edition in superscript if it is a number. The code works with the standard mergedate=compact setting, for other mergedates this needs adapting.


The pages issue can be addressed with

renewcommand*{bibpagespunct}{addcolonspace}
DeclareFieldFormat{pages}{#1}

analogous to what you do with postnote.


The "Hrsg." string can be changed with

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}}}}}

You won't need the xpatch code then.


In the MWE I also used DeclareNameAlias{sortname}{family-given} per my comment above.

documentclass[a4paper,12pt,numbers=endperiod]{scrartcl}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage{csquotes}
usepackage[backend=biber,style=authoryear,sorting=nyt]{biblatex}

addbibresource{biblatex-examples.bib}

DefineBibliographyStrings{ngerman}{references={Bibliographie}}

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}}}}}

DeclareDelimFormat{multinamedelim}{/}
DeclareDelimAlias{finalnamedelim}{multinamedelim}

DeclareDelimFormat[bib,biblist]{nametitledelim}{addcolonspace}

renewcommand*{postnotedelim}{addcolonspace}
DeclareFieldFormat{postnote}{#1}
DeclareFieldFormat{multipostnote}{#1}

DeclareFieldFormat{superedition}{textsuperscript{#1}}

renewbibmacro*{date+extradate}{%
  iffieldundef{labelyear}
    {}
    {printtext[parens]{%
       iffieldnum{edition}
         {printfield[superedition]{edition}%
          globalclearfield{edition}}
         {}%
       iflabeldateisdate
         {printdateextra}
         {printlabeldateextra}}}}

renewcommand*{bibpagespunct}{addcolonspace}
DeclareFieldFormat{pages}{#1}

DeclareNameAlias{sortname}{family-given}


begin{document}
nocite{sigfridsson,companion,cotton,iliad,malinowski,
        gaonkar:in,westfahl:space,pines,brandt,hyman,kant:kpv}
printbibliography
end{document}

Correct answer by moewe on May 18, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP