Highlighted

GREP style to insert tabs in a ToC??

Participant ,
Jul 29, 2020

Copy link to clipboard

Copied

Is is possible to insert tabs using a GREP style? 

I have a ToC text style that has a nested style (italics) through two tabs, then the normal style. 

I want it to look like this when I update the ToC:

Screen Shot 2020-07-29 at 2.36.26 PM.png

The head style it is using to make the ToC has a space and a soft return betwen it and rest of the headline. That's fine, as the soft return gets removed and the third tab with leader dots gets inserted when the TOC generates. What I am wondering is there a GREP STyle I can write to have it insert the first and second tabs automatically? 

I DID IT!! Yay me.

Find: ^\w+(\s)  Beginning of ¶, a word, a space

Change: \t$0\t  A tab, found word, a tab

 

Hooray.

TOPICS
How to, Type

Views

63

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

GREP style to insert tabs in a ToC??

Participant ,
Jul 29, 2020

Copy link to clipboard

Copied

Is is possible to insert tabs using a GREP style? 

I have a ToC text style that has a nested style (italics) through two tabs, then the normal style. 

I want it to look like this when I update the ToC:

Screen Shot 2020-07-29 at 2.36.26 PM.png

The head style it is using to make the ToC has a space and a soft return betwen it and rest of the headline. That's fine, as the soft return gets removed and the third tab with leader dots gets inserted when the TOC generates. What I am wondering is there a GREP STyle I can write to have it insert the first and second tabs automatically? 

I DID IT!! Yay me.

Find: ^\w+(\s)  Beginning of ¶, a word, a space

Change: \t$0\t  A tab, found word, a tab

 

Hooray.

TOPICS
How to, Type

Views

64

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jul 29, 2020 0
Adobe Community Professional ,
Jul 29, 2020

Copy link to clipboard

Copied

GREP Styles can't add text, they can only style it. You would have to run a Find/Change to insert the tabs.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 29, 2020 0
Adobe Community Professional ,
Jul 29, 2020

Copy link to clipboard

Copied

Why not let the ToC generator do it? It is something you switch on in the dialog box

Mike Witherell

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 29, 2020 0
Adobe Community Professional ,
Jul 29, 2020

Copy link to clipboard

Copied

I don't think that's possible. You're asking the TOC command to either insert a tab within the chapter name (e.g. between "One" and "Discovering Your Inner Child") or to number the chapters as a string.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 29, 2020 0
Participant ,
Jul 29, 2020

Copy link to clipboard

Copied

Okay, I couldn't do it as a GREP style but I could run a find change afterward. Does anyone know what the strings would be?

I know that beginning of paragraph is ^ So for the first tab it could be:

Find: ^

Change: \t$0 (tab found text)

but I don't know how I'd do the second tab. 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 29, 2020 0
Participant ,
Jul 29, 2020

Copy link to clipboard

Copied

I DID IT!! Yay me.

Find: ^\w+(\s)  Beginning of ¶, a word, a space

Change: \t$0\t  A tab, found word, a tab

 

Hooray.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 29, 2020 1
Most Valuable Participant ,
Jul 30, 2020

Copy link to clipboard

Copied

Here was a similar solution to a comparable problem:

Table of Contents tab before entry 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 30, 2020 0