Moving My Informal Footnotes Into My Main Text?

Similar to this old thread:

I have a lot of footnotes.

I have trouble working with them because (1) the main text and the footnotes don’t all fit in the screen at the same time, (2) I often mis-click on the anchors and bounce around as a result, (3) after 99, I run out of space between the footnote number and the footnote text, and (4) if I switch formats, this can break or remove footnotes.

I am writing my own notes, and the footnotes are important, but the citation style is flexible.

I would like to move the footnotes into the main text, preferably immediately following the paragraphs with the anchors. The old anchor could become an asterisk, and the footnote a new paragraph preceded by an asterisk. I think this would solve most of these problems. It might get a bit messy for paragraphs with multiple footnotes.

I could do this by hand, but when different files each exceed 100 footnotes, and some exceed 300 footnotes, it’d be nice to have some way to speed this up.

FootnoteExample.odt (37.6 KB)

1 Like

I think that if you upload a file containing typical examples for this topic, you will get help more quickly.

This is easily fixed by modifying indent Before text and First line indent in Footnote paragraph style.

1 Like

You can open a new window for the same document (menu Window - New Window).

Thanks, editing footnote styles would help a bit. Adding another window wouldn’t. I can’t fit another LibreOffice window on the screen, and if I could, I can get motion sickness from scrolling one window alongside another.

Thanks for the excellent example!
Here is a macro that implements the second option.
If needed, the text of the (former) footnote can also be formatted using an appropriate character style.

Sub MoveFootnotesToText(Optional Byval oDoc as Object)
    Dim oText as Object, oFootnotes As Object, oFootnote As Object
    Dim oCursor As Object
    Dim i As Long, sNoteText As String
    
    If IsMissing(oDoc) Then oDoc = ThisComponent
    
    oText = oDoc.Text
    oFootnotes = oDoc.Footnotes
    For i = oFootnotes.Count - 1 To 0 Step -1
      oFootnote = oFootnotes.getByIndex(i)
      sNoteText = " (" & oFootnote.String & ") "
      oCursor = oDoc.Text.createTextCursorByRange(oFootnote.Anchor.Start)
      oText.removeTextContent(oFootnote)   
      oText.insertString oCursor, sNoteText, True
    Next i
End Sub