Word to Calibre to MOBI: Part 3: File Conversion

You went through Part 1 and styled your Word file properly. In Part 2 you learned how to turn it into a functional html file. Now it is time to convert your file.

A caveat before we begin. I use Calibre, but I don’t really use it. It has a pleasant display and it’s a good way to double-check EPUB files I create. I don’t use it to convert my files. What I am about to show you is the result of some serious screwing around with the program. It’s a hack and it may not be the very best one. What it does is work. So, if any of you are more familiar with how Calibre works and you have a better way, feel free to share.

STEP 1: Open your html file in Calibre. It will convert into a “zip” file.

CAL16STEP 2: Convert the ebook into an EPUB file. (Yes, EPUB, not MOBI. You will never again use Calibre to convert MOBI files for commercial purposes. It’s still just fine for personal use.)

CAL17STEP 3: Once your book is converted and you are back at the main page, right click on the book title and a drop down menu will appear. There will be an entry that says “Edit Book.” Click that.

CAL18STEP 4: Holy Moley time again. It’s an EPUB editor.

CAL19STEP 5: In the left hand sidebar, under “Text” delete the file that says “titlepage.xhtml”

STEP 6: Under “Styles” open the file that says “page_styles.css”. It will contain some code that says:

{
margin-bottom: 5pt;
margin-top: 5pt
}

Delete that and Copy/Paste in its place this bit of code:

{margin: 0; padding: 0; border: 0; font-size: 100%; vertical-align: baseline;}
body {text-align: justify; line-height: 120%;}

STEP 7: Under “Images” will be your cover image. Open it. Now resize it. (make sure the Keep Aspect Ratio box is checked) Change the width to 800px. (The cover height should increase proportionately.)

STEP 8: Under “Miscellaneous” will be a file called “content.opf.” Open it. Scroll down to the bottom and you will see two entries: <guide> and </guide>. If you built your html file the same way as in this tutorial and deleted your titlepage.xhtml, there will be nothing in the guide.

CAL20Using Copy/Paste, insert this code between the two entries

<reference href=”FILE NAME” type=”toc” title=”Table of Contents” />
<reference href=”FILE NAME” type=”text” title=”Beginning” />

STEP 9: Figure out which of the files under “Text” is your table of contents. Copy the file name and paste it in the reference line so it replaces FILE NAME. (use Ctrl C to copy and Ctrl V to paste)

Do the same thing for whichever file (your title page or Chapter One or your preference for the beginning of your ebook) in the “Beginning” reference line.

Mine looks like this:

CAL21STEP 10: Save and close the EPUB editor.

STEP 11: Open the Kindle Previewer. Click on “Open Book” and select the EPUB file you just modified. If you did this right, you will get this box:

CAL22Now you have a MOBI file that will upload successfully at Amazon–and it will work. No squishy lines, no messed up formatting, and the user’s navigation guides will work.

I’m sure there are plenty of things you can do to modify the file in the EPUB editor. (I didn’t, for instance, even touch on the toc.ncx) This is a pretty rough hack I’ve come up with, and it can probably stand some streamlining. There is plenty of room for fine tuning. What I hope you see is that Word can be used for styling, but its html leaves far too much room for error in ebooks. With a little knowledge of html, you can write in Word, but then you do your styling in the text editor. When you’re comfortable with html, you can make complete ebooks and not have to use Calibre at all. (And you’ll be ready for Paul Salvette’s guide to ebook development, it’s featured in the sidebar.)

Again, you probably have plenty of questions. So send them to me at jayewmanus at gmail dot com and I’ll put together a FAQ post to answer them.

Extra Long Table of Contents? Table It

toc toiletTables of contents in ebooks are kind of like toilets. Necessary, but you don’t want them on display in the living room. This week I faced an interesting dilemma: a ToC with almost 70 entries, and the majority of them just numbers. So ensued my usual futzing about, trying to figure out how to make it as unobstrusive as possible. I could have gone with a short ToC at the beginning, linked to a full list of contents in the back. Ah, but then I would have several pages that looked like this:

 

 

