1

I am currently working on my bibliography template. I am very pleased with the current result - there is only one thing, that disturbes me:

The order in which details are printed.

my minimal example:

\documentclass[a4paper,12pt,headsepline]{scrartcl}
\usepackage{csquotes}
\usepackage[style=authoryear-comp,      % How should the citation look like in the text?
            backend=biber,
            natbib=true,                % Supports numeric and author-year citation schemes, incorporating
                                        % sorting and compression code found in the cite package.
            maxcitenames=2,             % How many names before et al.
            doi=true,                   % Show DOI
            isbn=false,                 % Show ISBN
            url=false                   % Show URL  
            ]{biblatex}
\renewcommand*{\nameyeardelim}{\addspace}   %removes the comma before the year in citations

\DefineBibliographyStrings{english}{andothers = {{et\,al\adddot}}} % et al. with only a half space

% Print authors bold in bibliography
\DeclareNameFormat{family-given-bold}{\mkbibbold{%  family name - given (first) name - bold(new)
        \ifgiveninits  %long first name if \namepartgiven and short first name when \namepartgiveni below
        {\usebibmacro{name:family-given}{\namepartfamily}{\namepartgiveni}{\namepartprefix}{\namepartsuffix}}
        {\usebibmacro{name:family-given}{\namepartfamily}{\namepartgiven}{\namepartprefix}{\namepartsuffix}} 
        \usebibmacro{name:andothers}}}      
    \DeclareNameAlias{sortname}{family-given-bold}

% Print 'Vol. ' in front of volume number
\renewbibmacro*{journal+issuetitle}{\usebibmacro{journal}\addcomma\space Vol. \usebibmacro{volume+number+eid}}

% Do not print locations and years, but publisher in a new line
\renewbibmacro*{publisher+location+date}{\newline Pub.:\printlist{publisher}}

% Do not print months
\AtEveryBibitem{\clearfield{month}}                                      % 
\AtEveryCitekey{\clearfield{month}\renewcommand*\finalnamedelim{\,\&\,}} % also changes 'and' to '&' in citations

% New line after authors in bibliography
%\renewcommand*{\labelnamepunct}{\newline\bibsentence}

% Remove the dot after the (year) in bibliography
\renewcommand{\labelnamepunct}{\addspace}

