1 <?xml version='1.0' encoding='utf-8'?>
3 <!-- XHTML-to-Manuscript converter by Fletcher Penney
4 specifically designed for use with MultiMarkdown created XHTML
6 Uses my manuscript class for output
8 MultiMarkdown Version 2.0.b5
10 $Id: manuscript-novel.xslt 479 2008-01-12 23:04:13Z fletcher $
14 # Copyright (C) 2005-2008 Fletcher T. Penney <fletcher@fletcherpenney.net>
16 # This program is free software; you can redistribute it and/or modify
17 # it under the terms of the GNU General Public License as published by
18 # the Free Software Foundation; either version 2 of the License, or
19 # (at your option) any later version.
21 # This program is distributed in the hope that it will be useful,
22 # but WITHOUT ANY WARRANTY; without even the implied warranty of
23 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 # GNU General Public License for more details.
26 # You should have received a copy of the GNU General Public License
27 # along with this program; if not, write to the
28 # Free Software Foundation, Inc.
29 # 59 Temple Place, Suite 330
30 # Boston, MA 02111-1307 USA
35 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
36 xmlns:html="http://www.w3.org/1999/xhtml"
39 <xsl:import href="xhtml2latex.xslt"/>
41 <xsl:template match="/">
42 <xsl:apply-templates select="html:html/html:head"/>
43 <xsl:apply-templates select="html:html/html:body"/>
44 <xsl:call-template name="latex-footer"/>
47 <xsl:template name="latex-footer">
56 \bibliographystyle{\mybibliostyle}
70 <xsl:template name="latex-document-class">
71 <xsl:text>\documentclass[10pt,oneside]{memoir}
72 \usepackage{layouts}[2001/04/29]
73 \usepackage{manuscript}
83 <xsl:template name="latex-paper-size">
88 <xsl:template name="latex-intro">
95 % \ifpdf % Removed for XeLaTeX compatibility
96 % \pdfoutput=1 % Removed for XeLaTeX compatibility
102 pdfauthor={\myauthor},
103 pdfkeywords={\mykeywords}
105 \usepackage{memhfixc}
106 % \fi % Removed for XeLaTeX compatibility
114 </xsl:template> <xsl:template name="latex-title">
119 \aliaspagestyle{titlingpage}{title}
120 \setlength{\droptitle}{30pt}
122 \manuscript\noindent\myauthor \\
128 \renewcommand{\baselinestretch}{2}
129 \normalsize\manuscript\centering\MakeUppercase\mytitle
140 <xsl:template name="latex-copyright">
141 <xsl:text></xsl:text>
144 <xsl:template name="latex-begin-body">
149 % Manuscript settings
150 \renewcommand{\baselinestretch}{2}
151 \raggedright\normalsize
152 \font\body="Courier New" at 12pt\body
155 \setlength{\parindent}{0.5in}
161 <!-- Rename Bibliography -->
162 <xsl:template name="rename-bibliography">
163 <xsl:param name="source" />
164 <xsl:text>\renewcommand\bibname{</xsl:text>
165 <xsl:value-of select="$source" />
170 <!-- Convert headers into chapters, etc -->
172 <xsl:template match="html:h1">
173 <xsl:text>\part{</xsl:text>
174 <xsl:apply-templates select="node()"/>
175 <xsl:text>}</xsl:text>
176 <xsl:value-of select="$newline"/>
177 <xsl:text>\label{</xsl:text>
178 <xsl:value-of select="@id"/>
179 <xsl:text>}</xsl:text>
180 <xsl:value-of select="$newline"/>
181 <xsl:value-of select="$newline"/>
184 <xsl:template match="html:h2">
185 <xsl:text>\chapter{</xsl:text>
186 <xsl:apply-templates select="node()"/>
187 <xsl:text>}</xsl:text>
188 <xsl:value-of select="$newline"/>
189 <xsl:text>\label{</xsl:text>
190 <xsl:value-of select="@id"/>
191 <xsl:text>}</xsl:text>
192 <xsl:value-of select="$newline"/>
193 <xsl:value-of select="$newline"/>
196 <xsl:template match="html:h3">
197 <xsl:text>\begin{center}
205 <xsl:template match="html:h4">
206 <xsl:text>\subsection{</xsl:text>
207 <xsl:apply-templates select="node()"/>
208 <xsl:text>}</xsl:text>
209 <xsl:value-of select="$newline"/>
210 <xsl:text>\label{</xsl:text>
211 <xsl:value-of select="@id"/>
212 <xsl:text>}</xsl:text>
213 <xsl:value-of select="$newline"/>
214 <xsl:value-of select="$newline"/>
217 <xsl:template match="html:h5">
218 <xsl:text>\subsubsection{</xsl:text>
219 <xsl:apply-templates select="node()"/>
220 <xsl:text>}</xsl:text>
221 <xsl:value-of select="$newline"/>
222 <xsl:text>\label{</xsl:text>
223 <xsl:value-of select="@id"/>
224 <xsl:text>}</xsl:text>
225 <xsl:value-of select="$newline"/>
226 <xsl:value-of select="$newline"/>
229 <xsl:template match="html:h6">
230 <xsl:text>{\itshape </xsl:text>
231 <xsl:apply-templates select="node()"/>
232 <xsl:text>}</xsl:text>
233 <xsl:value-of select="$newline"/>
234 <xsl:text>\label{</xsl:text>
235 <xsl:value-of select="@id"/>
236 <xsl:text>}</xsl:text>
237 <xsl:value-of select="$newline"/>
238 <xsl:value-of select="$newline"/>
243 <xsl:template match="html:pre/html:code">
244 <xsl:text>\begin{adjustwidth}{2.5em}{2.5em}
248 <xsl:value-of select="."/>
256 <!-- Changes due to limitations of manuscript format -->
257 <xsl:template match="html:a[@href]">
258 <xsl:value-of select="."/>
259 <xsl:text>(</xsl:text>
260 <xsl:value-of select="@href"/>
261 <xsl:text>)</xsl:text>
265 <xsl:template match="html:em">
266 <xsl:text>\underline{</xsl:text>
267 <xsl:apply-templates select="node()"/>
268 <xsl:text>}</xsl:text>
272 <xsl:template match="html:strong">
273 <xsl:text>\textbf{</xsl:text>
274 <xsl:apply-templates select="node()"/>
275 <xsl:text>}</xsl:text>