This is a follow up question to Customizing the biblatex style authoryear.
For my work I need 3 more types of literature altered:
@inbook:
Last Name, First Name (year): Title. In Last BookauthorName, First BookauthorName (Hg): Booktitle, Pages. Location, Publisher.
Here, "In" and "(Hg)" should be hardcoded (it's German). I managed to undo the italic style for the booktitle and the parentheses of the title by:
\DeclareFieldFormat[inbook]{booktitle}{#1}
\DeclareFieldFormat[inbook]{title}{#1}
but that's about it.
@article:
Last Name, First Name (year): Title. Journaltitle, Number (Series), Pages.
@online:
Last Name, First Name (year): Title, (besucht am Date). Url.
here, "besucht am" should be hardcoded but is no problem since it's biblatex standard in German.
I can imagine that all of this isn't quite straight forward.. But any help would be greatly appreciated! Thanks a lot!
What I have thus far:
\usepackage[style=authoryear]{biblatex}
\addbibresource{sources.bib}
\DeclareFieldFormat[book]{title}{#1} %titel non-italic
\DeclareFieldFormat[inbook]{booktitle}{#1} %booktitle non-italic
\DeclareFieldFormat[inbook]{title}{#1} %title without ""
\DeclareFieldFormat[article]{title}{#1} %title without ""
\DeclareFieldFormat[article]{journaltitle}{#1} %journaltitle non-italic
\DeclareFieldFormat[online]{title}{#1} %title non-italic
\renewbibmacro*{publisher+location+date}{%
\printlist{location}%
\setunit{\addcomma\space}%
\printlist{publisher}%
\setunit*{\addcomma\space}%
\usebibmacro{date}%
\newunit}
\renewcommand{\labelnamepunct}{\addcolon\space}
\begin{document}
\parencite{heybook}
\parencite{heyinbook}
\parencite{heyarticle}
\parencite{heyonline}
\printbibliography[heading=bibintoc]
\end{document}
My sources.bib file with examples looks the following:
@book{heybook,
author ={Simon Beck},
title ={Buchtitel},
publisher ={Verlag},
location ={Ort},
date ={2011} }
@inbook{heyinbook,
bookauthor={Simonbook Beckbook},
author ={Simoninbook Beckinbook},
booktitle ={Buchtitel},
title ={Kapiteltitel},
publisher ={Verlag},
location ={Ort},
pages ={123-124},
date ={2012} }
@article{heyarticle,
author ={Simonarticle Beckarticle},
title ={Artikeltitel},
journaltitle={Zeitschrift},
number ={12},
series ={Jahrgang},
pages ={123-124},
date ={2013} }
@online{heyonline,
author ={Simononline Beckonline},
title ={Onlinetitle},
url ={http://pes.ee.ethz.ch},
urldate ={2014-04-12},
date ={2014} }
Best Answer
Okay, look at your updated MWE:
This is rather much code. There may be better ways to do what you want, but it gives you a start. I've commented the code; in some parts it may not be the best, and you have to modify it to your needs. A few notes:
editor
(Herausgeber) instead ofbookauthor
.crossref={key}
. So you can seperate things better and don't have to write data again and again. For examplebooktitle
, this will be automaticall inherited if you put in atitle
-field from a book-entry and usecrossref
in your article.filecontent
.Output: