问题
我正在使用 biblatex 和authortitle-dw
样式。正如大多数情况下所希望的那样,引文以“ name
,, (如果有shorttitle
指示pages
)”的形式显示在脚注中。
然而,作为一名历史学家,我处理着从各个档案馆收集的大量未发表的文献。为了处理这些文献,我@unpublished
以一种相当业余的方式修改了条目类型(我猜)。
问题在于,在脚注中,正如可以预料的那样,只出现了我未发表文件的标题,而在这个特殊情况下,以“ title
,在:archive
,,shelf
Bd。box
”形式的完整引用是可取的。
该\fullcite
命令在这里对我来说不起作用,因为它不允许将某些字段的内容替换为“ibid”,而这是绝对必要的。
例子
这是我的 MWE:
\documentclass{article}
\usepackage[ngerman]{babel}
\usepackage[
style=authortitle-dw
]{biblatex}
\DefineBibliographyStrings{ngerman}{
chapter = {Bd.}
}
\DeclareBibliographyDriver{unpublished}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{title}%
\newunit
\usebibmacro{in:}%
\printlist{institution}%
\newunit\newblock
\printlist{location}%
\newunit\newblock
\printfield{chapter}%
\newunit\newblock
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\usebibmacro{finentry}}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@unpublished {test1,
title = {Source1},
institution = {Archive1},
location = {Shelf1},
chapter = {Box1}
}
@unpublished {test2,
title = {Source2},
institution = {Archive1},
location = {Shelf1},
chapter = {Box2}
}
@unpublished {test3,
title = {Source3},
institution = {Archive1},
location = {Shelf1},
chapter = {Box2}
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\footcite{test1}
\footcite{test2}
\footcite{test3}
\end{document}
此示例产生以下输出:
1 Source1
2 Source2
3 Source3
不过,我希望的方式如下:
1 Source1, in: Archive1, Shelf1, Bd. Box1
2 Source2, in: ibid., Bd. Box2
3 Source3, in: ibid.
有没有可能通过任何方式实现这一目标?
答案1
默认情况下,authortitle-dw
样式会生成“简短”引文,即由作者姓名和标题(以及根据设置的选项)组成的内容。您的@unpublished
条目只有title
一个与简短引文相关的“相关”字段,因此这将是唯一打印的字段。
由于您已经为这种格式编写了自己的参考书目驱动程序,因此使用完整引用并相应地调整驱动程序可能是最简单的方法。
展望authortitle-dw.cbx
,\cite
并\footcite
调用bibmacro
cite
,它做实际的工作。原始代码是
\newbibmacro*{cite}{%
\usebibmacro{cite:citepages}%
\global\boolfalse{cbx:loccit}%
\ifbool{cbx:firstfull}
{\ifciteseen
{\usebibmacro{cite:normal}}
{\usebibmacro{cite:firstfull}}}
{\usebibmacro{cite:normal}}}
即,如果给出了选项firstfull
,并且该项目首次被引用,则调用bibmacro
cite:firstfull
,否则cite:normal
调用。我们可以稍微调整一下,强制对类型的每个项目进行完整引用@unpublished
。这是使用biblatex
宏\ifentrytype
。请注意,这应该发生前检查选项firstfull
,以便行为不受该选项的(取消)设置的影响。
\renewbibmacro*{cite}{%
\usebibmacro{cite:citepages}%
\global\boolfalse{cbx:loccit}%
\ifentrytype{unpublished}%
{\ifciteibid{\usebibmacro{cite:ibid}}%
{\usebibmacro{cite:firstfull}}}%
{\ifbool{cbx:firstfull}%
{\ifciteseen%
{\usebibmacro{cite:normal}}
{\usebibmacro{cite:firstfull}}}
{\usebibmacro{cite:normal}}}%
\usebibmacro{savestuff}%
}
请注意,如果之前引用了相同的项目,则使用检查biblatex
和\ifciteibid
打印“ibid”(或您当地的替代方法),而不会打印其他内容bibmacro
cite:ibid
。在实践中,您可能希望将其与\iffirstonpage
检查前一个项目是否在最后一页(双页)上相结合,并且仅在引用的项目实际上在相同的页面,即
\ifthenelse{\ifciteibid\and\not\iffirstonpage}%
{\usebibmacro{cite:ibid}}{\usebibmacro{cite:firstfull}}%
如果任何引文在新的(双页)页面上首次出现,即与“ibid”所引用的引文位于不同的页面上,则这将阻止任何引文被“ibid”替换。
这种方法的优点是,您编写的参考书目驱动程序用于每个引用,因此这是您唯一需要担心的事情。
接下来,您需要告诉biblatex
用“ibid”(或“idem”或任何看起来最合适的词 ;))替换重复出现的字段。由于只有整个条目和主要字段(author
、editor
、title
...)会自动检查,因此我们需要手动执行此操作,例如通过定义bibmacro
\newbibmacro{savestuff}{%
\savelist{institution}{\lastinstitution}%
\savelist{location}{\lastlocation}%
\savefield{chapter}{\lastchapter}}
将所有字段的当前值保存到宏中,以便在下一次引用中进行比较。这不仅应该在这书目驱动程序,但只要引用或将任何内容放入书目中,否则下一个@unpublished
将与最后一个进行比较@unpublished
,而不是与前一个引用/书目条目进行比较。对于引用,可以通过将其放入(重新定义)来实现cite
bibmacro
。要“自动”将其包含在所有书目驱动程序中,可以将其附加到finentry
bibmacro
似乎被所有authortitle-dw
书目驱动程序调用的。这可以借助补丁包(另请参阅biblatex:是否可以修补用 \newbibmacro 创建的宏?)
\xapptobibmacro{finentry}{\usebibmacro{savestuff}}{}{}
现在,不仅仅是说
\printlist{location}%
你应该说类似
\iflistequals{institution}{\lastinstitution}%
{\bibstring{ibidem}}%
{\printlist{institution}}%
institution
用bibstring
关联的来替换该字段ibidem
。
据我了解,对于字段location
和chapter
,如果字段包含“新”信息,则打印该字段;如果字段与前面的条目匹配,则完全忽略该字段。这可以通过嵌套测试来实现:
\iflistequals{institution}{\lastinstitution}%
{\bibstring{ibidem}%
\newunit\newblock%
\iflistequals{location}{\lastlocation}%
{\iffieldequals{chapter}{\lastchapter}%
{}{\printfield{chapter}}}%
{\printlist{location}\newunit\newblock%
\iffieldequals{chapter}{\lastchapter}%
{\bibstring{ibidem}}%
{\printfield{chapter}}}%
}%
{\printlist{institution}\newunit\newblock%
\iflistequals{location}{\lastlocation}%
{\bibstring{ibidem}\newunit\newblock%
\iffieldequals{chapter}{\lastchapter}%
{}{\printfield{chapter}}}%
{\printlist{location}\newunit\newblock%
\iffieldequals{chapter}{\lastchapter}%
{\bibstring{ibidem}}%
{\printfield{chapter}}}%
}%
(可能存在“更清洁”的解决方案,类似于使用标点符号跟踪器biblatex
....)。
为了确保这符合“页面上的第一个条目没有同上”规则,要么扩展所有条件(如上所述)以进行检查,\iffirstonpage
要么我们可以\iffirstonpage
在参考书目驱动程序的开头进行检查,如果是这种情况,只需删除(或将一些“不可能”的内容放入)存储的数据,这样比较就会是负面的,例如
\iffirstonpage{\def\lastinstitution{}%
\def\lastlocation{}%
\def\lastchapter{}}{}%
无论如何,这是完整的文件(带有选项biblatex-dw
)firstfull
:
\documentclass{article}
\usepackage[ngerman]{babel}
\usepackage{xpatch}
\usepackage[
style=authortitle-dw,
firstfull=true
]{biblatex}
\DefineBibliographyStrings{ngerman}{
chapter = {Bd.}
}
\renewbibmacro*{cite}{%
\usebibmacro{cite:citepages}%
\global\boolfalse{cbx:loccit}%
\ifentrytype{unpublished}%
{\ifthenelse{\ifciteibid\and\not\iffirstonpage}%
{\usebibmacro{cite:ibid}}{\usebibmacro{cite:firstfull}}}%
{\ifbool{cbx:firstfull}%
{\ifciteseen%
{\usebibmacro{cite:normal}}
{\usebibmacro{cite:firstfull}}}
{\usebibmacro{cite:normal}}}%
\usebibmacro{savestuff}%
}
\newbibmacro{savestuff}{%
\savelist{institution}{\lastinstitution}%
\savelist{location}{\lastlocation}%
\savefield{chapter}{\lastchapter}}
\xapptobibmacro{finentry}{\usebibmacro{savestuff}}{}{}
\DeclareBibliographyDriver{unpublished}{%
\iffirstonpage{\def\lastinstitution{}%
\def\lastlocation{}%
\def\lastchapter{}}{}%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{title}%
\newunit
\usebibmacro{in:}%
\iflistequals{institution}{\lastinstitution}%
{\bibstring{ibidem}%
\newunit\newblock%
\iflistequals{location}{\lastlocation}%
{\iffieldequals{chapter}{\lastchapter}%
{}{\printfield{chapter}}}%
{\printlist{location}\newunit\newblock%
\iffieldequals{chapter}{\lastchapter}%
{\bibstring{ibidem}}%
{\printfield{chapter}}}%
}%
{\printlist{institution}\newunit\newblock%
\iflistequals{location}{\lastlocation}%
{\bibstring{ibidem}\newunit\newblock%
\iffieldequals{chapter}{\lastchapter}%
{}{\printfield{chapter}}}%
{\printlist{location}\newunit\newblock%
\iffieldequals{chapter}{\lastchapter}%
{\bibstring{ibidem}}%
{\printfield{chapter}}}%
}%
\newunit\newblock%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\usebibmacro{finentry}}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@unpublished {test1,
title = {Source1},
institution = {Archive1},
location = {Shelf1},
chapter = {Box1}
}
@unpublished {test2,
title = {Source2},
institution = {Archive1},
location = {Shelf1},
chapter = {Box2}
}
@unpublished {test3,
title = {Source3},
institution = {Archive1},
location = {Shelf1},
chapter = {Box2}
}
@article{test4,
title={something},
author={someone}
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\footcite{test1}
\footcite{test1}
\footcite{test4}
\footcite{test1}
\footcite{test2}
\footcite{test3}
\footcite{test1}
\footcite{test4}
\clearpage
\footcite{test1}
\printbibliography
\end{document}
结果(在脚注中):
第二页的脚注不包含“ibid”,因为尽管与前一个脚注相同,但它是同一页面上的第一个脚注(请注意,这需要两次通读才能起作用!):
参考书目如下:
注意:此解决方案在参考书目和引文中产生相同的行为。如果不希望出现这种情况(尤其是关于 ibidem 内容),请分别使用检查biblatex
和\ifcitation
来\ifbibliography
处理各种子情况。
答案2
干得好@Jonathan!我按照你笔记中的提示,插入\ifcitation
驱动程序声明来修复参考书目。虽然不是很优雅,但确实有效。
\DeclareBibliographyDriver{unpublished}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{title}%
\newunit
\usebibmacro{in:}%
\ifcitation{% <- here
\iflistequals{institution}{\lastinstitution}%
{\bibstring{ibidem}%
\newunit\newblock%
\iflistequals{location}{\lastlocation}%
{\iffieldequals{chapter}{\lastchapter}%
{}{\printfield{chapter}}}%
{\printlist{location}\newunit\newblock%
\iffieldequals{chapter}{\lastchapter}%
{\bibstring{ibidem}}%
{\printfield{chapter}}}%
}%
{\printlist{institution}\newunit\newblock%
\iflistequals{location}{\lastlocation}%
{\bibstring{ibidem}\newunit\newblock%
\iffieldequals{chapter}{\lastchapter}%
{}{\printfield{chapter}}}%
{\printlist{location}\newunit\newblock%
\iffieldequals{chapter}{\lastchapter}%
{\bibstring{ibidem}}%
{\printfield{chapter}}}%
}%
}{% <- else
\printlist{institution}%
\newunit\newblock
\printlist{location}%
\newunit\newblock
\printfield{chapter}%
}%
\newunit\newblock%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\usebibmacro{finentry}}
因此,参考书目如下所示:
虽然脚注仍然是这样的:
(我将其作为答案发布只是因为代码太长,无法发表评论。)