With a little help from the folks on the Literature and Latte forums, I have been gently massaging Scrivener into something I might want to write a dissertation in. Or, rather something I can write a dissertation in. A big part of that has been learning XSLT, since Scrivener uses Fletcher Penny’s Multimarkdown for LaTeX export. I am agaog. I am aghast. I am a number of other descriptors that imply the combination of unpleasant surprise and simple stupefication.

Who designed this monstrosity? As a culture, programmers share two main features. We’re lazy, and we’re creatures of habit. Whence, then, XSLT? Just because it transforms XML doesn’t mean it has to look like XML. In what world does this:

            <xsl:with-param name="substring">

               <xsl:text>~</xsl:text>

            </xsl:with-param>

            <xsl:with-param name="replacement">

               <xsl:text>\ensuremath{\sim}</xsl:text>

           </xsl:with-param>

make sense? Most text processing (or, if you prefer, “transforming”) lanuages have an idiom for this, and usually it looks more like s/~/\\ensuremath{\\sim}/ or maybe sub('\ensuremath{\sim}', '~'). Where’s the laziness, XSLT? And why are you reinventing the wheel–and a square wheel at that?

biblatex MLA patch

November 28, 2007

As part of finally getting a jump on my dissertation, I’ve been re-learning LaTeX and BibTeX, and learning biblatex, which seems to be the only thing that offers any hope of turning out LaTeX reports that are MLA formatted. Thanks to James Clawson and his bibtex-MLA package, “MLA BibTeX support” is no longer any oxymoron. It’s a godsend. The current release is very usable, but it has trouble with some corner cases. Workarounds are pretty simple using brackets to force formatting behavior, but since I’m going to be using this a lot and I may have to export the records out of BibTeX at some point, I’m patching the style macros as I go along.

So far, I’ve only had two real issues: the default url handling using \mbox and \hfill forced problematic line breaks and justification errors, and books with editors, but not authors, weren’t handled correctly.

Since James hasn’t supplied copyright information for the code or contact information, I’m supplying the changes as a patch against the MLA.bbx in the current 0.2 release, rather than posting the file I’ve patched: MLAbbx02-0020.patch.

If you’re on OS X or Linux, updating should be as simple as downloading the file, opening a terminal window, and typing

$ patch /path/to/your/MLA.bbx /path/to/MLAbbx02-0020.patch