{"id":7561,"date":"2012-07-20T22:34:43","date_gmt":"2012-07-21T03:34:43","guid":{"rendered":"http:\/\/www.onelowerlight.com\/writing\/?p=7561"},"modified":"2012-07-21T22:35:16","modified_gmt":"2012-07-22T03:35:16","slug":"adventures-in-ebook-formatting","status":"publish","type":"post","link":"https:\/\/www.onelowerlight.com\/writing\/adventures-in-ebook-formatting\/","title":{"rendered":"Adventures in ebook formatting"},"content":{"rendered":"<figure id=\"attachment_7562\" aria-describedby=\"caption-attachment-7562\" style=\"width: 453px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.onelowerlight.com\/writing\/wp-content\/uploads\/2012\/07\/epub-sigil-screenshot.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-7562\" title=\"epub sigil screenshot\" src=\"https:\/\/www.onelowerlight.com\/writing\/wp-content\/uploads\/2012\/07\/epub-sigil-screenshot-600x351.jpg\" alt=\"\" width=\"453\" height=\"265\" srcset=\"https:\/\/www.onelowerlight.com\/writing\/wp-content\/uploads\/2012\/07\/epub-sigil-screenshot-600x351.jpg 600w, https:\/\/www.onelowerlight.com\/writing\/wp-content\/uploads\/2012\/07\/epub-sigil-screenshot-300x175.jpg 300w, https:\/\/www.onelowerlight.com\/writing\/wp-content\/uploads\/2012\/07\/epub-sigil-screenshot-140x82.jpg 140w, https:\/\/www.onelowerlight.com\/writing\/wp-content\/uploads\/2012\/07\/epub-sigil-screenshot.jpg 1024w\" sizes=\"auto, (max-width: 453px) 100vw, 453px\" \/><\/a><figcaption id=\"caption-attachment-7562\" class=\"wp-caption-text\">Under the hood of my latest ebook release, <strong>Star Wanderers: Part I<\/strong>.<\/figcaption><\/figure>\n<p>So a couple of days ago, I set out on a quest to figure out a better way to build an ebook. \u00a0In the process, I ended up learning WAY more about ebooks than I&#8217;d bargained for, in the most awesome of possible ways. \u00a0Seriously, I don&#8217;t think I&#8217;ve ever felt so empowered as an indie author as I do right now.<\/p>\n<p>My old process was extremely convoluted. \u00a0It basically involved saving my manuscript as HTML (introducing all kinds of excess code) and using four or five programs to cobble together a Frankenstein-like creation, with bolts sticking out of its forehead and extra arms and fingers sticking out of weird places. \u00a0The tools I was using were like blunt instruments, and I was operating them blindfolded.<\/p>\n<p>So what changed? \u00a0Well, three things:<\/p>\n<ol>\n<li>I added the <a href=\"http:\/\/extensions.openoffice.org\/en\/project\/Writer2ePub\/\" target=\"_blank\">Writer2ePub<\/a> plugin for Open Office \/ Libre Office,<\/li>\n<li>I downloaded an open-source epub editor called <a href=\"http:\/\/code.google.com\/p\/sigil\/downloads\/list\" target=\"_blank\">Sigil<\/a>, and<\/li>\n<li>I watched this video:<\/li>\n<\/ol>\n<p><iframe loading=\"lazy\" src=\"http:\/\/www.youtube.com\/embed\/RSc7XZzMkq0\" frameborder=\"0\" width=\"480\" height=\"360\"><\/iframe><\/p>\n<p>So what did I learn?<\/p>\n<p>&lt;geek&gt;<\/p>\n<p>First of all, that ebooks are WAY simpler than I thought they were. \u00a0An epub is basically a zipped folder containing HTML files for the text, jpgs\/gifs for the cover and any interior illustrations, a CSS stylesheet, maybe some extra fonts (if you want to get fancy), and two additional additional files ending in .opf and .ncx that look a lot like HTML files.<\/p>\n<p>So why is this so exciting? \u00a0Because it means that if you know HTML\/CSS, you can build a fully functional epub file using only notepad, windows explorer, and the command prompt. \u00a0THAT&#8217;S IT! \u00a0And if you want to learn HTML, you can do so <em>for free<\/em> at <a href=\"http:\/\/w3schools.com\/\" target=\"_blank\">w3schools.com<\/a>.<\/p>\n<p>Basically, an epub is structured just like a website, except that an ebook reader reads it instead of an internet browser. \u00a0If you can build a website, you can build an epub with very little trouble. \u00a0Even if you can only tweak a website, you can build an epub with very little trouble.<\/p>\n<p>&lt;\/geek&gt;<\/p>\n<p>In other words, the barriers to entry for ebook publishing are ridiculously low. \u00a0If you&#8217;re patient and a good learner (or hell, just a good learner), there is not a single reason why you need to spend any money to format your ebooks, upload them directly to retailers, or do anything else. \u00a0Using tools that are 100% available for free, you can create a product that looks every bit as professional as anything coming out of New York&#8211;in many cases, even more professional.<\/p>\n<p>So what&#8217;s my new process?<\/p>\n<p><strong>1) Format the master file in Open Office.<\/strong><\/p>\n<p>This includes adding the copyright page and table of contents, adding anchors (in OO they&#8217;re called &#8220;bookmarks&#8221;) and hyperlinks, adding the author&#8217;s note and acknowledgments, any teasers, etc. \u00a0I save the file in <a href=\"http:\/\/en.wikipedia.org\/wiki\/Odf\" target=\"_blank\">open document format<\/a>, add &#8220;Smashwords Edition&#8221; on the copyright page and save it as a .doc file for Smashwords.<\/p>\n<p>At some point, I&#8217;m going to upgrade to Libre Office, but I haven&#8217;t gotten around to it yet. \u00a0When I do, it&#8217;ll basically be the same thing.<\/p>\n<p><strong>2) Export as .epub using the Writer2ePub plugin.<\/strong><\/p>\n<p>I cannot tell you how happy I am with this Open Office \/ Libre Office plugin. \u00a0It pulls out all of the unnecessary formatting and breaks up every chapter into a separate, cleanly coded HTML file, all bundled together into a fairly simple epub. \u00a0SO MUCH BETTER THAN SAVING AS HTML. \u00a0Or Mark Coker&#8217;s &#8220;nuclear option,&#8221; for that matter.<\/p>\n<p>I don&#8217;t add the cover at this point, though. \u00a0Writer2ePub adds some weird stuff if you do it that way, and I find it easier just to code it manually in the next step.<\/p>\n<p><strong>3) Finalize the .epub in Sigil.<\/strong><\/p>\n<p><strong><\/strong>Sigil is basically just an HTML editor with some extra functionality that allows it to build an epub from those HTML files. \u00a0It&#8217;s easy to learn, simple to use, and tells you exactly what&#8217;s wrong when something breaks. \u00a0Unlike Calibre and Mobipocket Creator, you can always see what&#8217;s going on underneath the hood. \u00a0Simple, clean, and elegant. \u00a0I love it.<\/p>\n<p>This is the phase that takes the most work. \u00a0I add the cover, fill in the relevant metadata, tweak the CSS stylesheet for margins and indents, add the book guides, build the table of contents, etc. \u00a0If you want to know exactly how I do this, let me know and I&#8217;ll write up a post on it later. \u00a0It&#8217;s a little technical, but not too difficult. \u00a0Like I said, if you know even a modicum of HTML, you can figure it out.<\/p>\n<p>Once this step is finished, I have the final epub version of my book. \u00a0I upload that to Pubit! and Kobo Writing Life, and just about anywhere else outside of Amazon where I sell my book. \u00a0Someday soon, Smashwords will hopefully allow you to directly upload an epub, at which point I&#8217;ll do that here as well.<\/p>\n<p><strong>4) Convert to .mobi with KindleGen.<\/strong><\/p>\n<p><strong><\/strong>Amazon uses its own proprietary format for ebooks, unlike everywhere else, which takes the open source epub format. \u00a0This is probably because of all the weird and funky stuff that Amazon likes to track for data collection purposes, although honestly, who knows? \u00a0A mobi file is about twice as large as an epub, and I suspect that that&#8217;s the reason.<\/p>\n<p><a href=\"http:\/\/www.amazon.com\/gp\/feature.html?ie=UTF8&amp;docId=1000234621\" target=\"_blank\">KindleGen<\/a> is a free program that Amazon has made available to developers in order to facilitate conversion of epubs and other ebook formats into mobi. \u00a0It&#8217;s a command line tool, which means that you have to get a little retro to use it. \u00a0But hey, I grew up in the 90s with DOS, so it&#8217;s actually kind of nostalgic.<\/p>\n<p>Once you&#8217;ve got KindleGen installed to c:\\kindlegen, all you basically need to do is go to the file folder where your ebook is saved and enter the following command:<\/p>\n<blockquote><p>c:\\kindlegen\\kindlegen mybook.epub -c1 -verbose<\/p><\/blockquote>\n<p>&#8220;mybook.epub&#8221; is whatever you named your epub file, &#8220;-c1&#8221; stands for standard DOC compression, and &#8220;-verbose&#8221; stands for verbose output (whatever that means). \u00a0There are other options you can enter, but I&#8217;m not sure what they do yet. \u00a0All I know is that if you want to convert from epub to mobi, this will give you a clean result.<\/p>\n<p>There are a few small things that get lost in the conversion, so you need to add them as redundancies in the epub. \u00a0The biggest one I&#8217;ve noticed so far is the paragraph indents: if you go into the CSS stylesheet using Sigil and add p { &#8230; text-indent: 2em; &#8230; } that should fix it.<\/p>\n<p>And that&#8217;s it! \u00a0Once this step is finished, I&#8217;ve got the final mobi version and can upload that directly to Amazon and my kindle. \u00a0Once that&#8217;s done, my book is available from every major ebook retailer in every country in the world. \u00a0Total time = maybe an hour (plus however long it takes for the retailers to publish the files to their stores).<\/p>\n<p>I know it&#8217;s 2012 and this is old news by now, but do you have any idea how cool this is? \u00a0With one hour of work and two or three programs, all of which are available for free, I can produce a clean, professionally formatted ebook, and sell it around the world instantaneously with a marginal cost of zero.<\/p>\n<p>And now, because I took the time to learn how to use the tools, I can be confident that there aren&#8217;t any bits of rogue or useless code in it either. \u00a0The only &#8220;black box&#8221; is really the mobi format, but I could probably crack that and figure it out if I wanted to.<\/p>\n<p>So yeah, needless to say, I am <em>extremely\u00a0<\/em>happy to be an indie writer. \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So a couple of days ago, I set out on a quest to figure out a better way to build an ebook. \u00a0In the process, I ended up learning WAY more about ebooks than I&#8217;d bargained for, in the most awesome of possible ways. \u00a0Seriously, I don&#8217;t think I&#8217;ve ever felt so empowered as an&hellip; <a class=\"more-link\" href=\"https:\/\/www.onelowerlight.com\/writing\/adventures-in-ebook-formatting\/\">Continue reading <span class=\"screen-reader-text\">Adventures in ebook formatting<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[664,547,577,742,529,739,748,747,744,745,743,746],"class_list":["post-7561","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-amazon","tag-ebook-formatting","tag-ebook-revolution","tag-epub","tag-indie-publishing","tag-kobo","tag-libre-office","tag-open-office","tag-pubit","tag-sigil","tag-smashwords","tag-writer2epub","entry"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p7iXK-1XX","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.onelowerlight.com\/writing\/wp-json\/wp\/v2\/posts\/7561","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.onelowerlight.com\/writing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.onelowerlight.com\/writing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.onelowerlight.com\/writing\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.onelowerlight.com\/writing\/wp-json\/wp\/v2\/comments?post=7561"}],"version-history":[{"count":5,"href":"https:\/\/www.onelowerlight.com\/writing\/wp-json\/wp\/v2\/posts\/7561\/revisions"}],"predecessor-version":[{"id":7565,"href":"https:\/\/www.onelowerlight.com\/writing\/wp-json\/wp\/v2\/posts\/7561\/revisions\/7565"}],"wp:attachment":[{"href":"https:\/\/www.onelowerlight.com\/writing\/wp-json\/wp\/v2\/media?parent=7561"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.onelowerlight.com\/writing\/wp-json\/wp\/v2\/categories?post=7561"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.onelowerlight.com\/writing\/wp-json\/wp\/v2\/tags?post=7561"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}