1

I'm currently doing an epub where the original scanned pdf has many "xxx !…" — that's any word (xxx)… followed by a thin space… followed by an exclamation mark, followed by an ellipsis.

In unicode code points: xxx U+202f U+0021 U+2026

I use a bunch of different e-reader apps on android or Kobo and I noticed that occasionally when justification sends the "!" to the end of the line, the ellipsis flows over to the next line. As a result when this ellipsis is the last character of a paragraph I end up with a line with just the ellipsis sticking out like a sore thumb.

Obviously I would like to avoid this and have the ellipsis stay where it belongs, next to the exclamation mark with no intervening space. The original appears to follow the typesetting standards for French literature in the 19th century and I don't wish to mess with that and change this typesetting quirk to something else.

I did a pdf of the same text using LaTeX and haven't noticed the same thing happening.

How would I go about fixing this annoying problem with epub/html?

Thanks,

CJ

1

1 Answer 1

1

If the rendering implementation supports this, You might want to wrap that string in a span tag and add the white-space: nowrap style.

You can see it here in action.

3
  • I'll give this a shot as a workaround and see how it behaves on different ereaders. But I have many such character sequences in the document and since this is html/epub generated from markdown I'm not too keen on cluttering up my source with such span tags. Oct 12, 2019 at 19:03
  • Perhaps I need to take this up with the renders' developers… Basically I have an exclamation mark or question mark followed by en ellipsis with no intervening white space and I don't see why the render would decide to insert a line break between the two. Oct 12, 2019 at 19:06
  • Additional problem is that I haven't been able to think of a way to build a test that would reproduce the problem reliably… which makes it difficult to verify tha the workaround actually works… Oct 12, 2019 at 19:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.