Skip to content
Snippets Groups Projects
Commit 415552bc authored by Goik Martin's avatar Goik Martin
Browse files

Html using SVG generated from PDF

parent c3883d65
No related branches found
No related tags found
No related merge requests found
File added
<?xml version="1.0" encoding="UTF-8"?>
<chapter annotations="slide" version="5.1" xml:id="intro"
xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:ns2="http://docbook.org/ns/docbook"
xmlns:ns="http://docbook.org/ns/transclusion"
xmlns:m="http://www.w3.org/1998/Math/MathML"
xmlns:html="http://www.w3.org/1999/xhtml">
<chapter annotations="slide" version="5.1" xml:id="intro" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns2="http://docbook.org/ns/docbook" xmlns:ns="http://docbook.org/ns/transclusion" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:html="http://www.w3.org/1999/xhtml">
<title>Introduction</title>
<para>Some MathML:</para>
......@@ -128,10 +120,8 @@
</mediaobject>
</figure>
<para>A <filename>Svg</filename> figure containing a screenshot:</para>
<figure xml:id="xhtmlRendering">
<title>Rendering Html</title>
<title>A <filename>Svg</filename> figure containing a screenshot</title>
<mediaobject>
<imageobject>
......@@ -140,6 +130,16 @@
</mediaobject>
</figure>
<figure xml:id="xhtmlRenderingPdf">
<title>A PDF</title>
<mediaobject>
<imageobject>
<imagedata fileref="Ref/Fig/saxcharacter.pdf" scale="60"/>
</imageobject>
</mediaobject>
</figure>
<para>A <filename>.fig</filename> containing TeX based math:</para>
<mediaobject>
......@@ -148,8 +148,7 @@
</imageobject>
</mediaobject>
<para>What about <acronym
xlink:href="http://www.w3.org/TR/SVG">SVG</acronym>?</para>
<para>What about <acronym xlink:href="http://www.w3.org/TR/SVG">SVG</acronym>?</para>
<mediaobject>
<imageobject>
......
......@@ -114,8 +114,17 @@
</xsl:template>
<xsl:template match="db:imagedata[ends-with(@fileref, '.fig')]">
<xsl:template match="db:imagedata[ends-with(@fileref, '.fig')]">
<xsl:copy>
<xsl:attribute name="fileref">
<xsl:value-of select="@fileref"/>
<xsl:text>.svg</xsl:text>
</xsl:attribute>
<xsl:apply-templates select="@*[not(name(.) = 'fileref')] | node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="db:imagedata[ends-with(@fileref, '.pdf')]">
<xsl:copy>
<xsl:attribute name="fileref">
<xsl:value-of select="@fileref"/>
......@@ -123,7 +132,6 @@
</xsl:attribute>
<xsl:apply-templates select="@*[not(name(.) = 'fileref')] | node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
......@@ -14,8 +14,17 @@
</xsl:copy>
</xsl:template>
<xsl:template match="db:imagedata[ends-with(@fileref, '.fig')]">
<xsl:template match="db:imagedata[ends-with(@fileref, '.fig')]">
<xsl:copy>
<xsl:attribute name="fileref">
<xsl:value-of select="@fileref"/>
<xsl:text>.svg</xsl:text>
</xsl:attribute>
<xsl:apply-templates select="@*[not(name(.) = 'fileref')] | node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="db:imagedata[ends-with(@fileref, '.pdf')]">
<xsl:copy>
<xsl:attribute name="fileref">
<xsl:value-of select="@fileref"/>
......@@ -23,7 +32,6 @@
</xsl:attribute>
<xsl:apply-templates select="@*[not(name(.) = 'fileref')] | node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="db:figure/db:mediaobject/db:imageobject/db:imagedata[ends-with(@fileref, '.svg')]">
......
......@@ -11,6 +11,7 @@
<xsl:template match="/">
<xsl:variable name="figFiles" select="//d:imagedata[ends-with(@fileref, '.fig') ]" />
<xsl:variable name="pdfFiles" select="//d:imagedata[ends-with(@fileref, '.pdf') ]" />
<xsl:apply-templates select="//d:imagedata[ends-with(@fileref, '.fig') ]" mode="printLatex"/>
......@@ -30,6 +31,19 @@
<xsl:text>.pdf </xsl:text>
</xsl:for-each>
<xsl:for-each select="$pdfFiles">
<xsl:call-template name="relative-uri">
<xsl:with-param name="destdir">
<xsl:call-template name="dbhtml-dir">
<xsl:with-param name="context" select="."/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
<xsl:value-of select="@fileref"/>
<xsl:text>.svg </xsl:text>
</xsl:for-each>
<xsl:for-each select="//d:videodata[ends-with(@fileref, '.webm') ]">
<xsl:call-template name="relative-uri">
<xsl:with-param name="destdir">
......
......@@ -13,6 +13,9 @@ include mediaobjects.list
cd $(@D)/Generate; fig2mpdf -l -m ../$(*F).fig
cd $(@D); pdflatex Generate/$(*F); mv $(*F).pdf $(*F).animate.pdf; rm -f $(*F).toc $(*F).log $(*F).nav $(*F).aux $(*F).snm $(*F).out
%.pdf.svg: %.pdf
cd $(@D);pdf2svg $(*F).pdf $(*F).pdf.svg
%.webm.mp4:%.webm
avconv -y -i $< -vcodec libx264 -acodec aac -strict -2 -r 10 $<.mp4
avconv -i $< -vframes 1 $<.png
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment