biblatex-philosophy
(现代)当没有作者/编辑/翻译等需要声明时,无法正确换行。
以下是 MWE:
\documentclass[12pt,a4paper]{article}
\usepackage{filecontents}
\begin{filecontents}{test2.bib}
@online{guit:sito,
Date = {2012},
Date-Added = {2012-04-21 16:52:51 +0200},
Date-Modified = {2013-03-15 16:40:18 +0100},
Hyphenation = {italian},
Keywords = {esempio, web},
Title = {GuIT. Gruppo degli Utilizzatori Italiani di \TeX},
Url = {http://www.guitex.org},
Urldate = {2012-01-15},
Annote = {A Web site},
Bdsk-Url-1 = {http://www.guitex.org}
}
@periodical{jcg,
title = {Computers and Graphics},
year = 2011,
issuetitle = {Semantic {3D} Media and Content},
volume = 35,
number = 4,
issn = {0097-8493},
annotation = {This is a \texttt{periodical} entry with an \texttt{issn}
field.},
}
\end{filecontents}
\usepackage[backend=biber, style=philosophy-modern, language=american,publocformat=loccolonpub]{biblatex}
\addbibresource{test2.bib}
\begin{document}
\nocite{*}
\printbibliography
\end{document}
使用@moewe修改后的宏,我进行了测试,似乎出现了一个新的错误;标题后面有一个错误的换行符。这是 MWE:
\documentclass[12pt,a4paper]{article}
\usepackage{filecontents}
\begin{filecontents}{test2.bib}
@online{ctan,
Date = {2006},
Date-Added = {2011-06-02 17:33:32 +0200},
Date-Modified = {2013-03-15 16:35:26 +0100},
Hyphenation = {american},
Keywords = {esempio, web},
Label = {CTAN},
Subtitle = {The Comprehensive TeX Archive Network},
Title = {CTAN},
Url = {http://www.ctan.org},
Urldate = {2006-10-01},
Annote = {Note the \texttt{urldate} field and the \texttt{label} field, used for the citations.},
Bdsk-Url-1 = {http://www.ctan.org}}
\end{filecontents}
\usepackage[backend=biber, style=philosophy-modern, language=american,publocformat=loccolonpub]{biblatex}
\addbibresource{test2.bib}
\NewBibliographyString{origpubbare}
\DefineBibliographyStrings{english}{origpubbare = {orig\adddotspace pub\adddotspace}}
\makeatletter
\newbibmacro*{transorigstring}{%
\iffieldundef{reprinttitle}%
{\printtext{\ifdefstring{\bbx@origfields}{origed}
{\bibstring{origpubbare}}%
{\bibstring{translationas}}}\nopunct}%
{\printtext{\bibstring{reprint}}}\nopunct}
\makeatother
\makeatletter
\renewbibmacro*{author}{%
\ifboolexpr{%
test \ifuseauthor
and
not test {\ifnameundef{author}}
}%
{\usebibmacro{bbx:dashcheck}%
{}%
{\usebibmacro{bbx:savehash}%
\printnames{author}%
\iffieldundef{nameaddon}
{}%
{\setunit{\addspace}%
\printtext[brackets]{\printfield{nameaddon}}}%
\iffieldundef{authortype}%
{}%
{\setunit{\addcomma\space}}%
\usebibmacro{authorstrg}}}%
{\global\undef\bbx@lasthash%
\usebibmacro{labeltitle}%
\setunit*{\addspace}}%
\postsep
\usebibmacro{date+extrayear}}%
\renewbibmacro*{bbx:editor}[1]{%
\ifboolexpr{%
test \ifuseeditor
and
not test {\ifnameundef{editor}}
}%
{\usebibmacro{bbx:dashcheck}%
{}%
{\printnames{editor}%
\postsep%ADD
\usebibmacro{bbx:savehash}}}%
{\global\undef\bbx@lasthash%
\usebibmacro{labeltitle}%
\postsep}%
\usebibmacro{date+extrayear}%
\ifboolexpr{%
(test \ifuseeditor
and
not test {\ifnameundef{editor}})
and test {\iffieldundef{label}}
}%
{\usebibmacro{#1}%
\clearname{editor}%
\printtext{\addcomma\space}}
{\blx@initunit}}%
\renewbibmacro*{bbx:translator}[1]{%
\ifboolexpr{%
test \ifusetranslator
and
not test {\ifnameundef{translator}}
}%
{\usebibmacro{bbx:dashcheck}%
{}%
{\printnames{translator}%
\postsep%ADD
\usebibmacro{bbx:savehash}}}%
{\global\undef\bbx@lasthash%
\usebibmacro{labeltitle}%
\postsep}%
\usebibmacro{date+extrayear}%
\ifboolexpr{%
(test \ifusetranslator
and
not test {\ifnameundef{translator}})
and test {\iffieldundef{label}}
}%
{\usebibmacro{#1}%
\clearname{translator}%
\printtext{\addcomma\space}}
{\blx@initunit}}%
\makeatother
\begin{document}
\nocite{*}
\printbibliography
\end{document}
答案1
较新版本中已修复此问题
biblatex-philosophy
。
我无法说这是否是有意的,但我们当然可以确保在标题后面也有一个换行符。
我们只需要在,和宏\postsep
后面添加一个(后者参见\usebibmacro{labeltitle}
author
editor:bbx
bbx:translator
biblatex philosophy-modern:一个错误?)
\makeatletter
\renewbibmacro*{labeltitle}{%
\iffieldundef{label}%
{\iffieldundef{shorttitle}%
{\printfield{title}\clearfield{title}}%
{\printfield[title]{shorttitle}}}%
{\printtext{\printfield{label}}}}
\renewbibmacro*{author}{%
\ifboolexpr{%
test \ifuseauthor
and
not test {\ifnameundef{author}}
}%
{\usebibmacro{bbx:dashcheck}%
{}%
{\usebibmacro{bbx:savehash}%
\printnames{author}%
\iffieldundef{nameaddon}
{}%
{\setunit{\addspace}%
\printtext[brackets]{\printfield{nameaddon}}}%
\iffieldundef{authortype}%
{}%
{\setunit{\addcomma\space}}%
\usebibmacro{authorstrg}}}%
{\global\undef\bbx@lasthash%
\usebibmacro{labeltitle}}%
\postsep
\usebibmacro{date+extrayear}}%
\renewbibmacro*{bbx:editor}[1]{%
\ifboolexpr{%
test \ifuseeditor
and
not test {\ifnameundef{editor}}
}%
{\usebibmacro{bbx:dashcheck}%
{}%
{\printnames{editor}%
\postsep%ADD
\usebibmacro{bbx:savehash}}}%
{\global\undef\bbx@lasthash%
\usebibmacro{labeltitle}%
\postsep}%
\usebibmacro{date+extrayear}%
\ifboolexpr{%
(test \ifuseeditor
and
not test {\ifnameundef{editor}})
and test {\iffieldundef{label}}
}%
{\usebibmacro{#1}%
\clearname{editor}%
\printtext{\addcomma\space}}
{\blx@initunit}}%
\renewbibmacro*{bbx:translator}[1]{%
\ifboolexpr{%
test \ifusetranslator
and
not test {\ifnameundef{translator}}
}%
{\usebibmacro{bbx:dashcheck}%
{}%
{\printnames{translator}%
\postsep%ADD
\usebibmacro{bbx:savehash}}}%
{\global\undef\bbx@lasthash%
\usebibmacro{labeltitle}%
\postsep}%
\usebibmacro{date+extrayear}%
\ifboolexpr{%
(test \ifusetranslator
and
not test {\ifnameundef{translator}})
and test {\iffieldundef{label}}
}%
{\usebibmacro{#1}%
\clearname{translator}%
\printtext{\addcomma\space}}
{\blx@initunit}}%
\makeatother
为了确保不会出现虚假的“ed。”/“trans。”我们还对最后一个进行了一些修改\if...
,并添加了\blx@initunit
清理标点符号跟踪器。