Thank you for prompt response.

I copied the default.epub3 template to ~/.pandoc/templates/default.epub3 and added the above <div><svg> ... </svg></div> and ran pandoc.

What happens is that my cover.xhtml custom code does not replace the default <div><img> ... </div> ... It gets inserted as expected but the default code is also there below it! Hence epubcheck gives me an error (duplicate ID 'cover-image' and there is a duplicate cover image in the resulting epub.

How do I "suppress" the body variable? I tried specifying "-V body=' '" (body="false" etc.) ... but that caused all the xhtml files in the epub to contain the same code as cover.xhtml and nothing else.

I also tried to unset the 'body' variable directly inside the template in "$if(coverpage)$ ... $endif$ ... hoping the variable's content would be restored to its original value after leaving the if(coverpage)'s ... endif scope ...but this didn't seem to do anything except perhaps give me an error when running pandoc IIRC...

In any event, here's what I added to my default.epub3:


<body$if(coverpage)$ id="cover"$endif$>
$if(coverpage)$
<div id="cover-image">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="100%" height="100%" viewBox="0 0 900 1200" preserveAspectRatio="none">
<image width="900" height="1200" xlink:href="../media/cover.png"/>
</svg>
</div>
$endif$

Obviously I'm not doing it right but I'm not sure how I could fix this.

Thanks,

SM

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/37457961-7b29-4490-a5b0-70063b901ed2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.