Reduce/remove extra vertical spacing between selected styles

OS: Debian Bookworm (aka Testing).
LO: 7.4.0.2 (Installed from Debian repository as 1:7.4.0_rc2-3)

Background:

I am using LO to write screenplays (I’m using that term to avoid “scripts” which is highly ambiguous in a computer context, “character” in the following means naming the person who will speak). Screenplays have highly prescriptive formatting rules, e.g. dialogue starts 2.5" from left, character names start 3.7" from left and have a blank line above them, scene headers are at the left margin and have blank lines before and after.

I really want to avoid the error prone process of manually typing blank lines & setting margins so I am using custom styles to control the layout, I have built the margins and spacing rules (Above paragraph/below paragraph) into these styles. When I want a character, I select the character style, a dialogue: dialogue style, action: action style, …

Problem: Scene headers are preceded and followed by a blank line. Character names are preceded by a blank line. When the first thing in a scene is a character I get spacing from both styles, giving twice the spacing I am required to have.

I do have a work-around, additional styles that lack the vertical spacing, for example, Character has an alternate version Character_AS (After Scene). Having to manually select these is error prone, so I am already considering writing a little python script to fix the styles, but before doing that, is there a proper way to get rid of those double spaces?

Thank you

Word just uses the single largest spacing between paragraphs which sounds like what you want. There is a setting in Tools > Options > LibreOffice Writer > Compatibility called Add spacing between paragraphs and tables. If that is unticked you should see only one line between Scene and Character paragraph styles.

Downside:

  • The spacing would still be there if viewed on a default version of LibreOffice. If the final output is pdf or printed document it shouldn’t be an issue.
  • It is a global setting so would apply to all documents. Consider a parallel installation.
2 Likes

Excellent! A quick test gives me what I want to achieve, thank you.

I haven’t experimented in any depth, but the options screen suggests that the change is just for the current document (With an extra button to make global). If I’m reading it right, I can add it to the template for screenplays so any new screenplay document I start will be correct.

I faced such a situation and solved it differently.
Writer offers settings for both spacing above and below paragraph while theoretically only one of them is sufficient.
Take a sheet of paper and sketch all possible sequences of scene, dialogue and character you’ll ever use. It is usually possible to set spacing above and below so that below+above (taken from styles in the sequence) gives the expected result.

Another solution with your Character_AS variant(s) would be to “chain” the styles though the Next style parameter in the Organizer tab. This will work if your sequences follow a strict pattern, like scene header, character, dialogue. By attaching keyboard shortcuts to your styles, you can override the next style.
More details on this approach if you provide more info on the screenplay structure (eventually with a sample covering all cases).

2 Likes

Yes, “Add spacing between paragraphs and tables” is available on a per-document basis. It’s stored in the AddParaTableSpacing line in the settings.xml subfile in the .odt document. I’ve also noticed another setting “Add paragraph and table spacing at tops of pages” (AddParaTableSpacingAtStart in settings). Between these two settings practically all my screenplay formatting woes are history. Once again, thank you so much.

Thanks, but EarnestAI’s solution has solved my problem. I’m already using the next style setting for the most common case, but as the order of styles quite often varies, it’s usually easier for me to just select the style for each paragraph that needs it.

Your Character_AS + Character pair is a very common trick. Character_AS next is Character and Character loops on itself. And if you add a keyboard shortcut to Character, you can override Character_AS as set by the “next chain” by using this shortcut when the automatic style assignment as applied the style where you don’t like it.

My suggestion about sophisticated configuration for above and below spacing is motivated by my distrust against all compatibility tricks. Being compatibility they are dependent on today compatibility goals which may not be the same tomorrow.