我正在使用 biblatex+biber,希望在打印作者后开始新的一行,然后打印标题,再开始新的一行,其余部分照常打印。这解决方案接近我的问题,但是我使用默认样式,标题仍然不在单独的行上。
以下是一个例子
Author1, Author2, and Author3. Title. In: Proceedings. Ed. John Doe. World. 2017
以及它应该是什么样子
Author1, Author2, and Author3.
Title.
In: Proceedings. Ed. John Doe. World. 2017
以下是一个最小的工作示例:
\documentclass{scrartcl}
\usepackage{biblatex}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@inproceedings{inProc,
author = {Author11 and Author12 and Author13},
editor = {Editor1},
title = {Title1},
booktitle = {Booktitle1},
year = {2017},
pages = {50--67},
publisher = {Publisher1}
}
@article{article,
author = {Author21 and Author22},
title = {Title2},
journal = {Journal2},
year = {2007},
volume = {29},
number = {5},
pages = {29:1--29:27}
}
@book{book,
author = {Author31},
title = {Title3},
year = {1970},
publisher = {Publisher3}
}
@incollection{inCollection,
author = {Author4},
title = {Title4},
booktitle = {Booktitle4},
pages = {843--993},
editor = {Editor4},
chapter = {15},
volume = {B},
series = {Series4},
publisher = {Publisher4},
year = {1990}
}
@techreport{techreport,
author = {Author5},
institution = {Institution5},
number = {Number5},
pages = {Pages5},
title = {Title5},
year = {5}
}
@phdthesis{phdthesis,
author = {Author6},
title = {Title6},
school = {School6},
month = {Month6},
publisher = {Publisher6},
address = {Address6},
year = {6}
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\begin{document}
\nocite{*}
\printbibliography
\end{document}
答案1
第一步是
\DeclareDelimFormat[bib]{nametitledelim}{\newline\bibsentence}
在名字后面添加一个新行。
然后你需要一些东西来跳转到标题后的新行。不幸的是,这里没有标准的分隔符可以重新定义。适用于所有条目类型的最简单方法是以下
\usepackage{xpatch}
\makeatletter
\def\do#1{
\ifcsdef{blx@bbx@#1}
{\xpatchbibdriver{#1}
{\printlist{language}%
\newunit\newblock}
{\printlist{language}%
\printunit{\newline\bibsentence}}
{}{}}
{}}
\abx@doentrytypes
\makeatother
这会在语言后添加一个换行符,在所有标准驱动程序中,换行符都紧跟在标题之后。我们使用该xpatch
包来更改参考书目驱动程序,并使用循环(\abx@doentrytypes
循环遍历所有内容的内部宏)将更改应用于所有驱动程序。
平均能量损失
\documentclass{scrartcl}
\usepackage{biblatex}
\usepackage{filecontents}
\DeclareDelimFormat[bib]{nametitledelim}{\newline\bibsentence}
\usepackage{xpatch}
\makeatletter
\def\do#1{
\ifcsdef{blx@bbx@#1}
{\xpatchbibdriver{#1}
{\printlist{language}%
\newunit\newblock}
{\printlist{language}%
\printunit{\newline\bibsentence}}
{}{}}
{}}
\abx@doentrytypes
\makeatother
\begin{filecontents*}{\jobname.bib}
@inproceedings{inProc,
author = {Author11 and Author12 and Author13},
editor = {Editor1},
title = {Title1},
booktitle = {Booktitle1},
year = {2017},
pages = {50--67},
publisher = {Publisher1}
}
@article{article,
author = {Author21 and Author22},
title = {Title2},
journal = {Journal2},
year = {2007},
volume = {29},
number = {5},
pages = {29:1--29:27}
}
@book{book,
author = {Author31},
title = {Title3},
year = {1970},
publisher = {Publisher3}
}
@incollection{inCollection,
author = {Author4},
title = {Title4},
booktitle = {Booktitle4},
pages = {843--993},
editor = {Editor4},
chapter = {15},
volume = {B},
series = {Series4},
publisher = {Publisher4},
year = {1990}
}
@techreport{techreport,
author = {Author5},
institution = {Institution5},
number = {Number5},
pages = {Pages5},
title = {Title5},
year = {5}
}
@phdthesis{phdthesis,
author = {Author6},
title = {Title6},
school = {School6},
month = {6},
publisher = {Publisher6},
address = {Address6},
year = {6}
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\begin{document}
\nocite{*}
\printbibliography
\end{document}
类似这样的松散参考书目的另一种解决方案block=par
在BibLaTeX 的参考书目样式与 BibTeX+Beamer 类似。
答案2
以下解决方案仅会给出所需的结果,如果所有条目都有“In:”,例如对于没有期刊的文章,就不会有新行。
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@article{Neu93,
author = {John von Neumann},
title = {First Draft of a Report on the EDVAC},
journaltitle = {IEEE Ann. Hist. Comput. },
date = {1993},
volume = {15},
number = {4},
pages = {27--75},
}
\end{filecontents*}
\usepackage{biblatex}
\renewcommand*{\labelnamepunct}{\newunitpunct\par}
\renewbibmacro{in:}{\newline In:}
\addbibresource{\jobname.bib}
\begin{document}
\nocite{*}
\printbibliography
\end{document}