toc list

Not what I want at all.

Then I had a lightbulb moment. Table it. (pardon the typo, I fixed it already!) Screenshots off my Paperwhite Kindle:

toc SS3The nice thing about using a table as opposed to just writing a line of text is consistency. Look what happens when I change margins.

toc SS2Or change the font size:

toc SS3No matter how the user sets their preferences, the tables remain intact and no text wrapping. The result is a large ToC on one or two “pages” that is easy to read and use, and doesn’t eat up the sample or Look Inside preview.

The styling is very easy in html (though repetitive–hooray for copy/paste).

toc htmlYou can learn more about how to do this at the w3schools site.

Now would this work for a long ToC styled as Chapter 1 or Chapter One? It might be worth experimenting. Then, your ToC can be like your toilet, doing its job quietly in the background.

Fun With Formatting Ebooks: Paragraph Styles

Whether a reader is conscious or not of doing it, they are judging at least some of the quality of your writing by how it looks on the screen. When you send your writing into the world you want it to look polished, professional, and assertive. Even if you don’t use fancy bits and curlicues, you can make your ebook look polished, professional and, yes, assertive–as in, “I am a smart and sophisticated writer who knows what she is talking about, so pay attention!“–just by taking care with your paragraph styles.

The most basic of basic styles are indented and block paragraphs. Convention says, indented paragraphs for fiction and block style for non-fiction. Why the convention? Indented paragraphs are quicker to read (not really, but doesn’t it seem that way?), while block paragraphs tend to be weightier, denser, and can add a measure of gravitas to the text. It’s really a preference and not about right and wrong. Readers do expect text to look a certain way, though, and you take a chance of distracting them from the prose if you mess with their expectations.

For those of you using anything other than html to format your ebooks, (pardon my shouting) NO TABS! Tabs, and using the space bar to indent paragraphs, play havoc with ebooks. NO TABS. Your word processor enables you to use style sheets–use them. NO TABS.

How wide an indent?   para6

The narrow indent is a leftover from the days of pulp fiction when every sheet of paper counted against the bottom line and so the publisher needed to cram as much text onto a page as possible. It looks a bit squishy, especially if the reader prefers narrow line spacing on their device. Wide indents are a writer habit, I think, from being used to working on manuscripts with their half inch indents. Too wide, though, and the ebook can assume the look of a manuscript, and that’s not polished. I prefer a medium width indent of 1.4ems (.3″ in a word processor).

Block paragraphs require spaces between the paragraphs so they don’t run together.

para5Whether you’re using a word processor or html, you need to include that extra leading in your style sheet–not (never) by manually inserting a blank line between paragraphs. Be aware, too, that you do not want to increase the space between indented paragraphs. Doing so means users of the Kindle iOS app will end up with huge spaces between paragraphs. Smashwords will reject files for inserting extra space.

Another style is one I don’t recommend for full paragraphs. Centering.

para4para3

Don’t forget that centering IS a style. Don’t just highlight the text then click the “center” command in the menu bar. Make sure your text indent is set to zero so the center doesn’t end up off-center.

Sometimes you’ll need to set off text. Quotes, song lyrics, poetry, missives.

para2para1The only difference in coding between the first block quote and the lines of poetry is the use of italics.

What if you want to set off an entire section of text?

para7Keep it simple, aim for sophisticated, and keep your reader’s comfort in mind while you style your paragraphs.

What about the rest of you? Any fun styling tricks you’d like to share?

Boast Post: A New Way To Make Ebooks

A new way for me anyway. Not long ago I got my hands on Paul Salvette’s book, The eBook Design and Development Guide (link in the sidebar). I talked it up because it explained in plain English (mostly) the hows and whys of building a better ebook. Even though it intimidated me, I knew I had to try his method.

Well…

(Pardon my not using screenshots. I haven’t figured out how to capture screenshots off the Kindle Fire yet. The instructions I’ve seen require a little more… Anyhow.)

