Copy link to clipboard
Copied
THE SITUATION
I have a document that consist of many lines, each with tab separated data.
Eg
Smith J 21 Brown Street Nowhereville
Bloggs D 15 Smith Ave Somewheretown
Each line of data is effectively a paragraph.
Each line is one of 4 colours (Red, green, black, blue).
I have to fit between about 1500 - 2000 lines of such data in a fixed space.
For aesthetic reasons it needs to fill the space, ie, no big empty space at the end because there's not enough data.
So what I want to do is control the character size and leading using a paragraph style: a paragraph style that ignores colour. Apply that style to the entire document, and if there's not enough room, decrease the font size and leading in the paragraph style. If there's too much white space at the end, increase the leading and/or space after paragraph in the paragraph style.
THE PROBLEM
No matter what I do, applying a paragraph style either (a) changes all the lines to the same colour or (b) randomly changes some lines from one colour to another (unwanted) colour.
Is this problem actually solvable?
I have looked for several hours on the internet, and I have found people who have similar problems. All the "solutions" I have found either don't work, or are solutions to a different problem from what's been described.
(I look back with fondness on Freehand which solved this easily and intuitively 20 years ago...)
Copy link to clipboard
Copied
Create 4 paragraph styles with the colours you need, then use the "Next paragraph style" function in the Paragraph Styles you create.
https://indesignsecrets.com/indesign-how-to-switch-paragraph-styles-automatically.php
Search for more tutorials on Next Paragraph Style too. it's a very handy feature.
Copy link to clipboard
Copied
Why do you really need a paragraph style to fix this. You can manually select all the texts (I assume, your entire document will have the same kind of text) and change the size or leading manually in control panel until the texts fit within the space.
If you still need to have a paragraph style then I think the suggestion given by Eugene Tyson is great but you need to have a base/parent style created before creating four paragraph styles and then you will have to create these four paragraph style based on the parent style (again 'based on' feature is very handy). Changing the size and/or leading in the parent style will affect all the child styles.
Hope this helps.
Copy link to clipboard
Copied
Hi,
It would be really easier to just select the story containing the text and play a script that increases/decreases the global leading until the "perfect" result! [+/-0.001 point leading].
… but of course, you can do it manually!
That will just take you a little more time! …
Best,
Michel, for FRIdNGE
Copy link to clipboard
Copied
Apologies - early morning and no coffee - I see the issue now
Setup your colours in and name them Blue, Green, etc. Character Styles
Set your Character Colour in each of the Character Styles
Setup 4 paragraph styles - and Para 1 next style is Para 2, and Para 2 is next style Para 3.
In the paragraph styles for Para 1 - set up the Nested Style to be the character style you want (colour) for the paragraph
In the paragraph style for Para 2 - set up the Nested Style so the character style is the colour of the paragraph
(the above is assigning the character colour from the character style)
Sample file attached. Select All - then in the Paragraph style panel right click Paragraph 1 and select Apply and Apply Next Style.
Copy link to clipboard
Copied
@Eugene
I think the color issue here is a (pardon the pun) red herring, and the issue is more of a copyfitting issue. When I re-read the post, I noticed this line:
For aesthetic reasons it needs to fill the space, ie, no big empty space at the end because there's not enough data.
My suspicion is that the text has all been manually overriden in terms of the colour, and the opening post doesn't say the colours repeat in a logical order, it just says each line is one of four colours. By this definition, twenty lines could be in black, then two lines in red, one line in green, 4 more lines in black...
I think Michel's suggestion of a scripted solution is probably the way to go, but I don't know of any in the public domain that will do this line by line, so the OP would either need to have a bespoke script commissioned for them, or maybe choose an off-the-shelf script such as typefitter: https://www.typefi.com/products-services/design-tools/typefitter/
Copy link to clipboard
Copied
If your colors are not a repeating pattern, then use 1 paragraph style for everything, then 4 character styles (1 for each color). Depending on what the color signifies, you may be able to use GREP to apply the colored character styles (Like if all people from Nowhereville get a red color, you could use a GREP style to do this for you automatically).
If they are a repeating pattern, then yes, you can use Next Style.
Copy link to clipboard
Copied
Thanks to everyone for taking the time to respond!
Unfortunately, unless I'm misreading, no-one's solved my problem.
I think I didn't provide enough information in my original post. The 2000 or so paragraphs are seemingly randomly coloured.
(There is actually a pattern: the colours indicate the size of the property owned by the people named in each paragraph: red = 8-20 hectares, green = 20-40 ha, and so on. For the unmetricated, 1 hectare = approx 2.5 acres. So for all intents and purposes they're random. The original file is generated in Excel, sorted by property size, coloured appropriately, re-sorted alphabetically, copied and pasted into Word, saved as either docx or rtf, then finally placed into indd.)
They're also listed alphabetically, separated by a large capital letter, hence
etc for 1995 or so more lines.
So I have a paragraph style for the individual letters which I apply 26 times (takes a few minutes but no biggie) and what I want is a paragraph style for all the rest that ignores colours.
I could have 4 different paragraph styles, one for each colour, but that would be a nightmare to apply. I would have to go through the list and apply the red paragraph style to the reds - up to 500 times, then the greens, and so on. If they were in 4 contiguous blocks of colour that would be no problem, but they're in alphabetical order, not font colour order.
I thought I'd solved the problem thus:
Initially I formatted one paragraph as I wanted, then highlighted it and created a style based on that paragraph. That failed because it applied the colour of that paragraph to all paragraphs.
So I highlighted enough paragraphs to include all 4 colours and created a style based on that. At first I though it worked, but when I applied that style to the whole document, most paragraphs retained their original colours, but some, at random, changed. So that didn't work.
I tried applying [none] Character style first, but that didn't help.
I've tried having 4 different character styles, but, like having 4 different paragraph styles, that's impractical because it has to be applied on a line-by line basis (or perhaps several contiguous lines of the same colour), ie, hundreds of times.
A couple of respondents mentioned scripts and/or GREP. I know of their existence, but my skill set doesn't stretch that far!
To summarise: I want a paragraph style that doesn't affect colour.
(<rant> This should be dead simple. And as I said in my original post, this is something that Macromedia Freehand did out of the box. In moving from ancient FH to modern Indesign/Illustrator, I expected progress, not regress!</rant>)
For those who are still awake and keen, here's a link to an extract from a genuine file as seen in the pic above:
Microsoft OneDrive - Access files anywhere. Create docs with free Office Online.
Copy link to clipboard
Copied
As long as the text is all in one story (which it seems to be), I think this would be most easily accomplished without using styles. Just put your cursor in the story, select all (Ctrl-A) and adjust leading until it fills the page.
Copy link to clipboard
Copied
"As long as the text is all in one story (which it seems to be), I think this would be most easily accomplished without using styles. Just put your cursor in the story, select all (Ctrl-A) and adjust leading until it fills the page."
Thanks for the quick response.
Yes, I've tried that, but that also resets all the section headings - the uppercase "A", "B" etc to the same as the body. So I have to go back and reset them to their own paragraph style - 26 times.
In reality, I do just that, anticipating how much space the "A", "B" etc will need once they're enlarged.
That works, but oh how much easier and nicer if I:
1. Applied one paragraph style, once only, to everything
2. Applied a different paragraph style, once only (but 26 times x once only) to the headings
3. Adjusted the styles to suit.
Copy link to clipboard
Copied
If the beginning is 2,000 "colorized" paras and you only want 1 para style, simply "mark" each para depending it's original color!
If "black", do nothing.
If "red", insert 1 "non-joiner" at the beginning of the para, associated to a simple grep style => "red" char style
If "blue", insert 2 "non-joiner" at the beginning of the para, associated to a simple grep style => "blue" char style
If "green", insert 3 "non-joiner" at the beginning of the para, associated to a simple grep style => "green" char style
Simple with 3 regex.
Now, select all the text and apply 1 para style. It will include 4 grep styles [so 4 Grep codes], one for the "group", the 3 others for the red/bleu.green colors!
I let finish the Grep experts! …
Best,
Michel
Copy link to clipboard
Copied
Hi Ian,
I would like to know if the steps suggested above helped you?
Kindly update the discussion if you need further assistance with it.
Thanks,
Srishti
Copy link to clipboard
Copied
Just to pass on my idea to you so you're not stuck waiting days for a reply:
I have 5 character styles defined: 1 for red text, 1 for blue text, 1 for black text, 1 for green text, and 1 for the Alpha section header. I have 1 paragraph style defined that matches your body style.
Inside the paragraph style are 5 grep styles, as seen here:
Alpha Section finds instances of only 1 uppercase letter in a paragraph, followed by a tax (since that's how your document is set up) and changes it to the character style making it big and bold.
Red is finding all lines that end with a tab then a number between 8 and 20 and making them red.
Green is finding 21-40. Blue is finding 41-60. Black is finding 1-8. (sorry, I set this up before I had the full size range details in your sample, and was assuming the P number in the row was property size? If P has nothing to do with the property size, then this may not work for you at all, but may give you ideas for other options?)
Anyway, this may work for you, or even give you a new avenue to explore. One thing I did find out is that there is no way to make a paragraph style ignore the color option. You may be able to get around that by setting the color to None, but if you cleared overrides on the style (the + sign beside it), your text would still revert to invisible, unless it also has a character style applied to it.
Copy link to clipboard
Copied
To me, this looks like a perfect job for a plugin such as InData (there are a number of others), where you can apply styles based on data (if/else).
Copy link to clipboard
Copied
Hey Ian. So what you're working on in ID doesn't actually have the property size that defines what color the text is? I actually have a grep that would deal with all of it, but based on the property size being in the text.
Copy link to clipboard
Copied
Hi there,
I suspect this has already been addressed for the original OP, but I have to provide the insight here for any other like me searching for this fix:
Copy link to clipboard
Copied
This is a really old thread here, but since it's been revived, if the point is to fit the copy and you have a type size that's readable, why not just set the frame fitting options to vertically justify?