Here's an example that doesn't create a new bibliography driver from scratch, but modifies the existing book
driver. Try and comment out my redfinitions to see what they effect. Note that I have changed the contents of the edition
field in your .bib
file to an integer and instead used the babel
package plus the biblatex
package option abbreviate=false
.
Note: In the bibliography driver in your code snippets, semicolons and colons aren't ignored, but overridden by the following \newunit
which typesets \newunitpunct
(by default, a period and a space) instead.
Further information may be found at Guidelines for customizing biblatex styles.
\documentclass{article}
\usepackage[ngerman]{babel}
\usepackage[backend=biber,style=alphabetic,sorting=nyt,abbreviate=false]{biblatex}
\DeclareNameAlias{default}{last-first}
\renewbibmacro*{author/editor+others/translator+others}{%
\mkbibbold{% ADDED
\ifboolexpr{
test \ifuseauthor
and
not test {\ifnameundef{author}}
}
{\usebibmacro{author}}
{\ifboolexpr{
test \ifuseeditor
and
not test {\ifnameundef{editor}}
}
{\usebibmacro{editor+others}}
{\usebibmacro{translator+others}}}}
}% ADDED
\renewcommand*{\multinamedelim}{\addsemicolon\space}
\renewcommand*{\finalnamedelim}{\addsemicolon\space}
\renewcommand*{\labelnamepunct}{\mkbibbold{\addcolon\space}}
\renewbibmacro*{publisher+location+date}{%
\printlist{location}%
\iflistundef{publisher}
{\setunit*{\addcomma\space}}
% {\setunit*{addcolon\space}}% DELETED
{\setunit*{~:\space}}% ADDED
\printlist{publisher}%
\setunit*{\addcomma\space}%
\usebibmacro{date}%
\newunit}
\DeclareFieldFormat{edition}{%
\ifinteger{#1}
% {\mkbibordedition{#1}~\bibstring{edition}}% DELETED
{\mkbibordedition{#1}\bibstring{edition}}% ADDED
{#1\isdot}}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{weck,
author = {Manfred Weck and Christian Brecher},
year = {2005},
title = {Werkzeugmaschinen},
edition = {6},
location = {Berlin},
publisher = {Springer},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\nocite{*}
\begin{document}
\printbibliography
\end{document}
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.
\DefineBibliographyStrings{norsk}{%
andothers = {et\addabbrvspace al\adddot},
andmore = {et\addabbrvspace al\adddot},
}
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
\renewcommand*{\finalnamedelim}{%
%\ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}% there really should be no funny Oxford comma business here
\addspace\&\space}
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
\renewcommand*{\intitlepunct}{\space}
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
\newbibmacro*{in:}{%
\printtext{%
\bibstring{in}%
\ifboolexpr{test {\ifentrytype{inbook}} or test {\ifentrytype{incollection}}}
{\addspace}%
{\intitlepunct}}}
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?
% This gets rid of page numbers, don't worry they will be re-added later
\xpatchbibdriver{inbook}
{\newunit\newblock
\usebibmacro{chapter+pages}}
{}
{}
{}
\xpatchbibdriver{incollection}
{\newunit\newblock
\usebibmacro{chapter+pages}}
{}
{}
{}
\xpatchbibdriver{incollection}
{\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\usebibmacro{byeditor+others}%
}
{\renewbibmacro*{date+extrayear}{}%
\usebibmacro{editor+others}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\ifboolexpr{not (test {\iffieldundef{chapter}} and test {\iffieldundef{pages}})}
{\nopunct\printtext[parens]{\usebibmacro{chapter+pages}}}%
{}%
\newunit\newblock
}%
{}
{\typeout{failed to replace \usebibmacro{byeditor+others} by \usebibmacro{editor+others} in BibliographyDriver{incollection}}}%
\xpatchbibdriver{inbook}
{\usebibmacro{bybookauthor}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\usebibmacro{byeditor+others}%
}
{\renewbibmacro*{date+extrayear}{}%
\usebibmacro{editor+others}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\usebibmacro{byeditor+others}%
\newunit\newblock
\ifboolexpr{not (test {\iffieldundef{chapter}} and test {\iffieldundef{pages}})}
{\nopunct\printtext[parens]{\usebibmacro{chapter+pages}}}%
{}%
}%
{}
{\typeout{failed to replace \usebibmacro{byeditor+others} by \usebibmacro{editor+others} in BibliographyDriver{inbook}}}%
We move the editor macro before the title, but use the editor
not byeditor
macros.
To get the string "editor" in parentheses and to get rid of the comma preceding it, use
\DeclareFieldFormat{editortype}{\mkbibparens{#1}}
\xpatchbibmacro{bbx:editor}%
{\setunit{\addcomma\space}%
}
{\setunit{\addspace}%
}
{}
{\typeout{failed to patch bibmacro{bbx:editor}}}
The quite long and not so M WE
\documentclass[norsk,12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{lmodern}
\usepackage[style=authoryear-comp, firstinits=true, backend=biber, maxcitenames=3, citetracker=true, maxbibnames=99, dashed=false,texencoding=ascii]{biblatex}
\DeclareNameAlias{sortname}{last-first}
\renewcommand*{\nameyeardelim}{\addcomma\space}
\addbibresource{biblatex-examples.bib}
\usepackage{breakurl}
\DefineBibliographyStrings{norsk}{%
andothers = {et\addabbrvspace al\adddot},
andmore = {et\addabbrvspace al\adddot},
}
%from http://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-999]{labelname}}}
{}
{}
\xpatchbibmacro{textcite}
{\printnames{labelname}}
{\ifciteseen
{\printnames{labelname}}
{\printnames[][1-999]{labelname}}}
{}
{}
\renewcommand*{\finalnamedelim}{%
%\ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}% there really should be no funny Oxford comma business here
\addspace\&\space}
%\renewcommand*{\intitlepunct}{\space}
\newbibmacro*{in:}{%
\printtext{%
\bibstring{in}%
\ifboolexpr{test {\ifentrytype{inbook}} or test {\ifentrytype{incollection}}}
{\addspace}%
{\intitlepunct}}}
\xpatchbibdriver{inbook}
{\newunit\newblock
\usebibmacro{chapter+pages}}
{}
{}
{}
\xpatchbibdriver{incollection}
{\newunit\newblock
\usebibmacro{chapter+pages}}
{}
{}
{}
\xpatchbibdriver{incollection}
{\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\usebibmacro{byeditor+others}%
}
{\renewbibmacro*{date+extrayear}{}%
\usebibmacro{editor+others}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\ifboolexpr{not (test {\iffieldundef{chapter}} and test {\iffieldundef{pages}})}
{\nopunct\printtext[parens]{\usebibmacro{chapter+pages}}}%
{}%
\newunit\newblock
}%
{}
{\typeout{failed to replace \usebibmacro{byeditor+others} by \usebibmacro{editor+others} in BibliographyDriver{incollection}}}%
\xpatchbibdriver{inbook}
{\usebibmacro{bybookauthor}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\usebibmacro{byeditor+others}%
}
{\renewbibmacro*{date+extrayear}{}%
\usebibmacro{byeditor+others}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\usebibmacro{byeditor+others}%
\newunit\newblock
\ifboolexpr{not (test {\iffieldundef{chapter}} and test {\iffieldundef{pages}})}
{\nopunct\printtext[parens]{\usebibmacro{chapter+pages}}}%
{}%
}%
{}
{\typeout{failed to replace \usebibmacro{byeditor+others} by \usebibmacro{editor+others} in BibliographyDriver{inbook}}}%
\DeclareFieldFormat{editortype}{\mkbibparens{#1}}
\xpatchbibmacro{bbx:editor}%
{\setunit{\addcomma\space}%
}
{\setunit{\addspace}%
}
{}
{\typeout{failed to patch bibmacro{bbx:editor}}}
\begin{document}
\cite{aksin} again \cite{aksin}.
\nocite{wilde,kant:kpv,hyman,pines,baez/article}
\printbibliography[title=Kilder]
\end{document}
yields
Best Answer
The command
\footcite
puts the citation into a footnote: the citation in a numeric style is '1' or similar, as expected. You want\footfullcite