How do I show a list of all footnotes/endnotes in a Writer document?

I’m trying to get a list of all my endnotes - I want to spot duplicate endnotes, or near-duplicates. I want to get a sortable list.

This could be showing it in the interface, or by exporting to a file.

Insert->Cross-references displays a list - but the list cannot be sorted or manipulated at all. (However, this suggests the list can somehow be accessed internally.)

This page on the OpenOffice wiki has two partial solutions - the first involves removing footnote numbers by hand, and the second suggests creating a regular expression that will reliably capture 100% of your personal footnoting style. Neither of these are likely to scale to a document with hundreds of endnotes.

Is there a way to do this that doesn’t involve going through hundreds of endnotes by hand?

(I’m using LO 6.4 for Ubuntu 20.04, and LO 7.1 alpha from git master on Ubuntu 20.04.)

If your purpose is to spot similar notes and you don’t mind working on two documents in parallel, here is a rather twisted procedure. As you noticed, there is no way to produce directly a sortable list of notes.

  1. Save a copy of your document as an HTML file, say h.html

  2. Open h.html with a text editor. All the notes are grouped at the end of the fil, footnotes first, followed by endnotes.

  3. Delete all text in <body> preceding the <div> of the first note.

    You can also delete the <style> element in <head>. Besides the fact that it makes the file smaller, it will also eliminate note numbering. Thus, if you want the note text without number, delete the <syle> element. If you need the note number to be able to discriminate and locate the notes, keep the <style> element.

  4. Save the truncated file, eventually under a different name to be able to try another deletion strategy, say t.html.

  5. Open the truncated file in Writer.

    You now have only the text of the notes without their number if you deleted the <style> element. This could make difficult to differentiate between footnotes and endnotes.

    The Navigator shows that each note lives in its own section. This prevents Tools>Sort from sorting the notes against each other.

  6. Save the note file as text only, say notes.txt

    Every paragraph in this text file is a single line. As a consequence, sorting the file will group together similar paragraphs. However, if notes are multi-paragraph, it is likely that these paragraphs will be spread over the sorted file, losing the relationship with sibling note paragraphs.

This is not perfect but you can improve on the procedure with tools such as grep or macro-generators, even script languages like Perl or Python to get closer your goal.

To show the community your question has been answered, click the ✓ next to the correct answer, and “upvote” by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!

In case you need clarification, edit your question (not an answer which is reserved for solutions) or comment the relevant answer.

This is kludgy, but appears to work, thank you :slight_smile: Alternate step 6: cut’n’paste the list (which is a table) to Calc - it’s easy to sort there as well.