I've just turned to biblatex
from bibtex
. I am newbie to the biblatex
. I am trying to figure out how to use the biblatex
to meet my uni's bibliography requirements. My LaTex code is
\documentclass[12pt,a4paper, british]{article}
\usepackage{babel} % Switch to English style quotation mark, remember to add british to document option
\usepackage[utf8]{inputenc}
\usepackage{textcomp}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{xpatch}
\usepackage[colorinlistoftodos]{todonotes}
\usepackage{hyperref}
\hypersetup{unicode=true}
\usepackage{filecontents}
\begin{filecontents}{test.bib}
@Article{Vanschoenwinkel2016,
author = {Vanschoenwinkel, Janka and Mendelsohn, Robert and Van Passel,
Steven},
title = {Do Western and Eastern Europe have the same agricultural climate
response? Taking adaptive capacity into account},
journal = {Global Environmental Change},
year = {2016},
volume = {41},
number = {7},
pages = {74-87}
}
@InBook{Adams1999,
pages = {1-18},
title = {Economic effects of climate change on US agriculture},
publisher = {Cambridge University Press},
year = {1999},
author = {Adams, Ricahard M. and Mccarl, Bruce A. and Segerson, Kathleen and Rosenzweig, Cynthia and Bryant, Kelly J and Dixon, Bruce L and Conner, Richard and Evenson, Robert E and OJima, Dennis},
editor = {Mendelsohn, Robert and Neumann, James E.},
type = {Book Section},
address = {Cambridge, UK},
isbn = {0521607698},
booktitle = {The Impact of Climate Change on the United States Economy},
}
@Book{Cline2007,
title = {Global Warming and Agriculture:Impacts Estimates by Contry},
publisher = {Edward},
year = {2007},
author = {Cline, William R.},
address = {Washington DC},
type = {Book},
}
@TechReport{Dasgupta2007,
author = {Dasgupta, Susmita and Laplante, Benoit and Meisner, Craig and Wheeler, David and Yan, Jianping},
title = {The Impact of Sea Level Rise on Developing Countries: A Comparative Analysis},
institution = {World Bank},
year = {2007},
type = {Report},
number = {World Bank Policy Research Working paper 4136},
address = {Washington DC},
}
\end{filecontents}
\usepackage[autostyle]{csquotes}
\usepackage[style=authoryear, giveninits=true,backend=biber, maxcitenames=3,%
maxbibnames=9, sortcites, url=false, backref=false,]{biblatex}
\renewcommand{\labelnamepunct}{\addspace} % Replace dot with comma in reference after Author + Year
%\renewcommand*{\nameyeardelim}{\addcomma\space} %add comma between author and year in the intext-citation
\renewbibmacro{in:}{} % Suppress In: in the reference list
%use ":" after year in the intext citation
\renewcommand*{\postnotedelim}{\addcolon\space}
\DeclareFieldFormat{postnote}{#1}
\DeclareFieldFormat{multipostnote}{#1}
%format page range of @article and @incollection follow this format: volume(number): page range.
\renewcommand{\bibpagespunct}{\ifentrytype{article}{\addcolon\addspace}{\addcomma\addspace}}
\DeclareFieldFormat[article,incollection]{pages}{#1}
%format volume and number as follow: volume(number)
\renewbibmacro*{volume+number+eid}{%
\printfield{volume}%
% \setunit*{\adddot}% DELETED
\setunit*{\addnbspace}% NEW (optional); there's also \addnbthinspace
\printfield{number}%
\printunit{\addcomma\space}%
\printfield{eid}}
\DeclareFieldFormat[article]{number}{\mkbibparens{#1}}
% replace dot “.” by comma “,” after title in biblatex for @article
\xpatchbibdriver{article}
{\usebibmacro{title}%
\newunit}
{\usebibmacro{title}%
\printunit{\addcomma\space}}
{}
{}
\addbibresource{test.bib}
\begin{document}
This is cited by @ariticle entry: \parencite{Vanschoenwinkel2016}.
This is cited by @inbook entry: (\cite{Adams1999}).
This is cited by @book entry \cite{Cline2007}.
This is cited by @technicalreport: \parencite{Dasgupta2007}
\printbibliography
\end{document}
and the output is
Now, I want reformat for @inbook
and @book
with the format as following:
Any suggestion for me with above format?
Secondly, I would like to put the title of @Techreport
between single quotes ' '
Best Answer
You can use
biblatex-ext
to move the editors around and simplify some of the code you have already.Should get you closer to what you want
biblatex-ext
'sinnamebeforetitle
option does the major work of moving the editors of@incollection
s.xpatch
is used to move the pages from after the publisher to after the book title.@incollection
instead of@inbook
(as pointed out by Alan Munn); on the other hand a quick google search suggests that Mr Cline is the author ofCline2007
and so the "(ed.)" would not be appropriate. If he is indeed the editor and the thing turns out to be a collection, you should still the the correct results.