Copy link to clipboard
Copied
Hi there, I'm new to InDesign. I am trying to apply a No Break style to this:
The (see figure19) should be on the same line. Also (see table...) should also be the same. How do I use GREP for such case?
Here's the skeleton I'm basing with:
Try this instead (and you might want to also include the parenthesis, though they should travel with the text just fine).
see (figure|table) \d+
Copy link to clipboard
Copied
You need the pipe symbol between your words in the brackets, not a slash.
Copy link to clipboard
Copied
Hi thank you Erica that was an oversight. Using pipe symbol instead of slash still would not work. Please advise.
Copy link to clipboard
Copied
See my other reply...I answered too quickly...you need ( ) around your phrases...and also the space before the digits.
Copy link to clipboard
Copied
Try this instead (and you might want to also include the parenthesis, though they should travel with the text just fine).
see (figure|table) \d+
Copy link to clipboard
Copied
Thank you very much Erica. That worked as intended. Much appreciated!
Copy link to clipboard
Copied
A couple of problems in your GREP, but still easy to fix.
First off: [square brackets] are to create an allowed set of matches for a single character. For instance, [0123] will match a single '0', '1', '2', or '3'. So, your [figure\table] will match one of these character only. Use round brackets to create "full word" matches.
Second, the backslash before the 't' forms an escape code! This matches not '\' nor 't', but a Tab character. Your expression matches a single tab, or 'a', 'b', 'e', 'f' and a few more. You probably want the OR bar | here.
Third: you forgot the space after "figure/table".
All together , this should work:
see (figure|table) \d+
Copy link to clipboard
Copied
Thank you Jongware, that worked as intended! And thank you for your valuable knowledge. I still need to learn a lot! Thanks again