We are exporting content from our CMS into InDesign via RTF. All content has style names applied automatically, including italics which has an italic
character style. italic
has the Font Style set to "Italic".
This works great, except one of our paragraph styles (intro
) sets Font Style to "Italic" as well. In these cases, we would like the italic
style to remove "Italic" from the Font Style.
I came across this question which wants to do something similar, but both of the answers require manual intervention, which we're trying to avoid at all costs.
As far as I can tell, it's only possible to specifically set Font Style globally with a character class. That is, it isn't possible to have it apply different styles based on the parent paragraph style.
Ideally, we would like to have the italic
style switch between "Italic" and non-italic automatically. In CSS, this would be achieved like this (I know toggle()
doesn't work yet, let me dream):
.italic { font-style: toggle(italic, normal); }
Alternatively, we could settle for setting the Font Style different when it appears within a intro
paragraph. For example, in CSS:
.italic { font-style: italic; }
p.intro .italic { font-style: normal; }
Is there any way to achieve this behavior in InDesign with styles?
We don't do the import very often (a few times in a short period of time every few months), but each import is rather large, so it's both time-consuming and error-prone to fix these by hand. With that said, if there's a way to do a single search and replace that takes care of this, that could also be acceptable, but anything that needs to be done for each instance is out of the question.
Note: We are looking into changing the RTF export to use a different style name for italics within intro
, but are hoping for a better fix.
Setting up InDesign document
To set up a sample InDesign document, follow the instructions below. These instructions will create an InDesign document with italic
and intro
that are both "Italic".
Copy the following text into an empty file and save as
sample.rtf
:{\rtf1\ansi{\fonttbl{\f0 Times New Roman;}}{\stylesheet{\s1 intro;}{\s2 text;}{\*\cs3 \additive italic;}}\sectd\s1{Intro paragraph with {\*\cs3 italic} text.\par}\s2{Non-intro paragraph with {\*\cs3 italic} text.\par}}
Place
sample.rtf
into an empty InDesign documentSet Font Style to "Italic" for
intro
paragraph styleSet Font Style to "Italic" for
italic
character style