1

I am working on the bibliography of my Master's thesis with very particular formatting requirements, most of which I have managed with some help from here.
The last thing remaining for me is to use a comma after thesis type for Master's and PhD theses. This is what I've got currently: PhD thesis example with period

What I want is:
PhD diss., The University...
Master's thesis, The University...

The solution presented here does not work for me; I get the exact same output.

Here is my code:

% Produce modified CMS citations and bibliography using bastardized MLA style
\usepackage[
citestyle=numeric,  % force numeric inline citations
bibstyle=mla,       % vanilla mla
natbib=true,        % not sure why this is required
backend=biber,      % compiling stuff
maxnames=7,         % DTM guideline is up to 10
minnames=7,         %   biblatex defaults to minnames when max is exceeded, but need 7 per DTM
showmedium=false,   % don't print publication medium 
sorting=nty,        % sort name, title, year
language=american   % proper comma inside quotation behavior
]{biblatex}
\addbibresource{thbib.bib}

\DeclareFieldFormat{journalvolume}{#1} % Remove italicized formatting from journal volumes
\DeclareFieldFormat{booktitle}{#1} % Remove italicized formatting from journal volumes
\defbibheading{bibliography}{% % Change "Works Cited" to "Bibliography"
\section*{Bibliography}}

% \DeclareFieldFormat[thesis]{type}{#1\addcomma}
\DefineBibliographyStrings{american}{phdthesis = {PhD diss}}
\DefineBibliographyStrings{american}{mathesis = {Master's thesis}}

If I try adding the line \DeclareFieldFormat[thesis]{type}{#1\addcomma} I get this:
PhD thesis example with comma

It removes my string definition for PhD and Master's.

lloyd
  • 35
  • In general adding punctuation commands such as \addcomma or \addperiod to the end of field formats should be a last resort. It is not done in any of the standard styles and may lead to unwanted output (though it is not at all unlikely that you will never get to see a problematic case - see also my 'matter of taste' comment under Alan's answer). – moewe May 01 '18 at 21:18
  • 2
    While we are at it. natbib=true is only required if you use the natbib-like commands \citet and \citep, if you use the biblatex names \textcite and \parencite instead, you won't need that option. Instead of \defbibheading{bibliography} you could redefine the bibstring bibliography = {Bibliography} (depending on your class references = {Bibliography} might be needed as well). – moewe May 01 '18 at 21:23

1 Answers1

2

It seems that

\renewbibmacro*{mla:thesis:type}{%
  \iffieldundef{type}%
    {\printtext[mla:capital]{\bibstring{phdthesis}\addcomma}}%
        {\usebibmacro{mla:all:type}\addcomma}}

will do what you want provided you change your bibstring definition to:

\DefineBibliographyStrings{american}{phdthesis = {PhD diss\adddot}}
Alan Munn
  • 218,180
  • I really don't like bare \addcommas (or most \addcommas in \printtext for that matter), but I will admit that my preferred 'clean' solution would involve patching the driver \xpatchbibdriver{thesis}{\usebibmacro{mla:thesis:type}% \newunit\newblock}{\usebibmacro{mla:thesis:type}\setunit*{\addcomma\space}}{}{} (untested) – moewe May 01 '18 at 20:30
  • @moewe I was wondering about that and expecting that you might have a different idea. Is this a matter of taste, or are there real downsides to doing this? – Alan Munn May 01 '18 at 20:31
  • 2
    @moewe Actually I think this will not work with the MA thesis, which shouldn't have the \adddot. – Alan Munn May 01 '18 at 20:36
  • First and foremost it is a matter of taste. I used to think there were serious problems with this approach, but since biblatex is really clever I found it hard to come up with a convincing counterexample. A bare \addcomma behaves very differently from a \setunit{\addcomma} especially with respect to the following ounctuation, but in some cases that may actually be a feature. – moewe May 01 '18 at 20:41
  • @AlanMunn, you're right that your solution doesn't work for the Master's thesis. And that moewe's solution doesn't work for the PhD diss., which needs the dot. Tested both. – lloyd May 01 '18 at 20:46
  • Oh hey, figured out a hackey way to do it. Using @moewe's solution but changing my DefineBibliographystring to phdthesis = {PhD diss.,} manages the right output – lloyd May 01 '18 at 20:50
  • @lloyd I've updated the answer to a less hacky version... – Alan Munn May 01 '18 at 20:53
  • 2
    @lloyd Please don't include the comma in the bibstring phdthesis = {PhD diss\adddot} is very likely the definition you want instead of (PhD diss, if you want the dot, add the dot - the comma is different, however). That would actually bring Alan's answer back into play here. – moewe May 01 '18 at 20:53
  • @moewe Yeah, you're right. This puts the abbreviation into the bibmacro which is semantically wrong. I'll go back to the original version and use \adddot in the bibstring. – Alan Munn May 01 '18 at 21:03