I have two prepared LibreOffice Writer files. Each contains text with cross-references to its own numbered paragraphs.
In both files, the text appears first, followed by the numbered paragraphs themselves. Now these files need to be combined into a single document featuring continuous text with cross-references, followed by a common set of numbered paragraphs using a single numbering system.
Clarification: the text of the first file (excluding the numbered paragraphs themselves) should be followed by the text of the second file (excluding the numbered paragraphs themselves), then a section of the numbered paragraphs from the first file, and finally a section of the numbered paragraphs from the second file. The paragraph numbers from the second file must change to continue the numbering from the first file. Cross-references to paragraph numbers within the inserted text from the second file must now point to the new paragraph numbers (which have increased due to the renumbering).
An equivalent situation (which might make it clearer) is this: two independently prepared chapters are merged into a single book, and the literature citations in the second chapter need to point to the new reference numbers in the consolidated bibliography.
The simplest way: If I insert the text of the second chapter at the end of the first (using Ctrl+C/Ctrl+V or “Insert”—> “Text from File”), the cross-references from the added file will effectively point to paragraph numbers in the first chapter. While the numbered paragraphs from the second file can easily be merged into a single numbering sequence (using “Toggle Numbered List”/F12), the cross-references within the added second chapter must be updated to reflect the new numbers.
How can such a merging process be automated or simplified?
LibreOffice 7.1.8 from AlmaLinux 9 is being used.