As per my usual knuckleheadtude, I picked for my maiden voyage a three-book omnibus. Go bold or go home, right? By the time I figured out I should have chosen an easier project, it was too late and I had no choice except to keep going forward.

This method is NOT for beginners. You need at least some experience with html and text editors. If, however, you are like me, knowing just enough to be dangerous and curious about how ebooks and ereading devices work, going through the steps to build an ebook this way will teach you plenty. I now have a much better understanding about what happens to files when they go through conversion and why some things work better than others and why some things fail.

The biggest difference between what I was doing before and what I did with this book is that before I was formatting the ebook and producing files that could be read on ereaders, but they were not complete ebooks. To make them complete they had to be run through a conversion program. What was missing on my end was a navigation guide and a toc.ncx. Ebooks, I’ve learned, have two tables of contents. The one the formatter creates while formatting and the toc.ncx which is the internal table of contents which is generated during conversion. Conversion also produces a navigation guide which is what makes, for instance, jumping from chapter to chapter possible. Why are there two tables of contents? I do not know. All I know is, I didn’t know how to make them before and I left it up to the conversion programs to do it for me. With this new (to me) method, I built my own navigation guide and toc.ncx. Now, if someone asks me to format a book that they intend to sell on their own site rather than through a distributor, I know how to do it.

What I appreciate most about Paul’s guide (other than being written in language I could understand or figure out–which often takes staring at the screen until, like magic-dot pictures, the answer slowly appears) is that he takes the time to explain what is happening and how things can go right or wrong depending upon which device the book will be read on. That’s valuable information, especially for a non-programmer. I spend a lot of time over on the w3schools.com site seeking answers to my problems, but what’s over there is geared for programmers and people who have skills and experiences that are foreign territory for me. Which means I do a lot of, “hmn, let’s try this and see what happens,” and sometimes I get the desired results and sometimes I don’t. When I can’t get the results I want, it’s a bear figuring out why. I also learned I’ve been making some parts of my formatting tasks overly complicated and much too hard.

As a bonus, on his website, BB eBooks, Paul has an area for developers with templates and guides. It’s a terrific resource.

If you’re like me, you know how to format an ebook, know some html, are comfortable working in a text editor and now you’re ready to kick it up a notch, the guide will take you through the process step-by-step. I recommend you read the entire book first so you get the overall picture of what it is you’re about to attempt. I took a lot of notes and used my whiteboard to help me keep track of such things as bookmarking navigation points and naming files. Since this method involves splitting up the main file into many smaller files, you will need to find a solid, simple way to name the files and keep track of them.

One area where I had serious trouble was in making the zip file. I could not get the recommended program to synch with my computer. That’s not the guide’s fault (I need to get my son over here to figure out why my computer disallows changing directories). So I cheated and copied my files into a .zip folder then changed the .zip designation to .epub. I don’t know if you’re supposed to do that, but it worked. I’m not comfortable with it because my computer sends me nasty grams when I do, but it did work.

Because I was building a book for the Kindle, I had to disregard some of the advice about line spacing. In the most recent update that Amazon did for Kindle devices, they changed the default font and apparently the line spacing and paragraph spacing defaults, too. I’ve noticed in some of the recent stories I’ve downloaded the text appears double-spaced and changing the line spacing on my Kindle takes it down, at the most, to a space and a half between lines. Plus, where before some extra leading between paragraphs made them look better, now the extra leading puts a noticeable gap between paragraphs. I don’t think that is happening on Nooks or other EPUB readers. It didn’t appear to be a problem on Calibre. So pay attention to line spacing when you’re building a book for the Kindle. Things have changed.

I also refrained from reducing the font size anywhere in the book because I don’t know if Amazon fixed the bug that squishes the font in older Kindles. Until I’m sure of that, no font reductions for Kindle.

Some of the touches I did for this book included moving the copyright page and table of contents to the back of the book so potential buyers can get a larger sample. Plus, because it’s a three-book omnibus, I placed a header at the beginning of each chapter with the title of individual book. Just to keep readers reminded of which book they are reading.

I love the way the book turned out. Despite being intimidated by the process, I learned some skills, gained a whole lot of understanding and ended up with a very nice looking ebook that is easy for readers to navigate. (I also learned some new cuss words, but I won’t go into that…)

Thank you, Paul.

If you want to check out my latest masterpiece, and some pretty good stories, too, it’s available now on Amazon.

 

Oh My God, I’m a Nerd!

Long time readers of this blog have watched my progression from building ebooks in Word to the present day as I’m handcoding html. You’ve heard me whine about the quality of ebooks and the difficulty of producing a book that renders perfectly on every device, every time. I’ve used different programs, different methods–and for the longest time I utterly resisted learning html because 1) I knew nothing about it; and 2) I resented the idea that one had to be some kind of mad genius-computer nerd in order to make a decent ebook.

Well. I was wrong. It doesn’t matter that I knew nothing about html. If one is motivated, one can learn. Plus, one doesn’t need to be a mad genius (or even a slightly bent genius) in order to learn basic coding–which is really all one needs in order to make a beautiful ebook.

One does have to be, however, a bit of a nerd. I realized this the other day when I announced to the old man, “Ha! Regex isn’t so hard and toggling the extended command means I can wrap paragraphs and find extra spaces as easily in the editor as I can in Word. Bwahahaha!”

Do you understand what I just said? Don’t worry. The old man didn’t either. A month ago I wouldn’t have understood it. Suffice to say, I’m learning a whole new language and it is finally making sense to me even though that means my family now looks at me the same way the dog does when I’m talking to him (he’s waiting for me to say the magic words–“walkies” or “cookies”).

But, I haven’t done all this alone. Every time one of you guys, blog readers, makes a comment about a new way of doing something or talks about a new program, I have to check it out. And I learn things. When I’m working, I have a screen open to the W3Schools website so I can quickly get questions answered. I’m always bopping around the ‘net, seeing how others have solved problems and seeing if they’ve learned something new. I don’t always (okay fine, most of the time) understand what others are talking about. The real experts have been doing computer programming for decades and they speak “html” with casual fluency while I’m over here speaking very loudly and very slowly and adding vowels to the ends of every word in an effort to make myself understood (I said-o no comprehendo, capiche-o, amigo?).

Needless to say, when I do find a reference source that a) tells me what I need to know; b) shows me what I’m doing wrong and how to fix it; and c) is written in a way that I can actually understand, I glom onto it.

All that build-up and confession leads to sharing a new treasure: The eBook Design and Development Guide by Paul Salvette. Paul follows this blog and comments occasionally. He also has an ebook formatting service. He gave me a head’s up about the book. There were two major factors in my decision to buy it. First it was written in comprehensive English (most of these types of guides offend my writerly sensibilities) and second (this is really important!) it’s nicely formatted (it’s astonishing how many how-to-format-your-ebook guides are so wretchedly formatted as to be unreadable).

This is not a beginner’s guide. Two months ago I wouldn’t have understood much beyond “and” and “the.” With my usual la-di-dah methods of clicking madly until something works, I learned enough of the basics of html on my own to create some very nice ebooks. Armed with those basics, I’m able to understand quite a bit of what Paul is talking about. It helps that he truly cares about how ebooks look and that they work properly on ereading devices, no matter what those devices might be. It also helps that the book is readable, with an engaging style, and only occasionally lapsing into nerd-speak that leaves me smiling, nodding and waiting for him to say “walkies” and “cookies.”

I read it in one sitting, bookmarking countless passages and taking notes with my analogue word processor. I figured out some areas where I am working way too hard to accomplish simple tasks, and making some mistakes which I had to work even harder to overcome and compensate for. Of course I had to run to the computer and try some new things.  I formatted two ebooks using his guidelines and had so much fun, I reformatted another book that happened to be more complicated just to see if I could. I could. I did! I understand a bit more about how ebooks work and some of the differences between the different platforms and why versions of html coding work better on some platforms than with others.

