The new Adobe InDesign CC 2019 “Indents and Spacing” › “Space Between Paragraphs Using Same Style” option is excellent. It has allowed me to replace four styles for formatting a code listing (Listing, Listing:First Line, Listing:Final Line, Listing:Single Line) with just one Listing style (see https://graphicdesign.stackexchange.com/a/101784/20096 for details).

However, now I have a new problem. I want all my Listing-style lines to have “Keep with Next” set to 1, except for the final line in the listing, for which I wish to use “Keep with Next” set to 0. The only way I know to accomplish this is to hand-select each final line of a same-style paragraph sequence, and hand-edit the “Keep with Next” value. (I know, with some study, I could write a script to do it.)

Is there a way I can configure InDesign to automatically set “Keep with Next” to a different value for the final paragraph in a sequence of same-style paragraphs?

  • 1
    It occurred to me after posting my question that in my case, almost every such Listing that I have described is preceded by a special “Body Copy, Keep with Next” style paragraph. If I stop using “Keep with Next” and instead use “Keep with Previous” in my Listing style, then it solves my specific problem. (Then I don’t need “Body Copy, Keep with Next” either.) It solves my specific problem, but not the general case. Nov 16, 2018 at 0:39

1 Answer 1


There’s no way that I can think of to accomplish exactly that, but you could do the opposite:

  • make two list styles, List1 and List2
  • set space before on List1 and space after on List2
  • set the space between paragraph using same style to 0 for List2
  • set Keep with Previous on List2 but not List1
  • set next style in List1 to List2

Then whenever you have a list, choose List1 as your style. It will get the proper spacing and will allow a break before the first item in the list; and when you hit enter to go to the next item, it will switch to List2 for the rest of the list, with no extra spacing before each item, all items kept together, and with breaks allowed after the last item.

It’s a bit of a step back (to two styles per list), but it’s at least fairly automatic and still fewer styles than previously needed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.