I’d like my book TOC to look like this:
Preface
Ch 1: Introduction
PART I
Ch 2: …
Ch 3: …
PART II
Ch 4: …
I cannot figure out how to get Preface (without a chapter #), and Ch 1 (without a container Part). Any suggestions?
Thanks
I’d like my book TOC to look like this:
Preface
Ch 1: Introduction
PART I
Ch 2: …
Ch 3: …
PART II
Ch 4: …
I cannot figure out how to get Preface (without a chapter #), and Ch 1 (without a container Part). Any suggestions?
Thanks
Not sure about memoir, but here’s how it’s done in the LaTeX standard classes:
\chapter*{Preface}
\addcontentsline{toc}{chapter}{Preface}
Here’s an example how you can use this in an XSLT file:
<xsl:template match="html:h2">
<xsl:choose>
<xsl:when test='contains(node(), "Preface")'>
<xsl:text>\chapter*{</xsl:text>
<xsl:apply-templates select="node()"/>
<xsl:text>}</xsl:text>
<xsl:value-of select="$newline"/>
<xsl:text>\addcontentsline{toc}{chapter}{</xsl:text>
<xsl:apply-templates select="node()"/>
<xsl:text>\}</xsl:text>
<xsl:value-of select="$newline"/>
<xsl:text>\label{</xsl:text>
<xsl:value-of select="@id"/>
<xsl:text>}</xsl:text>
<xsl:value-of select="$newline"/>
<xsl:value-of select="$newline"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>\chapter{</xsl:text>
<xsl:apply-templates select="node()"/>
<xsl:text>}</xsl:text>
<xsl:value-of select="$newline"/>
<xsl:text>\label{</xsl:text>
<xsl:value-of select="@id"/>
<xsl:text>}</xsl:text>
<xsl:value-of select="$newline"/>
<xsl:value-of select="$newline"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
The problem is that both Scrivener and MMD assume that Part is the top level section. I would use a “dummy” Part that surpresses the LaTeX \part command. Another untested example:
<xsl:template match="html:h1">
<xsl:choose>
<xsl:when test='contains(node(), "DUMMY")'>
</xsl:when>
<xsl:otherwise>
<xsl:text>\part{</xsl:text>
<xsl:apply-templates select="node()"/>
<xsl:text>}</xsl:text>
<xsl:value-of select="$newline"/>
<xsl:text>\label{</xsl:text>
<xsl:value-of select="@id"/>
<xsl:text>}</xsl:text>
<xsl:value-of select="$newline"/>
<xsl:value-of select="$newline"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Have you tried adjusting the Base Header Level in the Multimarkdown Settings dialogue?
A value of 2 gets rid of Parts for me.
Thanks! I guess I could always go lo-tech with those Latex snippets:
Body of preface.
Body of introduction.
I do not recall if they are unnumbered, but a few of the stylesheet variants support a synopsis or abstract section, which could perhaps be renamed to preface. The XSLTs are all named intuitively, like memoir-synopsis.xslt
.