1

I'm working with biblatex and need to fulfill the following requirements:

The citation should look like this:

  • when there is one author: <lastname1> <year>
  • when there are two authors: <lastname1> and <lastname2> <year>
  • when there are more than two authors: <lastname1> et al. <year>

The bibliography should look like this:

<lastname>, <f>; <lastname>, <f>; <lastname>, <f>; <year> : Title. … (f = initial letter of firstname)

Until now, I have customized the style authoryear as follows:

authoryear-ing.cbx:

\ProvidesFile{authoryear-ing.cbx}
\RequireCitationStyle{authoryear-comp}

\DefineBibliographyStrings{german}{%
andothers     = {et\,al\adddot}
}

\endinput

authoryear-ing.bbx:

\ProvidesFile{authoryear-ing.bbx}

\RequireBibliographyStyle{authoryear}

% Redefining the separator between author-names
\renewcommand*{\multinamedelim}{\addsemicolon\addspace}

% Redefining the separator between the last two author-names
\renewcommand*{\finalnamedelim}{\multinamedelim}


% Redefining the separator between author-names  / editor-names and year in bibliography(not working yet)
\renewbibmacro*{author}{%
  \ifboolexpr{
    test \ifuseauthor
    and
    not test {\ifnameundef{author}}
  }
    {\usebibmacro{bbx:dashcheck}
       {\bibnamedash}
       {\usebibmacro{bbx:savehash}%
        \printnames{author}%
        \iffieldundef{authortype}
          {\setunit{\addsemicolon\space}}
          {\setunit{\addsemicolon\space}}}%
     \iffieldundef{authortype}
       {}
       {\usebibmacro{authorstrg}%
        \setunit{\addsemicolon\space}}}%
     {\global\undef\bbx@lasthash
     \usebibmacro{labeltitle}%
     \setunit*{\addsemicolon\space}}%
     \usebibmacro{date+extrayear}}

\renewbibmacro*{editor}{%
  \usebibmacro{bbx:editor}{editorstrg}}
\renewbibmacro*{editor+others}{%
  \usebibmacro{bbx:editor}{editor+othersstrg}}
\newbibmacro*{bbx:editor}[1]{%
  \ifboolexpr{
    test \ifuseeditor
    and
    not test {\ifnameundef{editor}}
  }
    {\usebibmacro{bbx:dashcheck}
       {\bibnamedash}
       {\printnames{editor}%
        \setunit{\addsemicolon\space}%
        \usebibmacro{bbx:savehash}}%
     \usebibmacro{#1}%
     \clearname{editor}%
     \setunit{\addsemicolon\space}}%
    {\global\undef\bbx@lasthash
     \usebibmacro{labeltitle}%
     \setunit*{\addsemicolon\space}}%
  \usebibmacro{date+extrayear}}

\renewbibmacro*{translator}{%
  \usebibmacro{bbx:translator}{translatorstrg}}
\renewbibmacro*{translator+others}{%
  \usebibmacro{bbx:translator}{translator+othersstrg}}
\newbibmacro*{bbx:translator}[1]{%
  \ifboolexpr{
    test \ifusetranslator
    and
    not test {\ifnameundef{translator}}
  }
    {\usebibmacro{bbx:dashcheck}
       {\bibnamedash}
       {\printnames{translator}%
        \setunit{\addsemicolon\space}%
        \usebibmacro{bbx:savehash}}%
     \usebibmacro{translator+othersstrg}%
     \clearname{translator}%
     \setunit{\addsemicolon\space}}%
    {\global\undef\bbx@lasthash
     \usebibmacro{labeltitle}%
     \setunit*{\addsemicolon\space}}%
  \usebibmacro{date+extrayear}}


% firstname is displayed after the lastname
\DeclareNameAlias{sortname}{last-first}

% no parenthesis
\renewbibmacro*{date+extrayear}{%
  \iffieldundef{\thefield{datelabelsource}year}
    {}
    {\iffieldsequal{year}{\thefield{datelabelsource}year}
      {\printdateextralabel}%
      {\printfield{labelyear}%
       \printfield{extrayear}}}}%

\endinput

My document looks like this:

 \documentclass[a4paper, ngerman, bibliography=totocnumbered, listof=numbered, 12pt]{scrartcl}

%% Codierung
\usepackage[ngerman]{babel}
\usepackage[latin9]{inputenc}

%% Biblatex
\usepackage[
backend = biber, 
sorting = nyt, 
citestyle = authoryear-ing, 
bibstyle = authoryear-ing,
maxcitenames = 2,
mincitenames = 1, 
maxbibnames = 100,
minbibnames = 100,
firstinits = true,
abbreviate = true
]{biblatex}

\begin{filecontents}{mwe.bib}
@book{buch1,
    Author = {Vornameeins Nachnahmeeins and Vornamezwei Nachnahmezwei},
    Title = {Title},
    Year = {2010}}

@book{buch2,
    Author = {Vornameeins Nachnahmeeins},
    Title = {Title},
    Year = {2015}}

@book{buch3,
    Author = {Vornameeins Nachnahmeeins and Vornamezwei Nachnahmezwei and Vornamedrei Nachnahmedrei},
    Title = {Title},
    Year = {2010}}
\end{filecontents}

\addbibresource{mwe.bib}

\begin{document}

\cite{buch1}\\
\cite{buch2}\\
\cite{buch3}

\printbibliography

\end{document}

The result is the following:

enter image description here

It seems like the citestyle and the bibstyle are influencing each other. Is there a way to fulfill the requirements I mentioned above? What am I doing wrong?

  • What version of biblatex are you using? (Add \listfiles to the beginning to your .tex file and check the list at the end of the .log file.) – moewe Mar 18 at 12:27
  • I'm asking about your biblatex version because your code seems to be for an older version (firstinits was renamed to giveninits in version 3.3 released a bit more than three years ago now, 2016-03-01) and some of the things you want to do are much easier with features and functions introduced in newer biblatex versions. In particular multinamedelim and finalnamdelim can be controlled context-dependently now and the separators between author, year and title can also be changed much easier in newer versions. – moewe Mar 18 at 12:46
1

In newer versions of biblatex there are many new functions and features that make your life much easier. Amongst other things multinamedelim and finaldnamedelim are now context sensitive which makes it easier to have different definitions for citations and the bibliography. Furthermore nametitledelim and nameyeardelim can help you get the colon after the year and the closing semicolon in the bibliography, respectively.

I have based my suggestion on ext-authoryear-comp (from my biblatex-ext bundle) because that allowed for a simpler way of getting rid of the parentheses around the year in the bibliography (cf. How to (properly) remove the parentheses around the year in authoryear style? (v3)).

I have moved the load-time options to the relevant .bbx and .cbx files and have also added the uniquelist and uniquename options because I think you would want them to be different from the default. See for example Set limit to one author when using "et al." in biblatex, Literature with Biber generates strange citations: firstnames appear erratically and the biblatex documentation about the two options.

In the MWE I used filecontents to produce the .bbx and .cbx files as well. Warning: Since the filecontents package is loaded authoryear-ing.bbx and authoryear-ing.cbx as well as the .bib file will be overwritten without prior notice or interaction. Test this MWE in a new and empty folder to avoid losing your precious work.

\documentclass[a4paper, ngerman, bibliography=totocnumbered, 12pt]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage{filecontents}
\begin{filecontents}{authoryear-ing.bbx}
\ProvidesFile{authoryear-ing.bbx}

\RequireBibliographyStyle{ext-authoryear-comp}

\ExecuteBibliographyOptions{
  maxbibnames = 100,
  minbibnames = 100,
  giveninits = true,
  abbreviate = true,
}

\DeclareNameAlias{sortname}{family-given}

\DeclareDelimFormat[bib]{multinamedelim}{\addsemicolon\space}
\DeclareDelimAlias*[bib]{finalnamedelim}{multinamedelim}

\DeclareDelimAlias*[bib]{nameyeardelim}{multinamedelim}
\DeclareDelimFormat[bib]{nametitledelim}{\addcolon\space}

\DeclareFieldFormat{biblabeldate}{#1}


\endinput
\end{filecontents}

\begin{filecontents}{authoryear-ing.cbx}
\ProvidesFile{authoryear-ing.cbx}

\RequireCitationStyle{ext-authoryear-comp}

\ExecuteBibliographyOptions{
  maxcitenames = 2,
  mincitenames = 1,
  uniquelist   = false,
  uniquename   = init,
}

\DefineBibliographyStrings{german}{%
  andothers     = {et\,al\adddot}
}

\endinput
\end{filecontents}

\usepackage[
  backend = biber, 
  style = authoryear-ing, 
]{biblatex}

\begin{filecontents}{\jobname.bib}
@book{buch1,
  author = {Vornameeins Nachnahmeeins and Vornamezwei Nachnahmezwei},
  title  = {Title},
  year   = {2010},
}
@book{buch2,
  author = {Vornameeins Nachnahmeeins},
  title  = {Title},
  year   = {2015},
}
@book{buch3,
  author = {Vornameeins Nachnahmeeins and Vornamezwei Nachnahmezwei
            and Vornamedrei Nachnahmedrei},
  title  = {Title},
  year   = {2010},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}
\cite{buch1}

\cite{buch2}

\cite{buch3}

\printbibliography
\end{document}

"Nachnahmeeins und Nachnahmezwei 2010//Nachnahmeeins 2015//Nachnahmeeins et al. 2010" in the citations. "Nachnahmeeins, V.; 2015: Title.//Nachnahmeeins, V.; Nachnahmezwei, V.; 2010: Title.//Nachnahmeeins, V.; Nachnahmezwei, V.; Nachnahmedrei, V.; 2010: Title." in the bibliography.

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.