Skip to main content
Inspiring
July 6, 2017
Question

Small words on end of lines in paragraphs

  • July 6, 2017
  • 2 replies
  • 10629 views

I've recently had a job where in paragraphs I was asked to around to the next line any one, two or three letter words so these words weren't looking like they were out on their own (even if they fell shorter than any line above or below). Never have I been asked to do this before, and I mentioned this to a friend, and he said you can set this in a style sheet or paragraph setting.

Does anybody know anything about this? If so, could you enlighten me please?

BTW: I know you can set a minimum of how many letters fall at the end of a line when using hyphenation by not breaking words under a user defined amount, but I wasn't allowed to use hyphenation.

Thanks.

Mat

    2 replies

    Erica Gamet
    Inspiring
    July 10, 2017

    I have a GREP expression I use in paragraph styles...where I apply a "no break" character style to a certain number of characters at the end of a paragraph. To make sure the last 12 characters, for example, don't break, I use .{12}$.

    I have a YouTube video explaining it in detail here: How To Eliminate Text Orphans and Widows (Runts)! - YouTube

    Inspiring
    July 13, 2017

    Is there a GREP command that applies to the end of each and every line rather than the end of each paragraph?. That would work.

    Currently I have tried things like:

    (\s.{1,3}\s)

    ...but this creates ugly paragraph shapes because you could have a run of one to three character words and they all have the no break style applied. E.g.: 'Is it fun to go ski if you can do it but do not like the cold?' This line doesn't break at all because there are too many one, two and three letter words that are having no breaks applied.

    From what I can tell, there doesn't seem to be a GREP command that looks at the end of each line. Am I right? Please do tell me I'm wrong if you know otherwise, but at the same time as you are telling me I'm wrong, I'd really appreciate you telling me what the command is!

    Thanks for your advice so far.

    winterm
    Legend
    July 13, 2017

    Well, that was your original request: to around to the next line any one, two or three letter words.

    Regex \b.{1,3}\b\K\s does exactly that.

    I second Erica: there's no regex for the "last character in a line". And I'm not able to see how it could help you if it were.

    Regarding your sample sentence: it only means that formal letter counting won't work for you. Well, create your own list of the words you don't want to see at the end of a line then.

    Here's the one "no lines ending with indefinite or definite articles":

    \b(a|an|the)\b\K\s

    Feel free to expand the list until you and your client will be satisfied with the result.

    Legend
    July 6, 2017

    Try check-marking Balance Ragged Lines under Indents and Spacing.

    winterm
    Legend
    July 6, 2017

    It should work, but not necessary save you from all cases of short 'hanging' words.

    Another possible approach: GREP that searches for whitespace preceded by a 1 or 2 or 3 letter words. Then apply a „No-Break” to the whitespace.

    \b.{1,3}\b\K\s

    You should create NoBreak Char style and implement GREP style in your para style.