Accept attributes in inline image syntax
[multimarkdown] / XSLT / custom-letterhead.xslt
1 <?xml version='1.0' encoding='utf-8'?>
2
3 <!-- Custom Letterhead by Fletcher Penney
4
5         Demonstration of how to customize the default letterhead template
6                 in MultiMarkdown with default return address information, as
7                 well as a custom logotype.
8
9         Uses the fletcherpenney.sty file available at:
10                 http://fletcherpenney.net/XSLT_Files
11
12         To include a signature, add `Graphic Signature` to your metadata,
13                 and include a `signature.pdf` file in your LaTeX class files.
14
15         Must be processed with XeLaTeX
16
17         MultiMarkdown Version 2.0.b5
18
19         $Id: custom-letterhead.xslt 479 2008-01-12 23:04:13Z fletcher $
20 -->
21
22 <!-- 
23 # Copyright (C) 2007-2008  Fletcher T. Penney <fletcher@fletcherpenney.net>
24 #
25 # This program is free software; you can redistribute it and/or modify
26 # it under the terms of the GNU General Public License as published by
27 # the Free Software Foundation; either version 2 of the License, or
28 # (at your option) any later version.
29 #
30 # This program is distributed in the hope that it will be useful,
31 # but WITHOUT ANY WARRANTY; without even the implied warranty of
32 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
33 # GNU General Public License for more details.
34 #
35 # You should have received a copy of the GNU General Public License
36 # along with this program; if not, write to the
37 #    Free Software Foundation, Inc.
38 #    59 Temple Place, Suite 330
39 #    Boston, MA 02111-1307 USA
40 -->
41
42         
43 <xsl:stylesheet
44         xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
45         xmlns:html="http://www.w3.org/1999/xhtml"
46         version="1.0">
47
48         <xsl:import href="letterhead.xslt"/>
49         
50         <xsl:template match="/">
51                 <xsl:apply-templates select="html:html/html:head"/>
52                 <xsl:apply-templates select="html:html/html:body"/>
53                 <xsl:call-template name="latex-footer"/>
54         </xsl:template>
55
56         <xsl:template name="return-address-defaults">
57                 <xsl:text>% Default info for return address
58 % These should include '\\' where appropriate for line endings
59
60 \def\defaultemail{\href{mailto:owner@fletcherpenney.net}{owner@fletcherpenney.net} \\}
61 \def\defaultposition{}
62 \def\defaultdepartment{}
63 \def\defaultaddress{123 Fake St \\ Charleston, SC 29401 \\}
64 \def\defaultphone{Tel 843 555 1234 \\}
65 \def\defaultfax{Fax 843 555 2345 \\}
66 \def\defaultweb{}
67
68 % Define height for logo and return address
69 \def\logoheight{1.2in}
70
71 % Define Logo or something for upper left corner
72 \def\coverlogo{
73 \font\logo="Didot:mapping=tex-text" at 24pt \logo
74 \href{http://fletcherpenney.net/}{fletcherpenney.\color{accent}net\color{black}}
75 }
76
77 % Use my stylesheet
78 \usepackage{fletcherpenney}
79
80 % Define signature
81 \ifx\signature\undefined
82         \def\signature{~ \\ Sincerely,\\
83         \ifx\graphicsignature\undefined
84         
85         \else
86                 \resizebox{2in}{!}{\includegraphics{signature}}\\
87         \fi
88 \myauthor}
89 \else
90 \fi
91
92 </xsl:text>
93         </xsl:template>
94
95
96         
97 </xsl:stylesheet>