Skip to main content
Participant
August 9, 2015
Answered

How to make InDesign choose the actual 1st word in required style when using Running Head (Character style)

  • August 9, 2015
  • 1 reply
  • 1256 views

I need to have a running header with the first word in a required style. However, when I choose Running Head (character style) and choose "the 1st on page", it finds the first paragraph on page and if the paragraph is not whole (started on the previous page), it takes the first word from that paragraph. For example:

I need the running header to show the word "Quis", which is the first word in Open Sans Bold. Instead, InDesign shows the word "Lorem" in the red text field.

Is it possible to create a script that will make InDesign unsee the first paragraph on page, if it is not whole when creating a running header?

This topic has been closed for replies.
Correct answer Peter Kahrel

1. Set up the running-header variable to use a character style, first on the page.

2. Apply the character style to the first word of all or selected paragraphs with a GREP find/replace: find ^\w+ (or whatever grep expression is the more appropriate), make sure the replace field is empty, and set the character style in the Change Format panel.

This is the way to do it because (1) running-header variable doesn't see GREP styles, and (2) though running-header variables do see nested styles, you get the same problem as what you already saw, namely, that 'first on the page' can in fact on the previous page.

Peter

1 reply

Peter Kahrel
Community Expert
Peter KahrelCommunity ExpertCorrect answer
Community Expert
August 10, 2015

1. Set up the running-header variable to use a character style, first on the page.

2. Apply the character style to the first word of all or selected paragraphs with a GREP find/replace: find ^\w+ (or whatever grep expression is the more appropriate), make sure the replace field is empty, and set the character style in the Change Format panel.

This is the way to do it because (1) running-header variable doesn't see GREP styles, and (2) though running-header variables do see nested styles, you get the same problem as what you already saw, namely, that 'first on the page' can in fact on the previous page.

Peter

Participant
August 10, 2015

It's working. Thanks