
我正在使用 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}