GREP style formatting suppression

Learn / Forums / General InDesign Topics / GREP style formatting suppression

Viewing 2 reply threads
  • Author
    Posts
    • #78552
      Douglas Wade
      Member

      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

    • #78571
      Peter Kahrel
      Participant

      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.

    • #78572
      Douglas Wade
      Member

      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

Viewing 2 reply threads
  • You must be logged in to reply to this topic.
>