Tuesday, January 31, 2012

Now in Spanish: De InDesign CS 5.5 a EPUB y Kindle

SCS55-coverI've been wanting to offer translated versions of my books for a long time, and today I'm happy to announce that “De InDesign CS 5.5 a EPUB y Kindle”, the translation into Spanish of “From InDesign CS 5.5 to EPUB and Kindle” is now available directly from my website. Like the English version, it comes with EPUB, Kindle/mobi, and PDF DRM-free files. You can also buy it from the Apple iBookstore and shortly on Amazon as well.

It has been a much longer and more difficult process than I thought; one more piece of evidence that even though these new tools let us do everything ourselves, it still takes a long time.

I have a fair bit of practice in this field. I used to run a publishing house in Barcelona and managed the translation of Macintosh-related books into Spanish.

Please note that I don't do the translation myself. Thankfully, my expert cover designer, Andreu Cabré, is also a native of Barcelona.

I'll admit that it's a bit of an experiment. Can this work? The publishing industry says that Spanish-reading ebook customers are all pirates. I don't believe it (and have the sales of my English books to Spain and Latin America to prove it), but I'll let you know. All I can say is, if it does work, I'll translate more books!

And I confess I would really love to translate my books into Catalan as well. Would you buy them if I did? Are there other languages that you'd like to see. Let me know!

Here's the Table of Contents for De InDesign CS 5.5 a EPUB y Kindle:

Tabla de Contenidos

De InDesign a ebook en 10 pasos

Planificar el libro

¿Qué se puede hacer en un ebook?

Cabeceras y texto al pie de página

Números de página


Tamaño de texto

Formateo adicional

Espaciado, saltos de página y viudas



Capitulares y versalitas

Caracteres extranjeros y demás símbolos


Bordes y colores de fondo

Tabla de contenidos e índice

Separación en sílabas



Sonido y vídeo

Crear el libro en InDesign

Crear una plantilla

Guardar una plantilla

La importancia de los estilos

Crear una portada

Generar una portada a partir de la primera página

Imágenes y el orden de exportación

Usar objetos en línea para controlar el orden de exportación

Objetos anclados colocados a medida

Usar artículos para controlar el orden de exportación

Colocar y exportar sonido y vídeo

Crear vínculos

Crear hipervínculos

Crear referencias cruzadas

Crear notas al pie de página

Formatear notas al pie de página

Crear una tabla de contenidos navegable

Generar una tabla de contenidos

Mapear las etiquetas para la exportación

Especificar los metadatos

Exportar a EPUB

Añadir más metadatos

Generar una portada

Ordenar el contenido al exportar

Márgenes, listas y ADE

Opciones para exportar imágenes

Tamaño de imagen y alineación

Formatos de imagen

Navegar el panel Contenido

Las opciones de CSS

Usar un CSS existente

¡A punto para exportar!

Reventar un EPUB

Porqué aún hay que reventar archivos EPUB de InDesign

Problemas nuevos

¿Cómo se revienta un EPUB?

Abrir archivos EPUB en BBEdit

Convertir a Kindle/mobi

Crear EPUBs compatibles con Kindle

Texto normal

Saltos de página


Ceñido de texto

Bordes y color de fondo



Tabla de contenidos

Indicar el lugar por donde se abre el libro


Convertir un EPUB para Kindle a Kindle/mobi

Usar fuentes incrustadas en iBooks

Recursos adicionales


Tuesday, January 24, 2012

Fixing the layout of a reflowable ebook in iBooks

Now I feel less guilty about looking at iBooks Author.

At the end of my last post, I asked if you could add the code that iBooks Author adds to vertically or horizontally block the layout of a regular flowable book. And it turns out that you can!

This is pretty interesting. Remember that with a regular fixed layout book on Apple, you can't change the font or the font size (or the theme). With flowing books you can. But what about if we created a hybrid: a flowing book that only displays in a single large vertical page (portrait orientation) no matter how you hold the iPad.

The trick is to add the orientation lock code to your com.apple.ibooks.display-options.xml file without specifying that the book be fixed layout:

<?xml version="1.0" encoding="UTF-8"?>
<display_options><platform name="*"><option name="orientation-lock">landscape-only</option></platform></display_options>

Imagine the poetry example that I gave last week. If we use the above code on that book, it only shows in a single vertical page, even when the iPad is held horizontally.

Portrait lock on flowing book

But you can still change the font and font size!

I'm wondering if there are a lot of new features in iBooks 2, revealed in the code in iBooks Author ebooks that we can take advantage of for regular EPUB-compatible books.

More soon!

iBooksAuthor and Fixed Layout

I know, I know, I couldn't resist at least looking at the code :)

I keep hearing people refer to iBooks Author books as Fixed Layout, but from what I've seen, they are anything but: hold the iPad vertically, and you get one format, hold the iPad horizontally, and the layout shifts to fit a landscape view.

