2

Is there any way of adding specific sequences of characters at the start and/or end of every instance of a determined paragraph style?

I could do this using Grep find & replace, but then the text would be 'fixed'.

What I'm searching for is a way to emulate adding content using ::before and ::after pseudo-elements in CSS...

  • 1
    Just out of curiosity, is string an accepted term outside of computer science? – Hanna Apr 8 '15 at 19:27
  • Hm, it hadn't occurred to me that this could be an issue, but you're probably right. String = a sequence of characters. – calua Apr 8 '15 at 21:22
  • "String" always works for me when referring to a collection of alphanumeric characters. Not sure it's "only computer science" – Scott Apr 8 '15 at 23:18
1

I don't have any help for similar-to ::after functionality, but the following should work for ::before.

Though it likely wasn't intended for this purpose, you can just customize a numbered list to accomplish this. Just choose List Type: Numbers, and in the Numbering Style section, change Number: to desired string sequence of characters.

String as numbered list

At any time, you can go back in to the Paragraph Style, and update that Number field to change it throughout.

  • Thanks! I think a solution to the ::after functionality is probably not possible without scripting, like @Alan said, but yours is a very interesting solution to the ::before problem. – calua Apr 13 '15 at 11:10
0

You can do this with text variables: Type > Text Variables.

In this case, you'd select Custom Text as the variable type when you define them, and insert the appropriate text. Any time you change the text in the variable definition, it will change in the layout.

One caveat: a variable looks like text, but it is actually a single character. That means you can't nest character styles inside a variable, and there is no such thing as a line break. If you need either of these, then you'll have to use a script.

  • But how can I associate a text variable to a paragraph style? Imagine the following: I have a list of names. I want each to be preceded by 'Name: ', but I don't want to have to add this to the text (maybe in the future I will change 'Name: ' to something else, for instance). Is this possible? – calua Apr 9 '15 at 11:22
  • I'm guessing you don't have access to FrameMaker... It's a real pity Adobe treats it like a red-headed stepchild. – Voxwoman Apr 9 '15 at 12:35
  • Don't get me started. There's a ton of stuff in Framemaker that really, really should migrate to InDesign. – Alan Gilbertson Apr 9 '15 at 17:55
  • @calua Not everything is a built-in, one-click automated solution. For that to work, you need a script. On the other hand, if you just want to have the option to hide/reveal, make the variable Conditional Text. – Alan Gilbertson Apr 9 '15 at 18:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.