From BrycesWiki
Jump to navigationJump to search

The EPUB standard is a fairly new standard from an organization known as IDPF. It is an attempt to create the eBook equivalent of MP3s.


EPUB, like MOBI, is an ebook standard that scales according to screen and window size, known as a reflowable format. As there were hardly any viable formats for eBooks that did not depend on screen size and cross-platform, the members of IDPF brought standards such as XML, XHTML, and Zip together into a new standard called EPUB.


The creation of EPUB eBooks is fairly simple, especially if one is familiar with HTML standards. In order to create such eBooks, one needs four files.

Content OPF

All EPUB files must have a listing of all files included in the zip. This helps to ensure that the reader can find all the contents of that particular eBook.

<?xml version="1.0"?>

<package xmlns="http://www.idpf.org/2007/opf" unique-identifier="dcidid" 
   <metadata xmlns:dc="http://purl.org/dc/elements/1.1/" 
      <dc:title>Man's Punishment</dc:title> 
      <dc:language xsi:type="dcterms:RFC3066">en</dc:language> 
      <dc:identifier id="dcidid" opf:scheme="None">
      <dc:subject>Crime Fiction
      <dc:description>There have been many murders recently. 
However, these aren't ordinary murder cases. The culprits are obvious, 
but they don't remember anything except for a bloody scene, the corpse, and a weapon with fresh blood dripping from it. 
Intrigued by these strange occurrences, 
a high schooler starts investigating, in order to find a way to prevent the problem. Eventually he falls victim to the incident as well. 
Can he find a solution to the plague of homicidal sleepwalkers?</dc:description> 
      <dc:creator>Bryce Campbell</dc:creator> 
      <dc:publisher>Bryce Campbell</dc:publisher> 
      <dc:date xsi:type="dcterms:W3CDTF">2010-11</dc:date> 
      <dc:rights>Copyright (c) 2010, Bryce Campbell</dc:rights>
	<meta name="cover" content="cover-image" /> 

	<item id="ncx"      href="toc.ncx"                 
         media-type="application/x-dtbncx+xml" />  
      <item id="logical-toc"      href="toc.html"                 
         media-type="application/xhtml+xml" /> 
      <item id="css"      href="content.css"           
         media-type="text/css" />
	<item id="cover-page"    href="front.html"    
         media-type="application/xhtml+xml" />
	<item id="cover-image"    href="mp_cover.jpg"    
         media-type="image/jpeg" />
	<item id="copyright-page"    href="copyright.html"    
         media-type="application/xhtml+xml" />
	<item id="thanks"    href="thanks.html"    
         media-type="application/xhtml+xml" />
      <item id="title-page"    href="title.html"    
         media-type="application/xhtml+xml" /> 
      <item id="p1" href="p1.html" 
         media-type="application/xhtml+xml" />
      <item id="ch1"    href="ch1.html"        
         media-type="application/xhtml+xml" />
	<item id="ch2"    href="ch2.html"        
         media-type="application/xhtml+xml" />
	<item id="ch3"    href="ch3.html"        
         media-type="application/xhtml+xml" />
	<item id="ch4"    href="ch4.html"        
         media-type="application/xhtml+xml" />
	<item id="ch5"    href="ch5.html"        
         media-type="application/xhtml+xml" />
	  <item id="p2"    href="p2.html"        
         media-type="application/xhtml+xml" /> 
      <item id="ch6"    href="ch6.html"        
         media-type="application/xhtml+xml" />
	<item id="ch7"    href="ch7.html"        
         media-type="application/xhtml+xml" />
	<item id="ch8"    href="ch8.html"        
         media-type="application/xhtml+xml" />
	  <item id="p3"    href="p3.html"        
         media-type="application/xhtml+xml" /> 
      <item id="ch9"    href="ch9.html"        
         media-type="application/xhtml+xml" />
      <item id="find"    href="find.html"        
         media-type="application/xhtml+xml" />
	  <item id="about"    href="about.html"    
         media-type="application/xhtml+xml" />
	  <item id="coverback"    href="back.html"    
         media-type="application/xhtml+xml" />
	  <item id="coverback-image"    href="mp_cover_back.jpg"    
         media-type="image/jpeg" />

<spine toc="ncx">
<itemref idref="cover-page" />
<itemref idref="copyright-page" />
<itemref idref="thanks" />
<itemref idref="title-page" />
<itemref idref="logical-toc" />
<itemref idref="p1" />
<itemref idref="ch1" />
<itemref idref="ch2" />
<itemref idref="ch3" />
<itemref idref="ch4" />
<itemref idref="ch5" />
<itemref idref="p2" />
<itemref idref="ch6" />
<itemref idref="ch7" />
<itemref idref="ch8" />
<itemref idref="p3" />
<itemref idref="ch9" />
<itemref idref="find" />
<itemref idref="about" />
<itemref idref="coverback" />
<reference type="cover" title="Cover page" href="front.html" />
<reference type="copyright-page" title="Copyright" href="copyright.html" />
<reference type="thanks" title="Special Thanks" href="thanks.html" />
<reference type="title-page" title="Title Page" href="title.html" />
<reference type="toc" title="Table of Contents" href="toc.html" />
<reference type="about" title="About Author" href="about.html" />
<reference type="back cover" title="Back Cover" href="back.html" />

