Re-enumerate footnotes

1))Software environment:

Libreoffice Writer 6.4.4.2, Ubuntu 20.04 .

2))Objectives:

a)I have about twenty FB2 ebook files, containing info of certain subject.

b)I want to merge them into one custom-format-unified and self-structured document (about 3500 pages in total), PDF-exported version of which will be shared.

c)Each file was opened by LO Writer and converted to ODT. Then, these ODT files were manually merged (copy//paste-like) into combined document (combodoc).

d)Style replacing, header style customization and test PDF-output exporting was successfull.

3))Problem:

a)Each input FB2 file have footnotes (from 20 to 400 per file).

b)Footnotes are normally available in ODT files, converted from source FB2’s.

c)BUT, in combodoc, numbers of footnotes ARE preserved from original ebook, so i have several footnote enumeration ranges ( 1…235, then 1…388, and so on) in one document.

4))Question

a)Is there a standard(bundled//built-in) or LibreOfficeBasic-based method(possibility//way) to re-enumerate footnotes in document FROM SCRATCH?

b)(suggestion) Is it possible to achieve my goal via temporary saving combodoc as HTML, edit it manually via text editor, and then save as ODT again?LOA_test+.odt

Congrats - that’s an elaborated question. Upvote for that …

Don’t detour through HTML, you will lose many formatting properties and your case will be worse after that.

From a quick web-search, FB2 stands for “FictionBook” version 2. How do you convert to ODF? Wikipedia says that FictionBook has a notion of footnotes. Is this preserved as Writer footnotes (as per ODF specification and not as other object looking the same but not being a formal footnote) after the conversion? Since you have several footnote ranges, it seems it is not the case.

Could you then attach to your question a 2-page converting file with footnotes? Attaching is done through editing your question and using the paperclip tool.

1))HTML:

a)I KNOW about formatting properties issues of ODT==>HTML==>ODT “semi-pipe”, and it is fully OK with me to re-set page numbering and paragraph formatting (and so on) after it.

b)Besides, this semi-pipe is (for me) the only way to batch removal of webform elements (radiobuttons, checkboxes, comboboxes) after copypasting text content from internet.

c)In cases, where you need to create widely formatted ankette (Header_Block(5 rows/1 column) and nearly 30-40 Question_Blocks(1 row//united_columns & 3_rows//2_columns ) ) IMHO it is more suitable to create HTML-sketch (Header_Block and 1 or 2 Question_Blocks), then copypaste Question_Block desired number of times, and then open HTML-file in LO Writer, assigning questions to table…

2))FB2:

a)I use Doublecmd as default file manager, and LO Writer IS in context sub-menu “Open with” of FB2 files.

b)FB2 file, when opened in LO writer, opens lookalike normal openoffice document, BUT with all four page borders equals ZERO.

c)Headings in FB2 file viewed by LO Writer not as “Заголовок 1”(“Heading 1”), but as “FictionBook2 Heading 1”. Heading numbers mostly are from 1 to 4.

d)Annotation and pictures, included in FB2 file, IS NOT recognised by LO Writer and can not be saved as ODT. All other content (includind footnotes “layer”) does.

e)IMHO, FB2 footnotes is normally converted to LO Writer footnotes, Footnotes, BUT NOT footnote numbers.

f)Footnotes block located in the end of HTML-exported example document. SYSTEM enumeration of footnotes in footnotes block(“sdfootnotesym”) is correct.

3))ODT:

Example ODT file with 4 footnotes added to topicstarting message

======

Also, here is the link to FictionBook format description:

http://www.fictionbook.org/index.php/Eng:FictionBook_description

I discovered the cause of the apparent independent enumeration range for your footnotes. I don’t know if FB2 or your conversion process is responsible.

When you insert a footnote, you have the choice between automatic or manual numbering. Here, all notes are manually numbered. This means the number is static. When you merge several separate documents, the note numbers will not change because they are not obtained from some counter.

You can verify this by right-clicking on the note anchor and Footnote/Endnote (caution, the mouse cursor must be located on the very left edge of the note anchor to get the item in the context menu).

Having no experience with FB2, I can’t suggest any fix. Check however if the HTML step is not creating the mess.

In case you are the one creating the FB2 files, you may mitigate the inconvenience (bug?) by numbering your notes per page. This is possible in Writer (in FB2?). Thus if page breaks do not change, it will not really matter that note numbers are reused. This is possible if you don’t need to uniquely reference your notes (such as using the same note in different pages or citing a note number in the text).

Side remark: your notes are styled Default Style instead of the tradition Footnote.

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!

Yes, OK, i see.
When i tried to add a footnotes to test document, its enumeration started from 1.
Am i understand correctly, that automatic footnotes enumeration is DEFAULT in LO?
Am i understand correctly, that there is no functionality in LO Writer about INDEXING manually numbered footnotes?

Automatic footnote numbering: default; can be replaced by manual number/symbol by a voluntary action

What do you mean with “INDEXING manually numbered footnotes”? Indexing??? When you Insert>Footnote/Endnote, it is entered in the notes dictionary whether automatically numbered or not, and you can cross-reference them like any other referenceable object.

Your problem is to attach your notes to the Writer note counter. I suspect that when importing from FB2 or HTML the notes are handed over to Writer as manually numbered notes. Ideally, you should try to put them in auto numbering mode from the start. Doing that manually (400/file!) is not reasonable.

!!There are two possible solutions now in my head. But, both of them are about re-create combo-document from scratch:

#Solution 1:

a)convert all FB2 files into ODT.

b)Add footnote to each new ODT document (NOD), then step-by-step-appending them, watching about footnotes enumeration (is it one enumeration with concatenated numbers or two separate).

c)Remove NOD-added footnotes.

#Solution 2:

a)I know about the certain software, which purpose is about joining multiple FB2 files.

b)As i remember, joining also includes footnote reindexing.

c)So, all i need is manually enumerate input FB2 files, and then drag&drop them to the software.

d)name of software is “MergeFB2”

********************************

Both of mentioned solution requires style&formatting re-setting of new combodoc to obtain styles//headers, exicting in combodoc i have by now.

This is not a finish, but, rather, a checkpoint.

Maybe, in a week or two i will implement both solutions, and then post results of implementing here…

----------------------------------------------

{{P.S.}}::

1)) You also mentioned “notes dictionary” and “Writer note counter”. This terms are completely new to me. It is something about inner LO mechanics, yes? Could you share with me some links, containing info about them?

2)) I’ve extracted content.xmi from my main ODT file and send it via sed+grep bash pipe. I obtained info, that there are totally near 900 footnotes in my document.

Since I am not a developer, “notes dictionary” and “Writer note counter” are concepts I put on my mental model of Writer. The “note counter” increments for each auto-numbered note and is recomputed if you delete a note in the middle. A manually numbered note keeps its number for ever, no matter what happens to the others.

The “notes dictionary” is where the notes are stored waiting to be laid out in the page(s). This isprobably not the way it is implemented but it is enough for me to use (efficiently) Writer.