Drop caps for first paragraph in chapter in InDesign
Is there a way to format paragraph styles so that only the first paragraph in each chapter gets a drop cap?
So far I have seen this solved by saving a "first_paragraph" style and a "regular" style to be the next-style, however I am modifying an imported text, so I need it to be able to automatically change all first chapter paragraphs.
Is there a way to de this without introducing separating into two paragraph styles?
Different styles are for different styles
You don't want one style to produce two different visual results. That would be a very strange feature. What you're after is automation of applying the styles. That makes sense.
I assume you have your whole book chained in one text flow. And the styles surrounding your chapter text are already in place from the source. The source doc should have the basic semantic framework in place.
So from the source file your styles should look something like this:
heading-chapterTitle > heading-chapterSubtitle >> heading-leadingQuote >>> text-base >>> text-base >>> ... heading-chapterTitle > ...
Break each chapter into it's own source doc prior to import. Assuming your style flow is
opening stuff >
end of chapter as I outlined above, you should be able to select the frame at the start of the chapter and
apply style then next (or whatever it's called). Problem solved.
^ There's also a slick scripting solution for that, but it breaks the "easy answer" promise.
Assuming a structured pattern like my outline, InDesign has all the search power to do the style application for you.
- Do a GREP search for
- Set the applied paragraph style in your find query to the text style.
- Set the applied p-style in replace to your "text-opener" style.
That will set the first paragraph in a sequence of text-styled paragraphs to your desired style. The problem is, you can only run it once and you need to be sure you don't have the opener style applied anywhere yet.
Write functions to:
- Crawl through the text and find the chapter opening block.
- Target the next paragraph (the beginning of the chapter text).
- Apply your "text-opener" style.
- Repeat until you reach the document's end.
InD gives you script access to all the search functions your heart desires.
If you're new to scripting, it may sound daunting at first. It's really not that difficult and there are plenty of people on Adobe's forum to help you out. I haven't written scripts for InD in a long while, but if I find something to get you started, I'll post it back here.
[ UPDATE ]
Here's an example that shows you how to access your paragraph styles and apply them. In this case, it's just operating on the selected story and applying according to the order of the paragraphs. Not a very flexible approach (compared to searching), but it might work for you.
var mySelection = app.selection, paraStyle1 = app.activeDocument.paragraphStyles.itemByName("style1"), paraStyle2 = app.activeDocument.paragraphStyles.itemByName("style2"); mySelection.paragraphs.appliedParagraphStyle = paraStyle1; mySelection.paragraphs.appliedParagraphStyle = paraStyle2;
Another option: Don't learn, just pay for it. This fine scripter has already solved your problem and packed it up nicely.