-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Support for footnote. #1
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
Comments
@julienfr112 check out the notation I added above, makes the XML much more readable :) It's just adding triple-backticks on a line by themselves before and after the indented code, and an optional language name, 'xml' in this case. |
Good to know, thank you ! |
Added a first shot at (end|foot)notes support in #53 |
How this is going? There is an api available yet for footenotes? If not, there is any workarounds till its done? |
Hi @Huyston. Haven't gotten to this yet, might be a while. You might look at the work @ludoo did in #53 to see if that can work for you. There are a lot of features on the docket to add so might be a while before I get to this one. The first challenge is to get access to the notes part, then you can parse through the XML it contains. Looks like Ludovico has solutions to those problems, so you may be able to use his as is or extend it to meet your purposes. |
Four years later, and I need this 😄 |
@scanny
|
the problem i’m facing right now: assigning text to a run removes all footnote references. any easy way to get around this? i don’t need to edit footnotes – just keep existing ones intact. |
fwiw: #53 worked for me. i was able to modify Runs without losing associated references. of course, i had to modify the code a little bit because the library didn’t even support editing Run text back then. link to my branch in case anyone needs it: https://github.com/xrisk/python-docx/tree/footnotes |
I just uploaded PR to provide access to footnotes and endnotes. It might be helpful if you check my PR. |
@xrisk You should not assign text to runs directly or it will remove all child elements a run have. Currently, you should inspect and change child elements of a run individually and prevent changing content of |
Looking forward to these PRs being merged as well. That would be a great news :) |
Dear @ludoo or @scanny when I insert cell content, I make the content like this code, hdr_cells = table.rows[0].cells hdr_cells[0].paragraphs[0].add_run('Cell').normal = True I want to insert footnote 'cell' How can I insert the footnote? |
What about footnotes guys? |
…r_level Feature/comments lower level
Patiently waiting in mid-2023 :-) |
Don't wait. Implement it yourself and offer it to the community via opening a PR. Please see #1154 |
added cache for table cells
The bayoo-docx fork works like a charm in adding footnotes - major snaps for BayooG in developing this. But I am now trying to embed hyperlinks within the text of footnotes. Others (here and here) have done this for text within the main body of a word doc (the word/document.xml), but is there a way to do it in footnotes? It seems the hiccup with available code is that some of the docx functions (Document() and relate_to()) only apply to the word/document.xml and documents.xml.rels files, whereas to manipulate footnotes you need to access footnotes.xml and footnotes.xml.rels. Questions:
|
A footnote is two thing :
The text was updated successfully, but these errors were encountered: