0

I'm trying to customize an apalike-german style in Biblatex. The apalike style from BibTex was fine, but because it wasn't possible to change some small things (et al. instead of u.a) I changed to Biblatex.

I improved the Biblatex style=authoryear a lot, but it has still some problems. The style=authoryear doesn't have an short-form documentation in a bracket before the bibliography on the left.

That is the bracket on the left with author-year, that I want: apalike-german

This are example references:

@misc{EuropaischeKommission.2011,
 author = {{Europ{\"a}ische Kommission}},
 year = {2011},
 title = {Was ist ein „Nanomaterial“? Europäische Kommission legt erstmals gemeinsame Definition vor},
 url = {https://ec.europa.eu/commission/presscorner/detail/de/IP_11_1202},
 urldate = {03/13/2021}
} 

@article{Siddique.2017,
 author = {Siddique, Abu Raihan Mohammad and Mahmud, Shohel and {van Heyst}, Bill},
 year = {2017},
 title = {A review of the state of the science on wearable thermoelectric power generators (TEGs) and their existing challenges},
 pages = {730--744},
 volume = {73},
 issn = {13640321},
 journal = {Renewable and Sustainable Energy Reviews},
 doi = {10.1016/j.rser.2017.01.177}
}

@article{Muller.2018,
 author = {M{\"u}ller, Eckhard and Stiewe, Christian and Ebling, Dirk},
 title = {Anwendungspotential thermoelektrischer Generatoren zur Abw{\"a}rmenutzung in station{\"a}ren Systemen},
 year = {2018},
 pages = {1--11},
 journal = {Gefahrstoffe-Reinhaltung der Luft}
}

That are the packages I'm using:

\usepackage{hyperref}
\usepackage[utf8]{inputenc} 
\usepackage[ngerman]{babel}
\usepackage[backend=biber, citestyle=authoryear-icomp, bibstyle=authoryear, sorting=nyt, hyperref=true, uniquename=false,
dashed=false, isbn=false, maxcitenames=2, maxbibnames=3, minnames=1 
]{biblatex} 
\addbibresource{bib/references.bib}
\DefineBibliographyStrings{ngerman}{andothers={et\addabbrvspace al\adddot},}
\makeatletter
   \patchcmd{\blx@citeprint}
           {\blx@loopcode}
           {\blx@imc@bibhyperlink{#1}{\blx@loopcode}}
           {}{}
\makeatother
\setlength\bibitemsep{\medskipamount} 
\renewcommand{\labelnamepunct}{\addcolon\addspace}
\DeclareFieldFormat*{title}{#1}
\DeclareFieldFormat{url}{{In:}\addspace\url{#1}}
\newcommand*{\bibmultinamedelim}{\addsemicolon\space}
\newcommand*{\bibfinalnamedelim}{\addsemicolon\space} 
\AtBeginBibliography{
  \let\multinamedelim\bibmultinamedelim
  \let\finalnamedelim\bibfinalnamedelim
  }
\renewcommand*{\labelnamepunct}{\addcolon\space} 
\DeclareNameAlias{sortname}{last-first}

\begin{document}
Lorem \autocite{EuropaischeKommission.2011} \autocite{Siddique.2017} \autocite{Muller.2018}

\printbibliography[heading=bibintoc, title={Literaturverzeichnis}]
\end{document}

How can I change the biblatex-bibstyle to an apalike-german-bibstyle?

11
  • 2
    Well regarding the urldate: biber is warning you: WARN - Entry 'EuropaischeKommission.2011' (test-apa.bib): Invalid format '3/13/2021' of date field 'urldate' - ignoring.. Dates must be given in iso-format. Aug 29, 2021 at 16:17
  • 2
    beside this: don't use the ngerman package, use \usepackage[ngerman]{babel}, conference is not a known field, and volume should be an integer. I also wouldn't mix the apa-bibstyle with another citestyle. Simply use style=apa if you want apa. Aug 29, 2021 at 16:27
  • Thanks. I don't want apa. I want an apalike style. Like the one bibtex had. The citestyle=apa has many problems, it uses for example & instead of und. With the citestyle=authoryear I'm satisfied, but the bibstyles apa and authoryear have many problems. So I thought maybe it's easier to customize the apa then the authoryear bibstyle.
    – Hanna
    Aug 29, 2021 at 16:35
  • @UlrikeFischer I changed the date to a JJJJ-MM-TT format. Thanks, it works now :)
    – Hanna
    Aug 29, 2021 at 17:27
  • 1
    I absolutely cannot recommend combining citestyle=authoryear, bibstyle=apa,. biblatex-apa is only intended to give you APA style (7th ed.) output. It can be tricky to modify and customise and it is not guaranteed that mixing and matching this style with other styles (as in citestyle=authoryear, bibstyle=apa, instead of style=apa,) works without error.
    – moewe
    Aug 30, 2021 at 6:32

1 Answer 1

4

The output shown in the screenshot with the citation label to the left of the entry in brackets comes from a misuse of the apalike bibliography style. That output is not the intended result. And indeed if you look round at bibliography and citation styles outside the LaTeX world very few (if any - I don't know any at the moment) author-year styles require that the citation label be repeated in the bibliography.

\bibliographystyle{apalike} should be used together with \usepackage{apalike} in the preamble. See the following note in apalike.bst

% This style should be used with the `apalike' LaTeX style (apalike.sty).
% \cite's come out like "(Jones, 1986)" in the text but there are no labels
% in the bibliography, and something like "(1986)" comes out immediately
% after the author.  Author (and editor) names appear as last name, comma,
% initials.  A `year' field is required for every entry, and so is either
% an author (or in some cases, an editor) field or a key field.

Hence,

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}

\begin{filecontents}{\jobname.bib}
@book{elk,
  author    = {Anne Elk},
  title     = {A Theory on Brontosauruses},
  year      = {1972},
  publisher = {Monthy \& Co.},
  location  = {London},
}
\end{filecontents}

\begin{document}
Lorem \cite{elk}

\bibliographystyle{apalike}
\bibliography{\jobname}
\end{document}

produces the incorrect

[Elk, 1972] Elk, A. (1972). A Theory on Brontosauruses. Monthy & Co.

output, whereas with \usepackage{apalike} in the preamble you would get the intended

Elk, A. (1972). A Theory on Brontosauruses. Monthy & Co.

natbib is largely backwards compatible with apalike (there are some edge cases with weird behaviour), so you can also get the correct output if you load \usepackage{natbib} instead. (Just don't load \usepackage{apalike} and \usepackage{natbib} together.)

Looking closer at the output in the screenshot you can see that the author-year info in the brackets is redundant. The author and year are clearly and prominently shown at the beginning of the entry in the bibliography anyway, so the author-year citation labels are easily matched to the entries in the bibliography even without the additional label.


If you insist on having the author-year citation label in the bibliography with biblatex, you can use biblatex-ext stylesDisclaimer: I'm the author and their introcite feature (see the biblatex-ext documentation, pp. 15-21 in v0.13).

The "Example customisations for introcite=plain" on p. 19 come pretty close to what you want, but you can shop around for other options as well.

Here is how that could look in your document. Note that I simplified your biblatex options

  • there is generally no need to choose separate bibstyle and citestyle: citestyle=authoryear-icomp, bibstyle=authoryear, is equivalent to style=authoryear-icomp (but we will use the biblatex-ext replacement anyway),
  • the authoryear styles will automatically select sorting=nyt, so there is no point in specifying it manually,
  • the setting hyperref=true, is usually no better than the default hyperref=auto,: Both options turn on links if and only if \usepackage{hyperref} is loaded. The only difference is that hyperref=true, will produce a warning if \usepackage{hyperref} is not loaded.

Some of your other code could be modernised as well: For context-sensitive delimiters like multinamedelim you should be using \DeclareDelimFormat. Then you can use the optional argument to change their behaviour only in the bibliography. No need for \AtBeginBibliography and \bibmultinamedelim. \labelnamepunct has been deprecated in favour of the context-sensitive nametitledelim. The name format last-first was renamed to family-given on v3.3 more than five years ago (Biblatex 3.3 name formatting).

(I only removed the \DeclareFieldFormat{url}{{Zugriffsdatum:}\addspace\url{#1}} line because I didn't understand its significance: clearly the \url is not the URL access date.)

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{csquotes}
\usepackage[
  backend=biber,
  style=ext-authoryear-icomp,
  uniquename=false,
  maxcitenames=2, maxbibnames=3, minnames=1,
  introcite=plain,
  dashed=false,
  isbn=false,
]{biblatex}

\usepackage{hyperref}

\setlength\bibitemsep{\medskipamount}

\DeclareFieldFormat{bbx@introcite}{\mkbibbrackets{#1}}
\DeclareDelimFormat[bbx@introcite]{nameyeardelim}{\addcomma\space}
\UndeclareInnerCiteDelims{bbx@introcite}
\renewcommand*{\introcitepunct}{\quad}

\DefineBibliographyStrings{ngerman}{andothers={et\addabbrvspace al\adddot},}

\DeclareNameAlias{sortname}{family-given}

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

\DeclareDelimFormat[bib]{nametitledelim}{\addcolon\space}

\DeclareFieldFormat*{title}{#1}

\addbibresource{biblatex-examples.bib}

\begin{document}
Lorem \autocite{sigfridsson}

\printbibliography
\end{document}

[Sigfridsson und Ryde, 1998] Sigfridsson, Emma; Ryde, Ulf (1998): Comparison of methods for deriving atomic charges from the electrostatic potential and moments. In: Journal of Computational Chemistry 19.4, S. 377–395. doi: 10.1002/(SICI)1096-987X(199803)19:4<377::AID-JCC1>3.0.CO;2-P.

5
  • Thanks a lot for this substantial answer. Thanks also for \usepackage[T1]{fontenc} instead of \usepackage[utf8]{inputenc}. The Zugriffsdatum was a confusion of mine, I changed it toIn:. Even if the combination of \usepackage{apalike} and \usepackage{natbib} was not the intended result, I Iiked it, it's very reader-friendly. I don't see it as an reptition, more as an indication.
    – Hanna
    Aug 31, 2021 at 19:01
  • Sadly DeclareDelimAlias[bib]{finalnamedelim}{multinamedelim} %missing} gives me the error: missing \begin{document}. ` \DeclareDelimFormat[bib]{multinamedelim}{\addsemicolon\space}` and DeclareDelimFormat[bib]{nametitledelim}{\addcolon\space} don’t change anything.
    – Hanna
    Aug 31, 2021 at 19:19
  • @Hanna You probably have an old system. Try updating or \DeclareDelimAlias*[bib]{finalnamedelim}{multinamedelim} instead.
    – moewe
    Aug 31, 2021 at 19:32
  • Thanks, that works! I work with Overleaf, shouldn't it be upgraded by itself? One more question: Is it possible, to remove the comma between name and year in the short-form documentation (German: Kurzbeleg) in the reference list, so that ist looks like the short-form documentation in the citations?
    – Hanna
    Aug 31, 2021 at 20:04
  • 1
    @Hanna Overleaf don't update their system as often, because they want to make sure their users have a stable experience. For the comma remove the \DeclareDelimFormat[bbx@introcite]{nameyeardelim}{\addcomma\space}.
    – moewe
    Aug 31, 2021 at 20:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .