What’s easy in TeX is often cumbersome or impossible in InDesign. Today’s task was to allow hyphenation in words whose syllables are separated with bars, as depicted here:

In TeX, you’d define some macro as `\discretionary{\hyphenchar}{}{|}`. In InDesign, however, I fumbled with Ligatures and other OpenType features such as `falt` (Final Glyph on Line Alternates). Alas, InDesign doesn’t seem to support `falt` yet.

To my rescue came TeX, in the form of Liang’s seminal hyphenation patterns. They found their way to InDesign via OpenOffice, which uses Hunspell, which in turn uses (essentially) Liang patterns for hyphenation.

I created a new language variant under de_DE with an arbitrary name, and placed a file `hyph_de_DE.dic` in there with the following content:

```UTF8
7|/=-```

I introduced it to InDesign (CS5.5 or newer) by following this step-by-step guide.

What I didn’t find out is how to name this new language variant. So I created a character style with this nameless language and assigned it to the bar-bearing phrases.

Other hyphenation patterns didn’t seem necessary. This is because the bars in the input represent all legal hyphenation positions. The only requirement was to allow line breaks at the bar positions and turn the bars into hyphens when there’s a line break at their position.

### 2 Responses to “InDesign: Turning a vertical bar into a hyphen at the end of a line”

1. Congratulations, Gerrit. But why don’t you just use LaTeX and save yourself the pain? 😉

In many ways we seem to have gone backwards in the 30 years since TeX was born. It can still do things “modern” software cannot dream of…

2. You’re certainly right, Kaveh. I did this research for an RFQ response. We’ll be offering a TeX and an InDesign solution. The latter costs 4× as much and it does less: for example, it doesn’t come with a preview server (unless the customer wants to spend a lot more on an InDesign server).

The customer is part of a group that strives to concentrate all typesetting in one system. There are also layout-heavy books, therefore TeX doesn’t qualify as the one and only system. I think to some people, InDesign is a kind of religion. The group certainly adheres to a monotheistic cult. But it’s not my business to question other people’s beliefs

Therefore we think that we should be offering an InDesign solution as long as it’s technically feasible. We have proven that we can typeset this kind of books with IDML synthesis, from XML input, and now we’ve also tackled this special requirement.