(adapted from: http://www.1984produkts.com/donkeyhottie/archives/2008/05/16/customizing-multimarkdown-to-make-scrivener-easier-part-b/)
One of the nice things about the mla.sty is that the mla environment includes a field for “surname,” so you can get the (to me) more professional “Surname, pagenumber” headers on all pages after the first. I figured replicating this would be a good chance to make use of the MMD Metadata in Scrivener.
In your Scrivener project, open the MMD settings and define a key called “Surname” with your surname as the value.
Next, you have to edit xhtml2latex.xslt in three places (as well as in one place in memoir-xelatex.xslt, if you’re using XeLaTeX)
- Around line 67, you should see:
<xsl:template match="html:meta">
<xsl:choose>
Right after that xsl:choose, paste in:
[code]
<xsl:when test=“translate(@name,‘ABCDEFGHIJKLMNOPQRSTUVWXYZ’, ‘abcdefghijklmnopqrstuvwxyz’) = ‘surname’”>
xsl:text\def\surnamecomma{</xsl:text>
<xsl:call-template name=“clean-text”>
<xsl:with-param name=“source”>
<xsl:value-of select="@content"/>
</xsl:with-param>
</xsl:call-template>
xsl:text, }
</xsl:text>
</xsl:when>
It’s important to nail this, so that’s why I encourage copying and pasting. Note especially the line with the , }. that means that it’s going to append a comma and a space to the surname you provide in the Scrivener metadata, automatically.
- Around line 1079, you should see:
\def\myauthor{Author} % In case these were not included in metadata
\def\mytitle{Title}
\def\mykeywords{}
\def\mybibliostyle{plain}
\def\bibliocommand{}
Right underneath, add:
\def\surnamecomma{}
REPEAT this on memoir.xelatex.xslt, looking for the similar part of the file
- Around line 1150 of xhtml2latex.xslt:
Where you see:
\begin{document}
Right above it, insert:
\makepagestyle{surname}
\makeoddhead{surname}{}{}{\surnamecomma\thepage}
\pagestyle{surname}
That’s it!