我刚刚从 转到biblatex
。bibtex
我是 的新手biblatex
。我正在尝试弄清楚如何使用biblatex
来满足我所在大学的参考书目要求。我的 LaTex 代码是
\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}
输出为
现在,我想要重新格式化@inbook
和,@book
格式如下:
对于上述格式,您有什么建议吗?
其次,我想把标题放在@Techreport
单引号‘ ’之间
答案1
您可以使用biblatex-ext
移动编辑器并简化一些已有的代码。
\documentclass[12pt,a4paper, british]{article}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage[autostyle]{csquotes}
\usepackage[style=ext-authoryear, giveninits=true, uniquename=init, backend=biber, maxcitenames=3,%
maxbibnames=9, sortcites, url=false, isbn=false, backref=false,
articlein=false, innamebeforetitle=true]{biblatex}
\usepackage{xpatch}
\usepackage{hyperref}
\hypersetup{unicode=true}
\DeclareDelimFormat[bib,biblist]{nametitledelim}{\addspace}
\DeclareFieldFormat{editortype}{\mkbibparens{#1}}
\DeclareDelimFormat{editortypedelim}{\addspace}
\DeclareFieldFormat{translatortype}{\mkbibparens{#1}}
\DeclareDelimFormat{translatortypedelim}{\addspace}
%\renewcommand*{\nameyeardelim}{\addcomma\space} %add comma between author and year in the intext-citation
\DeclareFieldFormat[report]{title}{\mkbibquote{#1}}
% replace dot “.” by comma “,” after title in biblatex for @article
\xpatchbibdriver{article}
{\usebibmacro{title}%
\newunit}
{\usebibmacro{title}%
\printunit{\addcomma\space}}
{}
{}
% remove chapter and pages
\xpatchbibdriver{incollection}
{\usebibmacro{chapter+pages}}
{}
{}{}
% add them into the new position
\xpatchbibmacro{incollection:parent}
{\usebibmacro{maintitle+booktitle}%
\newunit\newblock}
{\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\usebibmacro{chapter+pages}}
{}{}
\renewcommand*{\intitlepunct}{\addspace}
\renewbibmacro*{in:}{%
\setunit{\addcomma\space}%
\printtext[emph]{%
\bibstring{in}\intitlepunct}}
%format volume and number as follow: volume(number)
\renewcommand*{\volnumdelim}{\addnbspace}
\DeclareFieldFormat[article]{number}{\mkbibparens{#1}}
%format page range of @article and @incollection follow this format: volume(number): page range.
\renewcommand{\bibpagespunct}{\ifentrytype{article}{\addcolon}{\addcomma}\addspace}
\DeclareFieldFormat[article]{pages}{#1}
%use ":" after year in the intext citation
\renewcommand*{\postnotedelim}{\addcolon\space}
\DeclareFieldFormat{postnote}{\mknormrange{#1}}
\DeclareFieldFormat{multipostnote}{\mknormrange{#1}}
\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}
}
@incollection{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}
\addbibresource{test.bib}
\addbibresource{biblatex-examples.bib}
\nocite{westfahl:frontier,westfahl:space}
\begin{document}
This is cited by @article entry: \parencite{Vanschoenwinkel2016}.
This is cited by @inbook entry: \parencite{Adams1999}.
This is cited by @book entry \cite{Cline2007}.
This is cited by @technicalreport: \parencite{Dasgupta2007}
\printbibliography
\end{document}
应该让你更接近你想要的
biblatex-ext
的innamebeforetitle
选择对移动 s 的编辑起着主要作用@incollection
。xpatch
用于将页面从出版商之后移至书名之后。@incollection
而不是@inbook
(正如 Alan Munn 指出的那样);另一方面,通过谷歌快速搜索可以发现,克莱恩先生是作者所以Cline2007
“(编辑)”不合适。如果他确实是编辑,而且这个东西最终是一个合集,那么你仍然应该得到正确的结果。- 标点符号方面有几个问题让我感到困惑,我无法找到一种算法来描述我所看到的内容,所以你可能需要稍微调整一下。