Insert stanzas numbers alongside the text

Hi, I wonder if it is possible to achieve this kind of numbering in libreoffice. I mean to have the numbers of stanzas alongside the test, i this way:

1 Ingiustissimo Amor, perché sí raro
  corrispondenti fai nostri desiri?
  onde, perfido, avvien che t’è sí caro
  il discorde voler ch’in duo cor miri?
  Gir non mi lasci al facil guado e chiaro,
  e nel piú cieco e maggior fondo tiri:
  da chi disia il mio amor tu mi richiami,
  e chi m’ha in odio vuoi ch’adori et ami.

2 Fai ch’a Rinaldo Angelica par bella,
  quando esso a lei brutto e spiacevol pare:
  quando le parea bello e l’amava ella,
  egli odiò lei quanto si può piú odiare.
  Ora s’affligge indarno e si flagella;
  cosí renduto ben gli è pare a pare:
  ella l’ha in odio, e l’odio è di tal sorte,
  che piú tosto che lui vorria la morte.

3 Rinaldo al Saracin con molto orgoglio
  gridò: — Scendi, ladron, del mio cavallo!
  Che mi sia tolto il mio, patir non soglio,
  ma ben fo, a chi lo vuol, caro costallo:
  e levar questa donna anco ti voglio;
  che sarebbe a lasciartela gran fallo.
  Sí perfetto destrier, donna sí degna
  a un ladron non mi par che si convegna. —

Is this a task beyond the abilties of libreoffice writer numbering feature or some hack is possible, in your opinion?

LibreOffice only has to recognize the paragraphs as such, then this is no problem at all via an ordered list.

2 Likes

but how can I obtain that only first line of stanza has the numbering?

Look carefully at what @PKG did: this is poetry, end of line is forced to show correctly the rhymes. In a poem, the unit is the verse which is ended by a paragraph break Enter. End of line is forced with Shift+Enter.

2 Likes

Ok. Now I understand, but is there a way to automatically turn all first 7 hard returns (paragraph breaks) of any stanza (apart the last line) into soft return (shift+enter)?

Unfortunately not directly.

Since you can’t modify search results, you’ll have to proceed stanza per stanza (hoping there are not too numerous).

  1. type somewhere Shift+Enter, copy it and delete the sample
  2. select stanza text up to but not including the final paragraph break
  3. Edit>Find & Replace
  4. in Find:, enter $ (dollar sign); leave Replace: blank because you can’t enter a line break there
  5. tick Regular expressions
  6. Find All

Close the dialog (or if you’re smart enough, manage to send the focus to your text). All paragraph breaks within the selection are highlighted. Type Shift+Enter to replace the highligthed paragraph breaks.

  1. paste Clipboard contents (Shift+Enter )


Repeat on the other stanzas.


EDIT 2025-04-14: post edited with @LeroyG fix

1 Like

Should I expect to can replace all highlited hard returns with a soft return in this way? Because I tried

and only first line was replaced rightly,

Apologies, insufficient test on my side. I was hoping a similar behaviour to what you do to change styles but it seems the limitation internal to built-in F&R also applies in this case. F&R (Find & Replace) transformation is limited to one paragraph contents (though it can be iterated over paragraphs. Shame.

Your hope is someone familiar with macros provides a solution.

1 Like

Maybe using

1 Like

Step 0. Type Shift+Enter and copy it
Step 6. (after closing the dialog) Paste

1 Like

@LeroyG Congratulations! It works.

1 Like