Friday, November 11, 2011

Keeping it together - Page breaks in iBooks

I've been doing a lot of testing with InDesign CS 5.5 and was surprised this morning to find that the CSS it uses to create page breaks in EPUB documents actually works in iBooks. It used to be that iBooks only supported page breaks when they were in local CSS, and then it supported it in external CSS, and then for a while it didn't support even that, but now it looks like full iBooks support for page breaks is back.

Maybe this is a good time to go over the page breaks capabilities in CSS and what iBooks supports. While they don't give absolute control over where elements appear on a page, they have an enormous influence on how professional the page looks. (Note the design of these pages is bare-bones, the emphasis is on page breaks.)

The three CSS properties are page-break-before, page-break-after, and page-break-inside. Each one can take values of auto, always, and avoid, and the first two also accept left and right, though iBooks does not yet support those values.

If you want a title to appear alone on a page, you could use

.title {
     page-break-before: always;
     page-break-after: always;
     }

but note that if that is the first page in your EPUB, iBooks will show a blank page at the beginning (since it creates a page break before your title). In which case, you should only use:

.title {
     page-break-after: always;
     }

page-break-after


In order to make a header always start at the top of the page (together with the content that follows it), use:

.header {
     page-break-before: always; 
     page-break-after: avoid;
     }


page-break-before

And if you want to keep a photograph with its caption, you could use

.group {
page-break-inside: avoid;
}

assuming that you've got a div with class="group" that contains both the image and the caption.

page-break-inside-avoid

It would be really, really nice if iBooks would support the CSS widows and orphans properties. But it doesn't yet. (NOOK does, yay.)




Thursday, November 10, 2011

Non-allowed characters in filenames in EPUB

I got an email from a reader yesterday wondering about an error that iTunes Producer was giving as it rejected his EPUB submission to the iBookstore (despite having passed EpubCheck with nary a murmur), to wit:

ERROR ITMS-9000: "Invalid URI in NCX file Title Page.html :
Illegal character in path at index 5: Title Page.html" at Book
(MZItmspBookPackage)

When he converted the spaces to underscores, the errors went away and iTunes Producer accepted his book.

His book was originally created in InDesign, and it was InDesign that failed to convert the spaces to their hex equivalents so that iTunes Producer wouldn't choke.

Until Adobe updates its software, and for everyone who codes on their own or with some other tool, I recommend restricting filenames to the 26 unaccented letters of the English alphabet, the dash (-), and the underscore (_). That includes the names of documents in an InDesign book, images, videos, audio, CSS files you apply upon export, whatever.

Note that you can have spaces in titles, say Chapter 1, just not in filenames of those chapters, e.g., chapter1.xhtml.

A quick search on Mobile Read reveals that this is not a new issue.

Thanks so much to Edward Matte who brought this to my attention and shared his error reports and progress with me (and all of us).



Wednesday, November 9, 2011

Organic Farming and Ebook Piracy

Yesterday in my car I was listening to a recent episode of this excellent Catalan radio show about technology (and “what people do with technology”), l'Internauta, hosted by Vicent Partal. The filmmaker, Anna Boluda, was co-host, and the special guest was Simona Levi who was talking about "free culture" and lots of other interesting things

