{"id":3482,"date":"2011-09-23T13:11:11","date_gmt":"2011-09-23T21:11:11","guid":{"rendered":"http:\/\/www.rudyrucker.com\/blog\/?p=3482"},"modified":"2012-02-21T14:40:41","modified_gmt":"2012-02-21T22:40:41","slug":"making-your-own-ebooks","status":"publish","type":"post","link":"https:\/\/www.rudyrucker.com\/blog\/2011\/09\/23\/making-your-own-ebooks\/","title":{"rendered":"Making Your Own Ebooks, Feb 21, 2012 Update"},"content":{"rendered":"<p>This is a February 21, 2012 revision of this post, which originally appeared September, 23, 2011.<\/p>\n<p>This is one of those posts where I describe something mind-breakingly complex that I did with my computer.  The reason I want to post it is so I can find the description after I\u2019ve totally forgotten all the details in six months.  Computer knowledge has such a short half-life.<\/p>\n<p>Over time, I&#8217;ll also be revising this post directly, as well adding links and ideas to the comments section as the information filters through my head&#8212;and as I continue making mistakes.  Let the learning process begin!<\/p>\n<p>[As I often do, I\u2019ll be using photo illos with absolutely no connection to the subject at hand.  I took these photos at Nick Herbert\u2019s house in Boulder Creek, on a dude ranch in Wyoming, and in the park at Wilder Ranch in Santa Cruz.]<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.rudyrucker.com\/blog\/images3\/nickaphik.jpg\"><\/p>\n<p><b>Plan<\/b><br \/>\nSo suppose I have a document and I want to make it into an ebook.<\/p>\n<p>Amazon will let you submit a DOC, but you are more likely to get the formatting you want if you submit an HTML.  Amazon won&#8217;t take an EPUB.  In practice it seems to work better to send HTML to Amazon, some files I\u2019ve tried had bad indents when I sent DOC, but looked okay in HTML.<\/p>\n<p>Barnes and Noble PubIt will take an HTML or an EPUB.  You can convert HTML to EPUB with the Calibre or the Sigil tool.<\/p>\n<p>Lulu will get you on iBook, and they take EPUB.<\/p>\n<p>We\u2019ll need HTML and EPUB versions of our book.  So our workflow is to go from DOC to HTML, and then from HTML to EPUB.<\/p>\n<p><em>[Supposedly Smashwords takes DOC only, but they seem to be becoming a little <a target=\"blank\" href=\"http:\/\/brianjjaxn.wordpress.com\/2011\/09\/23\/three-reasons-to-not-publish-through-smashwords\/\">irrelevant<\/a>.  And, for that matter, they don\u2019t seem to be processing their requests for new accounts.  To hell with them.]<\/em><\/p>\n<p><b>Setup<\/b><\/p>\n<p>Tools I\u2019m going to use: Microsoft Word, Adobe Dreamweaver, the free <a tar-get=\"blank\" href=\"http:\/\/calibre-ebook.com\/\">Calibre <\/a>ebook software,  the free <a tar-get=\"blank\" href=\"http:\/\/code.google.com\/p\/sigil\/\">Sigil <\/a>epub software, and the free <a tar-get=\"blank\" href=\"http:\/\/code.google.com\/p\/epubcheck\/\">Epubcheck <\/a>software.<\/p>\n<p>I make a directory for my project and put my Word document in there.  It\u2019s important at this point to format all of your chapter or section headings with a Header style such as Header 1, Header 2, etc.  The EPUB file is going to want to make a table of contents, and it will build them by finding Header-formatted lines.  And you\u2019ll want an internal table of contents that Word generates from headers.<\/p>\n<p>Regarding the images you want to include, even if you inserted them into your Word DOC from somewhere else on your hard drive, put copies of all the images that in a subdirectory of your project directory and name the subdirectory images.  Use some photo editing software to adjust the sizes of these images to be, let\u2019s say, 800 pixels across so they can fill up an iPad reader page.  This way you have control of what images get used.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.rudyrucker.com\/blog\/images3\/skutbike.jpg\"><\/p>\n<p><b>Word Formatting<\/b><\/p>\n<p>You can adjust font in the ereader, but I go with a default font size of 12 to start with.  Don\u2019t use any font larger than about 18 points for titles or sections, or it\u2019ll look too big on a smartphone.<\/p>\n<p>The fonts available in ereaders vary widely.  I myself like to go to Georgia.  There\u2019s a setting you can do to make the ereader use a similar font if Georgia\u2019s not available. More on this point below.<\/p>\n<p>The Amazon guidelines, and others, suggest that you justify your text, that is, choose the justified paragraph style so that both the left and right edges of the text are in straight columns.  I feel your ebook is easier to read if you forget about straight right edges and choose the Flush Left option.  Then the spacing between words will be uniform.  This said, many ereaders will ignore your format and will justify the text anyway.<\/p>\n<p>Set your paragraph first-line indent fairly small, like 0.2 inches.  What you\u2019ll see on the readers again varies.  Kindle always puts a huge indent, doesn&#8217;t skip a line between paragraphs.  Kindle Fire does no indent, skips a line between paragraphs.  iPhone does a small indent if you asked for that, doesn&#8217;t skip a line.  Etc.<\/p>\n<p>Put a Table of Contents into the DOC using the Word automatic TOC.  If you\u2019re planning to send an HTML to Amazon, you\u2019ll need the Table of Contents in there, as the Amazon processor won\u2019t build one for you.<\/p>\n<p> If you are heading for EPUB, you&#8217;ll be building a Table of Contents from the headers in Calibre or Sigil, but it\u2019s good to have a  Table of Contents inside your document anyway.  The thing is, some ereaders are unable to show the hidden EPUB table of contents. <\/p>\n<p>Once you have your Word-made TOC, also apply a header style to the title of your book at the beginning, as this will make the EPUB-built TOC more useful.  Or you can do this later in Sigil.<\/p>\n<p><b>Cover<\/b><\/p>\n<p>For the cover of your Ebook, use an external photo editor to create a cover.jpg file which is about 600 pixels by 800 pixels high. The cover obviously should show your name and the title of the book. Save it in your images mages subdirectory.  In World use Insert|Picture to insert this image at the very start of your DOC.  <\/p>\n<p>If you want you can have a bigger version of your cover as well.  When you upload to Amazon or B&#038;N, they\u2019ll as for a cover image, and you can upload the same one you use in the book or you can upload the bigger one.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.rudyrucker.com\/blog\/images3\/wildertoolwall.jpg\"><\/p>\n<p><b>Converting DOC to HTML<\/b><\/p>\n<p>In Word, I save the Word file as a \u201cWeb Page, Filtered\u201d\u009d or filtered HTML file.  Filtered means there\u2019s less Word crap in the file.  And I open this file in Dreamweaver and use Commands | Clean Up Word HTML\u2026 to get rid of more Word crap.  When I save the \u201cFiltered HTML\u201d\u009d file, Word makes a directory of extra files in my directory, but there\u2019s actually nothing in that directory that matters, and you can delete it.<\/p>\n<p>While you&#8217;re in HTML, look at the image links, and make sure they all point to file-names to the images subdirectory that you made.  You may need to use the Edit | Find and Replace dialog to get things set.<\/p>\n<p>You\u2019ll have at least one image, your cover.  It\u2019s better not have the size of the images hardcoded.  That way you\u2019re free to force in larger images if you want.  Use the  Edit | Find and Replace dialog and for the <em>Search: <\/em>field select Specific Tag and set to img, then for the<em> Action: <\/em>field select Remove Attribute and set to width.  Then do the same for height.  Then do the same for border.<\/p>\n<p>Fill in the Title field for your HTML in Dreamweaver.<\/p>\n<p>Now we need a few more tweaks so that the HTML can be used to build an EPUB.<br \/>\n*Delete the body attributes link and vlink.<br \/>\n*Remove all the align attributes of the p tags<br \/>\n*Remove all the clear attributes of the br tags<br \/>\n*Search and replace to change every occurrence of <b>a name= <\/b> to <b>a id= <\/b>.  These are the anchor tags that make your Word-built Table of contents work. The Epub standard likes the id attribute but not the name attribute, and either one works.<\/p>\n<p>Your probably want to add some separators between your sections, especially at the start of the book.  HTML runs all the pages together.  To make a separator, at the top of your HTML file, inside the style block of definitions, add this line<br \/>\nhr {page-break-after:always;}<\/p>\n<p>And then, wherever you want a break in your document, insert the symbol < then the letters hr then the symbol >, and you get a nice looking line like below, which plays the role of a page break.  I can&#8217;t write out what you <em>actually <\/em>put, because then you just get the pagebreak line!<\/p>\n<p><em>Cautionary note<\/em>: Once you get your HTML file all tweaked, you&#8217;d better not save it from Word again, as Word may put in some of the crap that you just removed.  I&#8217;m not positive about this, but at some point it seems safer to do any further edits in Dreamweaver.<\/p>\n<p><b>Sending HTML to Amazon<\/b><\/p>\n<p>I won\u2019t go into the details about getting a KDP (Kindle Direct Publishing) account, and filling out all the dialogs.  Let\u2019s talk about how you send the file to Amazon.  You\u2019ll have an HTML file and a directory with some files, in particular with the image files (Word makes some files, but they don\u2019t matter).  In order to upload, I put my main HTML file and the directory with the images into a single zipped directory file and uploaded that and the Kindle meat grinder eats that fine.  To zip the file and directory in my Windows machine I  I highlighted them and right clicked and selected Send To and sent to a Compressed File.<\/p>\n<hr>\n<p><img decoding=\"async\" src=\"https:\/\/www.rudyrucker.com\/blog\/images3\/wymormoncrick.jpg\"><\/p>\n<p><b>Tweaking HTML and EPUB in Sigil <\/b><\/p>\n<p>So now you\u2019ve made an HTML file and cleaned it up. Open the HTML  in Sigil.  As soon as you open you file in Sigil, it\u2019s converted into an EPUB file that you can save and distribute.  But first do some tweaks.<\/p>\n<p> Use the menu item View to put check marks on Book Browser and Table of Contents.<br \/>\nThe Book Browser shows all the different components that are hidden inside your EPUB file.<\/p>\n<p>The Table of Contents window should show a Table of Contents.  You can create a Table of Con-tents by clicking Generate TOC from Headings, and then clicking OK in the Heading Selector.  You can see if it worked by double clicking on some of the items in the Table of Contents box.<\/p>\n<p>If you didn\u2019t format your book title as a header in Word, you can still do that here in Sigil. Select the title and use the drop-down menu on the upper left corner of the Sigil window and apply a format such as Heading1.<\/p>\n<p>Use the menu item Tools|MetaEditor\u2026 to fill in names for the Title, Author, and Language of your EPUB file.  <\/p>\n<p>In the Book Browser window in the left hand side of your Sigil window, find the Images directory and look for contents.jpg in there.  Right click on it, select Add Semantics, and check Cover Image.  <\/p>\n<p>Now before you save and distribute your EPUB, use the Sigil Tools|Validate EPUB selection to see if you get errors.  If you click on the error messages, you\u2019ll see source code for the HTML, showing where the error lies.<\/p>\n<p>If you don\u2019t understand an error message paste it into the Google search box.<\/p>\n<p>Fix all the changes, but do the fixes over in Dreamweaver, and then save the HTML and  reload it in Sigil.  You need the roundabout approach, as Sigil won\u2019t save HTML for you.  And it\u2019s good to have the fixed HTML as a kind of base code file.<\/p>\n<p>Once you get past the errors, save your EPUB file with a name with no spaces.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.rudyrucker.com\/blog\/images3\/redberrywilder.jpg\"><\/p>\n<p><b>Validating with Epubcheck.<br \/>\n<\/b>Install the Epubcheck ware on your computer, it probably ends up in Program Files\\Epubcheck. Make a sample subdirectory of the Epubcheck directory and put a copy of your current EPUB file there.  Suppose it\u2019s called betterworlds.epub.<\/p>\n<p>Then go to the Command Line interface for your computer, navigate into the directory where epubcheck lives, like to Program Files\\Epubcheck.  Now run a command like this:<br \/>\njava -jar epubcheck-3.0b2.jar sample\/betterworlds1.epub<\/p>\n<p>Of course the letters and numbers after epubcheck depend on which version of the software you have.  And the name of the epub file depends on what file you\u2019re checking.<\/p>\n<p>If all goes well, epubcheck will either print a \u201cNo Errors Found\u201d\u009d message, or it will spew out a lot of error messages.  You can scroll up and down to see them all.  Most common causes of errors are (1) you forgot to build a table of contents using the Sigil Table of Contents window, or (2) you didn\u2019t fill in the Name, Title and Language fields using Sigil Meta tool, or (3) the Epub ware is confused because you gave your epub file a name with spaces in it.  If you see an error you can\u2019t understand, try copying into the Google search bar to see what other people say about it.<\/p>\n<p>As before, do the fixes in Dreamweaver, save the fixed HTML, reload in Sigil, save off a fresh PUB and try epubcheck again.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.rudyrucker.com\/blog\/images3\/wyruriverbluff.jpg\"><\/p>\n<p><b>Publish on Amazon and B&#038;N<\/b><\/p>\n<p>And maybe Lulu, as a way to get to iBook.  And if Smashwords ever starts working again, maybe try that\u2026if you care about being listed on the smaller distribuor sites like Diesel.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a February 21, 2012 revision of this post, which originally appeared September, 23, 2011. This is one of those posts where I describe something mind-breakingly complex that I did with my computer. The reason I want to post it is so I can find the description after I\u2019ve totally forgotten all the details [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3482","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.rudyrucker.com\/blog\/wp-json\/wp\/v2\/posts\/3482","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rudyrucker.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rudyrucker.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rudyrucker.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rudyrucker.com\/blog\/wp-json\/wp\/v2\/comments?post=3482"}],"version-history":[{"count":28,"href":"https:\/\/www.rudyrucker.com\/blog\/wp-json\/wp\/v2\/posts\/3482\/revisions"}],"predecessor-version":[{"id":3786,"href":"https:\/\/www.rudyrucker.com\/blog\/wp-json\/wp\/v2\/posts\/3482\/revisions\/3786"}],"wp:attachment":[{"href":"https:\/\/www.rudyrucker.com\/blog\/wp-json\/wp\/v2\/media?parent=3482"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rudyrucker.com\/blog\/wp-json\/wp\/v2\/categories?post=3482"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rudyrucker.com\/blog\/wp-json\/wp\/v2\/tags?post=3482"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}