-1

I'm laying out a bibliography in ID, and I need a way to insert a non-breaking space after initials, so A., B., etc. don't end up at the end of lines.

Thanks in advance.

0

2 Answers 2

1

Find any uppercase, followed by a full stop and a space:

 (\u\.)\s

And replace with the same letter and full stop, followed by a non-breaking space:

 $1~S

Or see my other answer here which describes a different solution to a similar situation.

1
  • 1
    Alternative: a GREP style that applies No Break – a fire-and-forget method.
    – Jongware
    Oct 29, 2020 at 15:19
-2

Figured it out:

Find:

(A.|B.|C.|D.|E.|F.|G.|H.|I.|J.|K.|L.|M.|N.|O.|P.|Q.|R.|S.|T.|U.|W.|X.|Y.|Z.)(\s)

Change to:

$1~S
2
  • 1
    This is very inefficient. You’re completely bypassing the whole concept and point of regular expressions. See Lucian’s answer for a much better and greppier way to do it. Oct 29, 2020 at 15:07
  • 2
    The full stop will match any character after an uppercase. This will mess up your text.
    – Jongware
    Oct 29, 2020 at 15:18

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.