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:
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.
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.
Copy link to clipboard
Copied
Why not let the ToC generator do it? It is something you switch on in the dialog box
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.
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.
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.
Copy link to clipboard
Copied
So glad I found this, it was a lifesaver!
Copy link to clipboard
Copied
Here was a similar solution to a comparable problem: