Stop automatically adding a tab at the start of every line with a heading style

OS: Windows 11 Pro, 64-bit
LibreOffice Writer: 7.4.5.1 (x64)
File Save format: odt

EDIT: Steps to reproduce the problem:

  1. Create or open an ODT Writer document that already has some paragraph Headings used in the document.
  2. Copy some code from a SQLQuery window in SQL Server Management Studio (SSMS) version 19.0.1.
  3. Paste into the ODT Writer document. Not only does the new text come in formatted, but this action also screws up the appearance of the Headings that previously existed in the document; those Headings are all now indented.
    I understand that normal paste copies in the formatting, so that the pasted text preserves tables, colours, etc. But changing the paragraph style for Headings so that the entire remainder of the document is changed is wrong behaviour; I am pretty sure most users would say this should not happen.

My various documents behaved correctly until about a month ago.
Now, in various Writer documents, all paragraph headings get automatically adjusted to have a TAB at the beginning. This happens for new heading I am adding, and also automatically alters all headings throughout an existing file.
None of the headings have numbers at the front; sample heading is: Structures
I created the headings with the “Set Paragraph Style” dropdown list from the toolbar, not with a numbering toolbar button.

I have checked in Styles > Manage Styles > the Heading 1 style > Modify > Indents & Spacing. In this dialog, the Indent Before text is correctly set at 0.00 cm.
I did not do anything to ask Writer to automatically add these tabs in front of every header throughout every document I open. This is extremely annoying.

Although less annoying, I notice that there is now also a thin vertical gray line at the beginning of the header text for every header. Deleting the TAB and the first letter of the header text does not remove this thin line.

This seemed to start after I cut-and-pasted some text from Word. That should not be able to alter the styles in more than at most the current document however; allowing this action to alter the template used for all documents is virus-like behaviour.

How do I stop this auto-add of tabs before every heading? Thank you.

EDIT: Work around to remove this infected setting:
Save the document as RTF (Rich Text Format) from within Writer. Then close and re-open the new RTF file. Then save that back as ODT.
Now the new ODT file does not automatically add TABs anymore. So there is some setting in LibreOffice that gives this behaviour, which RTF apparently does not support and therefore RTF stripped that setting out.

To be able to get some help, edit (= modify, don’t answer with a comment) your question to mention OS name, LO version and save format.

You seem to make a confusion between header = text repeated the same at top of every page and heading = title paragraph for chapter, sub-chapter, … Since you reference Heading 1, I’ll assume your are concerned with headings.

Important point: when a heading is numbered, Before text indent becomes ineffective. This setting is taken over by Tools>Chapter Numbering, Position tab. This is where you request the number to be followed by a space, a tab, a newline or nothing.

Also, don’t add a list style (a numbering) with toolbar buttons. You’ll create a confusion between Tools>Chapter Numbering and the added numbering. A paragraph can have only one numbering. For headings, Tools>Chapter Numbering is the way to go to avoid conflicts.

The thin gray line means some metadata is associated with the paragraph (this gray line doesn’t print). In this case, it is probably a bookmark or reference point added by the Heading n engine to allow to quickly jump to the heading from the TOC.

I found an example that does not require any program other than Libre Office.
Copy the A1 cell from the attached ODS file , into the attached sample ODT file. Prior to the paste the ODT heading paragraphs will not be indented; but the paste will mess that up.

Note that the ODS file was originally an XLSX document, so there may have been some extra formatting brought in from Microsoft. But the ODS file is now obviously a Libre Office file.
Sample file with bad source.ods (13.1 KB)
Sample-before paste.odt (13.9 KB)

There is probably something broken both in your .ods and .odt documents. The only workaround I found to avoid changes in your headings is to paste as unformatted text. I include the .ods in the malfunction candidates because this spurious tab appears also when I manipulate your document without reference to external data. I even tried to recreate a “clean” file by opening a blank document, pasting the present contents as unformatted text and restyling the paragraphs. Alas, the same change occurs on the headings.

You should perhaps submit a bug report so that developers can have a look at the documents encodings (attach both your documents).

tdf#151728

You earlier created the following; I assume that is a valid bug report.
tdf#154790

Thank you.

Brilliant. Thank you. I was losing my mind,

Simply pasting text from another source can introduce unknown hidden code. I always recommend using Paste Special>Paste Unformatted Text to avoid this.

As you mention, however, this should only affect the current document.