The book is easy to navigate (a most useful table of contents written in plain English) and it includes templates for xhtml address thingies and resets and style sheets. Handy-dandy and easy to use.

Paul, being a generous fellow, generously (foolishly) opened himself up to answering whatever stupid questions I might throw his way. He might be sorry about the offer, but I won’t be. One book doesn’t make me an expert and it sure doesn’t catch me up on twenty years of experience, but it does go a long way toward helping me reach my goal of producing beautiful ebooks.

Highly recommended for nerds-in-training.

Pioneers in Ebook Design: Monica Pierce

Thank you, Jaye, for letting me add my two cents on the matter of ebook formatting. I appreciate your advocacy of self-publishing as well as your ardent promotion of any writers’ ability to create and market their own material.

(No, thank you, Monica. It’s a pleasure to see what you’ve done. Thank you for sharing your process and the gorgeous results.)

——————–

As Jaye has so often pointed out, we (writers and publishers) need to put as much design thought into what comes after an ebook’s cover as we do that cover itself. After all, 99% of the reader’s ebook experience involves what lies beneath. Yet too few writers and publishers seem to pay attention to formatting, and even fewer (writers, in this case) bother to learn the basic markup language (HTML and CSS) that goes into making ebooks. This isn’t rocket science, folks. Hell, it’s not even high school biology. Uploading your Word file into a conversion program and hoping for the best is asking for a questionable and, in some cases, impossible reading experience. It may seem a small thing, but all those strange page breaks, screwed up quotation marks, and odd characters add up to annoyed readers who want to throw your virtual book across the virtual room.

In comments, Jaye mentioned that she’d like to see how some self-published authors have addressed various design issues and decisions. I volunteered to be the first.

After reading Guido Henkel’s excellent blog series on ebook formatting, I tackled the process, making some specific design decisions in order to give the readers the best formatted, but least intrusive, reading experience I could possibly create. So here’s how and why I did what I did with the guts of Girl Under Glass.

GENERAL CLEAN UP

I write in Word and did the initial manuscript clean up (removing extra spaces and marking up italics) with that program. Then I imported the manuscript into Textmate to strip out all the Word gobbledegook and used HTML to mark up paragraph breaks, single and double quotation marks and apostrophes, special characters, and breaks. Lastly, I set up styles using CSS for the paragraphs and centering, as well as the title, copyright, dedication, glossary, phrases, and about pages. Centering the images (section and chapter titles and scene breaks) is controlled with p and span tags.

I’m doing a back page promo swap with another indie author and will be inserting a Recommended Reads page with her ad at the end of the book, as well as a link in the TOC. (Thanks, Jaye, I stole that idea from you.)

Honestly, I think I can probably clean up my CSS a little, but I got tired of playing whack-a-mole with divs, spans, and p tags.

TITLE PAGE

This entire page is an image. I wanted to use my cover font, Proxima Nova, for my inside title, section titles, chapter titles, and additional end material, but ebooks allow for a very limited font selection. So my husband, Scott, (a former web and graphics designer) was roped into volunteered to design all of these graphics. But I wanted something more than just the title on this page, so he added the design element. Since the premise behind this book revolves around my main character, Rachel’s, unique genome, he used a diagram of an unraveled RNA segment. It’s a strange, but compelling image.

SECTION BREAK

There are three sections in this book. Again, we repeated the use of Proxima Nova and linked the sections to the title with the RNA graphic. It stops the reader and signals the transition while also, I hope, recalling the reader to the title with a subtle nudge.

CHAPTER HEAD

The large RNA graphic was too much for the chapter, so we decided to use a more compact image. This, too, is RNA, but the view is looking down inside the tightly wound strand. I didn’t define the font or font size in my CSS for the pages. Many readers don’t play with the settings on their ereaders, but I saw no reason to aggravate those who do. The standard font is clean and readable. I set my paragraph bottom margins at 0.7em and the indent at 1em. That’s a totally personal decision; I don’t like a larger indent for this book because that feels more like a traditional design. This book is dystopian and set in the near future, so I made some spacing decisions that were a little non-traditional without being annoying. (I hope.)

