我对 LaTeX 还很陌生,上周末才开始写代码。我学了基础知识,bibtex
并改用biblatex
它编写参考书目。
我一直在努力学习教程,试图获得我自己的版本harvard-style
。我需要它以 为authoryear
后端bibtex
。我已经按照自己的喜好格式化了@article
,但我一直在为 和 的格式化而烦恼@inbook
。@incollection
如果有人能帮我重新排序引用并格式化一些分隔符,那就太好了。
我需要它们看起来像这样:
• Smith, MP 和 Wu, C.,2000 年。《白云鄂博铁-稀土-铌矿床的地质和成因:综述》。收录于:Porter, TM(编辑),热液氧化铁铜金及相关矿床:全球视角. 澳大利亚矿产基金会,阿德莱德,第 271-281 页。
到目前为止我的代码返回的是这个(相关的2个@inbook
是#11和#13):
到目前为止,我的序言
\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}
我的.bib
文件:
@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}},
}
我需要:
- 打印时删除“Chap.”前缀
chapter
。只保留未格式化的标题。 - 在“In:”和编辑者姓名后面加上
booktitle
go。如果用斜体显示就好了。 booktitle
在)前加上 'Ed. (或 Eds,如果有多个编辑者)- 其余信息如下
publisher
。 pp.
在页面之前可以看到和@inbook
,而不是其他引用,其中volume
和number
被定义。
抱歉,如果我没有提供一些东西。我尝试查找之前的问题,但在我看来,这些问题的格式偏好数不胜数,很难biblatex
从其他答案中找出主要驱动因素。我大多最终复制了别人的代码,通常无法分辨出所有的来龙去脉。
希望有人能帮忙!谢谢!
PS - 如果有人碰巧知道如何格式化参考书目authoryear
,以便enumerate
标签缩进几乎在页边距内,而不是将文本挤到框架的中间,这也会有很大的帮助!
答案1
在您目前使用@inbook
条目类型的两种情况下,您实际上都应该使用@incollection
条目类型。此外,正如@moewe 在其评论中指出的那样,您应该将字段更改title
为booktitle
,将字段更改chapter
为title
。
@incollection{Smith2000,
author = {M. P. Smith and C. Wu},
title = {The geology and genesis of the Bayan-Obo Fe-REE-Nb deposit: a review},
editor = {Porter, T. M.},
booktitle = {Hydrothermal iron-oxide, copper-gold and related deposits: a global perspective},
year = {2000},
pages = {271--281},
publisher = {Australian Mineral Foundation},
address = {Adelaide},
}
@incollection{Wu1996,
author = {C. Wu and Z. Yuan and G. Bai},
title = {Rare earth deposits in China},
editor = {Adrian P. Jones and Frances Wall and C. Terry Williams},
booktitle = {Rare Earth Minerals: Chemistry, Origin and Ore Deposits},
year = {1996},
chapter = {11},
pages = {281--310},
publisher = {Chapman and Hall},
series = {Mineralogical Society Series},
number = {7},
}