Today I prematurely posted, given that information, that iBooks Author does NOT create Fixed Layout. According to Apple's spec, that's technically true. A regular iBooks Author book does not contain the com.apple.ibooks.display-options.xml file and as I mentioned, changes depending on how your reader holds the iPad. The curious thing is that the book is paradoxically both Fixed Layout and Flowing: the former when it's held horizontally, the latter when you hold it vertically.

Here's a single book with its different views according to how the iPad is held:

iBooks Author Vertical

In a vertically oriented book, you can change the font size, but not the font. Note that some images completely disappear in Portrait mode. Not sure if there's a way to insist that they appear, but they are definitely not there.

Horizontal iBooks Author book

In a horizontally oriented book, you can't change even the font size.

DisablePortraitBut iBooks Author has an option in the Inspector palette called “Disable portrait orientation”. If you check that option, you will create a virtual fixed layout book (albeit only in landscape orientation), though again, the com file will only contain this:

<?xml version="1.0" encoding="UTF-8"?>
<display_options><platform name="*"><option name="orientation-lock">landscape-only</option></platform></display_options>

So what's the advantage of using "Disable portrait orientation"? I guess if you don't like the way Apple adjusts the layout for portrait orientation, this would be an easy way to get rid of it, and to create a sort of fixed layout.

What I'm really curious about is if there's a way to force regular flowing books to a certain orientation using this code. Previously, it only worked with Fixed Layout books. Apple is really blurring the lines.

That said, if you've read my earlier posts on iBooks Author, you know that I am very reticent about agreeing to Apple's exclusivity agreement, and so I haven't delved into it very far.

Friday, January 20, 2012

Ten reasons I can't recommend or use iBooks Author

Update 3 Feb 2012: Apple updated the End User License Agreement (EULA) on Friday, February 3 to make clear that they were not attempting to control the content of books created with iBooks Author, but rather the formatting itself:

Important Note:
If you want to charge a fee for a work that includes files in the .ibooks format generated using iBooks Author, you may only sell or distribute such work through Apple, and such distribution will be subject to a separate agreement with Apple. This restriction does not apply to the content of such works when distributed in a form that does not include files in the .ibooks format. [emphasis mine]

So, cross #2 of my list below. The rest remains the same, unfortunately.

I haven't stopped thinking about iBooks Author since I saw it announced yesterday morning. There are so many pieces to the story that I thought I'd take another stab at explaining them all.

