Paragraph numbering - how to automatically number frames / side notes / marginalias in writer?

I want to number all the paragraphs in my document. The numbers should be on the outside of the page / margin. For that purpose, I manually insert frames at the beginning of the each paragraph. Is there a way to assign numbers automatically for all the frames? or automatically assign numbered frames to each paragraph?

I have tried list numbering in the frames and numbered headings. However, the numbering breaks up if I insert a new frame in between written paragraphs with numbered frames.

One can see what I want to do in german law books. Each paragraph has a number at the beginning. I am also open to suggestions of possible answers regarding numbering paragraphs in another way / apart from frame numbering.

Thanks for the responses.

It would be good if you could upload or link to an example, as this is fairly advanced DTP in terms of layout. To that end I would recommend using LO as a proofing tool for the content and a DTP tool (e.g., Scribus) as a layout tool.

Is there a way to assign numbers automatically for all the frames?

An auto-incrementing field can be inserted into a frame. This will increment each time the frame is copied / duplicated. I know of no method to automatically assign incrementing numbers to existing frames.

or automatically assign numbered frames to each paragraph?

Again, the frame can be manually copied to each new paragraph, however regardless of anchoring method (to paragraph, to character) the frame will not copy along with the paragraph.

I have tried list numbering in the frames and numbered headings.

Simply pressing ENTER to create a new paragraph will also not automatically insert an auto-incrementing field or frame. As you correctly indicate, such behaviour is, in essence, an ordered list.

However, the numbering breaks up if I insert a new frame in between written paragraphs with numbered frames.

Please attach or link an example to the question showing this behaviour. Thanks.

there is a semiautomatic solution for that question: auto-incrementing field.

the solution is adding fields into the frames. there is the logic behind the numbering:

you insert a frame. Then, you adjust the place the frame the way you want. In my case, this is outside border of the text on the mirrored pages. Following, you insert a field into the frame you’ve just created.

Click insert on the toolbar, go to field and then select variables. select number ranges. click insert.

now, you have a numbered frame. you can adjust the place of the number in the frame, I used centered numbers.

you can copy that frame and paste at the beginning of each paragraph. I think you can insert this frame by creating a new macro or autotext as well. With this solution, you always get the right numbering, even when you insert/write new paragraphs in between old ones. Numbers are automatically adjusted.

Before this solution, I was trying to number frames by editing style “frame contents” under paragraph styles. I was activating “outline & numering”. With this way, you can number all the frames, even existing unnumbered frames. However, the frames are numbered by creation order, not by their vertical place in the document.