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

Footnote Reference Numbering Bug #570

Open
leandroxxxxx opened this issue Oct 29, 2024 · 0 comments
Open

Footnote Reference Numbering Bug #570

leandroxxxxx opened this issue Oct 29, 2024 · 0 comments
Labels

Comments

@leandroxxxxx
Copy link

leandroxxxxx commented Oct 29, 2024

The bug occurs in the manipulation of text footnotes, specifically in the relationship between the numbering and the corresponding footnote text. In the example file, when a paragraph and its associated footnote reference are deleted, the numbers reorganize as expected. However, the remaining footnote texts no longer correspond to their new reference numbers. For example, in the red-colored text, the footnote number changed from 3 to 2, but the footnote text still refers to the yellow-colored text that was removed from the document. This same issue persists for all subsequent footnotes.

Code:

from docxtpl import DocxTemplate
import os
dir = os.path.dirname(os.path.abspath(__file__))
doc = DocxTemplate(dir + "/my_word_template.docx")
context = { 'company_name' : "World company" }
doc.render(context)
doc.save(dir + "/generated_doc.docx")

Update: I discovered this issue only happens in LibreOffice. Microsoft Word works correctly.

generated_doc.docx
my_word_template.docx

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

No branches or pull requests

1 participant