Attachment 'article-html.xsl'

Download

   1 <?xml version='1.0'?> <!-- As XML file -->
   2 <!-- Identify as a stylesheet -->
   3 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
   4 
   5 <!-- Intend output for rendering by a web browser -->
   6 <xsl:output method="html" />
   7 
   8 <xsl:template match="/article">
   9 <html>
  10     <head>
  11 <!--         <link rel="stylesheet" type="text/css" href="good-preview.css" /> -->
  12         <xsl:call-template name="mathjax" />
  13     </head>
  14     <body>
  15         \(<xsl:value-of select="macros" />\)
  16         <div class="headerblock">
  17             <div class="title"><xsl:value-of select="title" /></div>
  18             <div class="author"><xsl:value-of select="author" /></div>
  19             <div class="email"><xsl:value-of select="email" /></div>
  20             <div class="department"><xsl:value-of select="department" /></div>
  21             <div class="institution"><xsl:value-of select="institution" /></div>
  22             <div class="date"><xsl:value-of select="date" /></div>
  23         </div>
  24         <xsl:apply-templates select="p|theorem|corollary|lemma" />
  25     </body>
  26 </html>
  27 </xsl:template>
  28 
  29 <xsl:template match="theorem|corollary|lemma">
  30 <xsl:apply-templates select="statement" />
  31 <xsl:apply-templates select="proof" />
  32 </xsl:template>
  33 
  34 
  35 <!-- Prepend to first paragraph -->
  36 <xsl:template match="theorem/statement">
  37 <b>Theorem: </b><xsl:apply-templates select="p"/>
  38 </xsl:template>
  39 
  40 <!-- Prepend to first paragraph -->
  41 <xsl:template match="corollary/statement">
  42 <b>Corollary: </b><xsl:apply-templates select="p"/>
  43 </xsl:template>
  44 
  45 <!-- Prepend to first paragraph -->
  46 <xsl:template match="lemma/statement">
  47 <b>Lemma: </b><xsl:apply-templates select="p"/>
  48 </xsl:template>
  49 
  50 <!-- Prepend to first paragraph -->
  51 <xsl:template match="proof">
  52 <b>Proof: </b><xsl:apply-templates select="p"/>
  53 </xsl:template>
  54 
  55 <xsl:template match="p">
  56 <p><xsl:apply-templates /></p>
  57 </xsl:template>
  58 
  59 
  60 <!-- Math  -->
  61 
  62 <xsl:template match= "m">\(<xsl:value-of select="." />\)</xsl:template>
  63 
  64 <xsl:template match="dm">\[<xsl:value-of select="." />\]</xsl:template>
  65 
  66 <xsl:template match="am">\begin{align*}<xsl:value-of select="." />\end{align*}</xsl:template>
  67 
  68 
  69 
  70 
  71 
  72 
  73 <xsl:template name="mathjax">
  74 <script type="text/x-mathjax-config">
  75 MathJax.Hub.Config({
  76     tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]},
  77     TeX: {
  78     extensions: ["AMSmath.js", "AMSsymbols.js"]
  79     },
  80 });
  81 </script>
  82 <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML-full" />
  83 </xsl:template>
  84 
  85 
  86 
  87 </xsl:stylesheet>

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2013-06-25 21:18:57, 169.9 KB) [[attachment:Shuttleworth-Funded-Logo.jpg]]
  • [get | view] (2013-06-20 19:59:48, 2.4 KB) [[attachment:article-html.xsl]]
  • [get | view] (2013-06-20 20:00:34, 2.3 KB) [[attachment:article-latex.xsl]]
  • [get | view] (2013-06-20 20:04:02, 0.8 KB) [[attachment:calculus-article.xml]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.