At 37:09, Vicent said something that really caught my ear (my translation, original at end of post):
Two things that I always put on the table and that at Vilaweb [Vicent's news portal] we are always thinking about and working on: the first is sufficiency, that is, you don't have to earn that much money, you just have to earn enough, no? I mean, is it possible to imagine a model in which, for example, in our case, those who are really interested and care about Vilaweb pay for it, and for those for whom it's just another website, well, thanks for reading. You don't have to make everyone pay, you can find a mass of people that is enough for you and you don't necessarily need everyone to pay you.
The second thing, said the other way around, is sustainability, that is, you have to know what you need to keep yourself financed and you have to act from that base of sustainability for your own project. In my opinion, that comes naturally and doesn't need complicated algorithms or arguments, it's just that there's a certain equilibrium, no? between the people who say I'll pay [and those who won't] and if the ones that are willing to pay are enough, well, you don't have to force the machine and turn yourself into a huge global power, I don't know, I see it as one of the keys, and of course, the only problem is that sufficiency ends up depending on each person, for one person it's enough to have a house, and for the next guy only a three masted yacht will do...
And it made me think about something I read in one of Barbara Kingsolver's books, maybe it was Prodigal Summer. It doesn't really matter where it came from; it's a common tenet of organic farming... that you have to plan to make a big enough crop so that losing some of it to "pests" isn't the end of the world. And not only that, if you spray pesticide over your crops to kill the bad bugs, you inevitably kill lots of beneficial bugs as well.

What are the beneficial bugs in the ebook ecosystem? They are your loyal readers who want to read your book and then will talk about it with other people so that they want to read your book too. When you tie your ebook up with DRM, you make it a hassle not just for pirates (who, like corn borers, just evolve to beat you another day) but for the folks who would buy your books and promote them to your friends.



You can find the recording at Vilaweb. Here's my rather wobbly transcript of Vicent's Valencian Catalan:
Dues claus que jo sempre poso sobre la taula i que també a Vilaweb estem d'alguna manera amb +Vilaweb pensant i treballant sobre tots aquests conceptes: un el de suficiència, és a dir, no cal guanyar tants diners, cal guanyar els justos, no? és a dir, és necessari, podem plantejar un model en el qual per exemple en el nostre cas, plantegem un model, a qui realment li interessi i li importi Vilaweb que ajudi pagant, però a qui som un més, gràcies per llegir-nos, no cal, per tant, no cal obligar a tothom a pagar, tu pots pagar un nucli de gent que és suficient per a tu ja i no necessites que et pagui tothom per dir-ho d'alguna forma i el segon que és girat al revés el de sostenibilitat és a dir, tu també has de saber el que necessites per finançar-te i per tant actuar sempre des d'aquesta base de la sostenibilitat del teu propi projecte. Per mi hi hauria una especie de diàleg molt difícil de fer segurament però a la vegada molt, tinc la sensació que molt natural, que naix de forma espontànea, que no requereix ni grans algoritmes ni grans discusions que és com un cert equilibri no? natural entre la gent que diu no, jo pague i aquells que diuen jo pague si ja són prou, no cal forçar la màquina per a convertir-te en un potentat, no, no sé, jo ho veig com una de les claus i clar, això, diguem, el defecte que pot tenir és que la suficiència al final acaba depenent de cadascú, per algú és suficient tenir una casa i per algú per ser suficient necesita un veler de tres pals...



Thursday, November 3, 2011

Where should an ebook begin?

Updated December 9. I meant to say use type="text" (as I do in my book) but wrote down "start" instead. Argh.

Thinking about ebooks and covers. Of course a cover is supposed to give you an idea of what the book is like, is supposed to inspire a sale. But on ebook commerce sites (say, Amazon or iBookstore), you only see a tiny icon of a cover

Kindle searchiPad search

So, some people think you should see the cover when you open the book. I'm not one of them. Let's take a look first at what is the norm right now. I downloaded the sample of John Grisham's The Litigators from the iBookstore, Kindle store, and Barnes & Noble. When I opened the sample on each device, this is what I saw:

Kindle first pageiPad cover

As you can see both Kindle (left) and iPad (as well as iPhone, not shown) open to the first page of the novel.

NOOK Color cover

Only the NOOK Color opened to the cover.

If you're reading on a NOOK, you then have to scroll through eight pages of front matter (copyright, toc, title page, etc.) to get to the first page. That's annoying (and may not discourage a sale if just the sample has been downloaded).

If you're reading on Kindle or iBooks, you have to scroll back several pages to get to the cover, which is indeed the first page of the EPUB file, but it's there if you want to go see it.

Kindle coveriPad cover first page

Or, if you're on an iPad (but not iPhone), you can see the cover by going to the navigational TOC and rotating the iPad to a horizontal position:

iPad cover opposite TOC

So, what's going on here? How can you control how and when the cover appears? First, you have to create a page in your EPUB document for your cover. It should be a separate XHTML file so you can ensure that it is the first page in your ebook, and so you can ensure that the cover image appears full screen. I explain how to do this in my “EPUB Straight to the Point” book. It basically consists of having the XHTML file be the first file referenced in the <spine> section of your content.opf file.

So, if the cover is the first page of the EPUB or Kindle file, why isn't it the first thing showing when you open a book for the first time? You can control which page opens first in the EPUB by including a line in the <guide> section of your content.opf file, with the type attribute set to text. (A value of start also works, but text is the standard value, accepted by the EPUB spec.)

<guide>
...
<reference type="text" title="Chapter 1" href="chapter1.xhtml" />
...
</guide>


This works on both iBooks and Kindle. I'm guessing that NOOK doesn't support this feature, and that's why the EPUB file (which should theoretically be the same for iBooks and NOOK and other EPUB compatible ereaders) starts with the first page of the book (the cover) instead of where the publisher specified.



Tuesday, November 1, 2011

Pricing books on Apple iBookstore

I have been selling ebooks on Apple's various iBookstores for several months now. I noticed last night that the amount I earned on books sold outside of the US and Canada was much closer to 60% rather than the 70% promised. Since I know that Amazon charges different amounts depending on the location of the buyer, I wondered if that was the issue here as well. It is, but for a different reason altogether.

When you set the price for a book in the US on the Apple iBookstore, the price does not include any sales tax. So, if you set the price at $4.99, Apple will send you $3.49 for each sale (70% * $4.99 = $3.49).

If you set the price of your books in Europe, something very different happens. Apple has cleverly based their European operation in Luxembourg which has the lowest taxes in Europe. Nevertheless, Apple is required to do two things: collect Luxembourg’s 15% VAT on digital books and advertise books with that 15% already included in the price.

What Apple doesn't make very clear, in my opinion, is that when you choose the price for your ebook in European iBookstores, you are choosing a price that already includes that 15% VAT. So, if you quickly convert your $4.99 into 3.65€, you might be tempted to choose an iBookstore price of 3.49€ for Europe. But you should know that .45€ of that amount is VAT and so the actual price of the book would only be 3.04€. This will become all the more clear when you get your sales reports from Apple and they only give you 2.12€ ($2.89) for each sale (which is roughly 70% of 3.04€, and only about 60% of 3.49€).

To figure out a better equivalent for your $4.99 book, do this:

1. Convert $4.99 to euros (google “$4.99 to euros” for a rough estimate): 3.65€
2. Multiply price in euros by 1.15 (adding 15% to price): 4.20€
3. Look for closest matching price tier in iTunes Producer: 3.99€ or 4.49€

One way to see what Apple will send you for each sale is to click on the question mark next to the Price Tier field in iTunes Producer or in iTunes Connect:

Price tiers 1

When you click the question mark, you'll see this list of Price Tiers and “Your Proceeds” which is how much Apple will send you for the sale of each book. Note that for EU customers, it's always 70% of the Tier price divided by 1.15 (70% * (Tier/1.15)).

Your Proceeds

Note also that if you click any Price Tier in the list, your book will be automatically and immediately updated to that Price Tier. No additional OK will be required, and no Cancel is available. To go back to the original price, you'll have to reselect the original price.

This same pricing issue also occurs with the Australian iBookstore (where the price you set includes about 10% tax).

This article is meant to be orientative, not definitive. I'm not a lawyer, tax or otherwise, or an accountant. You should consult one of those if you have doubts.

More of my books