I'm very new to LaTeX, only started coding last weekend. I've learned the basics of bibtex and switched to biblatex to use for my bibliography.
I've been fighting my way through tutorials trying get my own version of the harvard-style. I need it to be authoryear backended with bibtex. I've formatted the @article to my liking, but I've been stumbling over the @inbook and @incollection formatting. If somebody could help me reorder the reference and format some delimiters, it would be great.
I need those to look as such:
• Smith, M. P. & Wu, C., 2000. The geology and genesis of the Bayan Obo Fe–REE–Nb deposit: a review. In: Porter, T.M. (Ed.), Hydrothermal Iron Oxide Copper–Gold and Related Deposits: a Global Perspective. Australian Mineral Foundation, Adelaide, pp. 271–281.
Thus far my code returns this (the 2 relevant @inbooks are #11 and #13):

MWE of my preamble thus far
\documentclass[a4paper, 12pt, twoside]{report}
\usepackage[top=1in, bottom=1in, left=1in, right=1in, paperwidth=8.5in, paperheight=11in]{geometry}
\usepackage{titlesec}
\usepackage[utf8]{inputenc}
\titleformat{\chapter}[display]
{\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}
\titlespacing*{\chapter}{0pt}{0pt}{20pt}
\usepackage{xcolor}
\usepackage{siunitx}
\usepackage[polish, english]{babel}
\usepackage{enumitem} % listing package
%Referencing Style
\usepackage{hyperref}
\hypersetup{colorlinks = true, citecolor = blue} % recolors hyperlinks
\usepackage
[backend=bibtex,
style=authoryear-comp,
citestyle=authoryear-icomp,
maxcitenames=2, % sets limit for et al in citations
maxbibnames=99, % frees up limits to authors listed in references
giveninits=true, % initialise each author
sorting=nyt, % sort by name, author and publication title
hyperref=true]{biblatex} % citation hyperlinks
\defbibenvironment{bibliography}
{\enumerate{}
{\setlength{\leftmargin}{\bibhang}%
\setlength{\itemindent}{-\leftmargin}%
\setlength{\itemsep}{\bibitemsep}%
\setlength{\parsep}{\bibparsep}}}
{\endenumerate}
{\item}
%Corrections to referencing style
\DeclareFieldFormat*{title}{{#1}} % * clears formatting of publication titles
\DeclareFieldFormat*{journaltitle}{\mkbibemph{#1}\isdot} % italicised journal titles
\renewbibmacro{volume+number+eid}{%
\setunit{\adddot\addspace}%
\printfield{volume}%
\printfield{number}%
\setunit{\addcomma\space}%
\printfield{eid}} % changed volume-number-pages layout
\renewcommand*{\bibpagespunct}{\addcolon} % colon between volume numbers and pages
\DeclareFieldFormat[article]{number}{\mkbibparens{#1}} % parentheses around volume number
\DeclareDelimFormat{translatortypedelim}{\addspace} % parentheses bracket around Ed.
\DeclareBibliographyDriver{inbook}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/translator+others}%
\setunit{\printdelim{nametitledelim}}\newblock
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock % <- change
\printfield{chapter}
\DeclareFieldFormat[chapter]{
\usebibmacro{in:}%
\usebibmacro{byeditor+others}%
\newunit\newblock
\usebibmacro{maintitle+booktitle}%
\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}}
\DeclareNameAlias{sortname}{family-given} % puts given names after surname
\DeclareFieldFormat{postnote}{#1}% no postnote prefix in "normal" citation commands
\DeclareFieldFormat{multipostnote}{#1}% no postnote prefix in "multicite" commands
\DeclareFieldFormat{pages}{#1}% no prefix for the `pages` field in the bibliography
\DeclareFieldFormat[article]{volume}{\mkbibbold{#1}}%emboldens volume #
\renewbibmacro{in:}{}
\newcommand{\biband}{\ifcurrentname{labelname}{\bibstring{and}}{\&}} % changes citation 'and' to ampersand
\renewcommand*\finalnamedelim{ \& } % references delimiter becomes ampersand
\renewcommand*{\nameyeardelim}{\addcomma\space} % adds comma between cited author and year
\addbibresource{Bib/References.bib}
%Paragraph indentation
\setlength{\parindent}{2em}
\setlength{\parskip}{0.5em}
\begin{document}
And my .bib file:
@Article{Salvi1996,
author = {Stefano Salvi and Anthony E. Williams-Jones},
title = {The role of hydrothermal processes in concentrating high-field strength elements in the Strange Lake peralkaline complex, Northeastern Canada},
journal = {Geochimica et Cosmochimica Acta},
year = {1996},
volume = {60},
number = {11},
pages = {1917-1932},
}
@InBook{Smith2000,
chapter = {The geology and genesis of the Bayan-Obo Fe-REE-Nb deposit: a review},
pages = {271-281},
title = {Hydrothermal iron-oxide, copper-gold and related deposits: a global perspective},
publisher = {Australian Mineral Foundation},
year = {2000},
author = {M. P. Smith and C. Wu},
editor = {Porter, T.M.},
address = {Adelaide},
}
@Article{Smith2007,
author = {M.P. Smith},
title = {Metasomatic silicate chemistry at the Bayan Obo Fe{\textendash}{REE}{\textendash}Nb deposit, Inner Mongolia, China: Contrasting chemistry and evolution of fenitising and mineralising fluids},
journal = {Lithos},
year = {2007},
volume = {93},
number = {1-2},
pages = {126--148},
month = {jan},
doi = {10.1016/j.lithos.2006.06.013},
publisher = {Elsevier {BV}},
}
@InBook{Wu1996,
chapter = {Rare earth deposits in China},
pages = {281–310.},
title = {Rare Earth Minerals: Chemistry, Origin and Ore Deposits},
publisher = {Chapman and Hall},
year = {1996},
author = {C. Wu and Z. Yuan and G. Bai},
editor = {A.P. Jones and F. Wall and C.T. Williams},
}
@Article{Yang2004,
author = {Xue-Ming Yang and Le Bas, M.J.},
title = {Chemical compositions of carbonate minerals from Bayan Obo, Inner Mongolia, China: implications for petrogenesis},
journal = {Lithos},
year = {2004},
volume = {72},
number = {1-2},
pages = {97--116},
month = {jan},
doi = {10.1016/j.lithos.2003.09.002},
publisher = {Elsevier {BV}},
}
@Article{Zhang2017,
author = {Shuan-Hong Zhang and Yue Zhao and Yongsheng Liu},
title = {A precise zircon Th-Pb age of carbonatite sills from the world's largest Bayan Obo deposit: Implications for timing and genesis of {REE}-Nb mineralization},
journal = {Precambrian Research},
year = {2017},
volume = {291},
pages = {202--219},
month = {apr},
doi = {10.1016/j.precamres.2017.01.024},
publisher = {Elsevier {BV}},
}
I need:
- To remove the 'Chap.' prefix when
chapteris printed. Just to have an unformatted title. - Have
booktitlego after the 'In:' and the editor names. It'd be great if it was italicised. - Have 'Ed. (or Eds, if several editors are named) precede the
booktitle) - Have the remaining information like
publishercome after these. - To have
pp.visible before the pages for@inbookand not for other references wherevolumeandnumberare defined.
Sorry if there's something I haven't provided. I tried looking up the previous questions, but it seems to me preferences on formatting of these are countless and it's difficult to dislodge the principle driving biblatex from other answers. I mostly end up copying somebody else's code, often without being able to tell ins and outs of it all.
Hope someone could help! Thanks!
PS - if anybody by a chance has an idea how to format the bibliography in authoryear style so that the enumerate labels are indented to be almost within the page margin instead of squeezing the text into the middle of the frame, that'd be of big help as well!
@inbook/@incollectionshould be given in thetitlefield, not inchapter(chaptershould just contain the chapter number). The title of the book/collection should go intobooktitleand nottitle. – moewe Jun 20 '19 at 20:10inbookdriver (I haven't had a closer look at the code, maybe that is no longer necessary once you fix the issues mentioned above?), but some more work would be needed. See for example https://tex.stackexchange.com/q/173638/35864 – moewe Jun 20 '19 at 20:13\DeclareFieldFormat{pages}{#1}with\DeclareFieldFormat[article]{pages}{#1}? – moewe Jun 20 '19 at 20:14Ad 1 & 2 - this worked. I am using JabRef as a BibTex reference generator and manager, and its default @inbook entry format had
chapterandtitlefields only. I've managed to edit that successfully! Ad 3 & 4 - yes, I will need to change the driver it seems as I do want the 'Ed.' in a bracket before thebooktitle.Ad 5 - this worked fine, but now conflicts with:
\renewcommand*{\bibpagespunct}{\addcolon}which I intended to separatenumberandpagesin article referencesI'll address the PS later
– Wolfe79 Jun 20 '19 at 22:43biblatexmode and not in BibTeX mode (you can see the mode in the window title and can switch modes in the "File" menu under "Switch to\renewcommand*{\bibpagespunct}{\ifentrytype{article}{\addcolon}{\addcomma\space}}. – moewe Jun 21 '19 at 06:49chapterandtitleand notbooktitlefor@inbook/@incollectionentries, so I thought it might have to do with that. – moewe Jun 22 '19 at 05:08