How do you handle in-line white space?

  • This topic has 2 replies, 2 voices, and was last updated 4 months ago by Libris.
Viewing 3 posts - 1 through 3 (of 3 total)
How do you handle in-line white space? thread
Author Posts
Libris

How do you work with white-space characters other than the standard space or non-breaking space? Things like em space, en space or thin space are relatively common in typesetting, and although they can be used in XHTML with Unicode entities (like   for em space), InDesign converts them all to a basic space on export.

I don’t use them for indents, but I do often use them in my print typesetting for in-line spacing, especially in poetry but sometimes other books require them as well. When exporting to EPUB, though, it becomes a hassle.

I have a script that converts all the white-space characters to something like :emsp: before export, then converts those to the entities after export. This works, but is hard to use with InDesign’s new automatic page break marker option, since the placeholders take up more space and often cause reflow. So I need to use something like PageStaker in those cases, which just takes more time. Not ideal.

Curious about what other solutions you may have!

b.keith

I’ve not yet decided InDesign’s page breaks are superior to pagestaker in anything beside straight up fiction for reasons like this.

You could try using something that is the same length/size as an em-space instead of :emsp: … a math symbol? Then do the replace afterwards. My workflow relies heavily on post-InDesign processing because its easier to make it output things in a consistent way and replace them with what I actually want.

E.g. I replace context breaks with “BREAK” and then my python script runs a series of search and replaces including changing BREAK to <hr class="break" />. A simple fairly simple python script can open the epub, run the search and replaces and save it again in a couple of seconds.

The other option might be to use character styles since InDesign epub exports maintain those styles on spaces. Still a bit of post processing but maybe your existing script can handle that better?

Libris

Applying dedicated character styles to whitespace characters is an excellent idea. I can have them applied automatically with GREP Styles and then have my script (also a custom Python script) automatically swap them for the proper XHTML entity based on character style.

Sure would be nice if InDesign preserved all entities on its own, though!

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Want to join the discussion?

a wooden table with a white keyboard on top, and a persons hand writing on a piece of paper

View our current resources