在biblatex
文档中,它说(版本 1.7,第 11 页):
论文
为教育机构撰写的论文,以满足学位要求。使用类型字段指定论文的类型。
必填字段:作者、标题、类型、机构、年份/日期
可选字段:副标题、titleaddon、语言、注释、位置、月份、isbn、章节、页数、pagetotal、附录、pubstate、doi、eprint、eprintclass、eprinttype、url、urldate
我想知道是否有任何“规范”的方法可以在文件的字段中添加主管的姓名.bib
(.bbl
请不要进行任何操作,我希望我的参考书目可以在多个文档中“按原样”使用)。
预期结果可能是这样的:
Meand Myself。“解释一下,这是一个出色的结果”。博士论文**,由 Toto 教授和 Tata 教授共同指导。巴黎 24 大学,2013 年 11 月。
“在(联合)监督下”这一字符串可以有四种拒绝方式:
- 在...的监管下
- 在联合监督下
- 以及缩写形式
答案1
默认情况下,biblatex
似乎不支持主管,因此必须进行一些更改,但我们可以将这些更改保持在最低限度。
supervisor
首先,我们通过新的数据模型定义新的名称列表( thesis.dbx
)
\ProvidesFile{thesis.dbx}[2014/06/14 supervisor for theses]
\RequireBiber[3]
\DeclareDatamodelFields[type=list,datatype=name]{supervisor}
\DeclareDatamodelEntryfields[thesis]{supervisor}
将上面的几行保存在名为的文件中thesis.dbx
,并将其放在 LaTeX 可以找到的地方。在下面的 MWE 中,此操作通过 自动完成filecontents
。
datamodel
数据模型需要通过选项(datamodel=thesis
,例如)加载\usepackage[style=authoryear,backend=biber,datamodel=thesis]{biblatex}
。
其次,我们需要在文件中声明您要求的新字符串.lbx
(该文件应该被称为english-thesis.lbx
)
\ProvidesFile{english-thesis.lbx}[2014/06/14 english for thesis]
\InheritBibliographyExtras{english}
\NewBibliographyString{supervision,jointsupervision}
\DeclareBibliographyStrings{%
inherit = {english},
supervision = {{under the supervision of}{under sup\adddotspace of}},
jointsupervision = {{under the joint supervision of}{under joint sup\adddotspace of}},
}
确保将文件保存在 LaTeX 可以找到的地方(如上:在下面的 MWE 中,文件是使用创建的filecontents
)。
然后我们通过 来使用这种语言变体\DeclareLanguageMapping{english}{english-thesis}
。
最后我们定义一个新的 bibmacro
\newbibmacro*{thesissupervisor}{%
\ifnameundef{supervisor}{}{%
\ifnumgreater{\value{supervisor}}{1}
{\bibstring{jointsupervision}}
{\bibstring{supervision}}
\printnames{supervisor}}}
根据主管人数打印主管和介绍字符串。
然后我们修补@thesis
驱动程序以使用我们的新宏(使用 awesomexpatch
包裹)。
\xpatchbibdriver{thesis}
{\printfield{type}}
{\printfield{type}
\newunit
\usebibmacro{thesissupervisor}}
{\typeout{yep}}
{\typeout{no}}
现在,只需将主管添加到supervisor
字段中,如下所示
@thesis{geer,
author = {de Geer, Ingrid},
title = {Earl, Saint, Bishop, Skald~-- and Music},
type = {phdthesis},
institution = {Uppsala Universitet},
date = 1985,
subtitle = {The Orkney Earldom of the Twelfth Century. A Musicological
Study},
location = {Uppsala},
supervisor = {James Oint and Stan Upervisor},
}
平均能量损失
\documentclass[british,12pt,a4paper]{article}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@thesis{geer,
author = {de Geer, Ingrid},
title = {Earl, Saint, Bishop, Skald~-- and Music},
type = {phdthesis},
institution = {Uppsala Universitet},
date = 1985,
subtitle = {The Orkney Earldom of the Twelfth Century. A Musicological
Study},
location = {Uppsala},
supervisor = {James Oint and Stan Upervisor},
}
@thesis{loh,
author = {Loh, Nin C.},
title = {High-Resolution Micromachined Interferometric Accelerometer},
type = {mathesis},
institution = {Massachusetts Institute of Technology},
date = 1992,
location = {Cambridge, Mass.},
supervisor = {Stan Upervisor},
}
\end{filecontents*}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage{xpatch}
\usepackage[style=authoryear,backend=biber,datamodel=thesis]{biblatex}
\usepackage{hyperref}
\begin{filecontents*}{thesis.dbx}
\ProvidesFile{thesis.dbx}[2014/06/14 supervisor for theses]
\RequireBiber[3]
\DeclareDatamodelFields[type=list,datatype=name]{supervisor}
\DeclareDatamodelEntryfields[thesis]{supervisor}
\end{filecontents*}
\begin{filecontents*}{english-thesis.lbx}
\ProvidesFile{english-thesis.lbx}[2014/06/14 english for thesis]
\InheritBibliographyExtras{english}
\NewBibliographyString{supervision,jointsupervision}
\DeclareBibliographyStrings{%
inherit = {english},
supervision = {{under the supervision of}{under sup\adddotspace of}},
jointsupervision = {{under the joint supervision of}{under joint sup\adddotspace of}},
}
\end{filecontents*}
\DeclareLanguageMapping{english}{english-thesis}
\newbibmacro*{thesissupervisor}{%
\ifnameundef{supervisor}{}{%
\ifnumgreater{\value{supervisor}}{1}
{\bibstring{jointsupervision}}
{\bibstring{supervision}}
\printnames{supervisor}}}
\xpatchbibdriver{thesis}
{\printfield{type}}
{\printfield{type}
\newunit
\usebibmacro{thesissupervisor}}
{\typeout{yep}}
{\typeout{no}}
\addbibresource{\jobname.bib}
\nocite{*}
\begin{document}
\printbibliography
\end{document}
如果您无法创建新姓名列表supervisor
,您可以尝试滥用该editor
字段,那么该文件就没有必要了.dbx
。此解决方案也适用于 BibTeX。
宏thesissupervisor
变为
\newbibmacro*{thesissupervisor}{%
\ifnameundef{editor}{}{%
\ifnumgreater{\value{editor}}{1}
{\bibstring{jointsupervision}}
{\bibstring{supervision}}
\printnames{editor}}}
editor
然后,你就可以像这样在 bib 条目中向主管提供字段
@thesis{geer,
author = {de Geer, Ingrid},
title = {Earl, Saint, Bishop, Skald~-- and Music},
type = {phdthesis},
institution = {Uppsala Universitet},
date = 1985,
subtitle = {The Orkney Earldom of the Twelfth Century. A Musicological
Study},
location = {Uppsala},
editor = {James Oint and Stan Upervisor},
}
平均能量损失
\documentclass[british,12pt,a4paper]{article}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@thesis{geer,
author = {de Geer, Ingrid},
title = {Earl, Saint, Bishop, Skald~-- and Music},
type = {phdthesis},
institution = {Uppsala Universitet},
date = 1985,
subtitle = {The Orkney Earldom of the Twelfth Century. A Musicological
Study},
location = {Uppsala},
editor = {James Oint and Stan Upervisor},
}
@thesis{loh,
author = {Loh, Nin C.},
title = {High-Resolution Micromachined Interferometric Accelerometer},
type = {mathesis},
institution = {Massachusetts Institute of Technology},
date = 1992,
location = {Cambridge, Mass.},
editor = {Stan Upervisor},
}
\end{filecontents*}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage{xpatch}
\usepackage[style=authoryear,backend=bibtex]{biblatex}
\usepackage{hyperref}
\begin{filecontents*}{english-thesis.lbx}
\ProvidesFile{english-thesis.lbx}[2014/06/14 english for thesis]
\InheritBibliographyExtras{english}
\NewBibliographyString{supervision,jointsupervision}
\DeclareBibliographyStrings{%
inherit = {english},
supervision = {{under the supervision of}{under sup\adddotspace of}},
jointsupervision = {{under the joint supervision of}{under joint sup\adddotspace of}},
}
\end{filecontents*}
\DeclareLanguageMapping{english}{english-thesis}
\newbibmacro*{thesissupervisor}{%
\ifnameundef{editor}{}{%
\ifnumgreater{\value{editor}}{1}
{\bibstring{jointsupervision}}
{\bibstring{supervision}}
\printnames{editor}}}
\xpatchbibdriver{thesis}
{\printfield{type}}
{\printfield{type}
\newunit
\usebibmacro{thesissupervisor}}
{\typeout{yep}}
{\typeout{no}}
\addbibresource{\jobname.bib}
\nocite{*}
\begin{document}
\printbibliography
\end{document}