• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Grep style

New Here ,
Mar 21, 2022 Mar 21, 2022

Copy link to clipboard

Copied

Hi everyone,
I'd like to apply a grep style to a paragraph style to build a toc. The title of chapters are composed by two lines, that are obtained by means a \n. If I use the expression ".+\n.+" in grep search, it works, but if I use it in grep style the character style is applied just to first line.
For example:
Chapter 1
Thematic title

If I search for .+n.+, the entire pattern "Chapter 1 Thematic title" is found.
If I type the same expression in the field "To text" of grep style, the character style is applied just to "Chapter 1"

Thank you in advance!

Daniele

Views

334

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
community guidelines
Community Expert ,
Mar 21, 2022 Mar 21, 2022

Copy link to clipboard

Copied

Please let us know which program you are having problems with. Someone will be along to move this post to the appropriate product forum, where you are more likely to get an answer to your question.

The Using the Community forum is for help in using the Adobe Support Community forums, not for help with specific programs, installation issues, or account issues such as subscription questions or billing problems, or generalized questions about Creative Cloud services.

* Product questions should be posted in the associated product community.
* Installation questions should be posted in the Download & Install community.
* Account issues, including subscription questions or billing problems, should be posted in the Account, Payment, & Plan community.
* Questions about the Creative Cloud desktop app or general questions about apps in the Creative Cloud should be posted to the Creative Cloud Services community.

Votes

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
community guidelines
New Here ,
Mar 21, 2022 Mar 21, 2022

Copy link to clipboard

Copied

Sorry, I forgot to specify that. I'm using InDesign.

Thank you!

Daniele

Votes

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
community guidelines
Community Expert ,
Mar 21, 2022 Mar 21, 2022

Copy link to clipboard

Copied

I do not understand, what you want to accomplish with GREP styles in a TOC?

If you make a TOC, the information is drawn from the dedicated paragraph styles. Primary the styles are defined from the TOC styles in the layout menu. 

I use personally the nested and inline feature from the Paragraph style to accomplish different fomratting. But how would a GREP come into the game?

Can you provide us an example which cannot be done with nested and inline styles, nor with the given toc style capability?

Votes

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
community guidelines
Community Expert ,
Mar 21, 2022 Mar 21, 2022

Copy link to clipboard

Copied

Maybre you should break up the entries into 2 paragraphs with 2 different styles to build up the toc?

Votes

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
community guidelines
New Here ,
Mar 21, 2022 Mar 21, 2022

Copy link to clipboard

Copied

If I broke up entries in two paragraphs styles, I would have problem with exporting the text into the epub format, because:
1) if I exported into the h1 element, I would have two h1 in the same page, that is wrong
2) if I exported Chapter n. into the h1 element and the thematic title either in the h2 or into the p element, it would be wrong because they are the same logical object (so the same level)

Votes

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
community guidelines
Community Expert ,
Mar 21, 2022 Mar 21, 2022

Copy link to clipboard

Copied

make h1 and h1.sub as chapter title. only h1 should start with a new document in EPUB, but both can draw their information into the toc. I do this all the time with success.

Votes

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
community guidelines
New Here ,
Mar 21, 2022 Mar 21, 2022

Copy link to clipboard

Copied

Sorry, I'm not sure I have understood. I can start a new document, but what would be the result?

....

<h1>Chapter n <br/>

Thematic title</h1>

...

or

<h1>Chapter n</h1>

<h1>Thematic title</h1>

Votes

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
community guidelines
Community Expert ,
Mar 21, 2022 Mar 21, 2022

Copy link to clipboard

Copied

Normally in an EPUB you divide the document into chapters. On the first level it will start with a new HTML page.

 

What else is your problem with EPUBs if you have 1st level headlines with a subheadline? The h1 is an indicator to divide the document upon EPUB export.

Votes

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
community guidelines
New Here ,
Mar 21, 2022 Mar 21, 2022

Copy link to clipboard

Copied

"Chapter n. Thematic title" is relative to one logical level, H1 and H2 are relative to two logical levels.
...
<h1>Chapter n. Thematic title</h1>
<p>bla bla bla...</p>
....
<p>bla bla bla...</p>
<h2>Title second level</h2>
<p>bla bla bla...</p>
....
<p>bla bla bla...</p>

Not
<h1>Chapter n</h1>
<h2>Thematic title</h2>
<p>bla bla bla...</p>
....
<p>bla bla bla...</p>

In the second case, we're telling the <h1> is composed by a text at h2 level, in the first we're telling that <h1> is composed by a text at level h1 and other texts at level h2

Votes

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
community guidelines
Community Expert ,
Mar 21, 2022 Mar 21, 2022

Copy link to clipboard

Copied


@Daniele23680541van0  schrieb:


<p>bla bla bla...</p>

In the second case, we're telling the <h1> is composed by a text at h2 level, in the first we're telling that <h1> is composed by a text at level h1 and other texts at level h2


Is this separated by different lines? Use different paragraph styles.

Votes

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
community guidelines
New Here ,
Mar 21, 2022 Mar 21, 2022

Copy link to clipboard

Copied

LATEST

Ok, I'll try, thank you so much!

Daniele

Votes

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
community guidelines
Community Expert ,
Mar 21, 2022 Mar 21, 2022

Copy link to clipboard

Copied

Hi Daniele,

if the character style should be applied to all characters of the paragraph, I would change the characteristics of the applied paragraph style. Or if that is not possible, because you are using a paragraph style that is also needed outside of the TOC I would create an extra paragraph style for the TOC.

 

Regards,
Uwe Laubender

( ACP )

Votes

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
community guidelines
New Here ,
Mar 21, 2022 Mar 21, 2022

Copy link to clipboard

Copied

Hi Uwe,

I created a paragraph style, to apply to the entire chapter titles, and a character style, to apply to thematic title; whereas, I created a paragraph style and a character style to apply to the items of the TOC. I have tried to create a grep style in the paragraph style of the TOC getting the result illustrated above.

Regards,

Daniele

Votes

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
community guidelines
Community Expert ,
Mar 21, 2022 Mar 21, 2022

Copy link to clipboard

Copied

Work less with Character Styles and with more paragraph styles. Where a whole paragraph has only one character setting, no character style should be used.

Votes

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
community guidelines
New Here ,
Mar 21, 2022 Mar 21, 2022

Copy link to clipboard

Copied

Thank you for your suggestion!

Daniele

Votes

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
community guidelines