epub default cover
[librarian.git] / librarian / pdf / wl2tex.xslt
index 909cf4b..985847f 100644 (file)
@@ -36,7 +36,7 @@
         <xsl:choose>
             <xsl:when test="@morefloats = 'new'">
                 <TeXML escape="0">
         <xsl:choose>
             <xsl:when test="@morefloats = 'new'">
                 <TeXML escape="0">
-                    \usepackage[maxfloats=64]{morefloats}
+                    \usepackage[maxfloats=32]{morefloats}
                 </TeXML>
             </xsl:when>
             <xsl:when test="@morefloats = 'old'">
                 </TeXML>
             </xsl:when>
             <xsl:when test="@morefloats = 'old'">
@@ -60,8 +60,8 @@
         <env name="document">
             <xsl:if test="@data-cover-width">
                 <cmd name="makecover">
         <env name="document">
             <xsl:if test="@data-cover-width">
                 <cmd name="makecover">
-                    <parm><xsl:value-of select="210 * @data-cover-width div @data-cover-height" />mm</parm>
                     <parm>210mm</parm>
                     <parm>210mm</parm>
+                    <parm><xsl:value-of select="210 * @data-cover-height div @data-cover-width" />mm</parm>
                 </cmd>
             </xsl:if>
             <cmd name="maketitle" />
                 </cmd>
             </xsl:if>
             <cmd name="maketitle" />
@@ -89,7 +89,7 @@
 
             <TeXML escape="0">
                 \def\coverby{
 
             <TeXML escape="0">
                 \def\coverby{
-                <xsl:if test="@data-cover-by">Okładka na podstawie: 
+                <!--xsl:if test="@data-cover-by">Okładka na podstawie: 
                     <xsl:choose>
                     <xsl:when test="@data-cover-source">
                         \href{\datacoversource}{\datacoverby}
                     <xsl:choose>
                     <xsl:when test="@data-cover-source">
                         \href{\datacoversource}{\datacoverby}
@@ -98,7 +98,7 @@
                         \datacoverby{}
                     </xsl:otherwise>
                     </xsl:choose>
                         \datacoverby{}
                     </xsl:otherwise>
                     </xsl:choose>
-                </xsl:if>
+                </xsl:if-->
                 }
                 \def\editors{<xsl:call-template name="editors" />}
             </TeXML>
                 }
                 \def\editors{<xsl:call-template name="editors" />}
             </TeXML>
             \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{Ten utwór jest udostepniony na licencji
-            \href{<xsl:value-of select=".//dc:rights.license" />}{<xsl:value-of select=".//dc:rights" />}.}
+            \def\rightsinfo{Ten utwór jest udostępniony na licencji\\
+            \href{<xsl:value-of select=".//dc:rights.license" />}{<TeXML escape="1"><xsl:apply-templates select=".//dc:rights" mode="inline" /></TeXML>}.}
         </xsl:if>
 
         \def\sourceinfo{
             <xsl:if test=".//dc:source">
         </xsl:if>
 
         \def\sourceinfo{
             <xsl:if test=".//dc:source">
-                Tekst opracowany na podstawie: <xsl:apply-templates select=".//dc:source" mode="inline" />
+                Tekst opracowany na podstawie: <TeXML escape="1"><xsl:apply-templates select=".//dc:source" mode="inline" /></TeXML>
                 \vspace{.6em}
             </xsl:if>}
                 \vspace{.6em}
             </xsl:if>}
-        \def\description{<xsl:apply-templates select=".//dc:description" mode="inline" />}
+        \def\description{\raggedright <TeXML escape="1"><xsl:apply-templates select=".//dc:description" mode="inline" /></TeXML>}
     </TeXML>
 </xsl:template>
 
     </TeXML>
 </xsl:template>
 
 </xsl:template>
 
 
 </xsl:template>
 
 
+<xsl:template match="tabela|tabelka">
+    <cmd name="par" />
+    <cmd name="vspace"><parm>1em</parm></cmd>
+    <group><cmd name="raggedright" />
+    <env name="longtabu"> to <TeXML escape="0">\textwidth </TeXML>
+      <!--parm><cmd name="textwidth"/></parm-->
+      <parm><TeXML escape="0"><xsl:value-of select="@_format" /></TeXML></parm>
+        <xsl:choose>
+        <xsl:when test="@ramka='1' or @ramki='1'">
+        <!--parm><spec cat="vert"/>X[1,l]<spec cat="vert"/>X[1,l]<spec cat="vert"/>X[1,l]<spec cat="vert"/>X[1,l]<spec cat="vert"/>X[1,l]<spec cat="vert"/></parm-->
+        <cmd name="hline" />
+        <xsl:apply-templates mode="wiersze-ramki"/>
+        </xsl:when>
+        <xsl:otherwise>
+        <!--parm>XXXXX</parm-->
+        <xsl:apply-templates/>
+        </xsl:otherwise>
+        </xsl:choose>
+    </env>
+    </group>
+    <cmd name="vspace"><parm>1em</parm></cmd>
+</xsl:template>
+<xsl:template match="wiersz" mode="wiersze-ramki">
+    <xsl:apply-templates />
+    <spec cat="esc"/><spec cat="esc"/>
+    <cmd name="hline" gr="0" />
+</xsl:template>
+<xsl:template match="wiersz">
+    <xsl:apply-templates />
+    <spec cat="esc"/><spec cat="esc"/>
+</xsl:template>
+
+<xsl:template match="kol">
+    <xsl:apply-templates mode="inline"/>
+    <xsl:if test="position() &lt; last()">
+    <spec cat="align"/>
+    </xsl:if>
+</xsl:template>
+
+<xsl:template match="punkt">
+    <cmd name="punkt"><parm>
+        <xsl:choose>
+        <xsl:when test=".//akap">
+            <xsl:apply-templates />
+        </xsl:when>
+        <xsl:otherwise>
+            <xsl:apply-templates mode="inline"/>
+        </xsl:otherwise>
+        </xsl:choose>
+    </parm></cmd>
+</xsl:template>
+<xsl:template match="lista">
+    <xsl:if test="@typ='num'">
+        <cmd name="listanum">
+            <parm><xsl:apply-templates /></parm>
+        </cmd>
+    </xsl:if>
+    <xsl:if test="@typ='punkt'">
+        <cmd name="listapunkt">
+            <parm><xsl:apply-templates /></parm>
+        </cmd>
+    </xsl:if>
+</xsl:template>
+
+<xsl:template match="ilustr">
+    <cmd name="ilustr">
+        <parm><xsl:value-of select="@src" /></parm>
+        <parm><xsl:value-of select="@alt" /></parm>
+    </cmd>
+</xsl:template>
+
 <!-- ========================================== -->
 <!-- = PARAGRAPH TAGS                         = -->
 <!-- = (can contain inline and special tags)  = -->
 <!-- ========================================== -->
 <!-- = PARAGRAPH TAGS                         = -->
 <!-- = (can contain inline and special tags)  = -->
     </cmd>
 </xsl:template>
 
     </cmd>
 </xsl:template>
 
+<xsl:template match="www" mode="inline">
+    <cmd name="href">
+        <parm><xsl:value-of select="wl:urlquote(text())" /></parm>
+        <parm><cmd name="url"><parm><xsl:value-of select="text()" /></parm></cmd></parm>
+    </cmd>
+</xsl:template>
+
 
 
 <xsl:template match="tytul_dziela" mode="inline">
 
 
 <xsl:template match="tytul_dziela" mode="inline">
 </xsl:template>
 
 <xsl:template name="editors">
 </xsl:template>
 
 <xsl:template name="editors">
-    <xsl:if test="@editors">
+    <!--xsl:if test="@editors">
         <xsl:text>Opracowanie redakcyjne i przypisy: </xsl:text>
         <xsl:value-of select="@editors" />
         <xsl:text>.</xsl:text>
         <xsl:text>Opracowanie redakcyjne i przypisy: </xsl:text>
         <xsl:value-of select="@editors" />
         <xsl:text>.</xsl:text>
+    </xsl:if-->
+    <xsl:if test=".//dc:contributor.editor_parsed">
+    <cmd name="par"><parm>Redakcja literacka:
+    <xsl:for-each select=".//dc:contributor.editor_parsed">
+        <xsl:if test="position() != 1">, </xsl:if>
+        <xsl:apply-templates mode="inline" />
+    </xsl:for-each>
+    </parm></cmd>
+    </xsl:if>
+    <xsl:if test=".//dc:contributor.technical_editor_parsed">
+    <cmd name="par"><parm>Redakcja techniczna:
+    <xsl:for-each select=".//dc:contributor.technical_editor_parsed">
+        <xsl:if test="position() != 1">, </xsl:if>
+        <xsl:apply-templates mode="inline" />
+    </xsl:for-each>
+    </parm></cmd>
     </xsl:if>
     </xsl:if>
+
+
 </xsl:template>
 
 <xsl:template name="translators">
 </xsl:template>
 
 <xsl:template name="translators">
     </group>
 </xsl:template>
 
     </group>
 </xsl:template>
 
+
+
 <!-- ================ -->
 <!-- = IGNORED TAGS = -->
 <!-- ================ -->
 <!-- ================ -->
 <!-- = IGNORED TAGS = -->
 <!-- ================ -->