GREP style formatting suppression
- This topic has 2 replies, 2 voices, and was last updated 8 years, 6 months ago by .
- You must be logged in to reply to this topic.
Learn / Forums / General InDesign Topics / GREP style formatting suppression
Learn / Forums / General InDesign Topics / GREP style formatting suppression
Tagged: contextual output, GREP
I would like to import text (google docs) using DocsFlow. I have text coming in as two versions in the same document, marked in google docs as [E1:this][E4:that].
I want to use grep in the paragraph style to apply a character style that I made E1 or E4, so far so good. I have done that.
The question is I want to suppress the code part, for example, “[E4:” and “]”, I just want the content shown and character style applied.
Bonus question does ID do contextual formatting. In other words, I can export PDF for E1 and a second PDF E4, so I can maintain one document but have two different outputs.
d
To make text disappear, add a character style and name it e.g. ‘hide’. Set the point size to 0.1 and the horizontal scale to 1%. And for good measure set the colour to Paper. Then define two GREP styles in the paragraph style(s) using the ‘hide character style:
^\[E\d:
^.+?\]
The first one hides [E1:, [E2:, etc, the second one hides the first bracket in the paragraph. This assumes that the first ] in every paragraph is the closing bracket of the code.
As to conditional formatting, you could look into conditional text if you want to maintain two texts in one document.
Peter, thank you… Prefect. I wish I had used my brain, I knew to use something small and call it something like hide. Nice to be reminded, I used something similar for a work project a handful of years ago. Thanks for the conditional text reference.
d
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies allows us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
To provide the best experiences, we and our partners use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us and our partners to process personal data such as browsing behavior or unique IDs on this site and show (non-) personalized ads. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Click below to consent to the above or make granular choices. Your choices will be applied to this site only. You can change your settings at any time, including withdrawing your consent, by using the toggles on the Cookie Policy, or by clicking on the manage consent button at the bottom of the screen.
You have to be logged in to save.
Not a member? Join Today - it's FREE!