Chapter Decisions: So You Want to Make an eBook

This post is part of So You Want to Make an eBook?. I’m releasing this book in sections on my blog, but when it’s all finished I will offer the whole thing as a single eBook. Everyone who donates toward its production (use the coffee cups to the right, note that it’s because of this effort) will get a free copy of this eBook. You can find all the posts here.
Chapter Decisions
A downside of eReaders is their relatively weak processor. They don’t need a strong processor, because they’re usually not doing anything horribly strenuous. However, it’s a weak enough processor that large files or lots of images can really, really slow them down. The problem gets worse the further you get into a file. For example, if you make an entire novel into only one file, my eReader takes over two seconds to turn a page by the end of the book. Break that same work down into chapter-length bits, and a page turn takes half a second or less.
Images also compound the problem – especially if they’re too large, or there are many of them in each file. If you have an illustration (or table) heavy section, it might be worth separating that into multiple files.
Luckily, most prose works have a pretty natural break-point built in: chapters. I highly recommend that you make each chapter into a separate file. In fact, some stores require you to do this. If you are working with an anthology, then each story becomes a separate file, and if your eBook just contains a single short story or so just keep it as one single file. Here is my recommendation on how to do this most effectively:
In the
“base” directory from the sample pack is the file “empty_chapter.html”. Edit the title and conversion fields (where it says “Your Name Here” and “Your Title Here”). Then make copies for each chapter, naming them something like chapter_00.html, chapter_01.html, and so on. Additionally, if you have footnotes, make a file footnotes.html. Make a file CoverPage.html.
You want the names to be something obvious and simple. The reason you use a leading zero (“01” instead of “1”) is so that your files will sort properly when you look at them – it just makes your life easier. You’ll notice this throughout here. Shortcuts will bite you in the buttocks. Period, dot, end of story.
Okay, now that we’ve done that, let’s take a look at the empty chapter files. The very first line must be the one that begins <?xml (and then a bunch of other stuff). The first two lines declare what kind of file it is. The third line says that the HTML starts there, and gives some technical specifications about how the file is treated. Then you see the <head> tag. All of the tags from <html> on are closed later on in the file. Think of it like a math operation:

( ( 2 * 3 ) + ( 8 – 5 + ( 2 * 3) ) )

Each operation inside a parenthesis must be completed before moving onward.
The other thing to remember is that <html> and <HTML> are not the same. Capitalization counts – so if you open with a <P> tag, it will not be closed by </p>.
Anyway, back to our file. The head section can be left pretty much as is, since you’ve already put your name and the title of your book in there. All of your text will go between <body> and </body>. Finally, there is the closing </html>. There must be nothing after the closing tag!
Cut and Paste
So now you cut and paste the text into the appropriate chapter files. Footnotes go into footnotes.html, as we discussed earlier. This part is pretty simple and straightforward, just making sure that you put the text between <body> and </body>.
The hardest part here is going back through and fixing your footnotes in footnotes.html. Remember the double exclamation points you made as placeholders? Now it’s time to change those to the actual numbers for your chapter files. If you followed my advice before, you already know what chapter each footnote goes to, so it’s just a matter of typing the numbers in from your notes.
Making the cover page at this point is really easy as well. Edit CoverPage.html and paste in this text in the <body> section of that file:
<div id=”cover” style=”text-align:center”><img src=”cover.png” alt=”table”/></div>
That’s it!
A Table of Contents page – as opposed to the built-in table of contents that we’ll work with later – is simply a list of hyperlinks. Create another blank file like you did with the chapters. Then after the <body> tag, put the following:
<p class=”center”><span class=”b”>Table of Contents</span></p>
<p>&nbsp;</p>
<p><a href=”CoverPage.html”>Cover Page</a></p>
<p>&nbsp;</p>
<p><a href=”chapter01.html”>Chapter One</a></p>
<p>&nbsp;</p>
<p><a href=”chapter02.html”>Chapter Two</a></p>

You get the idea.

NOTE: Rob caught a typo/conversion error on my part (now corrected). The HTML tags MUST have a closing paragraph at the end.

There is no implicit paragraph close tag. You’ve got to implicitly close it each time – along with each element within that tag. For example:

<p><em><strong>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</strong></em></p>
<p><em><strong>Suspendisse eu diam nibh, ut consequat dolor.</strong></em></p>

NOT

<p><em><strong>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<p>Suspendisse eu diam nibh, ut consequat dolor.</strong></em></p>
This post was part of So You Want to Make an eBook?. I’m releasing this book in sections on my blog, but when it’s all finished I will offer the whole thing as a single eBook. Everyone who donates toward its production (use the coffee cups to the right, note that it’s because of this effort) will get a free copy of this eBook. You can find all the posts here.

Popular posts:

  • If there's one Nazi (or a racist) at the table...
  • Word Porn Quotes
  • SOLVED: Command line BPM (beats per minute) Analysis in Linux
  • Bash string padding with SED
  • The difference between boundaries and rules
  • Everything Is Awful and I'm Not Okay, in multiple formats.
  • Whole house audio, easily, freely, for Linux and MacOSX using SnapCast

4 Comments

  1. May 26, 2011

    In chapter the Title tag, it is better to put in the book title, or the chapter title?

    A minor point, I know, just curious.

  2. May 26, 2011

    I don't believe it makes a difference. I put the book title to save myself time.

  3. August 28, 2011

    I notice you don't explicitly close the paragraph tag which would wrap around each (a) anchor block. Is there a reason for that or are you relying on the implicit (/p) based on the new paragraph tag block on the following line (p) (/p) ?

    I hope that's clear.

    Also, round brackets substituted for angle brackets because of html ban on comments.

  4. August 30, 2011

    Good catch, Rob. That's an error from where I converted to Blogger's rendering schema.

    There is no implicit paragraph close tag. You've got to implicitly close it each time – along with each element within that tag. For example:

    <p><em><strong>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</strong></em></p>
    <p><em><strong>Suspendisse eu diam nibh, ut consequat dolor.</strong></em></p>

    NOT

    <p><em><strong>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
    <p>Suspendisse eu diam nibh, ut consequat dolor.</strong></em></p>

Comments are closed.
https://ideatrash.net/2011/05/chapter-decisions-so-you-want-to-make.html
ideatrash.net
crawl=CC-MAIN-2018-47
225312
application/http; msgtype=response
sha1:RBA7GY4HXWLNGBJZ5D6YWW6QETGTFEEM
<urn:uuid:2f1e89f1-37b9-4e32-85cf-403887574af3>
2018-11-14T07:04:34Z
198.187.31.53
text/html
sha1:SXPOVIKXTNPRLMPAN5YMZWKL224IJ2WS
<urn:uuid:81d5e6fc-d479-4e98-a300-0885956ba2c4>
https://ideatrash.net/2011/05/chapter-decisions-so-you-want-to-make.html
response
<urn:uuid:10bfd9ee-f302-461d-b0d9-b582593d2b36>
isPartOf: CC-MAIN-2018-47
publisher: Common Crawl
description: Wide crawl of the web for November 2018
operator: Common Crawl Admin (info@commoncrawl.org)
hostname: ip-10-67-168-131.ec2.internal
software: Apache Nutch 1.15 (modified, https://github.com/commoncrawl/nutch/)
robots: checked via crawler-commons 0.11-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)
format: WARC File Format 1.1
conformsTo: http://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/