Tuesday 8 March 2016

On Using Special Characters in an Index or Table of Contents in Adobe InDesign

Adobe InDesign has pretty good features for generating tables of contents and indices for documents, but these have a minor limitation that nonetheless can be very awkward: you can only choose from a small selection of special characters to insert into bits of text like the entry separators.

Here’s the possible characters for the index:

Screenshot of InDesign’s possible special characters for index entry separators

A good selection of the types of things you may want to insert, right? Until you get entries like this one:

Screenshot of a line broken at an awkward point

As you can probably tell, the word “line” will fit easily on the first line, but gets pulled to the second by the text after it. This is because the separator between the word “line” and the numbers is an em space, and those are non-breaking. (The default separator after a topic is two spaces, which avoids this problem, but the idea of using a hack like that doesn’t sit well with me — even if nobody would ever know, there’s a reason spaces of different widths are available.)

The solution seems simple: click on the Type menu to add one of these after the em space:

Type menu / Insert Break Character / Discretionary Line Break

… which works just fine, but you’ll have to go through your index manually to put them in — and that means you lose them if you have to regenerate the index. Wouldn’t it be nice if you could put them in automatically?

So insert a discretionary line break using the menu shown above, copy it, and then paste it into the entry separator field(s) of your choice in the index window. Yep, exactly: that doesn’t work. You can hit ⌘V (Ctrl+V on Windows) all you like, nothing will get pasted into the text field in the index options window.

The Solution

It turns out that the characters from the pop-up menu aren’t all you can put in. If you choose one from the menu and pay attention to the field, you’ll see most of the characters insert a special character code, consisting of a circumflex accent followed by a letter or another character. And what do you know, so do the fields in the Search window …

💡

Simple, really: all you need to do is close the index window, open the search window (⌘F, or whatever it may be on Windows — I’m guessing F3) and use the pop-up there to insert the character of your choice into the search field:


Then just select and copy it (or remember it — it’s only two characters, you can do it!), close the search window and re-open the index window so you can put it into the field where you need it:


After which index entries break nicely at the em space instead of at the word before it:



And what’s more, since it’s a space at the end of the line, it won’t cause the last word to wrap even if there isn’t enough room for the space itself:


To Save You Some Trouble


Here’s a list of all the character codes that the search field lets you put in, except the markers and text variables as those seem irrelevant for an index (if you need them after all, see above).


Special Character Looks Like Code
Bullet Character ^8
Caret Character ^ ^^
Column Break ^M
Copyright Symbol © ^2
Discretionary Hyphen - ^-
Discretionary Line Break ^k
Double Left Quotation Marks ^{
Double Right Quotation Marks ^}
Ellipsis ^e
Em Dash ^_
Em Space ^m
En Dash ^=
En Space ^>
End Nested Style Here ^h
End of Paragraph ^p
Even Page Break ^E
Figure Space ^/
Flush Space ^f
Forced Line Break ^n
Frame Break ^R
Hair Space ^|
Indent to Here ^i
Non-Breaking Hyphen ^~
Non-Breaking Space ^S
Non-Breaking Space (fixed width) ^s
Non-Joiner ^j
Odd Page Break ^L
Page Break ^P
Paragraph Symbol ^7
Punctuation Space ^.
Quarter Space ^4
Registered Trademark Symbol ® ^r
Right Indent Tab ^y
Section Symbol § ^6
Single Left Quotation Mark ^[
Single Right Quotation Mark ^]
Sixth Space ^%
Standard Carriage Return ^b
Straight Double Quotation Marks " ^"
Straight Single Quotation Marks (apostrophe) ' ^'
Tab ^t
Thin Space ^<
Third Space ^3
Trademark Symbol ^d

Mac users will recognise several of those codes as being much the same as the keypress to generate the symbol, except with ^ instead of the Option key (⌥).

No comments:

Post a Comment