Thursday, December 29, 2011

Wikipedia wants to delete me!

I doubt my notability all the time, but despite that fact, it's also true that I've sold more than a million books and helped a lot of people learn how to create web pages and ebooks. Just last week, I got a major prize in Barcelona for my publishing work about Catalonia.

However, this evening Dori Smith let me know via Twitter that someone on Wikipedia had marked my entry for deletion due to questions about my notability.

If you think I'm notable enough to be in Wikipedia, you can add sources about my notability to my current page and/or to the AFD page.

Here's what others say:

Omnium Cultural: “The jury for the 25th Joan B. Cendrós Prize has awarded the prize for work about the Catalan nation published outside of Catalonia to the North-American publisher Liz Castro [El jurat del 25è Premi Joan B. Cendrós ha atorgat el premi per a treballs publicats o emesos fora dels Països Catalans sobre la nació catalana a l’editora nord-americana Liz Castro.] Full translation here

Self-publishing guru Joel Friedlander: “Liz Castro’s EPUB Straight to the Point is a fantastic resource with clear instruction and should be in the ereader of anyone whose work involves dealing with EPUB and iBooks.”

Communication Arts magazine: She is the author of the bestselling HTML, XHTML, and CSS, Sixth Edition: Visual QuickStart Guide which together with its earlier editions has sold more than one million copies in more than fifteen languages. She has also written books on Blogger, iPhoto, Perl and CGI, and XML. The guides are written and published for inexperienced Web designers who want to start from the beginning and contain information in bullet points and note form for easy reading.

Vook calls me an "industry expert"

TidBITS: If you're thinking about making a book in iPhoto, my fellow Peachpit author Liz Castro has created a wonderfully useful Web site where she obsessively documents each and every iPhoto book theme

