Copy link to clipboard
Copied
Hi there,
I have a small issue when making a catalogue of over 200 pages: can I put a Paragraph Style within a Paragraph Style?
There is a specific piece of text in my document, that appears every so often, which automatically gets a specific paragraph style (I use a plugin for this). However, when this text with 'Paragraph Style A' contains a digit, I want it to change to 'Paragraph Style B'.
Is this in any way possible?
I know you can nest a character style, or use GREP to add a character style, but 'Paragraph Style A' specifically contains a Paragraph Rule in a certain color, so Character Style won't do the trick as 'Paragraph Style B' has a different color Rule, which can't be adjusted with just a Character Style...
No problem.
So those are separate pieces of text / information?
Can you / do you want to join them together?
My approach was - they are separate - @rob day treat it as a single paragraph...
Both approaches have positives and negatives - but I think you need to clarify and decide which way is better for you...
Copy link to clipboard
Copied
A paragraph can have only one single paragraph style as it name says.
But you can use Character Styles in a Paragraph Style. You can do it in an automatic way with GREP and Nested Styles.
Copy link to clipboard
Copied
Hi Will,
Thanks for replying. And yes, I do know about the possibilities with character style, however I need a paragraph style change as it's the paragraph rule that needs to change color.
Copy link to clipboard
Copied
Use Underline with the exact position as character style. It is not possible to apply 2 paragraph styles to the same paragraph and it will never be.
Copy link to clipboard
Copied
Thanks for that, but I was hoping maybe someone could help me find a solution. 'Underline' has a different effect from paragraph rule anyways, it doesn't go outside the word length. If you say 'it will never be possible', I happily welcome alternative ideas as well! Would make life much easier as I now have to change it manually. The catalogue is pretty big in number of pages and items to then adjust.
Copy link to clipboard
Copied
Use paragraph frames instead of paragraph rulers, they offer more flexibility.
You can place a word as anchored frame. Text in a frame can have a different paragraph style.
Copy link to clipboard
Copied
Not sure how that would work within my current setup here, but I'll give it a go and look into it, thx
Copy link to clipboard
Copied
Hi @TRIXIE , Maybe you could show a screen capture of what you are trying to do--there is no way to apply multiple paragraph styles to a single paragraph.
Copy link to clipboard
Copied
Here's a screen cap but I think it'll only be confusing, as I'm using a plugin and that should not need to have anything to do with the issue, I think it should have to be able to be solved outside the plugin. The basic thing I need is: when I import all my text, and it all has Paragraph Style A, how can I say: ok, I want every word that has a digit to be Paragraph Style B?
To explain what you see in the screencap:
These green tags are grouped within one frame, with anchored frames within, the individual tags that are green. This is being added automatically (through plugin), the one big frame with the green tags within it. The outside frame has NO color = the first Paragraph Style (as it is used to keep the white space between the different green frames) and then every anchored frame has Paragraph style A. they all get that style at once, so I need to find a way to say, ok when I have a frame with digits in it, I want my paragraph style to be a different colour = Paragraph Style B.
Copy link to clipboard
Copied
You can use a GREP Find&Change to search for a digit - in a particular ParaStyle - then change to a differrent ParaStyle:
Change to: is empty.
And next time - PLEASE start from example screenshots of BEFORE & AFTER - you'll get an answer much quicker...
Copy link to clipboard
Copied
Hi Robert,
Yes you ar right, and that is how I am doing it right now. However, as far as I know (correct me if I'm wrong because I'm no GREP expert!!), I can only do this manually. This means that, whenever the original data / text in my catalogue is being changed, I have to manually adjust this again and again. So I thought I could indeed use GREP but when you want to link a GREP style into a Paragraph Style (so it'll update the layout automatically, every time something changes in the text), that's not possible. As there is only the option to use Character Styles and no Paragraph Styles when applying a GREP Style in there.
Copy link to clipboard
Copied
What kind of a plugin are you using?
That's why my tool beats all other tools combined...
With my tool, you can import data and do post-processing at the same time - or in between "fields" / records in the database - during import ...
You can import text - and then use it as a template - so you don't have to specify "fields" in your original template - you can have "fields" in the new text that you're importing - and those "fields" can be filled with data from the same record ...
So kind of conditional data import - without setting any conditions ...
Copy link to clipboard
Copied
You can do it with a CharacterStyle using Underlines. Here the is an en-space on either side of the words, with no character style applied to the em space between.
Copy link to clipboard
Copied
@rob day, but @TRIXIE wants ONLY first part of the text with a different color - those texts aren't in the same block of text - they're are in a separate TFs anchored in another TF.
To explain what you see in the screencap:
These green tags are grouped within one frame, with anchored frames within, the individual tags that are green.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
The 3rd Nested Style rule wants to be 2 en spaces not words:
Copy link to clipboard
Copied
Hi Rob,
This suggests that I would have to add En- and Em-spaces in my original data?
It might be a good alternative to how the green tags are being made now, but this doesn't seem to solve the issue of being able to appoint tags with digits in them to have a different colour (whether underline of paragraph border)?
Copy link to clipboard
Copied
This suggests that I would have to add En- and Em-spaces in my original data?
Right, or some other white space combination—this uses regular spaces:
You might be able to change color with some kind of GREP Style, or you could make a Paragraph/Character Style for each color and apply via a script or search.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Yes, the thing is: I get several pieces of text at once: the age (3y+) and the text next to it. So it's the age that I want to put in a different color. It would also be a different color for different ages.
So only the 'tags' that contain digits.
Copy link to clipboard
Copied
So the answer to your problem is either my earlier reply - https://community.adobe.com/t5/indesign-discussions/add-a-paragraph-style-within-a-paragraph-style/m... - or you would have to use GREP Styles?
Nested could be - as long as your part with digit(s) is always in the same place...
Copy link to clipboard
Copied
So only the 'tags' that contain digits.
By @TRIXIE
Wait a minute... Can you clarify what do you mean by "tags that contain digits"?
You mean name of the "tag" - or contents / text after importing "tag"?
Because those are two different things.
Copy link to clipboard
Copied
I apologize, English is not my mother tongue and by 'tags' I just referred to the way they 'look' like tags. So I just meant the green underlined parts, like '3y+' is a tag. But I didn't mean it technically.
Copy link to clipboard
Copied
No problem.
So those are separate pieces of text / information?
Can you / do you want to join them together?
My approach was - they are separate - @rob day treat it as a single paragraph...
Both approaches have positives and negatives - but I think you need to clarify and decide which way is better for you...
Copy link to clipboard
Copied
Nested Styles can use mixed Character Styles: