-
Notifications
You must be signed in to change notification settings - Fork 286
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
callout with table produces problem in docx #6357
Comments
The issue is reported upstream at quarto-dev/quarto-cli#6357.
You seem to imply, this was working before, but I cannot see this working in 1.2.475 nor 1.1.251. Anyway, I can confirm it's not working with the latest dev version. Thanks for the report. Note that enabling collapse cannot work for obvious reason in Word document. |
Apologies, my wording might be ambiguous indeed. I meant that the problem is showing in 1.3.433, not that it first appears there.
Yes, indeed, this won't work, I'm aware. This was a leftover from the bigger project where this problem surfaced. It can be safely removed, and the problem will still appear. I've edited it now accordingly. |
Indeed, this document doesn't validate:
|
This problem is still present. Any estimate on a fix date? |
When there is an update it's documented on the relevant issues. |
This appears to only occur in specific situations - for example - the above repro case only occurs when a title is omitted (at least in my testing using Quarto 1.4). There are OOXML validation errors in the XML that we are producing, but the validation errors are identical when testing a version of the above document with and without a title (and only the one produced without a title indicates it is corrupt when opened). |
There is a duplicate
Probably due to this code:
I don't know whether that is causing the original problem, but might be worth trying to fix this and see whether Word will then open the file. |
@edwintorok Thank you for catching that! That's a good theory. It will be quite tricky for us to fix if Word disallows multiple property tags (we'd have to do it in an XML postprocessor, since Pandoc is emitting one of them..) I'll test it this week. |
If it helps I have a workaround script here that attempts to fix some of these errors (e.g. by merging the duplicate tag into a single one): https://gist.github.com/edwintorok/27b90e6f5f8f3b3e9f89372f05df1b6c#file-gistfile1-txt-L303-L403 (it depends on python-docx). You can try to see whether running that on the broken document creates a document that is accepted by Word. |
Here are 2 files:
They both open fine in LibreOffice and Google Docs. Could you try to see whether either of these opens in Word? |
Sorry, both files ( |
Thanks, I can actually reproduce the problem with the free version of Microsoft365 (web version of Word). The changes made by LibreOffice are quite substantial: the original document has 2 nested tables, but the final document only has one, so apparently it has merged the tables. According to this https://stackoverflow.com/questions/4485225/openxml-nested-tables you need an empty |
After inserting an empty paragraph the online version seems happy with this: test2.docx Here is the codechange: v1.3...edwintorok:v1.3 Could you confirm whether this works with the desktop version of Word? I can then open a PR for Quarto. |
Sorry for taking longer to get back to this @edwintorok, but it now seems to work well, and I do not get any error when opening the file, neither in MS Word, nor LibreOffice. So from that point of view, this look good, thanks! |
Apparently an empty paragraph is needed. Fixes quarto-dev#6357 Signed-off-by: Edwin Török <edwin@etorok.net>
Thanks, I've opened a PR here #8392. |
Bug description
When a callout contains a table, the generated
docx
contains "unreadable content" according to Microsoft Word (Office 365).Steps to reproduce
test.qmd
containing the following Quartodocx
usingquarto render test.qmd --to docx
Expected behavior
The generated
docx
should not contain "unreadable content".Actual behavior
The generated
docx
contains "unreadable content".Your environment
Run from the command line from Ubuntu (22.04) and Windows both reproduce this problem. Note that the error in the generated
.docx
is reported by Microsoft Word, not by Libre Office.The problem appears with quarto version1.3.433. Double checked with latest pre-release 1.4.268 and the problem persists.
Quarto check output
The text was updated successfully, but these errors were encountered: