I previously asked a question about adjusting the style of natbib
1, but gave up an switched to biblatex
.
I am working on my bachelor's thesis and need help adapting the bibliography and citation style to match my schools requirements. Below is what I've got so far:
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[norsk]{babel}
\usepackage[style=authoryear-comp,firstinits=true,backend=biber,maxcitenames=3,citetracker=true,maxbibnames=99,dashed=false]{biblatex}
\DeclareNameAlias{sortname}{last-first}
\renewcommand*{\nameyeardelim}{\addcomma\space}
\addbibresource{bachelor.bib}
\usepackage{breakurl}
%from https://tex.stackexchange.com/questions/48846/biblatex-et-al-beginning-from-second-citation
\usepackage{xpatch}
\AtEveryCitekey{\ifciteseen{}{\clearfield{namehash}}}
\xpatchbibmacro{cite}
{\printnames{labelname}}
{\ifciteseen
{\printnames{labelname}}
{\printnames[][1-99]{labelname}}}
{}
{}
\xpatchbibmacro{textcite}
{\printnames{labelname}}
{\ifciteseen
{\printnames{labelname}}
{\printnames[][1-99]{labelname}}}
{}
{}
\begin{document}
\printbibliography[title=Kilder]
\addcontentsline{toc}{chapter}{Kilder}
\end{document}
Using the above @book
is showing correctly both in citations and in the bibliography if there's a single author. With multiple authors there is "og" (Norwegian translation of "and") between the two last authors. I would like to change this to &.
@inbook
needs some modifications to the bibliography. Currently it's:
Author(s) (year). Title. I: booktitle. Red. av editor(s). Address: Publisher, s. pagefrom-pageto
I need this to be:
Author(s) (year). Title. I editor(s) (red.), booktitle (s. pagefrom-pageto). Address: Publisher
In the above the "I" is Norwegian translation of "In" and "mfl." is Norwegian translation of "et al.".
Also I can not figure out how to prevent that "et al" is being translated to "mfl.". I guess I would need to do something like:
\addto\captionsnorsk{%
\renewcommand{\something}%
{et al}%
}
but I can't figure out what to replace something with.
Thanks.
Best Answer
Well, there are quite some modifications to be done here.
To change the translation of "and others" from "med flere" to "et al.", we define.
You can find a list of all the bibstrings (the localisation kyes) in the
biblatex
documentation in §4.9.2 Localization Keys. For more on this topic, §4.9 Localization Modules is worth a read.To change the last name delimiter from "og" ("and") to "&", we redefine
Note that the second line that normally deals with Oxford commas is uncommented here, but that does not concern Norwegian as that does not use the Oxford comma anyway.
Now, over to
@inbook
and@incollection
.First, the easy part, to get rid of the colon after "I:" ("In:"), define
This will get rid of the colon for all entry types, however; if you prefer to keep it for all the other entry types (Why would you want to do that? It would be pretty pretty inconsistent.), try
The biggest problem is reordering the output. One could copy and paste the whole driver to the document and modify it, but since you use
xpatch
anyway, why not use that?We move the editor macro before the title, but use the
editor
notbyeditor
macros.To get the string "editor" in parentheses and to get rid of the comma preceding it, use
The quite long and not so M WE
yields