Copy link to clipboard
Copied
I am doing a book layout, and I have employed several GREP styles I've used in past to control 1) runts and 2) widows and orphans. I never had problems with them before, but tonight, they are throwing random italics throughout the manuscript. If I delete these two GREP styles, everything goes back to normal. (If I delete only one or the other, the problem remains in some spots; that is, they are both throwing random italics but in different places, so I have to delete both to get rid of all of it.)
I got these GREPs from other online posts here in the forum, so I'm hoping someone here can take a look at these to see if there's anything obvious I might be doing wrong, if I've intro'd a typo somewhere, etc., or perhaps they can offer new/different GREPs for these two situations (runts and widows/orphans). Also, the only character style I'm applying is NO BREAK. Nothing else.
Here are the GREPS to which I refer:
For RUNTS -- \w+\s\w+[[:punct:]]+$
For WIDOWS/ORPHANS -- \<\w \w (I note there is a space in this one, but that's the way I copied it off the 'net, I think)
Any help would be appreciated. Thanks in advance.
The code you have for widows/orphans isn't necessarily preventing either of those. What it's doing is preventing a single-letter word or single-digit number (e.g. "a", "I", "2") followed by a space and any word character from breaking. Removing the space would just prevent the first two letters of any word from breaking, so it makes sense that the space is there.
Copy link to clipboard
Copied
That has nothing to do with the GREP searches themselves. You need to look elsewhere.
Does "random" really mean it's not applied to ALL positions where that style is applied? If you manually apply the style somewhere, does the text also become italic?
Copy link to clipboard
Copied
Glad to hear it isn't the GREPs. I have used and appreciated them and was pretty sure I hadn't made any typos in them, but one never knows. (BTW, can you confirm that the second one I wrote SHOULD have that space in it between the first "w" and the third "\"?)
I'm not sure I understand your question re where the italics are applied. I had to move on without using the GREP styles, as I was on deadline. I just now went back to try to recreate the situation -- which I absolutely could not remedy the other day by closing/reopening InD or rebooting the system -- and I can't recreate it. I don't know if the GREP styles are working but they aren't, apparently, throwing italics anymore. But in partial answer to your question (like I said, I'm not sure I understand it), italics appeared where it was supposed to, but also appeared where it was NOT supposed to. If I applied italics to some spot of text, it "took." But if I tried to unitalicize the random ones, they would not unitalicize.
But since I can't recreate the problem, I don't know that there's anything else here worth speculating about. If you could confirm the answer to my above question re the space in the GREP formula, that would be great. Thanks much.
Copy link to clipboard
Copied
The code you have for widows/orphans isn't necessarily preventing either of those. What it's doing is preventing a single-letter word or single-digit number (e.g. "a", "I", "2") followed by a space and any word character from breaking. Removing the space would just prevent the first two letters of any word from breaking, so it makes sense that the space is there.
Copy link to clipboard
Copied
Thanks much. I still have a lot to learn about GREPs. 🙂