我的目标是实现这种 Google Scholar 风格:
- 条目的排序为类型->标题->作者->年份->出版商->URL
- 类型全部大写(最好是小写),并在标题前用方括号括起来
- 任何类型的标题都应采用大号粗体
- 第二行只有作者、年份、出版商和 URL
问题
- 如何显示类型条目(书籍、文章、艺术品、未出版)
- 如何交换条目?
- 如何使作者条目不显示
family=X, given=Y
?
平均能量损失
\documentclass{report}
\usepackage[url=false]{biblatex}
\addbibresource{test.bib}
\DeclareFieldFormat
[book,article,artwork,unpublished,website]
{title}{{\textbf{#1}}\newline}
\DeclareNameFormat
[book,article,artwork,unpublished,website]
{author}{{\small{#1}}}
\renewbibmacro*{title+author}{%
\printfield{title}%
\setunit*{\addcomma\space}%
\printnames{author}%
\setunit*{\addcomma\space}%
}
\begin{document}
\nocite{*}
\printbibliography
\end{document}
答案1
我们可以定义一个新的书目驱动程序,并让所有条目类型使用相同的驱动程序。
\documentclass{article}
\usepackage[style=authortitle]{biblatex}
\addbibresource{biblatex-examples.bib}
\renewcommand*{\newunitpunct}{\addspace\bibrangedash\space}
\DeclareFieldFormat{entrytype}{{\small{\textsc{\mkbibbrackets{#1}}}}}
\DeclareFieldFormat*{title}{\mkbibbold{#1}}
\DeclareNameAlias{sortname}{default}
\DeclareNameAlias{default}{family-given}
\DeclareDelimAlias{finalnamedelim}{multinamedelim}
\DeclareBibliographyDriver{googlescholarlike}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\printfield{entrytype}%
\setunit{\addspace}\newblock
\usebibmacro{title}%
\printunit{\newline}\newblock
\usebibmacro{author/editor+others/translator+others}%
\newunit\newblock
\usebibmacro{date}%
\newunit\newblock
\printfield{publisher}%
\newunit\newblock
\iffieldundef{doi}
{\iffieldundef{eprint}
{\printfield{url}}
{\usebibmacro{eprint}}}
{\printfield{doi}}%
\newunit\newblock
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}
}
\setlength{\bibitemsep}{.5\baselineskip}
\defbibenvironment{bibliography}
{\list
{}
{\setlength{\leftmargin}{0pt}%
\setlength{\itemsep}{\bibitemsep}%
\setlength{\parsep}{\bibparsep}}%
\renewcommand*{\makelabel}[1]{\hss##1}}
{\endlist}
{\item}
\makeatletter
\def\do#1{\DeclareBibliographyAlias{#1}{googlescholarlike}}
\abx@doentrytypes
\makeatother
\begin{document}
\nocite{sigfridsson,ctan,cicero,worman,nussbaum,baez/online}
\printbibliography
\end{document}