First, a quick recap. Apple yesterday launched a powerful WYSIWYG tool, iBooks Author, that creates electronic textbooks quickly and easily. That's the good news. The bad news is that the End user license for iBooks Author requires that all books created with iBooks Author be sold exclusively through Apple's iBookstore, and the books that iBooks Author (which I'm going to call iBA books) creates are in an Apple proprietary format, based on EPUB3, but distinct from it, and called "ibooks".

Why might that be a problem?

1. Apple has the final say in what can be sold on the iBookstore. Each book must be approved by Apple. If Apple doesn't approve your book, you can't sell it anywhere else.

2. It's not at all clear how far Apple's control of an iBA book's content goes. If you create an ebook in iBooks Author, can you then copy out the content and create a Kindle book in some other tool? What if you create an iBA book from an existing Kindle-published novel? Can Apple require that you remove that book from Amazon?

3. It's not at all clear that Apple's exclusivity benefits kids, schools, or teachers. iPads are expensive, and Apple's exclusivity will mean that schools will be entirely at the mercy of a single company, for its approval of content, pricing and availability of devices, and tools for making textbooks. In the US, content in textbooks is currently controlled by local schoolboards. I don't want to cede that role to Apple.

4. iBA ebooks will work only on iBooks on iPad (I don't think it works even in iPhone/iPod touch). Although Apple had promised support for EPUB in its initial release of iBooks for the original iPad in April, 2010, it has now broken that promise. Apple and Steve Jobs have long wanted to control all the hardware and software so that they were perfectly integrated. One of the first thing Jobs did upon returning to Apple was kill the clones. Now they want control over the content as well.

Currently iBA ebooks will work only in iBooks. Will iBooks stop supporting EPUB created with other tools?

5. It fragments the ebook ecosystem and requires new publishing tools and workflows for publishers. iBooks Author does not create EPUB files and it cannot import existing EPUB files. It certainly can't export to any other format. I don't know any publishers who are looking for extra formats in which to publish their books.

6. Apple's iBookstore currently serves only 32 countries out of the 205 existing countries in the world. Not included? Brazil (nor all of Latin America), Russia, India, Japan, China (nor all of Asia), New Zealand, South Africa (nor all of Africa).

7. Apple iBookstore is not that great. It's hard to find books in the Apple iBookstore, sometimes even if you know the title! There are few recommendations, few reviews. And there are hardly any books, especially outside the US. Sure Apple wants to compel people to put books into the iBookstore, but is it in our best interest?

8. It's bossy. I bridle at anyone telling me where I can sell my books. Even if I only wanted to sell through the iBookstore I would be annoyed at Apple making me sign a paper to that effect.

9. It's unnecessary. Even if iBooks Author generated EPUB standard supporting ebooks, there's not an ereader in existence that could have viewed them. They would have blown the competition out of the water, without any coercion required.

10. Books are special. This is about books (for teaching our children!) which in my opinion should not be controlled by any company or government. What I have loved about the web and ebooks is that anyone can create and publish them without anyone else's approval. Books are information, are democracy, are freedom. No one has a right to control them.

Before you go off to the comments to tell me how I have a choice and I can just not use iBooks Author, stop yourself. I know I have that choice. I also don't need to hear about how iBooks Author is a free program and I should therefore not have any opinion on what it can or cannot require. Besides the fact that free is a relative term here (given Apple's 30% take for starters), I'm not talking about what is legal but what I think would have been right, what would have been smart, what would have really had a transformative affect on publishing, technology, and education. Apple could have done so much better. I was rooting for Apple, and they took the low road.

Thursday, January 19, 2012

iBooks Author is beautiful but you can only use it to sell through Apple iBookstore

The license agreement to Apple's new iBooks Author tool for creating electronic textbooks has a very peculiar clause:

If you charge a fee for any book or other work you generate using this software (a “Work”), you may only sell or distribute such Work through Apple (e.g., through the iBookstore) and such distribution will be subject to a separate agreement with Apple.

I find that clause unacceptable and ridiculous. If I create a book, I want to be able to sell it anywhere I want, not only through Apple. I no more want to restrict my sales to their store than I want to restrict them on Amazon or anywhere else.

Frankly, I even find it insulting.

You can find the full license agreement by going to the iBooks Author menu, choose About iBooks Author, and then click License Agreement in the About box that appears.

Note that it didn't have to be this way. The files that iBooks Author creates are pretty reasonable EPUB files (masked with the .ibooks extension) and can be read in NOOK and other EPUB readers. You can unzip them and see the EPUB files inside.

I am very disappointed.

Sunday, January 15, 2012

Media Queries for formatting Poetry on Kindle and EPUB

What a tangled web we weave! Amazon wants to maintain support for its legacy ereaders, we all want to support different size ereaders, but nobody supports the code the same way. What to do? One solution is to use media queries, something I've been meaning to explain for months.

A media query lets you create multiple sets of CSS (just what you want to do, right?) and then apply the most appropriate set automatically according to the ereader the ebook is opened in. So, in a single ebook file, there would be various choices of CSS, perhaps one best suited for old legacy Kindles, another for KF8, another for really small screens like iPhones, and yet another for the full-color 9.7” iPad. The ebook would adapt to its environment, giving each user the best possible experience.

That's the theory anyway.

Of course, there are a couple of caveats. Media queries only affect CSS, not HTML, which limits to some degree what can be changed for those ereaders that don't understand a lot of CSS (yes, I'm talking about clunky old mobi). And not all devices of the same screen size support CSS the same way. Ebook designers, like web designers before them, will continue to make multiple versions of the same ebook until the code is standardized. (And don't expect ebook reader manufacturers to adhere to standards without a lot of prodding.)

But media queries do help. Let's see how they work.

Suppose you want to format poetry in your ebook. Poetry is tricky because each line's length must somehow be respected, even in a screen where the line does not fit. The typical solution is to divide each line of poetry into multiple lines, with the 2nd and subsequent lines indented below the first. No matter how narrow the ereader screen, the reader will still be able to identify each line of poetry as a unit.

Let's look at Whitman's O Captain! My Captain! on the Kindle App in a landscape-oriented iPad. (All of these screenshots are from Kindle Previewer, just so I don't have to copy them to a bunch of different devices.) Notice that no matter how short, each line of poetry is displayed on its own line. Poetry doesn't reflow. It's hard to tell from this screenshot, but note that Kindle automatically indents lines of text 40px for Kindle and Kindle for iPad and iPhone, but not for Kindle Fire!

Poetry, little formatting

If we turn the iPad sideways, or make the text bigger, or both, the lines suddenly don't fit. Not only that, the automatic first line indent that Amazon adds makes poetry look particularly bad. It starts being hard to tell what is the second half of a long line, and what is an individual shorter line.

Poetry, vertical

Here's what it looks like on a legacy Kindle (what I'm calling "old mobi"):

Not pretty.

And here's what it looks like on Kindle Fire. Remember that Kindle Fire doesn't have an automatic first-line indent:

Poetry, Kindle Fire

The combination of automatic full justification with no first-line indent and no adjustment for the poetry lines looks particularly bad on the Kindle Fire. It's just a sea of text.

What's the solution? The convention for formatting poetry is to indent the part of the line that doesn't fit. What layout folks call a hanging indent.

You can do this pretty easily with CSS. Add a left margin of say, 2em, which will push the whole line over and then add a negative text-indent of -2em so that the first line starts at the flush left as usual. In this way, each line of poetry will start at the left margin, but any part of the line that overflows will be displayed indented on the second and subsequent lines. Here's the CSS code:

p {line-height: 1;padding:0;margin:0}
p.firstline {margin-top:2em; margin-left:2em; text-indent: -2em;}
p.line {margin-left:2em; text-indent: -2em;}

And here's what it looks like on the Kindle Fire:

I'd certainly want to adjust the general formatting a bit, but now the lines of poetry are at least inteligible.

But if you open it up with a legacy Kindle, it looks pretty bad:

Poetry - bad Kindle formatting

And it looks equally bad on Kindle for iPad:

What's going on?? It turns out that old mobi handles values for text-indent in a very strange way. If you don't set a text-indent value, old mobi automatically indents 40px. If you set a positive text-indent, it will use that instead. (You can use px or em, but if you use em, only whole numbers will work.) But if you set a negative text-indent, it actually creates a hanging indent, with the first line flush left and the second and subsequent indented as much as the absolute value of text-indent. Go figure. That's weird and unexpected, but if you set the left margin at the same time, it all gets mucked up and the details are way too boring to explain. Trust me, you don't want to go there.

To create a hanging indent on old mobi, you use just a negative text-indent, but no left margin. It shouldn't work, but it does.

h1 {text-align: left}
p {line-height: 1} 
p.firstline {margin-top:20px;text-indent:-40px}
p.line {text-indent:-40px}

And here's what it looks like on a legacy Kindle:

That's fine, but look at the same code on a Kindle Fire:

Because of those negative-indents and the lack of an automatic left margin, or whatever hack old mobi used, now our text is cut off. Unacceptable.

So, Kindle Fire and decent EPUB ereaders that support CSS like iBooks want a left margin and a negative text-indent, but old mobi can't handle that combination, being able to use only the negative text-indent.

The answer is to serve different CSS to different ereaders, by way of a media query. I'm going to show you how to do it in an internal stylesheet but the same principles would hold in an external stylesheet.

First, create a regular stylesheet with no media attribute that will contain the styles that should be applied to all versions of the ebook.

<style type="text/css">
    h1 {text-align: left}
    p {line-height: 1;padding:0;margin:0}

Next, create a second stylesheet with media="not amzn-mobi" in the opening style tag. The stylesheet should include all of the styles that should apply to all ereaders except legacy Kindle. Amazon says you should use media="kf8" but that's just because they imagine a world where all ereaders are either Kindle Fire or legacy Kindle. Let's just say that most people's worlds are bigger than that.

<style type="text/css" media="not amzn-mobi">
    p.firstline {margin-top:2em; margin-left:2em; text-indent: -2em;}
    p.line {margin-left:2em; text-indent: -2em;}

Finally, create a stylesheet just for legacy Kindle, adding media="amzn-mobi" to the opening style tag.

<style type="text/css" media="amzn-mobi">
    p.firstline {margin-top:20px;text-indent:-40px}
    p.line {text-indent:-40px}

Here's what it looks like on Kindle Fire:

Kindle Fire Poetry - good

And here's what the very same file looks like on a legacy Kindle:

Old Kindle Poetry -good


And just in case you were worrying, here's what the EPUB file looks like in iBooks on the iPad:

Indeed, it looks fine, because iBooks' support of CSS is pretty good. 

A technical note. There was some concern that you couldn't serve different indents to Kindle Fire and to legacy Kindle because the legacy Kindle code uses the width attribute (in a bizarre way) in the HTML, and not the CSS. But the technique described above works because KindleGen converts the CSS in a good EPUB into the weird, hackish old mobi code—complete with width tag—that legacy Kindles love, but creates "KF8" code for the new Kindle Fire, which, as I mentioned Thursday, is virtually the same as the original EPUB. And EPUB readers will get the original, good, EPUB file. So everyone's happy.

Except designers who have to do twice the work. Think standards don't matter? Think again.

One final note. I've been saying that the KF8 files that KindleGen generates from the original EPUB are practically identical to that original EPUB. That's true only for the CSS that KF8 supports. I haven't tested it extensively, but I suspect KindleGen will just ignore the CSS it doesn't support. And I have yet to determine (nor have seen elsewhere) just how well Kindle Fire supports CSS in the first place. I need a couple more days!

Thursday, January 12, 2012

KF8 is nothing more than EPUB with mobi

OK, if you've been reading me a while, you know that I mostly specialize in EPUB, that I have a background in HTML, and that I know the basics of converting EPUB to mobi.

Today, as the Kindle Format 8 specifications were made public, the #eprdctn Twitter group filled up with complaints about what the new Kindle Gen and Kindle Previewer 3 were doing to people's ebooks. It sounded worrisome.

So, I took my “From InDesign CS 5.5 to EPUB and Kindle” book, which I had previously converted to mobi with the old Kindle Previewer 2, and converted it with Kindle Previewer 3 [Note that the new Kindle Previewer 3 contains the new Kindle Gen 2, with a GUI interface. Though it's ostensibly just for viewing mobi files, it also converts them without having to resort to the command line.] And then I unpacked them with my new toy, mobi_unpack, and compared the files inside.

Inside there are old mobi files and new KF8 mobi files (and the original EPUB!).

I started with the old mobi files. What I didn't realize is that Amazon has been generated non-standard hideous code for their ebooks for years. It's like MySpace in here. Look:

Here's my original code:

<p class="caption">The Articles panel starts out empty. You have to add articles to it manually either by dragging frames to it or by clicking the plus sign.</p>

And here's how KP 2 converted it to old mobi:

<p height="0em" width="0" align="center"><font size="-1" face="sans-serif" color="#000000"><i>The Articles panel starts out empty. You have to add articles to it manually either by dragging frames to it or by clicking the plus sign.</i></font></p>

And here's how KP3 converts it to old mobi:

<p height="0em" width="0" align="center"><blockquote width="0"><font size="-1" face="sans-serif" color="#000000"><i>The Articles panel starts out empty. You have to add articles to it manually either by dragging frames to it or by clicking the plus sign.</i></font></blockquote></p>

All I can say is ew. <font>? Really? What is this, 1997? Not only is this garbage in your HTML, when it should clearly be in the CSS, but it's old, and deprecated. Even when I set the Doctype to HTML4 Transitional, about as loose as you can get, the document created with the brand new Kindle Previewer 3, released today, had 3482 errors and 239 warnings. It does not validate. It's garbage.

The only differences I found in files converted with the old Kindle Previewer and the new was that they no longer add !important as an extra value for the align attribute (makes me shudder just to think of it, and I can't imagine it ever did anything in the first place), and the addition of blockquote tags, who knows why (as in the above example).

That was the old mobi content.

You can also find KF8 content in the Kindle Previewer 3 converted mobi file.

First I compared the CSS. It's very similar.

The only difference I found was that in the KF8, the max-width property was eliminated. I imagine as I investigate more, I'll find other things that KF8 won't accept. I'll let you know.

Now on to compare the HTML.

I see that KP3 changes <a id="Anchor-123" /> to <a id="Anchor-123"></a>. Not monumental. Not even significant.

And there were a bunch of spacing things, but really, if people are noticing differences upon viewing documents, I don't think it's because of the conversion.

The KF8 inside the mobi is practically identical to my original EPUB file.

But then, I opened up the new KF8 mobi file in my Kindle Fire. I found one small difference with the indenting.

KF8 indents

The things is, I'm not sure that's KF8's fault. I think it's probably the fault of mobi, which had some weird indenting behavior that I distinctly remember fiddling with a lot to get the original effect (right). And it looks like it breaks in KF8, which, as I noted above, is much more standard and looks just like my original EPUB.

So, I just need to fix the indenting.

All in all, I didn't see a lot of difference in the way this file was displayed, between the old mobi and the new KF8 mobi. Indeed, I think the move away from that disgusting code is a major improvement.

And the KF8 file looked exactly the same on my old Kindle 3 also. No change that I could discern. (In other words when you serve a KF8 file to an old Kindle, it keeps looking at the same old clunky  mobi code that it always has, and the book doesn't break—anymore than it did before.)

I still want to go through each property, bit by bit, to see what's supported and how, but so far, I'm hopeful.

Now, why they just don't call it EPUB, since that's what it is?

Fixed Layout in KF8 for Amazon Kindle is Disappointing

To say I'm very disappointed in KF8 would be an understatement. One major source of that disappointment is in the requirements for Fixed Layout, which differ markedly from that used by iBooks on iOS and Kobo Vox. In other words, you can't use the same files.

I used KindleGen2 to convert some of my fixed layout EPUBs to mobi, and then I opened up the mobi files with mobi_unpack to see what had happened. (Well, I looked at them in the Kindle Fire too, and though they did open, I'm almost embarrassed to show you screenshots here. Certainly, not acceptable for sale.) So much for "easily portable with minimal effort".

Original on iPad:
Fixed Layout on iPad

After conversion with KindleGen2 on Kindle Fire, that single page is displayed on several:

Converted Fixed Layout on Kindle Fire 1
Converted Fixed Layout on Kindle Fire 2
Converted Fixed Layout on Kindle Fire 3

So what happened inside? Mobi, from what I'm learning (just a beginner still), is a database, with no individual files, and thus no individual file names. mobi_unpack is a Python script that goes through the mobi database and generates what would be individual files from the data.

Inside KF8 MobiThere are a couple of interesting things here. First, there are non-KF8 mobi files and KF8 mobi files. I'm guessing that's so your mobi file will work in both KF8 compatible devices as well as legacy ereaders. Second, the original EPUB is also included (shown at the bottom, in a zip file), completely unaltered, which presumably means it sits unaltered in the actual mobi file as well, and adds to its size. Finally, there is an EPUB file that is generated from the KF8 files which is a lot smaller than the original EPUB because KindleGen reduces the size of the images. The mobi_unpack script generates this standard-format file so that you can use it to create new versions of the book. It's not an Amazon thing.

So, let's really look inside. The new specs say require a lot of things I don't see in the file that KindleGen2 created. My intepretation of that is that KindleGen2 doesn't create a fixed layout KF8 mobi from my fixed layout EPUB, it just creates a flowing KF8 mobi file.

But what if you create your own fixed layout file?

First of all, Amazon wants you to add a bunch of meta tags to the OPF file (and not to the com file, as Apple and Kobo do). These meta tags determine if the book is fixed layout, what the viewport size is, and in which orientation it should be locked, as well as what kind of book it is (for children?), and whether or not you're using "region magnification". The first three are required, which means that you can't have a book that can be viewed in both portrait and landscape modes. You have to choose.

Next, and most inexplicable of all, it says you should create a single page for pages in portrait mode, and a single HTML page for a two page spread in landscape mode. (Again, this necessitates completely redoing your original Fixed Layout book.) OK. What I completely don't understand is, if you're designing a two page spread in a single HTML page, why on earth do they want you to create it in two separate blocks that you then float next to each other? It seems like a lot of busy work.

Why not just create a single image on your single HTML page for the two page spread? Is there some benefit to dividing it up into two chunks of code on the single HTML page? I don't see it, if there is.

After much wrangling, I was able to manage to create a Fixed Layout in KF8 format and view it on the Kindle Fire. Here's the original on the iPad:

Fixed Layout on iPad

Here's what it looked like after I recoded it to work on the Kindle Fire. Note that the Javascript does not work but the link to Google Maps does. And you can't miss all that lost white space due to the letterboxing.

Fixed Layout on Kindle Fire

And let me tell you, it was a pain.

And led to my post from yesterday about aspect ratio (what timing, huh?) Because there was no way I was going to crop all of my pictures from that book so they would fit an entirely new aspect ratio, they simply would not have fit. Indeed, when I think of the way most people take pictures in 4:3, or similar, I consider the Kindle Fire's aspect ratio to be very problematic for the kind of books that might showcase photography in fixed layout. I'm not sure if kids' books are often found in an aspect ratio of 1.7, like the Kindle Fire.

So yeah, I'm disappointed. Just the same, I probably will get around to explaining how to do it all. And I promise more on regular flowing books for KF8 as well. Soon.

Wednesday, January 11, 2012

I don't care how big that tablet is, diagonally

Aspect ratio is as or more important than generic "size".

Back in highschool in the protean days of computers (we had a terminal with no screen that connected to a mainframe somewhere), I remember guys hanging around—and I'm afraid they were almost exclusively boys—comparing computer stats. Hertz and bytes and oh man, it was so dull. I could never really get into it, I wanted to know what the computers did, not what they were made of.

Lately, all I hear is if there will be a new “7" tablet” or a “9.3" tablet” or whatever. But as I compare ebooks on different devices, I find they're all missing the point. Let's take my current collection of ebook readers. If you look up the specs, you'll find that all are described in terms of the length of the screen from one corner to the opposite diagonal:

iPad: 9.7” (1024 × 768 pixel, 7.75×5.82 in (197×148 mm) => 4:3 or 1.3 aspect ratio
iPhone: 3.5” (960-by-640-pixel resolution at 326 ppi) => 3:2 or 1.5 aspect ratio
Kindle 3: 6” = 4:3 or 1.3 aspect ratio
Kindle Fire: 7”, 1024 x 600 => 1.7 aspect ratio
NOOK Color: 7”, 1024 x 600 => 1.7 aspect ratio
Kobo Vox: 7”, 1024 x 600 => 1.7 aspect ratio
(I also have a black and white NOOK.)

Those numbers don't begin to give the information that ebook readers and designers need to know. What proportion or aspect ratio does the screen have? What will a book filled with images look like? Will we ebook designers have to redesign the books for every tablet with a different aspect ratio?

It's not the same looking at a book on an ereader with a 1.3 aspect ratio (like the iPad)

Aspect Ratio iPad

Note that on the iPad, the image measures 7.5 x 5.7".

Now look at the same book on the Kindle Fire, which like the NOOK Color and Kobo Vox have a screen that measures 7” on the diagonal with an aspect ratio of 1.7:


The image on this screen only measured 4.75 x 3.5” partly because the screen is physically smaller but also because it has to be shoehorned into a different aspect ratio. Notice the lost space on the right and left.

There is a less pronounced effect on the iPhone, that has an aspect ratio of 1.5. You see some lost space to the right and left, but not nearly as much.

Aspect Ratio iPhone

I've tried to show the screenshots proportionally to their actual size. The width of the iPad screenshot is 400 pixels. The iPad is 7.75” wide in landscape mode. The width of the Kindle Fire screenshot is 320 pixels, since the Kindle Fire is 6” wide in landscape. (400 / (7.75/6)). The width of the iPhone screenshot is 155 pixels, since the iPhone is 3” wide in landscape (400/ (7.75/3)).

So, you either have to adjust the images to take advantage of the aspect ratio of a given screen, or the images will be even smaller than the screen requires. Ugh. And unless you make separate files for each kind of tablet, you'll always suffer from some sort of letterboxing.

For non-fiction, I'm also concerned about the trend toward tall and skinny. It makes it really hard to add interesting layout, graphical features, tables, and the rest without making the text impossibly small.

Monday, January 9, 2012

“When I lived in Barcelona, it never felt like Spain to me”

Liz Castro a Ara (I recently was interviewed in one of Barcelona’s principal newspapers, Ara, by Adam Martín. Here’s my translation of the article into English.)

Prize-winner Liz Castro is an American woman in love with Catalonia. So much so that she publishes books about Catalonia in the United States with her publishing house, Catalonia Press. Òmnium recently awarded her the Joan B. Cendrós prize.

Adam Martín | Posted on 9 January 2012

She made a quick trip to Barcelona to collect her prize and we met briefly on the night of Santa Llúcia [the awards ceremony]. A few days later, via Skype, she explains how she came to know Catalonia. I can't think of a more appropriate format for an interview of the author of a bestseller on HTML programming which has sold more than a million copies.

Your last name, Castro, doesn't seem very American.

I'll tell you the story, but it's kind of long. My great-grandparents were from Andalusia and immigrated to Hawaii in 1907 to work in the sugar plantations. The two families met on the boat, worked in the same places and then later moved to the same town in California [where I was born].

So you have roots on the Peninsula.

Yes. And all my life I wanted to learn how to speak Spanish, because I wanted to conserve something of my father's family. And when I went to college, I studied Spanish. And then found myself in a Catalan class.

In a university in California?

Yes, with a professor from Brazil, funny, huh? And he was very Catalanist: he made us read the Avui newspaper [the first Catalan language newspaper begun after Franco died], and sing “Baixant de la font del gat” [a Catalan nursery rhyme song] and even Els Segadors [the Catalan National Anthem]. And he told us a lot about linguistic policy. At the university I also studied a fair bit of sociolinguistics, and I was very interested in bilingualism, figuring out why, when there is more than one language, one is used more often than the other.

And you had never been to Catalonia?

I had been in Spain a few times, in Madrid, and I had spent a week in Barcelona, but I didn't know much about it. I did come in contact with Catalan, but in a very superficial way: at the house of some friends of a friend and they were watching Dallas in Catalan.

Why did you fall in love with Catalan?

I attended the Summer Catalan University in Prada [set up during the Franco era so that Catalans could keep studying about Catalonia and in Catalan], sort of by accident, and I was really blown away by the sense of identity, of nation that people had: they knew who they were. Maybe I was looking for that. I wanted to know more. I was 21 years old. And I remember that people treated me like a movie star: "An American who speaks Catalan, that's awesome!" they said. That was in 1986, when they're weren't that many of us [Catalan speaking foreigners].

And then you moved to Barcelona.

I had $800 saved up, and I packed my things and decided to move to Barcelona. I estimated my savings would last for about two months. I didn't want to be a tourist there, I wanted to be part of the city and live like a Catalan. I found an apartment in Vallcarca and then found work right away in a Macintosh software start-up, also by accident. And all of a sudden, I had enough money to stay for longer than two months.

What surprised you most about the city?

I didn't understand when people slept, because we went out every night. And the schedule, in general. I sang in the Orfeó Català [a choral group] and our rehearsals started at 9:30 pm! In the US, that would be absolutely unheard of, no-one goes out for a rehearsal at that time of night! And I also realized how social everyone was: they spent hours and hours chatting, at lunch and at dinner, and after lunch and after dinner, the sobretaula. [Sobretaula is the Catalan word for the time you stay at the table and talk after you finish a meal.] In English we don't even have a word for that.

How long were you here?

Six years. During the last three, I ran a small publishing house for which I found interesting Mac related books, secured the rights, had them translated into Spanish, and then sold them all over Spain. And then a publishing house in the US offered me a job in the US and I decided to go home.

Your ties with Catalonia continued?

Well, I brought a husband home with me, and he's from Barcelona! [laughs]. We have three kids and we return each year and make an effort so that they speak Catalan. Last year we spent the whole year in Catalonia so the kids could go to school there and really learn the language well.

And how did you start publishing digital books about Catalonia in a market that seems a priori not very interested?

It is and it isn't. Everyone I know probably knows more about Catalonia than they might have chosen to if they didn't know me... But now there are lots of tools for spreading information! Facebook, Twitter. It just seems so unfair what happens in Catalonia. People from the US go there and they don't have a clue what Catalonia is about. One of the things that I felt when I lived there was that it wasn't Spain, Spain was someplace else. Madrid was Spain, but not Catalonia.

How can digital books and the internet help?

They make tools available that help every person be able to tell his or her own story, and explain whatever they want. The gatekeepers are disappearing; you don't have to convince anyone to publish what you're thinking about, you can do it yourself.

What have you published with Catalonia Press?

Two books: one by Matthew Tree, Barcelona, Catalonia and one by Toni Strubell and Lluís Brunet, What Catalans Want. Now the access to publishing is so much simpler and I can help people know Catalonia much better. It's a small thing that I can do. And I need to. A few days agao, there was a terrible article about [the budget and] the autonomous communities in the New York Times. Whoever wrote it had no idea what they were talking about!

Thursday, January 5, 2012

Selling ebooks outside of the US

If you're thinking about self-publishing, make sure you don't forget to look beyond the borders of the United States.

I started selling the electronic version (only) of my EPUB Straight to the Point book when it was published in late 2010. The print version was available through my publisher, Peachpit Press, and through traditional and online booksellers. The response was very encouraging. The first thing that I noticed was that people were buying the book from far away. A fair number of my first sales were from Australia, South Africa, and Europe, where it might have taken the print book several more weeks (months?) to arrive.

In February, 2011, I published my first miniguide, Fixed Layout EPUB. Originally, I envisioned it as an update to EPUB Straight to the Point, and so I decided to offer it for free to anyone who had already purchased that book. For those who were just interested in the Fixed Layout EPUB miniguide, they could buy it for $4, and then apply the $4 to the purchase of EPUB Straight to the Point. I sent out an email to all of the people who had bought the book directly from me. It got a huge response, and indeed, I continue to get a few requests for the Fixed Layout miniguide pretty much every day.

Between May and December, 2011, I published three additional miniguides, Audio and Video in EPUB, Read Aloud EPUB, and most recently From InDesign CS 5.5 to EPUB and Kindle. I love the idea of writing very short, focused, timely, inexpensive guides on the latest ebook production techniques. I don't have to spend months and months, and the information is fresh. Instead of giving these away, I have sold them for nominal amounts that make it easy for people to keep up to date with the latest EPUB information. With each new book, I send out a mailing to everyone who has bought any of the previous ones. They have proved very successful.

I never meant to self-publish. But the more books that I sold directly to readers, and the more names and emails that I collected, the more it seemed to make sense to continue to offer EPUB information to these folks. As a long time user of FileMaker, I've been able to massage my data to see just which books people are most interested in, and also where I sell the most books. I love looking at this information so I thought I'd share it with you. If you're a self-publisher, look closely at how many readers are NOT in the US. Click on the graphic to magnify.


Indeed, more than 50% of my readers are outside of the US. More than 30% are in Europe. Almost 10% in the UK alone. Notice that although everyone says that Spain is full of pirates, there is little difference between sales to Spain and to France, which is similar in size. I am convinced that the way to compete with pirates is not on price, but rather on service and ease of use. Oceania, between Australia and New Zealand makes up amother 7%, Canada 5%, Asia 6%, and a sprinkling in Africa, Central and South America, and the Middle East. (Yes, my regions are pretty arbitrary.)

Now you see why I talk a fair bit on Twitter and in my blog about marketing outside of the United States. Ebooks are clearly a worldwide phenomenon and particularly for my readers, timeliness is one of the key features of my books. But neither Amazon nor Apple sell all over the world.

I didn't want to limit myself to the US, and I also definitely didn't want to depend on a single retailer. So I decided to sell my books both through those channels, and also directly to readers, using a fulfillment service called Kagi, based in California. Kagi stores my book files, charges customers and collects sales tax and/or VAT, and then emails a unique download link to each customer. It's not perfect—I've heard complaints that the system is sometimes slow—but it's definitely a start. And I love being able to get my files up just when I want to, without having to get Amazon or Apple to approve them.

More of my books