SOLVED: Line numbering vanishes when inserted using Insert > Text from File

I have a transcribed text with line numbering in one document.
I need the text embedded in another document.
If I use Insert > Text from file, it imports the text OK, but the line numbering vanishes.
How can I preserve the line numbering?

In principle, not at all.
The line numbering is part of the document and not the lines.
The lines have no direct connection to the numbers. The numbers are created by filling the individual lines with text.
I hope I was able to make this clear.

Thank you very much, that is very clear.
This was clearly designed and programmed by someone who did not understand line-numbering.

The answer is not to use Libre Office for Humanities research work. LaTeX does not make this mistake.

If line numbering is used for its Writer-technical meaning, i.e. a number inserted in the margin aside text, it is meta-information associated globally with the document. The feature is partially controlled with paragraph styles. You enable line numbering with Tools>Line Numbering and this applies to the whole document. You can exclude some paragraphs from this numbering by configuring their style Outline & List tab.

This is not really convenient if you’re looking for the opposite, i.e. only numbering a few paragraphs as this requires customising a lot of paragraph styles.

Thanks for the explanation. It’s a serious mistake by LibreOffice about what line-numbering is, but they probably just don’t understand its significance.

Not important now.

I don’t think it is a mistake. Line numbering is usually meant as a non-specific “reference system” akin to “anonymous” cross-references. Lines on pages are numbered, no matter your text. Then you can refer to any data as “See page 3, line 15” without inserting complex cross-reference markers. This is quite common in legal documents or patents.


The alternative is to use cross-references.

You didn’t describe your use case of line numbering. You mentioned inserting text from file. I assume you want to number only this “citation” in order to comment it, designating comment targets by their line number.

I think there is a possibility through list numbering provided your inserted text has special properties. The first of these is the text is not a “flowing” text, i.e. line breaks are meaningful. Then every line is a paragraph by itself and a list style can be attached to each line or their common paragraph style, achieving numbering without modifying text. If your tet is made of multi-line paragraphs, you can still apply the trick but you won’t get detailed line-level numbering, only paragraph-level. And if your insertion i a single huge paragraph, there is no solution.

The simple answer is, you can’t. Use a different system, such as LaTeX.