Home > Ebooks > Taming em dashes on the Kindle

Taming em dashes on the Kindle

January 4th, 2012 Paul Flo Williams

I like em dashes, and use them when writing (or preserving the style of older books when I’m formatting them), but they need some taming for the Kindle, as discussions on MobileRead will show you.

If you attempt to insert them between two words without any spaces, the Kindle will stubbornly keep both words together when breaking lines. A simple way of getting round this would be to use a spaced en dash instead, as Jaye Manus suggests, but can we do any better?

The Unicode-compliant method of hinting that a line break can occur without a visible space is to put U+200B ZERO WIDTH SPACE either side of the dash, but the Kindle doesn’t recognise this character. However, it does recognise U+200C ZERO WIDTH NON-JOINER, and appears to treat that in exactly the way that ZWSP should be treated.

So, I would mark up the first em dash in Jaye’s example sentence: “I think he’s the best–and I use that loosely–so will let him live.” as

...the best‌—‌and I use...

in the XHTML that I submit to Kindlegen.

With the U+200C ZWNJ included, the Kindle allows line breaking around the dash, and will even insert some space around the dash if necessary to justify the line. Dictionary lookups will also work exactly as you’d expect.

If you were sure that you always wanted a possible break point on both sides of your em dashes, you could just run a search and replace after marking up your document, but you may want to avoid breaks before a trailing dash at the end of a paragraph, for example.

The only further wrinkle here (for me) is that ZWNJ is the wrong character if you’re trying to maintain a ‘clean’ master XHTML file for EPUB conversion or as a web page, so I actually mark up the document with ZWSP and make the ZWSP-to-ZWNJ conversion part of the set that I do before running Kindlegen.

Categories: Ebooks Tags: ,
  1. January 15th, 2012 at 12:24 | #1

    Howdy. I’m so glad I’m not the only one who’s driven batty by formatting issues in ebooks. Such nit-picky details, but the details matter.

    I come from a non-techie perspective (at best, a bumbling, rather clueless semi-techie who knows just enough to really make a mess of things). When I see an issue, I tend to fumble around and come up solutions that sort of, kind of work. Mostly I look around for people who’ve come up with REAL solutions. I believe you have come up with a solution to the em-dash problem, but the tech talk goes right over my head.

    Do you perchance have a title to recommend that shows how you solved the problem? I have a Kindle. A link to Amazon would be great. That way I can do a blog post about it, then link back to this post so my readers who struggle with the issue can see there is a solution. If, like me, they are non-techies, they can either consult with you or hire you to fix the issue. It would be much appreciated.

Comments are closed.