Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Section numbering in table of contents is wrong (initially) #74

Open
blattms opened this issue Jan 10, 2024 · 3 comments
Open

Section numbering in table of contents is wrong (initially) #74

blattms opened this issue Jan 10, 2024 · 3 comments

Comments

@blattms
Copy link
Member

blattms commented Jan 10, 2024

Somehow before the last release the indices where not updated. Hence we have something like this (even in the last PDF):

image

In addition new sections/subsections are missing in the table of contents.

This can be fixed before publishing by updating all the indices.

@hakonhagland
Copy link
Collaborator

This can be fixed before publishing by updating all the indices.

@blattms Yes that is the most important thing. If we want to also update the indices manually (without the help from libreoffice) in the main.fodt file we would need a script that runs through all sections and sub sections to determine the correct ordering and numbering. But the table of contents also contains a reference to a page number (e.g. ACTNUM is on page 414 in the above screenshot). I don't think the script will be able to calculate the correct page number..

@hakonhagland
Copy link
Collaborator

I don't think the script will be able to calculate the correct page number..

Or maybe it could use a workaround... by using #108 to update the index, then save the modifed main.fodt to a temp file, then extract the correct page numbers from table-of-content in the temp file, then update the table-of-content in main.fodt with the correct pages, then loop through all sub documents and update the bookmark references for all sections according to the new table-of-content?

@hakonhagland
Copy link
Collaborator

then save the modifed main.fodt to a temp file

The best solution would of course be if it was possible to save the main.fodt file without libreoffice reincluding all the sub documents. Then we could just update the index and save main.fodt. (I guess we would still need to update bookmarks referenced in the table-of-content in the sub documents though.) I have added a question at the forum: https://ask.libreoffice.org/t/how-to-avoid-including-sections-from-other-documents-when-saving/101511

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants