我在自定义自己的biblatex
样式时遇到了问题。它应该是这样的:
我读完后在周末尝试了一下手动的和邮政。我认为自定义现有样式(我的示例样式)会更容易,authortitle
但也许创建新样式会更容易。但我只收到错误,而且截止日期的压力很大,所以我希望有人能帮助我。
编辑:需要改变的事情:
一般来说:
- 日期格式:dd.mm.yyyy。
文章:
- 删除“在:”
- 期刊名称、年份、期号、(全部斜体)页码。
口试(面试):
- 显示采访者
- 在面试官姓名前添加:面试:[面试官姓名]
- 日期,地址。
电子的:
- 标题用引号引起来,而不是斜体
- 删除“URL:”
- 删除“上次访问时间”的括号
- 显示机构
我添加了一个 MWE 和我的众多方法之一来定制authortitle
样式(该方法将非常无用)。
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[style=authortitle]{biblatex}
\usepackage[ngerman]{babel}
\usepackage{filecontents}
\begin{filecontents}{test.bib}
@article{article,
author = {Peter Adams},
title = {The title of the work},
journal = {The name of the journal},
year = 1993,
number = 2,
pages = {201-213},
}
@book{book,
author = {Peter Babington},
title = {The title of the work},
address = {Berlin},
year = 1993,
}
@Oral{dean,
author = {Dean Rusk},
interviewer = {David O'Brian},
date = {21.08.1970},
year = {1970},
address = {Boston},
}
@Electronic{pan,
author = Phlip Pan
institution = {The New York Times},
date = {118.11.2018},
year = {2016},
title = {The West was sure the Chinese approach would not work. It
just had to wait. It's still waiting.},
url =
{https://www.nytimes.com/interactive/2018/11/18/world/asia/china-
rules.html},
urldate = {18.11.2018},
}
\end{filecontents}
\addbibresource{test.bib}
\begin{document}
Some famous linguists wrote a couple of books \cite{article} \cite{book}
\printbibliography
\end{document}
答案1
要求实现整个风格的问题总是有点难以回答,而且需要很多时间,通常是很多询问风格的具体特征是一个更好的主意。biblatex
风格的分隔性质通常允许轻松组合答案(如果不是这种情况,总是可以提出关于组合两个答案的新后续问题)。在过去的几天里,有一系列问题似乎有助于建立这里显示的风格,所以我想我会在这里收集答案以确保这个问题有答案。
首先,您的文件中有几个语法错误.bib
。字段中的日期date
必须采用 ISO 8601/EDTF 格式 ( yyyy-mm-dd
),因此urldate = {18.11.2018},
是错误的,应该是urldate = {2018-11-18},
。这应该可以立即解决日期问题。不过您可能想使用选项dateabbrev=false
。
author
此外,中的字段存在问题pan
,必须是author = {Phlip Pan},
。
您也不应该同时提供 ayear
和 adate
字段。date
单独提供就足够了。
- 对于“In:”,有经典的抑制“在:” biblatex。
- 我没有找到所需格式的问题
journal
,date
和volume
(诚然,我没有仔细寻找),所以我在下面的 MWE 中拼凑了一些内容(带有 的块journal+issuetitle
)。 - 该类型的实现
@interview
可以在以下位置找到使用 biblatex 创建访谈书目类型和自定义类型在后续引用中消失,但引用样式需要做一些修改authortitle
。 - 必要的修改
@online
可以在 gusbrs 的回答中找到按字母顺序对作者和组织进行排序以及使用 biblatex 将日期移到参考书目中的标题之前也使用 biblatex 在 URL 后添加一个点。请注意,我们使用organization
而不是institution
,参见使用 biblatex 显示机构。
我们最终得到
\RequirePackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{article,
author = {Peter Adams},
title = {The title of the work},
journal = {The name of the journal},
year = 1993,
number = 2,
pages = {201-213},
}
@book{book,
author = {Peter Babington},
title = {The title of the work},
address = {Berlin},
year = 1993,
}
@interview{dean,
interviewee = {Dean Rusk},
interviewer = {David O'Brian},
date = {1970-08-21},
address = {Boston},
}
@online{pan,
author = {Phlip Pan},
organization = {The New York Times},
date = {2018-11-18},
title = {The West was sure the Chinese approach would not work.
It just had to wait. It's still waiting.},
url = {https://www.nytimes.com/interactive/2018/11/18/world/asia/china-rules.html},
urldate = {2018-11-18},
}
\end{filecontents}
\begin{filecontents}{interview.dbx}
\DeclareDatamodelEntrytypes{interview}
\DeclareDatamodelFields[type=list,datatype=name]{
interviewer,
interviewee,
}
\DeclareDatamodelEntryfields[interview]{
addendum,
doi,
eprint,
eprintclass,
eprinttype,
interviewer,
interviewee,
location,
note,
pubstate,
}
\end{filecontents}
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[german=swiss]{csquotes}
\usepackage[backend=biber, datamodel=interview, style=authortitle, dateabbrev=false]{biblatex}
% https://tex.stackexchange.com/q/10682/35864
\renewbibmacro{in:}{%
\ifentrytype{article}{}{\printtext{\bibstring{in}\intitlepunct}}}
\DeclareFieldFormat[article,periodical]{date}{\mkbibemph{#1}}
\DeclareFieldFormat[article,periodical]{volume}{\mkbibemph{#1}}
\DeclareFieldFormat[article,periodical]{number}{\mkbibemph{#1}}
\renewbibmacro*{journal+issuetitle}{%
\usebibmacro{journal}%
\setunit*{\addcomma\space}%
\iffieldundef{series}
{}
{\newunit
\printfield{series}%
\setunit{\addcomma\space}}%
\usebibmacro{date}%
\setunit{\addcomma\space}%
\usebibmacro{volume+number+eid}%
\setunit{\addcolon\space}%
\usebibmacro{issue}%
\newunit}
\DeclareFieldFormat[article,periodical]{pages}{#1}
% https://tex.stackexchange.com/q/464756/35864
\NewBibliographyString{interview}
\DefineBibliographyStrings{german}{%
interview = {Interview},
}
\DeclareNameAlias{interviewee}{author}
\DeclareBibliographyDriver{interview}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\printnames{interviewee}%
\newunit\newblock
\bibstring{interview}%
\setunit{\addspace}%
\printnames{interviewer}%
\newunit\newblock
\printfield{note}%
\newunit\newblock
\usebibmacro{location+date}%
\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}}
\DeclareSortingTemplate{nty}{
\sort{
\field{presort}
}
\sort[final]{
\field{sortkey}
}
\sort{
\field{sortname}
\field{author}
\field{editor}
\field{translator}
\field{interviewee}
\field{sorttitle}
\field{title}
}
\sort{
\field{sorttitle}
\field{title}
}
\sort{
\field{sortyear}
\field{year}
}
\sort{
\field{volume}
\literal{0}
}
}
\DeclareLabelname{%
\field{shortauthor}
\field{author}
\field{shorteditor}
\field{editor}
\field{translator}
\field{interviewee}
}
\renewbibmacro*{cite:title}{%
\printtext[bibhyperref]{%
\ifentrytype{interview}
{\bibstring{interview}%
\setunit{\addspace}%
\printnames[family]{interviewer}}
{\printfield[citetitle]{labeltitle}}}}
% https://tex.stackexchange.com/q/464205/35864
\DefineBibliographyStrings{english}{
urlseen = {visited at}
}
\DeclareFieldFormat[online]{title}{\mkbibquote{#1\isdot}}
\DeclareListWrapperFormat{organization}{\mkbibemph{#1}}
\DeclareFieldFormat{url}{\url{#1}}
\DeclareFieldFormat{urldate}{\bibstring{urlseen}\space#1}
% https://tex.stackexchange.com/q/464383/35864
\renewbibmacro*{url+urldate}{%
\usebibmacro{url}%
\iffieldundef{urlyear}
{}
{\setunit*{\newunitpunct}%
\usebibmacro{urldate}}}
\DeclareBibliographyDriver{online}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/editor+others/translator+others}%
\newunit\newblock
\printlist{organization}%
\newunit\newblock
\usebibmacro{date}%
\newunit\newblock
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{byeditor+others}%
\newunit\newblock
\printfield{version}%
\newunit
\printfield{note}%
\newunit\newblock
\iftoggle{bbx:eprint}
{\usebibmacro{eprint}}
{}%
\newunit\newblock
\usebibmacro{url+urldate}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
\addbibresource{\jobname.bib}
\begin{document}
Lorem \cite{article} ipsum \cite{book,dean,pan}
\printbibliography
\end{document}
可能缺少一些细节,但这应该能捕捉到风格的整体感觉。