option handling in book2pdf, ilustrations, <latex> verbatim tag
[librarian.git] / librarian / pdf / wl2tex.xslt
index 5b58d61..9663bf5 100644 (file)
@@ -15,7 +15,7 @@
 <xsl:template match="utwor">
     <TeXML xmlns="http://getfo.sourceforge.net/texml/ns1">
         <TeXML escape="0">
 <xsl:template match="utwor">
     <TeXML xmlns="http://getfo.sourceforge.net/texml/ns1">
         <TeXML escape="0">
-        \documentclass[<xsl:value-of select="@customizations"/>]{wl}
+        \documentclass[<xsl:value-of select="@customizations"/>]{<xsl:value-of select="@documentclass"/>}
 
         <!-- flags and values set on root -->
 
 
         <!-- flags and values set on root -->
 
@@ -96,7 +96,7 @@
 
             <TeXML escape="0">
                 \def\coverby{
 
             <TeXML escape="0">
                 \def\coverby{
-                <xsl:if test="@data-cover-by">Cover image:
+                <xsl:if test="@data-cover-by">Obraz na okładce:
                     <xsl:choose>
                     <xsl:when test="@data-cover-source">
                         \href{\datacoversource}{\datacoverby}.
                     <xsl:choose>
                     <xsl:when test="@data-cover-source">
                         \href{\datacoversource}{\datacoverby}.
             \href{http://creativecommons.org/licenses/by-sa/3.0/}{Creative Commons
             Uznanie Autorstwa – Na Tych Samych Warunkach 3.0 PL}.}
         <xsl:if test=".//dc:rights.license">
             \href{http://creativecommons.org/licenses/by-sa/3.0/}{Creative Commons
             Uznanie Autorstwa – Na Tych Samych Warunkach 3.0 PL}.}
         <xsl:if test=".//dc:rights.license">
-            \def\rightsinfo{This book is available under the terms of
+            \def\rightsinfo{Ta książka jest udostpęniona na licencji
             \href{<xsl:value-of select=".//dc:rights.license" />}{<xsl:value-of select=".//dc:rights" />}.}
         </xsl:if>
 
             \href{<xsl:value-of select=".//dc:rights.license" />}{<xsl:value-of select=".//dc:rights" />}.}
         </xsl:if>
 
     </cmd>
 </xsl:template>
 
     </cmd>
 </xsl:template>
 
+<xsl:strip-space elements="ilustr"/>
+<xsl:template match="ilustr">
+    <cmd>
+        <xsl:attribute name="name">
+            <xsl:value-of select="wl:texcommand(name())" />
+        </xsl:attribute>
+       <parm><TeXML escape="0"><xsl:value-of select="normalize-space(@src)" /></TeXML></parm>
+        <parm><xsl:apply-templates mode="inline" /></parm>
+    </cmd>
+</xsl:template>
+
+<xsl:template match="@*|node()" mode="identity">
+  <xsl:copy>
+    <xsl:apply-templates select="@*|node()" mode="identity"/>
+  </xsl:copy>
+</xsl:template>
+
+
+
+<xsl:template match="dmath">
+  <dmath>
+    <xsl:apply-templates mode="identity"/>
+  </dmath>
+</xsl:template>
+
+<xsl:template match="math" mode="inline">
+  <math>
+    <xsl:apply-templates mode="identity"/>
+  </math>
+</xsl:template>
+
+<xsl:template match="latex" mode="inline">
+  <TeXML escape="0">
+    <xsl:apply-templates select="@*|node()" mode="identity"/>
+  </TeXML>
+</xsl:template>
+
+<xsl:template match="tablewrap">
+  <cmd name="begin"><parm>table</parm><opt>h!</opt></cmd>
+  <xsl:apply-templates select="table"/>
+
+  <cmd name="caption*"><parm>
+    <xsl:apply-templates select="akap"/>
+  </parm></cmd>
+  <cmd name="end"><parm>table</parm></cmd>
+</xsl:template>
+
+<xsl:template match="table">
+  <xsl:if test="@caption">
+
+      <cmd name="caption*"><parm>
+
+       <cmd name="Large"/><xsl:value-of select="@caption"/>
+      </parm></cmd>
+    </xsl:if>
+    <env name="tabularx">
+      <parm><cmd name="textwidth"/></parm>
+        <parm><xsl:value-of select="@spec"/></parm>
+        <xsl:apply-templates />
+    </env>
+</xsl:template>
+
+<xsl:template match="r">
+    <xsl:apply-templates />
+    <spec cat="esc"/><spec cat="esc"/>
+</xsl:template>
+<xsl:template match="c">
+    <cmd name="footnotesize"/>
+    <xsl:apply-templates mode="inline"/>
+    <xsl:if test="position() &lt; last()-1">
+    <spec cat="align"/>
+    </xsl:if>
+</xsl:template>
+<xsl:template match="hr">
+  <cmd name="hline"/>
+</xsl:template>
 
 <!-- ================ -->
 <!-- = SPECIAL TAGS = -->
 
 <!-- ================ -->
 <!-- = SPECIAL TAGS = -->
 
 <xsl:template name="editors">
     <xsl:if test=".//dc:contributor.editor_parsed|.//dc:contributor.technical_editor_parsed">
 
 <xsl:template name="editors">
     <xsl:if test=".//dc:contributor.editor_parsed|.//dc:contributor.technical_editor_parsed">
-        <xsl:text>Technical editors: </xsl:text>
+        <xsl:text>Redakcja techniczna: </xsl:text>
         <xsl:for-each select=".//dc:contributor.editor_parsed|.//dc:contributor.technical_editor_parsed[not(.//dc:contributor.editor_parsed/text()=text())]">
             <!--xsl:sort select="@sortkey" /-->
             <xsl:if test="position() != 1">, </xsl:if>
         <xsl:for-each select=".//dc:contributor.editor_parsed|.//dc:contributor.technical_editor_parsed[not(.//dc:contributor.editor_parsed/text()=text())]">
             <!--xsl:sort select="@sortkey" /-->
             <xsl:if test="position() != 1">, </xsl:if>