Vilaweb [major Catalan news website] interviewed me in February, 2011: “Recently, Castro published EPUB Straight to the Point (Peachpit Press), a guide for writing books for digital readers like the iPad. She is also the author of the bestseller “HTML, XHTML, and CSS: Visual QuickStart Guide” of which six editions have been published and the seventh is being prepared, and more than a million copies of which have been sold. She also wrote “Creating a Web Page with HTML” and “Publishing a Blog with Blogger”, among others. [“No fa gaire va publicar 'EPUB Straight to the Point' (Peachpit Press), una guia per a escriure llibres en pissarretes digitals com l'iPad. És autora del 'best-seller' 'HTML, XHTML, and CSS: Visual QuickStart Guide', amb sis edicions (la setena, en preparació) i més d'un milió d'exemplars venuts. També ha escrit 'Creating a Web Page with HTML' i 'Publishing a Blog with Blogger', etc. ”]

Peachpit Press: Elizabeth Castro is the author of all edtions of the best-selling HTML for the World Wide Web: Visual QuickStart Guide. She is also the author of Perl and CGI for the World Wide Web: Visual QuickStart Guide and XML for the World Wide Web: Visual QuickStart Guide--both bestsellers! Liz also founded Pågina Uno, a publishing house in Barcelona, Spain.

Friday, December 16, 2011

The American who talks the most about Catalonia!

LizAnyone following my Twitter stream today wouldn't be able to avoid noticing that I'm pretty riled up about Google's bizarre and rather random translating of Catalan street names into Spanish. I talk about Catalan a lot on my blog and on Twitter.

Last winter and spring, while I was living in Barcelona, I started a new enterprise dedicated to translating interesting books about Catalonia into English, so that I could share the place I love with the non-Catalan speaking world. First, I published a collection of essays by long-time Barcelona resident but English son, Matthew Tree, called “Barcelona, Catalonia: A View from the Inside”. And in July, we presented Toni Strubell and Lluís Brunet's, “What Catalans Want”, their brilliant collection of essays of leading Catalan politicians, academics, economists, and media experts on whether Catalonia could be the next new state in Europe.

The other morning I got a call from Muriel Casals, the president of Òmnium Cultural, a Barcelona-based organization dedicated to promoting Catalan language and culture. It turns out that each year, Òmnium holds a grand gala event—La Nit de Santa Llúcia—in which they present the most prestigious book awards in the country.

Imagine my surprise when she told me that one of the prizes was for me, and if I could go to Barcelona to receive it! They are awarding me the "Premi Joan Cendrós" for works about Catalan and Catalonia published outside of Catalonia. I am totally honored and excited.

So, those of you who sometimes get overwhelmed by my Catalan-related tweets, I thank you for your patience. And I hope you have a better understanding of what's going on there. Every country, like every person, deserves to be recognized for who they are. Catalonia is a vibrant, unique place, and it's not Spain.

There's a lot more work to do. I'm not done yet.

_________

Here's a translation of the article on Òmnium Cultural's website: (links added by me :)

The American publisher Catalonia Press has won the 25th Joan B. Cendrós Prize for its books and writings about Catalonia published outside of Catalonia. The prize will be awarded during the 61st Night of Santa Llúcia.

The jury of the 25th Joan B. Cendrós Prize has awarded the prize for her work about Catalonia published outside of Catalonia to the American publisher Liz Castro. Castro, a writer living in Massachusetts, has become known in the last few years for her work promoting Catalonia and talking about its linguistic, cultural, and political situation through her publishing house, Catalonia Press, as well as the internet, where she reports on Catalan news in English.

The jury, consisting of Antoni Bassas, Joan Becat, Laura Cendrós, Josep Gifreu and Vicent Partal, paid particular importance to the various digital books that Catalonia Press has published in order to spread information around the world about the reality of life in Catalonia. In that vein, the jury wanted to highlight the publication this year of “What Catalans Want”, a collection of interviews about the situation in this country, written by Antoni Strubell with photographs by Lluís Brunet, as well as “Barcelona, Catalonia”, by Matthew Tree.

The prize award ceremony will take place on December 20th during the 61st Night of Santa Llúcia in the Auditori de Barcelona [National Theater]. The Festa de les Lletres Catalanes [Catalan Literary Festival], where the winners of the Sant Jordi, Carles Riba, Mercè Rodoreda, Folch i Torres i Joaquim Ruyra prizes will be announced and awarded returns again this year to the Catalan capital with a unique show created and directed by Paco Mir, of the group Tricicle.

Google Maps invents own Spanish names of Catalan streets, rendering the program useless (and incredibly offensive)

This morning on Twitter, I saw that Google had decided to replace Catalan placenames with crazy, sometimes random, translations into Spanish. The hashtag #googlecat has quickly become a TT (trending topic) on Twitter as people around Catalonia are outraged that Google has decided to call Catalan places however they like.

Pretty incredible. You, dear non-Catalan reader, might think it's much ado about nothing, really, how much difference is there between "Plaça Catalunya" and "Plaza de Cataluña"? Who cares? But there are very large issues here, which I hope to address one by one.

First, the names of streets, squares, and roads are all in Catalan in Catalonia. If you're looking for a street, the only street sign you will find will be in Catalan. Google Maps won't do a fat lot of good to you if it's giving you a translation into Spanish. For example, one of the streets near my apartment is “Carrer de Sant Domènec" (or Saint Dominic street) but Google has it labeled as "Calle de San Domingo".

SantDomènec

(Then, there's the added weirdness that you can't actually say "San Domingo", it would be "Santo Domingo".) There are many, many other bizarre translations. Things like "Verga María" [Cock Mary] (and I don't mean roosters) for "Verge Maria" [Virgin Mary]. Or changing the name of the town, “Sant Boi de Llobregat” into "San Baudillo de Llobregat".

Think it won't matter, that Catalan and Spanish are "close enough"? Try "Calle del Oxidado" instead of "Carrer Rovellat". Or "Rambla de la Colina" instead of "Rambla del Turó". Let's just say I wouldn't rely on Google Maps to get around Catalonia any more.

Carrer Rovellat

Vilaweb was finally able to get a first explanation from Google Spain about the problem. “The problem has to do with a database that was supplied by a third party and the technicians are working on updating it."

Ultimately, to Catalans who are continually feeling mistreated by the Spanish government, who will not stand up for the Catalan language in Spain, the European parliament or anywhere else, it feels like a crass political move by Google. Perhaps it's just a technical error, but I just don't have that faith anymore.

Interesting that names in English have not been translated into Spanish, as in Plaça John Lennon, which turned into "Plaza John Lennon" but not "Plaza Juan Lennon".

Check into Twitter and follow #googlecat to see egregious examples and anger. Follow Vilaweb for the latest news.






Thursday, December 15, 2011

Creating Custom Sample EPUBs for Apple iBookstore

When readers go the iBookstore and happen upon your book, they can download a sample to get an idea of what your book is like.

Get Sample

The sample file is downloaded to their iPad (or other iOS device) and the prospective customer can read a few pages of your book. When they get to the end of the sample, they are invited to purchase the book:

Buy this book!

Apple will automatically create a sample file from your EPUB when you upload your book, using either the first chapter or 5% of the total word count, whichever is more.

If you'd like to offer some other quantity or selection of sample content, you can create a custom sample EPUB file.

First, make a copy of your final EPUB. You obviously don't want to work on the original! Make sure to delete the .iTunesMetadata.plist file if iTunes has unhelpfully and surreptitiously added it to your file.

Next, decide how much of your book you want to offer as a sample. I like to offer enough of the book to get a taste, but not so much that they don't need to buy my book! :)

Eliminate the files that shouldn't be part of your EPUB. For example, you might delete all of the XHTML files from Chapter 2 onward. If you have particularly long chapters, you might not even want to include the entire first chapter. In that case, eliminate the part of the XHTML file that should not be included in the sample. In this case, make sure that the code in the remaining file still validates (e.g., has all of the appropriate closing tags).

The next step is to go through the XHTML files that will be included and search for IMG to see which image files you'll need to keep. Then go through your OEBPS folder and actually eliminate the image files that are not used in the sample. Repeat this step for any other extra files (audios, video, pdfs) that may not be a part of the sample.

Since you've removed both XHTML files and media files, you'll have to remove their declarations from the <manifest> in the content.opf file. I keep my images folder open, gather the declarations for the "good" images at the top of the manifest, and then delete the rest with one fell swoop.

Don't forget to remove references to the non-included XHTML files in the spine and guide sections.

Next, get rid of all the links that refer to documents not included in the sample. For example, you might have a TOC that links to every chapter in your book.

Here's what the code looks like in my book:

<p class="TOC-Header-3"><a href="EPUBwCS55-body-1.html#toc_marker-2-1-8">Columns</a></p>

And of course, each entry may have a different class, a different destination, and a different title.

I use GREP to quickly remove the links. And the links end up looking like this:

<p class="TOC-Header-3">Columns</p>

You can't have any links to files that are outside of your sample EPUB.

Hmm. Now that I think about it, it makes more sense to make the links remain, but go to the final page. I haven't tested it (and it may be two weeks before my next books is live on the iBookstore), but this is the GREP I will use:

grep link cleaner, absolutely final

(That lovely thing says "find a single link and remember the clickable text and then replace it with a link that goes to the buy button at the end of the book but keep the clickable text the same." Don't you love GREP?)

And here's how my code will look:

<p class="TOC-Header-3"><a href="EPUBwCS55-body-1.html#com_apple_itunes_epub_end0000">Columns</a></p>

Notice that I'm changing all the links from the deleted files to the same target "EPUBwCS55-body-1.html#com_apple_itunes_epub_end0000".

Finally, the hardest part is to adjust the toc.ncx file so that the Table of Contents items in the non-included chapters appear in gray—so the prospective customer knows what will be available in the full book—but don't generate errors in EpubCheck (as the actual links would).

Here's a part of the toc.ncx file from my recently published “From InDesign CS 5.5 to EPUB and Kindle”:

<content src="EPUBwCS55-body-6.html#toc_marker-7-3-1"/>
...
<content src="EPUBwCS55-body-6.html#toc_marker-7-3-1"/>

But the "EPUBwCS55-body-6.html" document is beyond the scope of the sample. Change it as follows:

<content src="EPUBwCS55-body-1.html#com_apple_itunes_epub_end0001"/>
...
<content src="EPUBwCS55-body-1.html#com_apple_itunes_epub_end0002"/>

where “EPUBwCS55-body-1.html" is the last available file in your sample EPUB, and “com_apple_itunes_epub_end0000” ends in a unique, sequential number. Start with 0001 and increase by one for each grayed out link.

You'll also, at the end of the final document in your Sample EPUB, have to create a bunch of a tags whose id is equal to each of the com links you created:

ids

Make sure you have as many ids as you do numbered coms in your toc.ncx file.

Any link that has the com_apple_itunes_epub_end0000 link will appear in gray in the navigational TOC.

Gray items in TOC

Once, for Barcelona, Catalonia, by Matthew Tree, I grayed out some interior items because I wanted to include the afterward. It worked fine, though it might feel a little confusing to someone paging through the sample.

I usually have to run EpubCheck about six times to catch all of the missing bits. It probably won't take you as many passes, but I recommend you use it to make sure you've caught all the changes.

Once you've zipped your Sample EPUB up, you can attach it to your ebook in the Assets panel of the iTunes Producer window:

Choose Sample

If you've got any suggestions for how to choose the content for a Sample, I'd love to hear what strategies you've used or considered.

Wednesday, December 14, 2011

Luxembourg's low VAT could give Amazon and Apple the edge in Europe

Luxembourg TravelphotosA hugely important article crossed my Twitter stream this morning, thanks to Sacha Heck. It said that Luxembourg plans to apply its reduced 3% VAT to ebooks [fr]. At first glance, you might think it shouldn't matter a whole lot how the tiny country taxes ebooks, but it turns out that the rule in Europe is that VAT is applied according to the seller's country (not the buyer's). That means that any company who sells ebooks from Luxembourg will only have to collect 3% VAT.

Next consider that although the reduced rate VAT is applied to print books across the EU, up til now they have insisted on classifying ebooks as services and applying the regular rate. That regular rate ranges anywhere from a current low of 15% (in Luxembourg, surprise!) to 25% in Sweden. The Huffington Post cites this application of the regular VAT rate on ebooks as one of the major reasons Why the UK is behind America for Ebook and E-reader Adoption.

This has two major effects. First, it makes it harder for publishers to deliver ebooks at competitive prices with respect to their print books. And second, ebook sellers in countries with lower VAT will have a huge competitive advantage over local sellers in countries with higher VAT. Sometimes the difference between print VAT and ebook VAT is as much as 20%.

Take Spain for example. The regular VAT is 18%. So an ebook that "costs" 20€ without VAT will cost 23.60€ including VAT. But if you buy that same book in (or from!) Luxembourg, it'll only cost you 20.60€. That's a big difference. Add that to the fact that many (most?) European countries have fixed pricing rules on books and you get a significant competitive advantage.

France has been threatening to lower the VAT rate for ebooks for months, promising to bring it down to 5.5% in January. But in the UK, just yesterday in an article in The Register Treasury Minister David Gauke said their hands were tied: “Under EU law, VAT on electronic books must be charged at the standard rate.”

Luxembourg doesn't seem to think so. But who's going to sell books from Luxembourg? Shoot, where is Luxembourg*? The answer is Amazon and Apple, of course, who already have their European headquarters (and tax homes) there and anyone else who wants an immediate advantage over their competitors. Amazon has made a fortune in the US by carefully avoiding having to charge customers sales tax. (In the US, you don't have to charge sales tax to residents of states where you don't have a tax presence yourself.) It clearly hopes to follow the same strategy in Europe.

(Photo by Wesley Oostvogels, used with Creative Commons permissions.)

Luxembourg, of course, is in the center of Europe, occupying about 1000 square miles, and home to half a million people.

Friday, December 9, 2011

From InDesign CS 5.5 to EPUB and Kindle

9781611500202-cover250 I am proud to announce a new Straight to the Point Miniguide: From InDesign CS 5.5 to EPUB and Kindle. The digital edition bundle—which includes EPUB, Kindle/Mobi, and PDF formats—is available right now, and it will be available in print soon.

This new miniguide, 76 pages in length, explains all the new features that Adobe added to InDesign CS 5.5 and how to take advantage of them when creating ebooks, both in EPUB and Kindle formats. It is not a beginner's book and assumes that you have some basic knowledge of both InDesign and EPUB itself. If you have my EPUB Straight to the Point, I think you’ll find it very useful.

The digital editions of From InDesign CS 5.5 to EPUB and Kindle cost $10 but for a limited time, I'm offering a 30% discount on my website to anyone who has already bought my EPUB Straight to the Point book (in any format and from any vendor). Just send me a proof of purchase (a receipt is good!) and I’ll send you a coupon. If you bought EPUB Straight to the Point from me, you should have a note from me in your inbox with the coupon inside.

Here's the table of contents so you can have an idea of what's inside:


Table of Contents

InDesign to ebook in 10 steps
Envisioning your book
What can you do in an ebook?
Running headers/footers
Page numbers
Fonts
Text size
Other text formatting
Spacing, page breaks, and orphans
Alignment
Columns
Drop caps and all caps
Non-Latin characters and other symbols
Images
Borders and background colors
Table of contents and index
Hyphenation
Links
Tables
Audio and video
Creating your book in InDesign
Creating a template
Saving a template
The importance of styles
Creating a cover
Generating a cover from the first page
Placing images and controlling export order
Using inline objects to control export order
Custom positioned anchored objects
Using articles to control export order
Placing and exporting audio and video
Creating links
Creating hyperlinks
Creating cross references
Creating footnotes
Formatting footnotes
Creating a navigational TOC
Generating a TOC
Mapping tags to export
Specifying metadata
Exporting to EPUB
Adding more metadata
Generating a cover
Ordering the contents upon export
Margins, lists, and ADE
Options when exporting images
Image Size and Alignment
Image formats
Navigating the Contents panel
Looking at the CSS options
Using Existing CSS
Ready to export!
Cracking open EPUBs
Why I still crack open InDesign EPUB files
New issues
How do you crack open an EPUB?
Opening EPUB files in BBEdit
Converting to Kindle/mobi
Creating Kindle-friendly EPUBs
Body text
Page breaks
Spacing
Text wrap
Borders and background color
Fonts
Covers
Table of contents
Marking where a book should open
Images
Converting a Kindle-friendly EPUB to Kindle/mobi
Using embedded fonts in iBooks
Additional Resources
Index

I hope you find this new miniguide useful. Let me know what you think!

CompleteEPUBI've just added a Complete EPUB Package to my website. Digital editions of all four miniguides, EPUB Straight to the Point, and Barcelona Beyond Gaudí for just $39.

And that lovely cover was designed in Blender, Cheetah3D, and Photoshop by Andreu Cabré.

Wednesday, December 7, 2011

iBooks 1.5 increases page size by about 15%

Apple released version 1.5 of their iBooks ereader app last night. The biggest improvement to iBooks 1.5 is undoubtedly the new Full Screen mode. To access it, click the Font menu, and then click Theme in the pop-up menu. Then turn on Full Screen at the bottom of the extended menu.

Theme menu FullScreen

Full Screen mode hides the faux pages, the faux spine, the space between those faux pages and the edge of the screen, etc. and increases the size of the page about 15%.

Here's what my upcoming book on InDesign CS 5.5 to EPUB and Kindle looks like with and without the chrome in vertical orientation:

Before Vertical After iBooks 1.5

Notice that there's hardly any difference vertically. Though you can see the line endings change ever so slightly, I couldn't measure any difference. The old page measured 560px wide by 760px, and the new page measures 560px by 850px high.

And here's what the horizontal two-page view looks like now, with chrome:

Before

and without:

After

Of course, the pages reflow when you go from Full Screen to Normal view, and so it's hard to compare two pages that are exactly the same. In my test, my book takes up 205 pages in normal view and only 178 in Full Screen, a difference of about 15%.

With chrome, a small page (in horizontal view) measures 400px by 540px high. In Full Screen mode, the page now measures 410px by 600px.

iBooks also removed three existing fonts—Baskerville, Cochin, and Verdana—and replaced them with new ones with curious, or at least lesser known names: Athelas, Charter, Iowan, and Seravek. I wonder if this is a licensing thing? Here's what they look like:

Athelas:

Athelas

Charter:

Charter

Iowan:

Iowan

Seravek:

Searavek

They've also changed the highlighting system slightly, and added a Night-reading theme which darkens the background so it's easier on your eyes and your sleeping companions. Indeed, it not only darkens the background, it eliminates it completely. Watch out if you have any images with white backgrounds, the white will stand out:

Night mode with non-transparent images

That will have to be fixed! (I'm hoping to get From InDesign CS 5.5 to EPUB and Kindle out the door today or tomorrow... more details soon.)

Thursday, December 1, 2011

Kindle Store and Kindle Direct Publishing open in Spain and Italy

Wow, Amazon has just opened both the Kindle Store and Kindle Direct Publishing in Spain and Italy.

Amazon.es: eBooks en catalán - eBooks en catalán, gallego y euskera: Tienda Kindle

This means that people in those countries can self-publish their ebooks to the Amazon ecosystem and it also means that existing self-publishers on Amazon KDP, including folks in the US, will receive 70% of royalties from sales in Spain and Italy (as well as San Marino, Vatican City, and Andorra). Up until now, only sales to customers in Austria, Belgium, Canada, France, Great Britain, Guernsey, Germany, Isle of Man, Jersey, Lichtenstein, Luxembourg, Monaco, Switzerland, and the US received royalties of 70% (sales to customers in other countries only receive 35%)

Amazon has translated most of the self-publishing help files into Spanish and Italian, simply click on the language button at the top of the Kindle Direct Publishing site:

KDP-ES-IT

I would recommend going carefully through the legal and tax information. Amazon recommends taking advantage of the tax treaties between countries in order to avoid double-taxation. Such a tax treaty exists at least between Spain and the US, I'm not sure about Italy.

For starters, Amazon says there are 22,000 books in Spanish for Kindle on the Amazon Kindle store. And I just found 1028 Kindle books in Catalan, 68 books in Galician, and 138 in Basque. There are 16,262 in Italian. Amazon says in its documentation that it only allows books in Spanish, French, German, English, Portuguese, and Italian,  but that clearly is not the case, at least not for big publishers.

Too bad I can't buy any of them. Looks like you have to have an account on Amazon.es in order to buy them. That's pretty ridiculous, this is the perfect opportunity for a small publisher to reach out to the world. My books published in the US are available on Amazon.es, now I would like to see those Catalan books available on Amazon.com. Please?

What Catalans Want eBook: Toni Strubell, Lluís Brunet, Colm Tóibín: Amazon.es: Tienda Kindle

Monday, November 21, 2011

Spanish election results confirm “Catalonia is not Spain”

El Punt Avui - Catalonia is not SpainThe Catalan language newspaper, El Punt Avui proclaims in English that “Catalonia is not Spain” this morning, in an attempt at explaining how the Catalan conservative party CiU managed to stem the blue tide of the rightist Spanish Popular Party that swept through most of the rest of Spain. The slogan in English, usually used by protesters at international events to bring attention to the ongoing struggle for more autonomy in Catalonia, neatly sums up the election results: the rightist Partido Popular swept the ruling PSOE party out of office in a stunning defeat, but were unable to make inroads in Catalonia, where the Catalanist though perhaps equally conservative CiU party took the region for the first time ever in general Spanish elections.

Spanish Election ResultsWhat the slogan doesn't explain to outsiders is why Catalonia is so different, and how the PP could have had such lackluster results there while sweeping every other part of Spain except the Basque Country, as shown in the map to the right.

The answer is that elections in Catalonia, especially “general elections” in which the seats in the Spanish Parliament are chosen, have various axes, not only right vs left, but Catalanist vs Spainist, for want of better terms. The important leftist parties in Spain have local affiliates in Catalonia that are mostly seen as hewing to the centralist party line. They tend to win country-wide elections and lose local ones. The right in Catalonia, however, is divided between the local affiliate of the Spanish Popular Party—whose francoist roots make it a particularly hard sell in Catalonia—and the completely homegrown CiU, whose wildly popular leader, Jordi Pujol was president of the Catalan Parliament for 23 years between 1980 and 2003, and with these results completed the trifecta after already having triumphed in recent municipal and Catalonia-wide elections.

It seems unsurprising that Catalans would want to kick the Socialists out, but would choose to do so without running into the arms of the PP, whose party was behind the recent trampling of Catalonia's new Statute of Autonomy, as well as attacks on the successful and popular Catalan-immersive educational system.

CiU clenched the deal with a big promise: they will demand a “fiscal pact” with Madrid, and if rebuffed, will demand political independence. Catalonia currently pays some 10% more in taxes than they receive in services from the central government, and the current fiscal crisis is fueling resentment in Catalonia. Catalans see brand new schools, free highways, and high speed trains in sparsely populated areas of Spain while being forced to make substantial cuts in medical, educational, and transportation services of their own.

As Salvador Cardús put it in What Catalans Want, “We live in a situation in which we are denied the guarantee that our daily work will contribute in any way to our prosperity.”

It's important to remember that Duran i Lleida, CiU's candidate, is more unionist than separatist, despite convenient rhetoric to the contrary. Last night he said, “Catalonia is different from the rest of the country. Today, these results confirm more than ever that we are a nation.”


It will be interesting to watch these next few months.

Thursday, November 17, 2011

Taking Screenshots with Kindle Fire

Renumbered at 4:02pm; Updated 3:47pm, thanks to corrections made by Wangen. (The mistakes were mine, not Erica’s.) Thanks, Wangen!

I just got off the phone with Erica Sadun, geek girl extraordinaire, who had posted instructions yesterday on how to take screenshots on a Kindle Fire but who kindly walked me through the process today. I'll explain what she told me in case you too are interested.

Let me preface this with the fact that I've never used Android before today. If you, too, are new to Android, you should find everything you need in these instructions. If you already know Android, you'll probably be bored.

1First, connect your Kindle Fire to your Mac. (I don't think the process is very different on a Windows or Unix box, but to be honest, I really don't know.) 

2Next, download the Android SDK. You can find that here: http://dl.google.com/android/android-sdk_r15-macosx.zip. You don't have to install anything else besides this.

3Unzip the folder and place it wherever you would like it to be on your computer. I put mine in my Documents folder. You'll need to know the location later on in the process, so I would recommend not burying it too deeply into your folder hierarchy. The folder starts out with the name android-sdk-macosx but you can change it to something faster to type (like android). Don't change the names of the things inside that folder.

4Next, open Terminal. It should be in the Utilities folder inside the Applications folder.

5When you open a Terminal window it defaults to your home directory. You have to navigate to the android sdk folder you just downloaded. Since I put mine in my Documents directory and I changed its name to "android", I typed:

cd Documents/android

(The cd stands for change directory.) Terminal will confirm that you are now "in" that directory by changing the prompt at the beginning of the line.

6Next type this:

./android

The Android SDK Manager should appear.

Erica told me to choose the "Android SDK Platform-tools" box and deselect everything else. Then click "Install 1 package…" at the bottom right.

Android SDK Manager

Next, you'll get the "Choose Packages to Install" window. Make sure it's the Android SDK Platform Tools in the upper left corner, and then click Install.

Choose Packages to Install

Once the package is installed, the ADB will have to be restarted. Click Yes.

ADB Restart

7Next, go back to the same window in Terminal, and create a symbolic link (a sort of alias) by typing:

ln -s ../platform-tools/adb adb

8Now, still in Terminal, to see if the Fire is connected, type

./adb devices

The output that you want looks like this:

List of devices attached
6C78000600000001    device


If you do see that, skip on ahead.

If, instead, you just see

List of devices attached

all by its lonesome—which is what I saw—we have to do a few more steps.

9First, we'll stop and restart the adb server. First type:

./adb kill-server

10And then type

./adb start-server

You should see this:

* daemon not running. starting it now on port 5037 *
* daemon started successfully *


11Now see again if your Kindle Fire device is listed, by typing

./adb devices

If it still doesn't show up, we'll edit the adb_usb.ini file.

12To do that, open a brand new Terminal window, leaving the old one open since we'll go back to it.

13As ever, Terminal starts you out in your home directory. Type:

cd .android

It turns out that this is the default location for android stuff on any Unix machine (like a Mac).

14Now type

touch adb_usb.ini

15That creates the adb_usb.ini file. Make sure you have a text editor that can save with Unix line endings like the free TextWrangler (or more powerful but not free BBEdit). Then type

open -a TextWrangler adb_usb.ini

16(Or type open -a BBEdit adb_usb.ini if you have that program.) Copy into it, the following four lines, being very careful to create a return after the last line:

# ANDROID 3RD PARTY USB VENDOR ID LIST -- DO NOT EDIT.
# USE 'android update adb' TO GENERATE.
# 1 USB VENDOR ID PER LINE.
0x1949



17Choose Save as and make sure that Unix (LF) is chosen in the Line breaks menu.

SaveUnixLF

18Then type

cat adb_usb.ini

in order to see your work. If you see it just as it appears above, you can continue to the next step. Unfortunately, mine appeared all jumbled on a single line (because I originally used TextEdit) and so Erica surmised that I had somehow entered the returns incorrectly and she emailed me the file. (You can download a zipped copy of that file here.

19Be sure to unzip it and place it on your Desktop before continuing as below.) I copied it to my Desktop and then from the second Terminal window, typed:

mv ~/Desktop/adb_usb.ini .

Which says "move the adb_usb.ini file from the Desktop to the current directory (represented by that final period).

Again I typed

cat adb_usb.ini

and this time, it looked like the four lines above. (Don't forget that final return after the 0x1949 line!)

OK, almost there.

Now, we go back to the first Terminal window, and for good measure, we'll stop and start the server once more. Type

./adb kill-server

And then type

./adb start-server

You should see this:

* daemon not running. starting it now on port 5037 *
* daemon started successfully *


Now see again if your Kindle Fire device is listed, by typing

./adb devices

You should really see 

List of devices attached
6C78000600000001    device


If you still don't see a device, make sure that your Kindle Fire is connected, and that the adb_usb.ini file has been correctly configured.

20The next step is to start up ddms. In the first Terminal window, type

./ddms

You should see something like

2011-11-17 13:16:02.750 java[4451:1707] [Java CocoaComponent compatibility mode]: Enabled
2011-11-17 13:16:02.751 java[4451:1707] [Java CocoaComponent compatibility mode]: Setting timeout for SWT to 0.100000


21The Dalvik Debut Monitor window will appear. You should see your Kindle Fire in the upper-left corner. Select any of the lines under your device as shown here:

Dalvik Debug Monitor

22Now to make a screenshot, press Command-S.

Device Screen Capture

The first I tried it, it came up black, because my Kindle had gone to sleep. Just wake up your Fire and then click the Refresh button. Click the Rotate button to get it to go the right way around, and then Save to create a PNG file. Here was my first screenshot (note that I added the drop shadow with Skitch):

KindleFireScreenshot


To take screenshots of the Kindle in action, you'll have to dismount the Kindle from your Mac by clicking the Disconnect button.

If you've left the Device Screen Capture window open, you can hit the Refresh button to see whatever you now see on your Kindle. For example, the first few sample books that you've downloaded:





And I think that's it.


Many, many thanks to Erica Sadun, without whose help I wouldn't have known even where to start. If anyone wants to add what's different on Windows and Unix machines, please add them to the comments.

Friday, November 11, 2011

Embedding fonts in iBooks without bugs

Pablo Defendini posted an error to the #eprdctn group on Twitter this morning and Susan Neuhaus quickly concurred. Both posted screenshots and code. Chris Casey quickly googled a bug report and solution on StackOverflow. Amazing collaborative group!

I found the bug report a little hard to understand and tried to recreate the problem. But I couldn't. I tweeted back to Pablo who recommended I experiment with Google Web Fonts, which is what he had used. And lo and behold, I discover a whole treasure of open source fonts available for commercial use and embeddable in EPUB books. I send a heads-up to Eric Hellman who is doing a similar project with funding ebooks up front so that they too can be free. The Zen of Ebook Production.

I had looked at Google Web Fonts ages ago when it was still just on the web. You had to link to them and there was the worry that if Google went down, so would your fonts. This also made them unavailable for EPUB use. No longer. Now you can download Google Web Fonts (and there are some really nice ones) and embed them in your own books. Of course, you don't have to use Google Fonts, all the info here is valid for any embedded TrueType or Opentype font. Here's what you do:

Use this code in your CSS:

@font-face {
    font-family : NixieOne;

    font-weight: normal;
    font-style: normal;
    src : url("fonts/NixieOne.ttf");
}


NixieOne is the name of the font I used. The name you use for font-family shouldn't matter, but I have found that sometimes it does. To be safe, double-click the downloaded .ttf or .otf file, and use the name that's listed in the menu. You don't need to install it to use it for EPUB.

The font-weight and font-style items are required. It seems, though I find this unclear in the CSS3 spec (info welcome), that these should not be necessary as they are the default values. However, Webkit (on which Safari and iBooks are based), does not default to them, and without them, will not allow you to apply bold or italic formatting at all. So, use them!

Then in your CSS, when you want to use the font for a given selector, use font-family, as shown here:

h1 {
     font-family: NixieOne;
     ...
     }

And now back to the bug in iBooks. It turns out that if you embed a font—seems that it happens with both TrueType and OpenType fonts—and that font is formatted in bold, then iBooks will render it incorrectly, most noticeably with thinner fonts and at larger sizes. (This is a simple, single stroke font and should not look this blurry.)

iBooks double-rendering bold bug

Note that it doesn't matter if you set the font-weight: bold yourself as in:

p {
     font-family: NixieOne;
     font-weight: bold;
}

or if it's in the default stylesheet for the selector as in:

h1 {
     font-family: NixieOne;
     }

Since h1 (h2, h3, etc.) are all bold by default, this text will also be rendered incorrectly:

iBooks double rendering bold bug

The solution is to first remove the bold:

h1   {
      font-family: NixieOne;
      font-weight: normal;
}


and then, if desired, create the bold with something other than font-weight. The folks at StackOverflow recommended -webkit-text-stroke and text-shadow.

Here's 1px stroke:

h1   {
      font-family: NixieOne;
      font-weight: normal;
      -webkit-text-stroke: 1px black;
}

webkit text stroke

and with 2px stroke:

h1   {
      font-family: NixieOne;
      font-weight: normal;
      -webkit-text-stroke: 2px black;
}


2px webkit text stroke
and here's text-shadow with a value of 1px:

h1   {
      font-family: NixieOne;
      font-weight: normal;
      text-shadow: 1px 1px #000;
}

text shadow for bold

I think all three are reasonable options and the choice depends on aesthetics more than anything else.

More thanks for helping figure this all out. Paul Irish for his @font-face gotchas page. Webkit for explaining -webkit-text-stroke. And finally to Sandra Williams, who sent me this page just as I was finishing this post. Someone else will have to follow through with that code—especially given the caveat about Safari at the end. Still, it looked interesting.

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.



More of my books