% Prevent journal & book title to be italic font
\DeclareFieldFormat{journaltitle}{#1}
\DeclareFieldFormat{booktitle}{#1} 

% New line after title
\usepackage{xpatch}
\makeatletter
\def\do#1{
    \ifcsdef{blx@bbx@#1}
    {\xpatchbibdriver{#1}
        {\printlist{language}%
            \newunit\newblock}
        {\printlist{language}%
            \printunit{\newline\bibsentence}}
        {}{}}
    {}} 
\abx@doentrytypes
\makeatother

% DOI in a seperate line    
\DeclareFieldFormat{doi}{%
    \newline
    \mkbibacro{DOI}\addcolon\space
    \ifhyperref
    {\href{http://dx.doi.org/#1}{\nolinkurl{#1}}}   % makes the DOI clickable with a hyper ref
    {\nolinkurl{#1}}}

% More space between entrys in bibliography
\setlength\bibitemsep{1.5\itemsep}
\renewcommand*{\mkbibnamefamily}[1]{\textsc{#1}}

% No page break within a bibliography entry
\patchcmd{\bibsetup}{\interlinepenalty=5000}{\interlinepenalty=10000}{}{}

\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
    @incollection{inColl,
        author    = {Author11 and Author12 and Author13},
        editor    = {Editor1},
        title     = {Title1},
        booktitle = {Booktitle1},
        volume = {493},number = {11},
        year      = {2017},
        pages     = {50--67},
        doi       = {10.1001/00000000001},
        publisher = {Publisher1}}
\end{filecontents*}
\addbibresource{\jobname.bib}

\begin{document}

hi world! \cite{inColl}
\printbibliography
\end{document}

Right now, the result reads like :

Author11, Author12, Author13 (2017) "Title"
In : Booktitle, Ed. by Editor, Vol. 493. 11
Pub.: Publisher, pp. 123-456
DOI: 10.1001/00000000001

Is there a possibility to switch around the Editor, Publisher and the pages? it should look like this :

Author11, Author12, Author13 (2017) "Title"
In : Booktitle, Vol. 493. 11, pp. 123-456
Pub.: Publisher, Ed. by Editor,
DOI: 10.1001/00000000001

Thanks alot :)

  • 2
    Please consider turning your code snippet into a fully working example document that reproduces the output you get at the moment. This is what we call an MWE (tex.meta.stackexchange.com/q/228/35864; or MWEB: tex.meta.stackexchange.com/q/4407/35864). The example should start with \documentclass and should have a \begin{document}...\end{document} section where a few example entries are cited. We also don't have your c:/Users/krause-j/Documents/library.bib, so it would help if you could add a few example entries. – moewe Oct 29 '18 at 15:32
  • Hi, I just edited my question. Now there is a minimal example, that should be working without an external library. – Jenso Oct 30 '18 at 8:38
2

Significant changes in the order of elements in the bibliography usually require changes in the bibliography driver. Smaller changes can sometimes be achieved by redefining bibmacros or patching the driver, but the changes you are after are so large that it makes sense to copy the entire driver and rearrange the macro calls. You can find the original definition of the macro in standard.bbx (see for example here) and can compare the changes (which only moved a few macro calls around).

In the MWE I only showed the @incollection driver. Something similar would probably have to be done for @inbook to make things consistent.

\documentclass[a4paper,12pt,headsepline]{scrartcl}
\usepackage{csquotes}
\usepackage[style=authoryear-comp,      % How should the citation look like in the text?
            backend=biber,
            natbib=true,                % Supports numeric and author-year citation schemes, incorporating
                                        % sorting and compression code found in the cite package.
            maxcitenames=2,             % How many names before et al.
            doi=true,                   % Show DOI
            isbn=false,                 % Show ISBN
            url=false,                   % Show URL  
            ]{biblatex}

\DeclareDelimFormat{nameyeardelim}{\addspace}   %removes the comma before the year in citations

\DefineBibliographyStrings{english}{andothers = {{et\,al\adddot}}} % et al. with only a half space

% Print authors bold in bibliography
\DeclareNameFormat{family-given-bold}{\mkbibbold{%  family name - given (first) name - bold(new)
        \ifgiveninits  %long first name if \namepartgiven and short first name when \namepartgiveni below
        {\usebibmacro{name:family-given}{\namepartfamily}{\namepartgiveni}{\namepartprefix}{\namepartsuffix}}
        {\usebibmacro{name:family-given}{\namepartfamily}{\namepartgiven}{\namepartprefix}{\namepartsuffix}} 
        \usebibmacro{name:andothers}}}      
    \DeclareNameAlias{sortname}{family-given-bold}

% Print 'Vol. ' in front of volume number       
\DeclareFieldFormat[article]{volume}{\bibstring{jourvol}~#1}
\renewbibmacro*{journal+issuetitle}{%
    \usebibmacro{journal}%
    \setunit*{\addcomma\space}% was: \setunit*{\addspace}
    \iffieldundef{series}
    {}
    {\newunit
        \printfield{series}%
        \setunit{\addcomma\space}}% was: \setunit{\addspace}
    \usebibmacro{volume+number+eid}%
    \setunit{\addspace}%
    \usebibmacro{issue+date}%
    \setunit{\addcolon\space}%
    \usebibmacro{issue}%
    \newunit}

% Do not print locations and years, but publisher in a new line
\renewbibmacro*{publisher+location+date}{\newline Pub.:\printlist{publisher}}

\DeclareDelimFormat[cite,parencite]{finalnamedelim}{\,\&\,}

% Do not print months
\AtEveryBibitem{\clearfield{month}}
\AtEveryCitekey{\clearfield{month}}

\DeclareDelimFormat{nametitledelim}{\addspace}

% Prevent journal & book title to be italic font
\DeclareFieldFormat{journaltitle}{#1}
\DeclareFieldFormat{booktitle}{#1} 

\DeclareBibliographyDriver{incollection}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/translator+others}%
  \setunit{\printdelim{nametitledelim}}\newblock
  \usebibmacro{title}%
  \newunit
  \printlist{language}%
  \newunit\newblock
  \usebibmacro{byauthor}%
  \newunit\newblock
  \usebibmacro{in:}%
  \usebibmacro{maintitle+booktitle}%
  \newunit\newblock
  \printfield{edition}%
  \newunit
  \iffieldundef{maintitle}
    {\printfield{volume}%
     \printfield{part}}
    {}%
  \newunit
  \printfield{volumes}%
  \newunit\newblock
  \usebibmacro{series+number}%
  \newunit\newblock
  \usebibmacro{chapter+pages}%
  \newunit\newblock
  \printfield{note}%
  \newunit\newblock
  \usebibmacro{publisher+location+date}%
  \newunit\newblock
  \usebibmacro{byeditor+others}%
  \newunit\newblock
  \iftoggle{bbx:isbn}
    {\printfield{isbn}}
    {}%
  \newunit\newblock
  \usebibmacro{doi+eprint+url}%
  \newunit\newblock
  \usebibmacro{addendum+pubstate}%
  \setunit{\bibpagerefpunct}\newblock
  \usebibmacro{pageref}%
  \newunit\newblock
  \iftoggle{bbx:related}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}
    {}%
  \usebibmacro{finentry}}

% New line after title
\usepackage{xpatch}
\makeatletter
\def\do#1{
    \ifcsdef{blx@bbx@#1}
    {\xpatchbibdriver{#1}
        {\printlist{language}%
            \newunit\newblock}
        {\printlist{language}%
            \printunit{\newline\bibsentence}}
        {}{}}
    {}} 
\abx@doentrytypes
\makeatother

% DOI in a seperate line    
\DeclareFieldFormat{doi}{%
    \newline
    \mkbibacro{DOI}\addcolon\space
    \ifhyperref
    {\href{http://dx.doi.org/#1}{\nolinkurl{#1}}}   % makes the DOI clickable with a hyper ref
    {\nolinkurl{#1}}}


% More space between entrys in bibliography
\setlength\bibitemsep{1.5\itemsep}
\renewcommand*{\mkbibnamefamily}[1]{\textsc{#1}}

% No page break within a bibliography entry
\patchcmd{\bibsetup}{\interlinepenalty=5000}{\interlinepenalty=10000}{}{}

\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
    @incollection{inColl,
        author    = {Author11 and Author12 and Author13},
        editor    = {Editor1},
        title     = {Title1},
        booktitle = {Booktitle1},
        volume = {493},number = {11},
        year      = {2017},
        pages     = {50--67},
        doi       = {10.1001/00000000001},
        publisher = {Publisher1}}
\end{filecontents*}
\addbibresource{\jobname.bib}

\begin{document}

hi world! \cite{inColl}
\printbibliography
\end{document}

Author11, Author12, and Author13 (2017). “Title1”//In: Booktitle1. Vol. 493. 11, pp. 50–67//Pub.: Publisher1. Ed. by Editor1.//doi: 10.1001/00000000001.

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.