Em spaces kept at end of lines

While preparing a copy of an old book, I’ve experimented with using em spaces between sentences, as this was the practice used when the book was printed. However LibreOffice doesn’t treat em spaces like spaces. If a justified line ends with a full stop followed by a space the space is normally ignored, but if it’s an em space, Writer keeps the space and prevents the line from being correctly justified.

I thought that in Unicode an em space was semantically identical to a space…so, is this a bug?

With em spaces

With regular spaces

That works in plain English text as well. It works as it should in Calligra Words (but what a terrible interface:=( ), so it might be a bug. Filed a bug report: https://bugs.documentfoundation.org/show_bug.cgi?id=144824. Please sign in there and add a comment to confirm.

I skimmed over the Unicode specification for line breaks (UAX#14) to check EM SPACE properties.

It is effectively considered a spacing character. They create an opportunity for line break, but the standard is silent about the fate of the character itself.

From personal experience, only U+0040 SPACE is removed from line display when it occurs in last position, causing expansion of other SPACE characters. All other spacing characters are kept, resulting in what you see.

Unicode is also slightly not really explicit about the width adjustment of other-than-SPACE characters. It looks like that they can be adjusted but it is not mandatory (some of them seem to have a fixed width, though).

Anyway, Writer considers other-than-Space characters as always-kept and fixed width when justification is in effect.


Bug or not bug? I don’t know. You seem to hint that hot-lead typography suppressed them at end of lines. Then Writer should try to mimic this. But this needs some deep reflexion about the consequences. Is suppressing spaces from layout in this context harmless for all documents?
You may try to submit an enhancement request on https://bugs.documentfoundation.org/.

As a workaround, would double spaces between sentences work sufficiently well?

That’s exactly what RoryOF from the Apache OpenOffice forum suggested to me in a PM (he isn’t registered here). Make sure to allow double spaces in Tools - Autocorrect options.

I am not convinced that double spaces would solve the issue. First it uses a pair of characters which means a line break may occur between them, unless a sequence of SPACEs is considered as “collapsible” when it occurs at end of line, which does not seem to be the case (I already saw small misalignment at start of line due to involuntary double spaces between words; a SPACE at start of line is not suppressed). Second it causes small “irregularities” when excess spacing is spread over the available SPACE character. This requires a sharp eye to be noticed but it is there.

So Delete spaces and tabs at end and start of line (Tools - AutoCorrect - AutoCorrect Options - Options tab) don’t work here.

As a workaround, Find All ". ", and apply Character spacing of 5 pt (or another value). A character style would be useful here.

By the way, after unchecking Delete spaces and tabs at end and start of line, I needed to restart LibreOffice for it to stop hiding the spaces (LibreOffice 7.0.6.2 on Windows 10.0).

Edit: The strikethrough that I wrote may be due to my confusion with Justified paragraph. But, for the deletion of spaces to apply, I need to choose menu Tools - AutoCorrect - Apply.

1 Like

ajlittoz: They don’t solve it, but a normal space at the end of a line is less of a pain than an em space.

@floris_v: right, but to be accurate, the space at end of line will be suppressed and the one at start of line is kept (not very noticeable anyway).

Not in my case. What may be the difference?

Edit: Following your comment, now I understand that it is not an automatic line break. Thanks.

LeroyG: In my understanding, deleting spaces at the start and end of lines in autocorrect really means deleting them at the start and end of paragraphs.

Testing normal spaces at the beginning of a line they are suppressed as well, unless it is the start of a new paragraph. This is with AutoCorrect ticked to suppress them of course.

You are absolutely correct about variations in spacing between sentences and in this case the m space would be preferable.

@floris_v:

Lines and paragraphs are not the same. And both options work.

delete spaces

2 Likes

@LeroyG: Due to specific needs in my documents these AutoCorrect options are not ticked because under some styles (usually derived from Preformatted Text) spaces are significant (computer program examples). This has consequences on the rest of the document, so I must be very careful about what I type.