You will need to create a new paragraph style for the first paragraph of each chapter. Then add the drop cap to that paragraph, and used a nested character style to format it the way you want it to look. Once it is working on the first paragraph, you can manually assign it to the other first paragraphs in each chapter.
You are asking in the InDesign scripting forum—is that because you don't want to manually assign the paragraph tag to the first paragraph of each chapter? It won't take that long. I can't tell if you are stuck on how to assign the drop cap to just the desired paragraphs, or if you need this to be automated.
I'm posting here because I would really like it to be automated.
Thank you for your answer anyways!
Surely not automatic but 1 simple regex could be enough (no need to use another para style or a script)!
So, just 1 click!
Michel, for FRIdNGE
I've just tried what you suggest on my file but when I try "Find" it shows the message "Cannot find match". What can I do?
I think the idea is great, it's exactly what I was looking for!
Thank you very much,
Hi Michel [FRIdNGE],
Since I'm new in the regex use, it would be really helpful if you can provide the expression. Thanks !
[...] it shows the message "Cannot find match". What can I do?
Elisabeth, Jean-Claude’s regex works just fine, and does what intended.
2 things first:
1. Ensure you’re working in a GREP tab of Find/Change panel.
2. Double check if you copied the code right. Don’t rewrite it looking at the browser window, just copy/paste directly to Find What field.
Another thing, I would create a separate para style with drop cap, to put in Change Format field, instead of entering format settings directly. Just for better future management.
1 person found this helpful
Your question could be summarized as:
Find any not-empty paragraph preceded by an empty paragraph!
In Grep, as previously indicated, this is simply written:
^\r for any empty paragraph
. for any character (excluding jumps! this avoids to catch any empty paragraph preceded by an empty paragraph)
\K syntax [CS6 +] for lookbehind = "preceded by ..."
I'd linked this thread yesterday [for fun] and posted this screenshot on "The Treasures of Grep" Facebook group of our friend Jean-Claude Tremblay, imho the finest place to find answers to Grep issues!