Changes

Jump to navigation Jump to search
1,059 bytes added ,  08:30, 27 August 2014
create cover
Unfortunately, ConTeXt has a bug in XML creation in this setup.
--[[User:Hraban|Hraban]] 10:19, 27 August 2014 (CEST)
== ConTeXt setup ==
Then you can call ConTeXt and its ePub script:
<codepre>
context mysongbook
mtxrun --script epub --make mysongbook
</codepre>
The first creates {{code|export.xml}} and a bunch of other files.
You don’t need the attributes of the document node, even if we could use the language setting.
== Transform XML to HTML etc. ==
Even if the ePub format is supposed to work with any XML, most readers only accept HTML.
h1, h2, h3, h4, h4, h6 {
font-family: DevroyeTeX Gyre Heros, Helvetica, Arial, sans-serif;
color: #286000;
-webkit-hyphens: manual;
.chapter {
margin-top: 1em;
border-top: 1px solid #600a00ccc;} img { max-width: 100%; max-height: 100%;
}
width: 100%;
}
</pre>
 
== Create a Cover ==
 
Create a {{code|cover.xhtml}}:
 
<xmlcode>
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version= "2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 
<xsl:output
method="xml"
encoding="utf-8"
indent="yes"
omit-xml-declaration="yes"
/>
 
<xsl:template match="/">
<html>
<head>
<title><xsl:value-of select='//metavariable[@name="title"]'/></title>
<link rel="stylesheet" href="style.css" type="text/css" ></link>
<link rel="stylesheet" href="Styles/style.css" type="text/css" ></link>
</head>
<body>
<div>
<img src="Images/cover.jpg">
<xsl:attribute name="alt">
<xsl:value-of select='//metavariable[@name="title"]'/>
</xsl:attribute>
</img>
</div>
</body>
</html>
</xsl:template>
 
</xsl:stylesheet>
</xmlcode>
 
If you don’t have a different cover picture, create one from the first page of your PDF (using ImageMagick’s convert):
 
<pre>
convert -density 196 somgbook.pdf'[0]' +repage cover.jpg
</pre>

Navigation menu