Skip to main content
Inspiring
July 28, 2024
Question

In certain style, display (but don't replace) a text string with an abbreviation

  • July 28, 2024
  • 2 replies
  • 265 views

I am working on a book file with the chapter names occuring both at the beginning of each chapter, and on top of every odd page.

Some of the chapter names are "too long" (cannot be changed, as this is an old book) and are to be abbreviated at the top of the page. Is there a way to do this automatically (where I at one single place type in the abbreviation - without changing templates, etc)?
As the chapter name at the top of the page is in its own paragraph style I was thinking that this maybe could be done using GREP - but that is just an idea, I'm not very profficient at GREP.

This topic has been closed for replies.

2 replies

Barb Binder
Community Expert
Community Expert
July 28, 2024

Hi Chris:

 

InDesign interprets a variable string as a single character so nested styles and GREP styles don't work. 

 

~Barb

~Barb at Rocky Mountain Training
Barb Binder
Community Expert
Community Expert
July 28, 2024

Hi Chris:

 

I accomplish this by using the Running Header (Character Style) in place of the usual Running Header (Paragraph Style) variable. I can assign a character style to the entire title if it is short, or to part of it if it is too long to fit and InDesign just pulls in that specific content into the running head. This solves the problem for me about 95% of the time. For the other 5% I create a custom master for that section and manually add the abbreviated title. (Not great, but gets it done.)

 

An alternative is to copy the titles into their own text frames, edit the titles to fit and assign a unique paragraph style (i.e., Title Short) and call that title into the running heads with Running Header (Paragraph Style). Drag the frame so that it is mostly on the pasteboard, but slightly overlaps the first page of each chapter. Just make sure the text doesn't appear on the page so that InDesign can see it but the readers can't. 

 

 

Of course, I forgot to note my favorite option: explain this issue to the client and ask them to write short titles. That's rarely successful, hence the other approaches mentioned first. 😊

 

~Barb

~Barb at Rocky Mountain Training
Inspiring
July 28, 2024

Thanks! It sounds as it should work so I will try it.

An alternative I was thinking about (on my daily runstreak run 😊) was to write the shortened version right after the chapter title (in the source document, i.e. word) with a hyphen inbetween. Then format the header style with a GREP expression attributing the text before/after (depending which I want to show) the hyphen to a Character Style which makes the text invisible (size 0.1, scale 1%, no color).
However, I got stuck when trying to get the GREP expression to work... (I think it might be that a nested GREP Style does not work on a variable(?))