numeric
我使用的是中的默认样式biblatex
。在这种样式中,年份打印在参考书目最后:
我想在作者名字后面直接显示年份:
乔治·哈里森。2000 年。我的音乐比保罗和约翰的音乐更好。
我可以在文件的前言中输入什么命令.tex
来强制执行这一点?
\documentclass{article}
\usepackage{csquotes,biblatex,filecontents}
\begin{filecontents}{\jobname.bib}
@BOOK{harrison2000,
AUTHOR = "George Harrison",
TITLE = "My music is better than Paul's and John's",
YEAR = "2000"}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
Text \parencite{harrison2000}.
\printbibliography
\end{document}
答案1
没有必要改变每一个BibliographyDriver
——解决方案类似于这个:加载biblatex
选项citestyle=numeric,bibstyle=authoryear
并添加\defbibenvironment
的定义numeric.bbx
。(xpatch
包仅用于删除年份周围的括号。)
\documentclass{article}
\usepackage{csquotes,filecontents}
\usepackage[citestyle=numeric,bibstyle=authoryear]{biblatex}
\DeclareNameAlias{sortname}{first-last}
\DeclareFieldFormat{labelnumberwidth}{\mkbibbrackets{#1}}
\defbibenvironment{bibliography}
{\list
{\printtext[labelnumberwidth]{%
\printfield{prefixnumber}%
\printfield{labelnumber}}}
{\setlength{\labelwidth}{\labelnumberwidth}%
\setlength{\leftmargin}{\labelwidth}%
\setlength{\labelsep}{\biblabelsep}%
\addtolength{\leftmargin}{\labelsep}%
\setlength{\itemsep}{\bibitemsep}%
\setlength{\parsep}{\bibparsep}}%
\renewcommand*{\makelabel}[1]{\hss##1}}
{\endlist}
{\item}
\usepackage{xpatch}
\xpatchbibmacro{date+extrayear}{%
\printtext[parens]%
}{%
\setunit{\addperiod\space}%
\printtext%
}{}{}
\begin{filecontents}{\jobname.bib}
@BOOK{harrison2000,
AUTHOR = "George Harrison",
TITLE = "My music is better than Paul's and John's",
YEAR = "2000"}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
Text \parencite{harrison2000}.
\printbibliography
\end{document}
答案2
对于某些内容,您只需设置选项/切换即可更改格式。这里有一个很好的解释问题更改日期并不那么简单。目前还没有所见即所得样式编辑器biblatex
,甚至类似的系统马克布斯特因此,最好的办法是找到一种满足您需求(或改变您的需求)的现有样式。如果您真的想这样做,您可以在序言中重新定义一堆宏,但创建自己的样式会容易得多。
standard.bbx
从你需要重新定义所有bibmacros
名称中包含“日期”的内容开始,例如
\newbibmacro*{publisher+location+date}{%
\printlist{location}%
\iflistundef{publisher}
{\setunit*{\addcomma\space}}
{\setunit*{\addcolon\space}}%
\printlist{publisher}%
\setunit*{\addcomma\space}%
\usebibmacro{date}%
\newunit}
成为
\newbibmacro*{publisher+location}{%
\printlist{location}%
\iflistundef{publisher}
{\setunit*{\addcomma\space}}
{\setunit*{\addcolon\space}}%
\printlist{publisher}%
\newunit}
然后将对有日期版本的引用替换为无日期版本。这将删除引用末尾的日期。
将日期添加到参考文献的开头需要添加
\usebibmacro{date}%
\newunit\newblock
在每个BibliographyDriver
适当的地方。例如,对于书籍
\DeclareBibliographyDriver{book}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/editor+others/translator+others}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{maintitle+title}%
\newunit
会成为
\DeclareBibliographyDriver{book}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/editor+others/translator+others}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{date}%
\newunit\newblock
\usebibmacro{maintitle+title}%
\newunit