1

I currently write my bachelor thesis and I have to use the following style for @incollections:

Mulkay, M.J., 1977: The Sociology of Science in Britain. S. 224-257 in: R.K. Merton & J. Gaston (Hrsg.), The Sociology of Science in Europe. Carbondale: Southern Illinois University Press.

Currently, it looks somewhat like that:

Mulkay, M.J., 1977: The Sociology of Science in Britain. In: The Sociology of Science in Europe. R.K. Merton & J. Gaston (Hrsg.). Carbondale: Southern Illinois University Press, S. 224-257.

How can I change the order of it?

As a minimal example:

\documentclass{article}
\usepackage{lmodern} % 
\usepackage[ngerman]{babel} % 
\usepackage[utf8]{inputenc} % 
\usepackage[T1]{fontenc} % 


\usepackage[backend=bibtex, style=authoryear-comp, dashed=false, 
sorting=nyt, hyperref=true, firstinits=true, indexing=cite]{biblatex}

% So that editors in incollections stand after the names
\renewbibmacro*{byeditor+others}{%
    \ifnameundef{editor}
    {}
    {\printnames[byeditor]{editor}%
        \setunit{\addspace}%
        \usebibmacro{byeditor+othersstrg}%
        \clearname{editor}%
        \newunit}%
    \usebibmacro{byeditorx}%
    \usebibmacro{bytranslator+others}}
\usepackage{xpatch}
\xpatchbibmacro{byeditor+othersstrg}{\printtext}{\printtext[parens]}{}        
{}

\begin{filecontents*}{lit.bib}