When you checked the Indents & Spacing tab, did you also notice the setting for First Line indent?

Indent section, within the Indents & Spacing tab within the dialog “Paragraph Style: Heading 1”, has the following three values; all are set to 0.00 cm:

  • Before text: 0
  • After text: 0
  • First line: 0

@Dale: Read my comment under your question. If your headings are numbered, left indent gets controlled by Tools>Chapter Numbering (if you didn’t add numbering with toolbar button) and settings in Heading 1 have no effect.

Thanks for your suggestions ajlittoz. I am not using numbered headings at all in the affected documents. (I do understand those; I use them in a different document.) So each (unnumbered) heading shows only the text.

I just did a test.
I first checked that the ODT file still has the stupid automatically added TAB for any (paragraph) Heading that I add; problem was still there.
I then saved the document as RTF (Rich Text Format) from within Writer. Then I closed and re-opened the new RTF file. Then saved that back as ODT.
Now the new ODT file does not automatically add TABs anymore. So there is some setting in LibreOffice that gives this behaviour, which RTF apparently does not support and therefore RTF stripped that setting out.

I am glad that I have a work-around. But this does not answer either where to find and fix that setting in Writer, or how this stupid setting got copied to a bunch of my other documents. I ran some tests, and a bunch of my documents do not exhibit the bad TABs, so this behaviour only infected some of my documents, not all.

Can you attach a short 1-2 page sample file with the faulty behaviour? If you feel text is private, replace it with silly words.

I can add the sample document, but unfortunately you will not be able to reproduce the problem unless you have access to SQL Server Management Studio (SSMS). (See the “Steps to reproduce the problem” section at the top of my first comment; I added that section.)

I am not permitted to upload more than two links, so I’ll just put the document that shows the end result; “Sample-after paste from SSMS.odt” to see what happens.

Thanks for looking at the problem. I also submitted a bug for this; see 154790 – Copy and paste alter all Heading paragraph styles throughout the remainder of the document
Sample-after paste from SSMS.odt (14.7 KB)

I have no SSMS because I’m under Linux. However I could analyse your sample. Your insertion of SSMS data has effectively damaged your document formatting. From the Style Inspector, your Heading n have received a list numbering of some sort though I can’t identify it. It is clearly not Tools>Chapter Numbering because it is set to [None]. If you enable it, everything behaves as usual.

The problem is caused by this list numbering which remains invisible. This is no direct formatting since Ctrl+M has no effect. What does your SSMS data contain? Does it come for a TEXT column, eventually containing RTF? A BLOB (binary large object data) allowing absolutely arbitrary content? If this is RTF, could you attach a sample? It may be that the Writer input filter does not understand some M$ directive.

The workaround I found was to customise Tools>Chapter Numbering, Position tab where I set Numbering followed by to Nothing in all levels. Of course, if you later change for heading numbering, don’t forget to reset it to Tab stop.

Thank you for your persistent investigation and your suggested workaround ajlittoz.

For your question of what I copied in: I am copying in a fragment of Transact-SQL code from the Query window. (So a bunch of text/letters; no objects, blobs, or tables.) Even just copying in a fragment of two lines that has just a code comment gives the problem. Note that the incoming paste does contain colouring, and obviously the damaging list numbering.
Although irrelevant, I find it very odd that SSMS is trying to send list numbering format info with a fragment of code. AFAIK, the code window does not even support any lists; it’s all just lines of code.

Perhaps you might try Paste Special and choose Unformatted Text as the paste option, if available.

Late to the party here, but I do not see this tagged as solved, so I offer my two-bit workaround.
I also cannot repeat the behavior described, but this fixes other style issues with files that have touched Microsoft context, so I suspect that this workaround may work also. Only useful if you need the styles preserved from the database report output. Otherwise just Paste special - Unformatted as @TXDon suggests.

Workaround

  • Save the SSMS output to a separate file.
  • Insert the document as “subordinate”, by either …
    • Use Insert - Text from file to insert the intermediate data into your work document.
      … or …
    • Insert a section, and link it to the file

The target document will then (hopefully) behave as “Master” and override style modifications present in the source doc. Note that with the Insert Text option, you can delete the source file, but if you link a section, you probably need to keep that source file.

You may also want to check whether “Automatic update” is enabled in the affected heading style of your target (main work) document. Again I cannot provoke the error from this setting, but I envision that it may be a possible enabler of the behavior as described.