Highlighted

[HOW TO] create a specific paragraph style

Community Beginner ,
Aug 12, 2020

Copy link to clipboard

Copied

Hi guys,

 

Want to create a TOC style, looking as follows:

p1.jpg

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

Adobe Community Professional
Correct answer by Laubender | Adobe Community Professional

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:

TOC-With-Magenta-Bar-1.PNG

 

TOC-With-Magenta-Bar-2.PNG

 

TOC-With-Magenta-Bar-3.PNG

 

TOC-With-Magenta-Bar-4.PNG

 

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 )

Topics

How to

Views

79

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

[HOW TO] create a specific paragraph style

Community Beginner ,
Aug 12, 2020

Copy link to clipboard

Copied

Hi guys,

 

Want to create a TOC style, looking as follows:

p1.jpg

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

Adobe Community Professional
Correct answer by Laubender | Adobe Community Professional

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:

TOC-With-Magenta-Bar-1.PNG

 

TOC-With-Magenta-Bar-2.PNG

 

TOC-With-Magenta-Bar-3.PNG

 

TOC-With-Magenta-Bar-4.PNG

 

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 )

Topics

How to

Views

80

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
Adobe Community Professional ,
Aug 12, 2020

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 )

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...
Community Beginner ,
Aug 12, 2020

Copy link to clipboard

Copied

Paper like fill is OK.

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...
Adobe Community Professional ,
Aug 12, 2020

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:

TOC-With-Magenta-Bar-1.PNG

 

TOC-With-Magenta-Bar-2.PNG

 

TOC-With-Magenta-Bar-3.PNG

 

TOC-With-Magenta-Bar-4.PNG

 

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 )

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...
Community Beginner ,
Aug 13, 2020

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.

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...
Adobe Community Professional ,
Aug 13, 2020

Copy link to clipboard

Copied

Ah. \h is a horizontal white space.

 

Regards,
Uwe Laubender

( ACP )

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...
Adobe Community Professional ,
Aug 13, 2020

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:

 

TOC-With-Magenta-Bar-5.PNG

 

Regards,
Uwe Laubender

( ACP )

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...
Community Beginner ,
Aug 13, 2020

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.

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...
Community Beginner ,
Aug 13, 2020

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.

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...
Adobe Community Professional ,
Aug 14, 2020

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

 

StartOfParagraph-GREP-AddEMSpaceIfThereIsNone.PNG

 

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 )

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...
Adobe Community Professional ,
Aug 14, 2020

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:

 

TOC-With-Magenta-Bar-6.PNG

 

Regards,
Uwe Laubender

( ACP )

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...
Community Beginner ,
Aug 16, 2020

Copy link to clipboard

Copied

Appreciate your help Uwe !

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...