By default, biblatex
does not seem to support a supervisor, so some changes have to be made, but we can keep these changes to a minimum.
Firstly, we define the new name list supervisor
via a new datamodel (thesis.dbx
)
\ProvidesFile{thesis.dbx}[2014/06/14 supervisor for theses]
\RequireBiber[3]
\DeclareDatamodelFields[type=list,datatype=name]{supervisor}
\DeclareDatamodelEntryfields[thesis]{supervisor}
Save the lines above in a file called thesis.dbx
and put it somewhere LaTeX can find it.
In the MWE below, this is done automatically via filecontents
.
The datamodel needs to be loaded via the datamodel
option (datamodel=thesis
, e.g. \usepackage[style=authoryear,backend=biber,datamodel=thesis]{biblatex}
).
Secondly, we need to declare the new strings you asked for in an .lbx
file (the file should be called 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}},
}
Make sure to save the file somewhere LaTeX can find it (as above: in the MWE below, the file is created with filecontents
).
We then employ this language variant via \DeclareLanguageMapping{english}{english-thesis}
.
Finally, we define a new bibmacro
\newbibmacro*{thesissupervisor}{%
\ifnameundef{supervisor}{}{%
\ifnumgreater{\value{supervisor}}{1}
{\bibstring{jointsupervision}}
{\bibstring{supervision}}
\printnames{supervisor}}}
that prints the supervisor and the introducing string depending on the number of supervisors.
We then patch the @thesis
driver to use our new macro (that is done with the awesome xpatch
package).
\xpatchbibdriver{thesis}
{\printfield{type}}
{\printfield{type}
\newunit
\usebibmacro{thesissupervisor}}
{\typeout{yep}}
{\typeout{no}}
The supervisor is now simply added to the supervisor
field like so
@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},
}
MWE
\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}

If you cannot create the new name list supervisor
, you could try and abuse the editor
field, then there is no need for the .dbx
file.
This solution should work with BibTeX as well.
The macros thesissupervisor
becomes
\newbibmacro*{thesissupervisor}{%
\ifnameundef{editor}{}{%
\ifnumgreater{\value{editor}}{1}
{\bibstring{jointsupervision}}
{\bibstring{supervision}}
\printnames{editor}}}
You then give the supervisor in the editor
field in the bib entry like so
@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},
}
MWE
\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}