Copy link to clipboard
Copied
I need to insert a hair space between a closing quote and an end notereference using GREP.
I can find the closing quote mark by using ~}
I can find an endnote reference number (which is no longer a digit) with ~U
But putting the two together like this ~}~U finds nothing.
Why does this not work?
Thanks,
Tom
Copy link to clipboard
Copied
Hi @Tom Tomasko,
I tried this and got the same results as you, this seems to be a bug. What is interesting is that the following works
~}~F
So the endnote reference is found using the footnote reference. However, if you just try to find endnote using ~F it fails, it works only in this combination. Also the pattern endnote followed by closing quote is found using ~U~} so looks like a bug to me.
-Manan
Copy link to clipboard
Copied
Bug known! …
A way to play the game is to first "mark" the endnote char with a condition:
Find ~U
Replace by: "temp" condition
Then:
Find .(?!\X) + no condition
Replace by: $0~<
Finally trash the "temp" condition.
(^/) The Jedi
Copy link to clipboard
Copied
Thanks Jedi, but I see a problem in your method. You are looking for every endnote reference and changing it to a temp condition. But that wipes out all the endnotes. But this method seems to work.
Find: (~U)
Change: xyz$1 Now all endnotes start with xyz, whether or not the endnote is preceeded by an closing quote but the end note number remains.
Find: (~})xyz
Change: $1~< Now all closing quotes with the temp condition after have a thin space in between the quote and the endnote.
This however leaves any endnote reference number that does not follow a closing quote with the xyz temp condition. Since this temp condition does not appear anywhere else in the text (something weirder than xyz should be used) you:
Find: xyz
Change: nothing