@incollection{maazschuler,
    title={Sch{\"u}ler als Informanten? Die Qualit{\"a}t von     
Sch{\"u}lerangaben zum sozialen Hintergrund},
    author={Maaz, Kai and Kreuter, Frauke and Watermann, Rainer},
    editor={Baumert, J{\"u}rgen and Stanat, Petra and Watermann, 
Rainer},
    booktitle={Herkunftsbedingte Disparit{\"a}ten im Bildungswesen: 
Differenzielle Bildungsprozesse und Probleme der     
Verteilungsgerechtigkeit},
    pages={31--59},
    year={2006},
    publisher={Springer VS},
address={Wiesbaden}
}

\end{filecontents*}
\addbibresource{lit.bib}

\begin{document}

\cite{maazschuler}

\printbibliography
\end{document}

The Output looks as follows:

Maaz, K., Kreuter, F. & Watermann, R. (2006). Schüler als Informanten?     
Die Qualität von Schülerangaben zum sozialen Hintergrund. In: 
Herkunftsbedingte Disparitäten im Bildungswesen: Differenzielle 
Bildungsprozesse und Probleme der Verteilungsgerechtigkeit. J. 
Baumert, P. Stanat & R. Watermann (Hrsg.). Wiesbaden: Springer VS, S. 
31–59.

Thanks in advance for your help!

moewe
  • 175,683
Till
  • 25
  • Welcome to TeX.SX! I added a \documentlcass to your otherwise very good MWE to make it compilable. I also changed the entrykey of the example citation to make sure the example actually produces a citation. – moewe Apr 26 '19 at 11:52
  • Off-topic: Note that sorting=nyt is the default sorting for style=authoryear-comp, and thus need not be given explicitly. The option hyperref=true, is not that different from the default hyperref=auto,. The only difference is that hyperref=true throws a warning if the hyperref package is not loaded. In particular both hyperref=auto and hyperref=true will produce links if and only if the hyperref package is loaded. Since many people seem to misunderstand what hyperref=true does I recommend not using that option unless absolutely necessary. The default should be good enough. – moewe Apr 26 '19 at 11:55
  • Nowadays it is very much recommended to use Biber with biblatex and not BibTeX. Unless you have a very good reason to stick with BibTeX, I recommend you replace backend=bibtex, with backend=biber, and run Biber instead of BibTeX in the compilation cycle (see https://tex.stackexchange.com/q/154751/35864 for help with your editor). – moewe Apr 26 '19 at 11:56
  • In newer versions of biblatex the option firstinits has been renamed to giveninits. Furthermore the option produces the warning Package biblatex Warning: Conflicting options. '<namepart>inits' conflicts with 'uniquename=full'. Setting 'uniquename=init'. You can avoid that warning by settng uniquename to an appropriate value (init or false) yourself. – moewe Apr 26 '19 at 11:57
  • Thanks for the hints! I will implemet that asap. On my old Laptop, I had trouble using biber so I never bothered to change my template for it on the new laptop. I will give that and giveinits (of which I didn't know) a go! – Till Apr 27 '19 at 06:16

2 Answers2

1

Changing the order of things in the \DeclareBibliographyDriver a bit to move the pages before the book title

\documentclass{article}
\usepackage{lmodern} % 
\usepackage[ngerman]{babel} % 
\usepackage[utf8]{inputenc} % 
\usepackage[T1]{fontenc} % 


\usepackage[backend=bibtex, style=authoryear-comp, dashed=false, 
sorting=nyt, hyperref=true, firstinits=true, indexing=cite]{biblatex}

% So that editors in incollections stand after the names
\renewbibmacro*{byeditor+others}{%
    \ifnameundef{editor}
    {}
    {\printnames[byeditor]{editor}%
        \setunit{\addspace}%
        \usebibmacro{byeditor+othersstrg}%
        \clearname{editor}%
        \newunit}%
    \usebibmacro{byeditorx}%
    \usebibmacro{bytranslator+others}}
\usepackage{xpatch}
\xpatchbibmacro{byeditor+othersstrg}{\printtext}{\printtext[parens]}{}{}

\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 % <- change
  \usebibmacro{chapter+pages}% <- change
  \newunit\newblock  
  \usebibmacro{in:}%
  \usebibmacro{maintitle+booktitle}%
  \newunit\newblock
  \usebibmacro{byeditor+others}%
  \newunit\newblock
  \printfield{edition}%
  \newunit
  \iffieldundef{maintitle}
    {\printfield{volume}%
     \printfield{part}}
    {}%
  \newunit
  \printfield{volumes}%
  \newunit\newblock
  \usebibmacro{series+number}%
  \newunit\newblock
  \printfield{note}%
  \newunit\newblock
  \usebibmacro{publisher+location+date}%
  \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}}



\begin{filecontents*}{lit.bib}

@incollection{maaz2006schuler,
    title={Sch{\"u}ler als Informanten? Die Qualit{\"a}t von     
Sch{\"u}lerangaben zum sozialen Hintergrund},
    author={Maaz, Kai and Kreuter, Frauke and Watermann, Rainer},
    editor={Baumert, J{\"u}rgen and Stanat, Petra and Watermann, 
Rainer},
    booktitle={Herkunftsbedingte Disparit{\"a}ten im Bildungswesen: 
Differenzielle Bildungsprozesse und Probleme der     
Verteilungsgerechtigkeit},
    pages={31--59},
    year={2006},
    publisher={Springer VS},
address={Wiesbaden}
}

\end{filecontents*}
\addbibresource{lit.bib}

\begin{document}

\cite{maaz2006schuler}

\printbibliography
\end{document}
  • Thanks for the code, I am on a hiking trip without wifi and laptop right now, so I won't be able to test it until tomorrow evening. Please excuse! But then, I'll try it asap! – Till Apr 27 '19 at 06:20
  • 1
    Thanks for your code, it did already work quite well (with a minor revision, as displayed in my second answer). Unfortunately, I still have 3 minor issues (as displayed in my second answer) – Till Apr 28 '19 at 20:10
0

thank you very much for your reply, I could fix quite a bit with it already. I changed two little things in the code, so the editors come right after the "in:" and before the booktitle.

\renewcommand*{\bibpagespunct}{\ifentrytype{incollection}{\addperiod}{\addcomma}\space} % suggested by moewe: now there is a period after the title of the work/chapter and before the Pages

% So that editors in incollections stand after the names
\renewbibmacro*{byeditor+others}{%
    \ifnameundef{editor}
    {}
    {\printnames[byeditor]{editor}%
        \setunit{\addspace}%
        \usebibmacro{byeditor+othersstrg}%
        \clearname{editor}%
        \newunit}%
    \usebibmacro{byeditorx}%
    \usebibmacro{bytranslator+others}}
\usepackage{xpatch}
\xpatchbibmacro{byeditor+othersstrg}{\printtext}{\printtext}{}{} % removed [parens] as it was printed out in parentheses - now it is (eds.)

\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{chapter+pages}% <- 
    \setunit{\space}\newblock  % as suggested by moewe to write a comma instead of a full stop after the pages
    \usebibmacro{in:}%
    \usebibmacro{byeditor+others}% <- Jonathan, I changed this: I put the editors here to have them before the booktitle
    \setunit{\addcomma\space}\newblock % again, following a suggestion by moewe, I made latex do a comma instead of a full stop between the editors and the booktitle
    \usebibmacro{maintitle+booktitle}%
    \newunit\newblock
    \newunit\newblock
    \printfield{edition}%
    \newunit
    \iffieldundef{maintitle}
    {\printfield{volume}%
        \printfield{part}}
    {}%
    \newunit
    \printfield{volumes}%
    \newunit\newblock
    \usebibmacro{series+number}%
    \newunit\newblock
    \printfield{note}%
    \newunit\newblock
    \usebibmacro{publisher+location+date}%
    \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}}

Now it looks like this:

Maaz, K., Kreuter, F. & Watermann, R. (2006). Schüler als Informanten? Die Qualität
von Schülerangaben zum sozialen Hintergrund. S. 31–59 in: J. Baumert, P. Stanat &
R. Watermann (Hrsg.), Herkunftsbedingte Disparitäten im Bildungswesen: Differenzielle
Bildungsprozesse und Probleme der Verteilungsgerechtigkeit. Wiesbaden: Springer VS.

Thanks for your help!

Till
  • 25
  • Please keep in mind that TeX.SX tries to be a Q&A site and not a normal, linear forum. This setup means that there is a strict separation between questions and answers. The space here is reserved for answers to the question on top only. Follow up question will not really be seen here, especially if they are contained in an answer. I suggest you remove the follow-up question bits from this post, so it becomes a proper answer, and re-ask the follow-up bits in a new question. ... – moewe Apr 29 '19 at 05:28
  • ... Ideally questions on this site revolve around one abstract issue, so if you can split up your new question that might be a good idea (though I have a hunch that at least point 2 and point 3 are going to be connected) – moewe Apr 29 '19 at 05:29
  • Anyway, about the code \xpatchbibmacro{byeditor+othersstrg}{\printtext}{\printtext}{}{} should do pretty much nothing (it replaces the first occurrence of \printtext in the bibmacro byeditor+othersstrg with \printtext), so it can be dropped. If you put the editors in a different position it might be a good idea to define a new macro for that instead to get the name format right more easily, similar to what I do in biblatex-ext. – moewe Apr 29 '19 at 05:33
  • You will probably be able to solve issue 2 and 3 in one swoop by replacing the \newunit\newblock just before \usebibmacro{in:}% with \setunit{\addcomma\space}\newblock. If I'm guessing right the easy way to solve issue 1 is to say \renewcommand*{\bibpagespunct}{\addperiod\space}. But that would also affect other entry types than @incollection so that might or might not be desired. You can restrict the change to @incollection with \renewcommand*{\bibpagespunct}{\ifentrytype{incollection}{\addperiod}{\addcomma}\space}. – moewe Apr 29 '19 at 05:41
  • ... All of that is untested, because I'm lazy. One last things: Note that there is little point in patching the bibdriver with \xpatchbibdriver when you are already completely rewriting it in your preamble anyway. The effects of the \xpatcbibdriver invocations could be reproduced by simply replacing the relevant bits in the new definition of \DeclareBibliographyDriver directly. – moewe Apr 29 '19 at 05:44
  • Dear moewe, thanks a lot, I did not know that. Your suggestions did indeed solve the problem. I edited my answer so that it now shows a full solution to the proble and deleted the question parts of it. I indicated in comments which parts of the code were suggested by you, moewe and Jonathan. I will keep in mind that I should not ask multiple questions in one thread for future questions I may (will) have. Cheers, Till – Till Apr 29 '19 at 09:52