Merge remote-tracking branch 'upstream/master'
[librarian.git] / librarian / pdf / wl2tex.xslt
index ca948da..d39b61a 100644 (file)
@@ -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>
                 <xsl:if test="@thanks">
                 </cmd>
             </xsl:if>
                 <xsl:if test="@thanks">
                     \def\funders{Publikację ufundowali i ufundowały:
                         <TeXML escape="1"><xsl:value-of select="@funders" /></TeXML>.}
                 </xsl:if>
                     \def\funders{Publikację ufundowali i ufundowały:
                         <TeXML escape="1"><xsl:value-of select="@funders" /></TeXML>.}
                 </xsl:if>
+
+                <xsl:if test="@sponsor-note|data-sponsor">
+                    \def\sponsors{
+                        \scriptsize
+                        <xsl:choose>
+                            <xsl:when test="@sponsor-note">
+                                <TeXML escape="1"><xsl:value-of select="@sponsor-note" /></TeXML>
+                            </xsl:when>
+                            <xsl:otherwise>
+                                Sfinansowano ze~środków:
+                            </xsl:otherwise>
+                        </xsl:choose>
+
+                        \vspace{1em}
+
+                        <xsl:apply-templates select="data-sponsor" mode="sponsor" />
+                    }
+                </xsl:if>
             </TeXML>
 
             <cmd name="editorialsection" />
             </TeXML>
 
             <cmd name="editorialsection" />
 
 <xsl:template match="rdf:RDF" mode="titlepage">
     <TeXML escape="0">
 
 <xsl:template match="rdf:RDF" mode="titlepage">
     <TeXML escape="0">
-        \def\authors{<xsl:call-template name="authors" />}
+        \def\authors{<TeXML escape="1"><xsl:call-template name="authors" /></TeXML>}
         \author{\authors}
         \author{\authors}
-        \title{<xsl:apply-templates select=".//dc:title" mode="inline" />}
-        \def\translatorsline{<xsl:call-template name="translators" />}
+        \title{<TeXML escape="1"><xsl:apply-templates select=".//dc:title" mode="inline" /></TeXML>}
+        \def\translatorsline{<TeXML escape="1"><xsl:call-template name="translators" /></TeXML>}
 
 
-        \def\bookurl{<xsl:value-of select=".//dc:identifier.url" />}
+        \def\bookurl{<TeXML escape="1"><xsl:value-of select=".//dc:identifier.url" /></TeXML>}
 
         \def\rightsinfo{Ten utwór nie jest objęty majątkowym prawem autorskim i~znajduje się w~domenie
             publicznej, co oznacza że możesz go swobodnie wykorzystywać, publikować
 
         \def\rightsinfo{Ten utwór nie jest objęty majątkowym prawem autorskim i~znajduje się w~domenie
             publicznej, co oznacza że możesz go swobodnie wykorzystywać, publikować
             Uznanie Autorstwa – Na Tych Samych Warunkach 3.0 PL}.}
         <xsl:if test=".//dc:rights.license">
             \def\rightsinfo{Ten utwór jest udostepniony na licencji
             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" />}.}
+            \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{<TeXML escape="1"><xsl:apply-templates select=".//dc:description" mode="inline" /></TeXML>}
     </TeXML>
 </xsl:template>
 
     </TeXML>
 </xsl:template>
 
     </xsl:if>
 </xsl:template>
 
     </xsl:if>
 </xsl:template>
 
+<xsl:template match="data-sponsor" mode="sponsor">
+    <cmd name="par"><parm>
+    <xsl:choose>
+        <xsl:when test="@src">
+            \includegraphics[height=0.25\textwidth,width=0.25\textwidth,keepaspectratio]{<xsl:value-of select="@src" />}
+        </xsl:when>
+        <xsl:otherwise>
+            <xsl:value-of select="@name" />
+        </xsl:otherwise>
+    </xsl:choose>
+    </parm></cmd>
+</xsl:template>
 
 <!-- ============== -->
 <!-- = ADDED TAGS = -->
 
 <!-- ============== -->
 <!-- = ADDED TAGS = -->