un-Collapse spaces at the end of line

Hello all,
I have a file (I’m almost sure that I created it from scratch in LibreOffice).
When the paragraph is right aligned, the extra spaces go to the right of the paragraph mark.
imagen
I can Clear Direct Formatting, but I wish to know where this came from. It is not the AutoCorrect option to Delete spaces and tabs at…

Here goes a reduced sample file: un-Collapse spaces.odt (12.0 KB)
Thanks in advance.


Version: 7.3.7.2 (x86) / LibreOffice Community
Build ID: e114eadc50a9ff8d8c8a0567d6da8f454beeb84f
CPU threads: 4; OS: Windows 6.1 Service Pack 1 Build 7601; UI render: Skia/Raster; VCL: win
Locale: es-MX (es_MX); UI: en-US
Calc: threaded

Very strange. I suppose it comes from an interaction with the justification algorithm.
The same occurs with center and justify (try with “lorem ipsum” and add spaces). When a line break occurs, the last word is flushed against the margin/indent. Spaces are anyway displayed as blue dots to remind user they exist. I thought that only one space was taken into account, the others used as “ordinary” characters either at end or beginning of line. Apparently, any run of consecutive spaces is considered a single space at end of line.

Perhaps someone familiar with the justification algorithm could give details.

Here, LO 7.4.5.1 under KDE Plasma and Linux

1 Like

I cannot clear it with Clear Direct Formatting. I added some text which showed the same effects and then created a new paragraph style from the selection and pasted that into a new document. I did the same with character style but neither would push the spaces beyond the margin, other than the single space to which @ajlittoz refers for lines within the paragraph.
That leaves Page Style and I tried to re-create it but I cannot interpret the + TRUE + FALSE in the Organiser tab. Top screenshot is from my attempt to recreate, bottom from @LeroyG

Note that @LeroyG’s document has several issues though it is simple (or it disturbs my copy of LO). If I request center alignment, “aa” and the pilcrow go to the center but blue dots and pilcrow remain in the right margin. I must “update all” to erase them. When I restore right alignment, only “aa” remains visible, Blue dots and pilcrow are not repainted in the margin. Again “update all” is necessary to show them.

From reading the corresponding .fodt, the possible flags are:

  • style:layout-grid-ruby-below=“false”
  • style:layout-grid-print=“true”
  • style:layout-grid-display=“true”
  • style:layout-grid-snap-to=“true”

The text itself is (broken into lines to make it more readable):

<text:p text:style-name="P1">
<text:span text:style-name="T1">aa </text:span>
<text:span text:style-name="T2"><text:s text:c="4"/></text:span>
<text:span text:style-name="T3"><text:s/></text:span>
</text:p>

Paragraph style “P1” is Standard, not Default Paragraph Style, which suggests the document was perhaps initially made with Word, though I can’t see the usual “signatures” of this in the style dictionary. The “Tx” character styles are the rsid markers for track changes feature.

Note that the terminal spaces were entered in 3 steps:

  1. with “aa”
  2. 4 spaces
  3. one additional space at end

I also see that the pilcrow is painted immediately right of “aa” which results in weird cursor movement when you use the right arrow. Center the paragraph and start at left of first “a”. This painting order makes difficult to see there are effectively 6 spaces. At 100% zoom, I see 3.5 blue dots. 400% shows only 5. If you add a character at end, 6 spaces are effectively hinted now.

2 Likes

It is easy to recreate in Word 2010, it seems to be default behaviour for right aligned text in Word. If I create a new document, right-aligned document with spaces at the end, and save as .docx from Word then the same behaviour occurs. The behaviour is retained if files is then opened in Writer and saved as .odt
un-Collapse spacesFromWord2010.docx (12.5 KB)
un-Collapse spacesFromWord2010.odt (10.1 KB)

The behaviour of un-Collapse spaces.odt might be inherited through the A4.ott template mentioned in one of the .xml files

1 Like