def transform(wldoc, verbose=False, save_tex=None, morefloats=None,
- cover=None, flags=None, customizations=None):
+ cover=None, flags=None, customizations=None, ilustr_path=''):
""" produces a PDF file with XeLaTeX
wldoc: a WLDocument
# TeXML -> LaTeX
temp = mkdtemp('-wl2pdf')
+ for ilustr in document.edoc.findall("//ilustr"):
+ shutil.copy(os.path.join(ilustr_path, ilustr.get("src")), temp)
+
for sponsor in book_info.sponsors:
ins = etree.Element("data-sponsor", name=sponsor)
logo = sponsor_logo(sponsor)
\fi
}
+\newcommand{\ilustr}[2]{%
+\vspace{1em}%
+\par{\noindent\includegraphics[width=\linewidth]{#1}}%
+\vspace{1em}
+}
</cmd>
</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 = -->
<div class="motto"><xsl:apply-templates /></div>
</xsl:template>
+<xsl:template match="ilustr" mode="inline">
+ <xsl:apply-templates select="."/>
+</xsl:template>
+
+<xsl:template match="ilustr">
+ <img>
+ <xsl:attribute name="src">
+ <xsl:value-of select="@src" />
+ </xsl:attribute>
+ <xsl:attribute name="alt">
+ <xsl:value-of select="@alt" />
+ </xsl:attribute>
+ <xsl:attribute name="title">
+ <xsl:value-of select="@alt" />
+ </xsl:attribute>
+ </img>
+</xsl:template>
+
<!-- ========================================== -->
<!-- = PARAGRAPH TAGS = -->