-
Notifications
You must be signed in to change notification settings - Fork 83
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
Quarto - Word cross reference #494
Comments
I did not notice Quarto is not producing the same reference than R Markdown and bookdown. Cross-references are in the format "Table XX" with Quarto; with R Markdown they are in the format "XX". I can generate "Table 1" as you are asking using Hello @cscheid. Is it something that can be changed/defined/set for Quarto? I understood that there would be soon evolutions on this subject (captions+cross-references in the context of raw xml injection) but I don't know which line to follow. Do you have any advice or indications? |
We are actively working on a way for libraries to communicate metadata (such as rich captions) directly to quarto, so that we can resolve crossrefs, etc, as well as make sure that the output is formatted properly. The plan is to make it so that (eg) flextable can detect it's running "in a quarto environment", in which case it doesn't need to know about the crossref style (which can be configured by quarto itself). Then, flextable wouldn't need produce a "decorated" caption with We hope to have a concrete implementation and preliminary documentation to share in about 3-4 weeks. Send me an email at [email protected]? I'd love to meet with you directly to explain and make myself available to help you get a solid implementation going. We are optimistic about the simplicity of the resulting implementation based on our early experiments. |
It really seems to fit what we need. Thank you very much for your answer, I will email you tomorrow, I'd love to chat and do a solid implementation! |
@davidgohel any progress on this one? |
@BMC1986 When there's progress, we will update the issue. |
I'm trying to get around the quarto features for referencing Tables and Figures for docx outputs. When using flextables we have a custom function to apply formatting. In there we use set_caption and run_autonum to configure the desired bookmark. We're primarily targeting two main outcomes:
There's a Lua filter that runs before the quarto filter to intercept intext references and convert them to inline openxml references, which works fine.
The problem we noticed was that the flexible object was creating a bookmark on just the field code, not the pre-label, even though running to_wml.autonum showed otherwise. The issue was traced to caption_default_docx_openxml where this code ignores any existing autonum in the caption:
We were able to fix the function in the namespace (kluge for now) by checking for existing autonum:
We also noted that get_word_autonum always sets bkm_all to FALSE.
The above fix works for us, but a more user/quarto friendly option could be to allow tab.lp and tab.bmk_all to pass through to get_word_autonum.
PS: Thanks for this fantastic package!
The text was updated successfully, but these errors were encountered: