我正在处理一份提交给大学的文档,现在我必须更改某些样式(主要是引用和参考书目),这些样式是由发布文档的出版商设置的。
给定的情况如下:
有两种参考书目条目:
- 来源
primary
,由相应 bib 条目中的关键字标识,以及 - 参考,通过关键字 来标识
secondary
。
不同的条目属于不同的书目。样式更改请求应仅影响来源即包含关键字 的条目primary
。
要求基本上是,条目应以 开头,title
后面editor
跟着 。条目还应按标题排序。
我已经实现了按标题排序(请参阅下面的 MWE)。我目前的理解是,此请求仅影响类型@book
和的 bib 条目@mvbook
,因为出现的其他类型已经满足标准。
还值得注意的是,中的所有条目sources
都没有作者。
以下是 MWE:
\documentclass{scrbook}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{filecontents}
\begin{filecontents}{bibliography.bib}
@book{adamofbremen_history_2002,
title = {Adam of {{Bremen}}, {{History}} of the {{Archbishops}} of {{Hamburg-Bremen}}},
editor = {Tschan, Francis J.},
date = {2002},
location = {{New York}},
keywords = {2 PDF/Book,5: cited,primary}
}
@incollection{abbooffleury_passio_1972,
title = {Abbo: Passio Sancti Eadmundi},
booktitle = {Three Lives of English Saints},
editor = {Winterbottom, Michael},
date = {1972},
pages = {67--87},
location = {{Toronto}},
langid = {latin},
keywords = {2 PDF/Book,5: cited,primary}
}
@mvbook{friis-jensen_saxo_2014,
title = {Saxo {{Grammaticus}}, {{Gesta Danorum}}. {{The History}} of the {{Danes}}},
editor = {Friis-Jensen, Karsten},
translator = {Fisher, Peter},
date = {2014},
series = {Oxford Medieval Texts},
volume = {1},
location = {{New York}},
isbn = {978-0-19-820523-4},
volumes = {2},
keywords = {2 PDF/Book,5: cited,primary,Sources}
}
% secondary
@book{adams_scandinavia_2004,
title = {Scandinavia and {{Europe}} 800-1350: {{Contact}}, {{Conflict}}, and {{Coexistence}}},
shorttitle = {Scandinavia and {{Europe}} 800 - 1350},
editor = {Adams, Jonathan and Holman, Katherine},
date = {2004},
series = {Medieval Texts and Cultures of {{Northern Europe}}},
number = {4},
location = {{Turnhout}},
isbn = {2-503-51085-X},
pagetotal = {369},
keywords = {1 get,2 PDF/Book,Context and Review,secondary}
}
\end{filecontents}
\usepackage[backend=biber, style=ext-authortitle-ibid, isbn=false]{biblatex} % comment in when running reference analysis
\addbibresource{bibliography.bib}
\DeclareSortingScheme{byTitle}{
\sort{\field{title}}
\sort{\field{name}}
\sort{\field{year}}
}
\renewbibmacro*{title+editor}{%
\usebibmacro{title}%
\newunit
\printtext[parens]{\usebibmacro{byeditor+others}}%
\clearname{editor}%
\newunit
}
\begin{document}
A primary source of type \emph{incollection}.\footnote{\cite{abbooffleury_passio_1972}.}
A primary source of type \emph{book}.\footnote{\cite{adamofbremen_history_2002}.}
A primary source of type \emph{mvbook}.\footnote{\cite{friis-jensen_saxo_2014}.}
A secondary source.\footnote{\cite{adams_scandinavia_2004}.}
\newrefcontext[sorting=byTitle]
\printbibliography[keyword={primary}, title={Sources}, heading=subbibintoc]
\newrefcontext[sorting=nyt]
\printbibliography[keyword={secondary}, title={References}, heading=subbibintoc]
\end{document}
其结果为以下 PDF:
带有类型的条目@incollection
基本上就是我需要实现的,标题前没有“In:”。
例如,@book
条目应该是:
Adam of Bremen, History of the Archbishops of Hamburg-Bremen. Ed. by Francis J. Tschan. New York, 2002.
附言:我已经更改了参考书目的许多样式,我将其省略以专注于主要任务。但这些更改可能会对给定解决方案的结果产生负面影响,我稍后会提到这一点,并编辑我的问题。
答案1
useeditor
对于不应editor
在主名称位置显示的条目,您可以将每个条目选项设置为 false。
\documentclass{scrbook}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[backend=biber, style=ext-authortitle-ibid, isbn=false]{biblatex}
\DeclareSortingScheme{byTitle}{
\sort{\field{title}}
\sort{\field{name}}
\sort{\field{year}}
}
\begin{filecontents}{\jobname.bib}
@book{adamofbremen_history_2002,
title = {Adam of {Bremen}, {History} of the {Archbishops} of {Hamburg-Bremen}},
editor = {Tschan, Francis J.},
date = {2002},
location = {New York},
keywords = {2 PDF/Book,5: cited,primary},
options = {useeditor=false},
}
@incollection{abbooffleury_passio_1972,
title = {Abbo: Passio Sancti Eadmundi},
booktitle = {Three Lives of English Saints},
editor = {Winterbottom, Michael},
date = {1972},
pages = {67--87},
location = {Toronto},
langid = {latin},
keywords = {2 PDF/Book,5: cited,primary},
}
@mvbook{friis-jensen_saxo_2014,
title = {Saxo {Grammaticus}, {Gesta Danorum}. {The History} of the {Danes}},
editor = {Friis-Jensen, Karsten},
translator = {Fisher, Peter},
date = {2014},
series = {Oxford Medieval Texts},
volume = {1},
location = {New York},
isbn = {978-0-19-820523-4},
volumes = {2},
keywords = {2 PDF/Book,5: cited,primary,Sources},
options = {useeditor=false},
}
% secondary
@book{adams_scandinavia_2004,
title = {Scandinavia and {Europe} 800-1350: {Contact}, {Conflict}, and {Coexistence}},
shorttitle = {Scandinavia and {Europe} 800 - 1350},
editor = {Adams, Jonathan and Holman, Katherine},
date = {2004},
series = {Medieval Texts and Cultures of {Northern Europe}},
number = {4},
location = {Turnhout},
isbn = {2-503-51085-X},
pagetotal = {369},
keywords = {1 get,2 PDF/Book,Context and Review,secondary}
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
A primary source of type \emph{incollection}.\footnote{\cite{abbooffleury_passio_1972}.}
A primary source of type \emph{book}.\footnote{\cite{adamofbremen_history_2002}.}
A primary source of type \emph{mvbook}.\footnote{\cite{friis-jensen_saxo_2014}.}
A secondary source.\footnote{\cite{adams_scandinavia_2004}.}
\newrefcontext[sorting=byTitle]
\printbibliography[keyword={primary}, title={Sources}, heading=subbibintoc]
\newrefcontext[sorting=nyt]
\printbibliography[keyword={secondary}, title={References}, heading=subbibintoc]
\end{document}
您也可以根据每个类型设置此选项,但是您需要确保使用正确的条目类型@collection
来进行此类工作adams_scandinavia_2004
。
\documentclass{scrbook}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[backend=biber, style=ext-authortitle-ibid, isbn=false]{biblatex}
\DeclareSortingScheme{byTitle}{
\sort{\field{title}}
\sort{\field{name}}
\sort{\field{year}}
}
\ExecuteBibliographyOptions[book,mvbook]{useeditor=false}
\begin{filecontents}{\jobname.bib}
@book{adamofbremen_history_2002,
title = {Adam of {Bremen}, {History} of the {Archbishops} of {Hamburg-Bremen}},
editor = {Tschan, Francis J.},
date = {2002},
location = {New York},
keywords = {2 PDF/Book,5: cited,primary},
}
@incollection{abbooffleury_passio_1972,
title = {Abbo: Passio Sancti Eadmundi},
booktitle = {Three Lives of English Saints},
editor = {Winterbottom, Michael},
date = {1972},
pages = {67--87},
location = {Toronto},
langid = {latin},
keywords = {2 PDF/Book,5: cited,primary},
}
@mvbook{friis-jensen_saxo_2014,
title = {Saxo {Grammaticus}, {Gesta Danorum}. {The History} of the {Danes}},
editor = {Friis-Jensen, Karsten},
translator = {Fisher, Peter},
date = {2014},
series = {Oxford Medieval Texts},
volume = {1},
location = {New York},
isbn = {978-0-19-820523-4},
volumes = {2},
keywords = {2 PDF/Book,5: cited,primary,Sources},
}
% secondary
@collection{adams_scandinavia_2004,
title = {Scandinavia and {Europe} 800--1350},
subtitle = {Contact, Conflict, and Coexistence},
editor = {Adams, Jonathan and Holman, Katherine},
date = {2004},
series = {Medieval Texts and Cultures of {Northern Europe}},
number = {4},
location = {Turnhout},
isbn = {2-503-51085-X},
pagetotal = {369},
keywords = {1 get,2 PDF/Book,Context and Review,secondary}
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
A primary source of type \emph{incollection}.\footnote{\cite{abbooffleury_passio_1972}.}
A primary source of type \emph{book}.\footnote{\cite{adamofbremen_history_2002}.}
A primary source of type \emph{mvbook}.\footnote{\cite{friis-jensen_saxo_2014}.}
A secondary source.\footnote{\cite{adams_scandinavia_2004}.}
\newrefcontext[sorting=byTitle]
\printbibliography[keyword={primary}, title={Sources}, heading=subbibintoc]
\newrefcontext[sorting=nyt]
\printbibliography[keyword={secondary}, title={References}, heading=subbibintoc]
\end{document}
答案2
根据@moewe提供的解决方案我在文件useeditor=false
中有条件地以以下方式添加了选项.tex
:
\DeclareSourcemap{
\maps[datatype = bibtex]{
\map{
% select only entries with a keyword `primary`
\step[fieldsource = keywords, match = \regexp{\bprimary\b}, final]
% Restricts all \steps to type `book` and `mvbook`
\pertype{book}
\pertype{mvbook}
% add a key `options` to the bib entry with the value `useeditor=false`
\step[fieldset=options, fieldvalue={useeditor=false}]
}
}
}
我这样做是为了让参考书目的数据源(来自外部工具)没有关于条目格式的信息,因为该数据源用于具有不同格式的不同出版物的多个分支。