A problem with exporting a selection as pdf when the selection includes two ordered lists one after the other

Am I doing something wrong? Does the following issue known? Can you reproduce it?

After exporting a selection that includes the two short and simple ordered lists from the
orderlistsbugwhenexportingpdfasselection.odt (9.6 KB) as pdf, the pdf file has the ordered lists as merged in a twisted manner.

How to reproduce? Have the cursor positioned before the A letter at the 1st line of this file. With the mouse, while pressing the left most mouse button, drag the cursor from before the A letter to exactly after the d letter of the ‘ 1. d’ line. You should get all the text between those 2 positions marked with a blue background. Release the left most mouse button. Now File > Export As > Export as PDF… . A PDF options window pops up. Within it, set the Range to Selection and confirm exporting. A dialog for choosing the file name pops up instead of the PDF options window. At the end of the process, after opening the resulted pdf file, the ordered lists within it were exported in a twisted manner. Note the appearance of the issue depends on the selection of the text to be exported. If the end of the selection is right at the beginning of the line that follows the ‘ 1. d’ line, the issue is avoided.

IMHO this is no big mistake or bug (if it is one!).


Writer: Try to copy/paste a selection of separated sentences of different paragraphs and you will see that the pasted text will merge within a single paragraph. Similar to that the export of different text parts into a PDF file seems to follow the above mentioned behavior. Probably a specialist may better explain this phenomenon.

IMHO, the flaw is in your selection procedure.

Your selection starts at beginning of text. You extend it down to ‘d’, before a paragraph mark (the paragraph mark is not included in the selection) and the end of selection is not the end of the document.

Your selection is “incomplete”: it is made of a series of paragraph plus a non-paragraph sequence.

Since you export to PDF, the selection needs to be made into a “standard” (complying) document. Therefore a paragraph mark is added at end. Now Writer has to guess which formatting to apply to this paragraph.

Since your document is an awful mess of direct-formatting (DF), The last paragraph is assigned Default Paragraph Text (active at end of selection) plus all DF present there. It is likely that this DF is “wound up” to similarly formatted text preceding the tweaked sequence. List numbering was done with DF, and it propagates backwards.

On the contrary, if the selection includes the paragraph mark after “d” (but not including the very last paragraph mark), no such misbehaviour happens and the PDF is similar to your document.


Start by creating correctly structured and styled documents. The clearer the architecture, the more predictable the results. Direct formatting is an express way to formatting nightmare. It should be avoided like plague. Contrary to common belief, formatting a document with DF is not intuitive at all and requires super-expert skills to succeed.

Thank you.

Does the use of <enter> to break lines is considered DF? Where in the document do you observe DF?

How to avoid DF when writing a document?

Enter is the most fundamental structuring command for an author. It creates the paragraphs (not lines) of your document. This is not DF but base creation work. You then add formatting on this bare outline. Formatting is spacing between paragraphs, choice of font face and changes of it to convey nuances of discourse, font size and weight, indents, colour, …

Everywhere.

Your text is styled Default Paragraph Style (DPS) which is not intended to “decorate” text. A minima, this is the role of Body Text. Settings in DPS cascade to all other styles (until the setting is overridden). DPS is the ideal location to configure your preferred attributes to give a personal look to your document (font face, size and weight; spacing above and below paragraph; line spacing; left and right indents; and many more). If you use DPS, you’ll tend to tune it for your discourse and this will have side-effects on other styles (like headings or header/footer). You’ll then try to fix the corresponding styles by creating unwanted lock situations (avalanche effect). So, define your preferences in DPS but apply other styles (dedicated to “standard” usages like main topic, headings, headers, notes, …) in your paper.

Your list were also created with DF: you pressed a toolbar button.

In summary, DF is any formatting created with mouse, toolbar buttons or legacy keyboard shortcuts like Ctl+I.

Use styles. Styles are ubiquitous in Writer (contrary to M$ Word which knows only of paragraph styles). If you’re not familiar with them, read the Writer Guide downloadable from the Documentation page. Click on the More button at bottom and scroll down to excellent Bruce Byfield’s Designing with LO which better explains the benefits of styling.

For me, it’s a bug.
I copied all the text, pasted as unformatted in a new document, added number style, exported selected, and :frowning:.


Version: 24.8.5.2 (X86_64) / LibreOffice Community
Build ID: 480(Build:2)
CPU threads: 4; OS: Linux 6.4; UI render: default; VCL: gtk3
Locale: es-MX (en_US.UTF-8); UI: en-US
Calc: threaded