return output_html, toc, chars
+def flatten_image_paths(wldoc):
+ root = wldoc.edoc.getroot()
+ for node in root.findall(".//ilustr"):
+ node.attrib['src'] = os.path.basename(node.attrib['src'])
+ return wldoc
+
def render_latex(wldoc, prefix="latex"):
"""
Renders <latex>CODE</latex> as images and returns
if main_text.tag == RDFNS('RDF'):
main_text = None
+ flatten_image_paths(wldoc)
+
if main_text is not None:
for chunk_xml in chop(main_text):
empty = False
display: block;
width: 50%;
float: right;
+ clear: both;
+ margin: 10pt;
+ padding: 0pt 5pt;
background-color: #d0d0d0;
+ font-style: italic;
+ font-size: 0.8em;
}
\ No newline at end of file
<xsl:template match="podtytul" />
- <xsl:template match="naglowek_czesc|srodtytul">
+ <xsl:template match="naglowek_czesc">
<h2 class="h2" xmlns="http://www.w3.org/1999/xhtml">
<xsl:apply-templates />
</h2>
</h2>
</xsl:template>
- <xsl:template match="naglowek_podpodrozdzial">
+ <xsl:template match="naglowek_podpodrozdzial|srodtytul">
<a xmlns="http://www.w3.org/1999/xhtml"></a>
<div class="p" xmlns="http://www.w3.org/1999/xhtml">
<xsl:apply-templates />
<img>
<xsl:attribute name="src"><xsl:value-of select="@src"/>.<xsl:choose><xsl:when test="@extbitmap"><xsl:value-of select="@extbitmap"/></xsl:when><xsl:otherwise><xsl:value-of select="@ext"/></xsl:otherwise></xsl:choose></xsl:attribute>
</img>
+ <xsl:apply-templates />
</xsl:template>
<xsl:template match="img">
cwd = None
os.chdir(temp)
+ if resources:
+ os.putenv("TEXINPUTS", "::.:%s" % resources)
+
if verbose:
p = call(['xelatex', tex_path])
else:
<!-- = INLINE TAGS = -->
<!-- = (contain other inline tags and special tags) = -->
<!-- ================================================ -->
-<xsl:strip-space elements="wyroznienie|akap|nota"/>
+
+<xsl:strip-space elements="nota|akap|wyroznienie"/>
<xsl:template mode="inline"
match="pa|pe|pr|pt|mat|didask_tekst|slowo_obce|wyroznienie|osoba|punkt|www|nota_red">