1 <?xml version='1.0' encoding='utf-8'?>
3 <!-- XHTML-to-Article converter by Fletcher Penney
4 specifically designed for use with MultiMarkdown created XHTML
6 Adds support for natbib citations.
8 Requires that the following command (or equivalent) be included
11 \usepackage[round]{natbib}
14 MultiMarkdown Version 2.0.b5
16 $Id: natbib-support.xslt 479 2008-01-12 23:04:13Z fletcher $
20 # Copyright (C) 2005-2008 Fletcher T. Penney <fletcher@fletcherpenney.net>
22 # This program is free software; you can redistribute it and/or modify
23 # it under the terms of the GNU General Public License as published by
24 # the Free Software Foundation; either version 2 of the License, or
25 # (at your option) any later version.
27 # This program is distributed in the hope that it will be useful,
28 # but WITHOUT ANY WARRANTY; without even the implied warranty of
29 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 # GNU General Public License for more details.
32 # You should have received a copy of the GNU General Public License
33 # along with this program; if not, write to the
34 # Free Software Foundation, Inc.
35 # 59 Temple Place, Suite 330
36 # Boston, MA 02111-1307 USA
41 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
42 xmlns:html="http://www.w3.org/1999/xhtml"
45 <xsl:import href="xhtml2latex.xslt"/>
47 <xsl:output method='text' encoding='utf-8'/>
49 <xsl:strip-space elements="*" />
51 <!-- use \citep by default -->
52 <xsl:template match="html:span[@class='externalcitation']">
53 <xsl:text>\citep</xsl:text>
54 <xsl:apply-templates select="html:span" mode="citation"/>
55 <xsl:apply-templates select="html:a" mode="citation"/>
56 <xsl:text>}</xsl:text>
59 <xsl:template match="html:span[@class='markdowncitation']">
60 <xsl:text>~\citep</xsl:text>
61 <xsl:apply-templates select="html:span" mode="citation"/>
62 <xsl:apply-templates select="html:a" mode="markdowncitation"/>
63 <xsl:text>}</xsl:text>
66 <!-- use \citet when indicated -->
67 <xsl:template match="html:span[@class='externalcitation'][child::html:span[position()='1'][@class='textual citation']]">
68 <xsl:text>\citet</xsl:text>
69 <xsl:apply-templates select="html:span" mode="citation"/>
70 <xsl:apply-templates select="html:a" mode="citation"/>
71 <xsl:text>}</xsl:text>
74 <xsl:template match="html:span[@class='markdowncitation'][child::html:span[position()='1'][@class='textual citation']]">
75 <xsl:text>~\citet</xsl:text>
76 <xsl:apply-templates select="html:span" mode="citation"/>
77 <xsl:apply-templates select="html:a" mode="markdowncitation"/>
78 <xsl:text>}</xsl:text>
81 <!-- Disable the text (not used for LaTeX output) -->
82 <xsl:template match="html:span[@class='textual citation']" mode="citation">