SCENE BREAK

Using asterisks for my scene breaks seemed like a cop-out after putting the graphics into the title, sections, and chapters, so Scott gave me a different RNA strand graphic. Ultimately, however, I decided it was too distracting to have a third design element, so I opted to use the circular RNA image to indicate the breaks, as well. (This is how it appears on the Kindle vs. the Kindle Fire for the previous images.)

ABOUT THE AUTHOR/LETTER TO READERS

The circular RNA image was repeated, again, on the supplemental pages. (This is the Kindle Touch. Note the different font. That’s a preset for the Touch, apparently. I don’t own one, so if you do, I’d love to know if that’s what your screen looks like.)

GLOSSARY AND OHNENRAI PHRASES

Finally, the Glossary (Kindle) and Ohnenrai Phrases (Kindle Touch). This book has a smattering of an alien language, and I wanted those readers who were interested to be able to find definitions. At some point, I’ll go back and link the main text to the glossary. In the meantime, this works, but I don’t love it.

Ohnenrai Phrases/Kindle Touch

The entries are separated with HTML breaks, and both the glossary and the phrases have their own divs. But I’m sure they can be better. I’d also like to include a guide to pronunciation for each word, so the glossary will look more like a dictionary. Any suggestions?

Regarding title and author identification at the top of each page. I mulled over various approaches to adding this data but, ultimately, decided it offered too much potential for problems down the road. New ereaders are already picking up that metadata and inserting it, and I couldn’t think of an elegant way to do it without creating repetitive information on the screen for the newer Kindles and the iPad.

Again, thank you, Jaye, for allowing me to talk about my formatting. Girl Under Glass isn’t perfect, but I think it’s a pretty good start for a newbie author with only a little HTML and CSS knowledge going into the project. Now that I have a template and a taste for the process, I’ll be looking for even more ways to design a lovely reading experience. I welcome any feedback on what I can do to make this book (and others) even better.

Monica Enderle Pierce is a self-publishing newbie whose first novel, Girl Under Glass, was a 2012 Amazon Breakthrough Novel Award semi-finalist. She writes dystopian romantic suspense and romantic gothic fantasy novels.

 
Beautiful, Monica! I’ve heard people discount the power of the little details, but as someone who reads a lot of ebooks–sometimes four or five a week–I know from my own experience that when I open a new book and if the first image, the first page has a nice look, a nice feel, my attitude about the book undergoes a slight change. It’s more attractive, it looks more important, it has weight–ergo, I’m cued in that is a better book. It automatically ramps down my inner-critic and puts me in a more receptive mood. Kind of like getting into the passenger seat of a clean, fresh-smelling luxury car. The journey is the journey, getting me from point A to point B, but the ride is nicer and I know from the get-go that I don’t have to worry about ketchup stains on my shoes from fast-food litter on the floor.

As for the glossary and pronunciation guide–love it! I was just discussing with a friend about glossaries and such, and the desirability of putting links in text (I don’t mind that in non-fiction, but I’m sure the underlining would bug the crap out of me in fiction). My initial idea (untried, just a thought) would be to link the glossary terms back to their first appearances in the text. No underlines in the text itself, that way, but those who are interested can see the term in context. It would be up to the writer, then, to make sure the readers know there is a glossary and/or pronunciation guide by creating a custom Table of Contents, and perhaps even a small note or foreword saying something along the lines of “Hey, folks, if you want to know how to pronounce Pzrryewrwtz, there is a pronunciation guide. Click here and then click on the words to take you back to the story.” (actually, something better than that, but you know what I mean) I know this reader appreciates tips and tricks for navigation.

(Just an odd thought about pricing. I read a lot, so I appreciate the lower priced books. Five or six bucks is my preferred price point. I’ve noticed something about myself–when I’m shopping for books, I always check the samples. There is always a moment of “Is this worth the price?” Quite often, how the sample LOOKS is what tips me over the edge and directs my finger to 1-click and Buy. Like I said, just a thought.)