Copy link to clipboard
Copied
Hi guys,
Want to create a TOC style, looking as follows:
My idea is to use for magenta line the character style, with strikethrough option on, and further use this style as GREP style in TOC paragraph style.
But then: 1/ how to create adjustable space between first character - I don't want to interfere anyhow the corrresponding header style), 2/ how to get equal offset between line and text and 3/ how to make it not too complicated 🙂
Or maybe my whole idea is wrong
many thanks for any tip
I see a way with a couple of GREP styles and some character styles.
The paragraph style applied in the TOC has a paragraph shading applied.
The gap in the shading is controlled by a GREP style that applies a character style with a underline colored in [Paper].
Some screenshots from my German InDesign to illustrate this:
One or two issues remain:
[1] The left and especially the right side-bearing.
[2] Text that is running in more than two lines.
Issue [1], left and right side-bear
...Copy link to clipboard
Copied
Hi Mike,
should the gap in the Magenta stroke be empty?
Or would you allow a fill like [Paper] for this?
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
Paper like fill is OK.
Copy link to clipboard
Copied
I see a way with a couple of GREP styles and some character styles.
The paragraph style applied in the TOC has a paragraph shading applied.
The gap in the shading is controlled by a GREP style that applies a character style with a underline colored in [Paper].
Some screenshots from my German InDesign to illustrate this:
One or two issues remain:
[1] The left and especially the right side-bearing.
[2] Text that is running in more than two lines.
Issue [1], left and right side-bearing.
The part with the left side-bearing can be solved if you can add or type a fixed width white space at the beginning of every title in the main story where the TOC pulls the contents from. In my screenshot above I used an EM space character, that I make "invisible" with a GREP style that sets its width to 1%.
In the TOC itself another GREP style changes the width to 50%. That's the way to control the width of the left side-bearing.
Change the width of a character to a percentage with a character style.
For the right side-bearing after the page number I have no easy solution.
We could create a separate special font with 10 digits that are designed to have a fixed right side-bearing and a GREP style that will apply that font to the last digit of the paragraph.
But in the end it would be easier to add a fixed width white space to the end of every paragraph in the TOC. That must be done again every time the TOC is updated. Could also be done with the beginning of every paragraph in the TOC and we forget about the solution I outlined above for the left side-bearing.
Issue [2] could be no issue at all if you do a point size of the text in the TOC that every title can go into one single line of text.
Let's see if others come up with a better solution…
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
Uwe,
Thanks a lot for your efforts!
One thing is still unclear for me. What is your definition of WHITEUNDERLINE char style and how does it interfere as GREP in TOC paragraph style?
OK, got it 🙂
BTW is /h equal to ~s ?
And any idea how to add space before number, when TOC is formatted as pagenumber before text ? To finally have the same effect.
Copy link to clipboard
Copied
Ah. \h is a horizontal white space.
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
Hi Mike,
the GREP pattern in my second screenshot is catching all the text in a paragraph.
The beginning of the text is defined by a paragraph indent for all lines. The applied character style is just using a 20Pt underline with color [Paper], offset is -5 Pt so that the paragraph shading is covered:
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
Uwe, thanks , after a while I realized your idea. Anyway looks pretty nice.
One more thing - how to add space at the beginning of the TOC paragraph style when it is formatted as page number befor text, so
99 CHAPTERTITLE
to have the same effect as before.
Copy link to clipboard
Copied
ok, after some trials I came to the point that adding spaces before and after text in TOC paragraph style can be done via ctrl-f using regex. I have no better idea.
Copy link to clipboard
Copied
Hi Mike,
adding a white space character to the beginning and to the end of a paragraph can be done using two GREP Find/Change actions. You can restrict the paragraphs that should be found to the ones using a destinct paragraph style.
Sample below that should be refined if the first character of a title cannot be caught by the dot.
Add EM space if there is no horizontal white space at the beginning of a paragraph.
Find text in paragraph style TOC-ChapterTitle with pattern:
^(\h{0,1})(.)
Replace found text with EM space and found character in the second group:
~m$2
Add EM space if there is no horizontal white space at the end of a paragraph.
Find text in paragraph style TOC-ChapterTitle with pattern:
(.)(\h{0,1})$
Replace found character in the first group and with EM space:
$1~m
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
And you should add a third GREP Style to the TOC paragraph to control the width of any horizontal white space at the end of the paragraph:
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
Appreciate your help Uwe !
Copy link to clipboard
Copied
I apologize if I'm missing something, but couldn't this be accomplished without GREP at all by using 2 paragraph rules? One set to magenta and aligned to column width and the other set to paper and aligned to text width (with right and left offsets). Only issue is if it goes onto 2 lines, but perhaps shading can be done the same way.
Copy link to clipboard
Copied
Simply try it!
And if you have any issues with it or if you are successful share your solution.
Thanks,
Uwe Laubender
( ACP )