The above code creates a content.opf file that can be used in the creation of both EPUB and MOBI files.


The toc.ncx file is the EPUBs table of contents. Unlike the OPF file, only HTML files must be listed.

<?xml version="1.0"?> 
<!DOCTYPE ncx PUBLIC "-//NISO//DTD ncx 2005-1//EN" 
<ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1"> 
      <meta name="dtb:uid" content= 
      <meta name="dtb:depth" content="2"/> 
      <meta name="dtb:totalPageCount" content="0"/> 
      <meta name="dtb:maxPageNumber" content="0"/> 
      <text>Man's Punishment</text> 
	<navPoint id="navPoint-1" playOrder="1"> 
            <text>Cover Page</text> 
         <content src="front.html"/> 
	<navPoint id="navPoint-2" playOrder="2"> 
            <text>Copyright Page</text> 
         <content src="copyright.html"/> 
      <navPoint id="navPoint-3" playOrder="3"> 
            <text>Special Thanks</text> 
         <content src="thanks.html"/> 
      <navPoint id="navPoint-4" playOrder="4"> 
         <content src="title.html"/> 
      <navPoint id="navPoint-5" playOrder="5"> 
            <text>Part 1:  The Mysterious Plague</text> 
         <content src="p1.html"/>
   <navPoint id="navPoint-6" playOrder="6"> 
               <text>Ch. 1</text> 
            <content src="ch1.html"/> 
	<navPoint id="navPoint-7" playOrder="7"> 
               <text>Ch. 2</text> 
            <content src="ch2.html"/> 
	<navPoint id="navPoint-8" playOrder="8"> 
               <text>Ch. 3</text> 
            <content src="ch3.html"/> 
	<navPoint id="navPoint-9" playOrder="9"> 
               <text>Ch. 4</text> 
            <content src="ch4.html"/> 
	<navPoint id="navPoint-10" playOrder="10"> 
               <text>Ch. 5</text> 
            <content src="ch5.html"/> 
         <navPoint id="navPoint-11" playOrder="11"> 
               <text>Part 2:  The Investigation Starts</text> 
            <content src="p2.html"/> 
		 <navPoint id="navPoint-12" playOrder="12"> 
            <text>Ch. 6</text> 
         <content src="ch6.html"/>
	 <navPoint id="navPoint-13" playOrder="13"> 
            <text>Ch. 7</text> 
         <content src="ch7.html"/>
	 <navPoint id="navPoint-14" playOrder="14"> 
            <text>Ch. 8</text> 
         <content src="ch8.html"/>

   <navPoint id="navPoint-15" playOrder="15"> 
               <text>Part 3: The Only Solution</text> 
			<content src="p3.html"/> 
         <navPoint id="navPoint-16" playOrder="16"> 
               <text>Ch. 9</text> 
            <content src="ch9.html"/> 
		    <navPoint id="navPoint-17" playOrder="17"> 
               <text>Find More Works</text> 
			<content src="find.html"/> 
         <navPoint id="navPoint-18" playOrder="18"> 
               <text>About Author</text> 
            <content src="about.html"/> 
		 <navPoint id="navPoint-19" playOrder="19"> 
               <text>Back Cover</text> 
            <content src="back.html"/> 

The code above is a simple table of content that gives details to each part, chapter, or other kind of page.


All EPUBs must have the location of the OPF file specified. The location is specified in the container.xml file, which is located in the META-INF directory.

<?xml version="1.0"?>
<container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:container">
	<rootfile full-path="content.opf" media-type="application/oebps-package+xml" />

The above code states that content.opf contains the list of files and that it is in the root directory of the EPUB.


All EPUBs must be declared as epub files. The file is named mimetype.


The above tells the reading software that the file is not an ordinary zip file.

Zip Content

All EPUBs are basically Zip wrappers. To get a correctly made epub, run this command in a terminal emulator (e.g. Command Prompt (Windows) or Terminal (Mac/Linux/BSD))

zip -Xr9D <filename>.epub mimetype *

Other details

IDPF states that EPUBs must validate against XHTML1.1, but valid EPUBs can validate against XHTML 1.0.


The following titles are available in EPUB format:

  • Death's Representatives by Bryce Campbell
  • Divinity's End by Bryce Campbell
  • Man's Punishment by Bryce Campbell