-
Notifications
You must be signed in to change notification settings - Fork 85
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
set_caption does not work when rendered in quarto, but does with print() command #570
Comments
It's a missing feature in Quarto. See #565 (comment), #494, quarto-dev/quarto-cli#1556, https://davidgohel.github.io/flextable/reference/set_caption.html#using-quarto-, https://ardata-fr.github.io/flextable-book/captions-and-cross-references.html#cross-references Captions will work in Quarto with HTML and PDF but not Word. |
Thanks @davidgohel. Sorry I missed this in the documentation. I did read through several pages and through opened cases, but I totally missed these. Thanks for pointing this out. I really appreciate the assist. |
This issue can be closed, captions seem to work as expected with Quarto For future readers, TLTR, |
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary. |
It seems that
set_caption
does not appear to be working (for me, at least) when rendering in Quarto to a Word document using the following yaml header:I have the following code in my .qmd file:
Unfortunately, this seems to produce the following in my Word document:
![image](https://private-user-images.githubusercontent.com/9097516/267560958-1ea0bd5b-869d-4e49-be05-a35a69921ad0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxNDY0NTYsIm5iZiI6MTczOTE0NjE1NiwicGF0aCI6Ii85MDk3NTE2LzI2NzU2MDk1OC0xZWEwYmQ1Yi04NjlkLTRlNDktYmUwNS1hMzVhNjk5MjFhZDAucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTBUMDAwOTE2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZTA0NjYxNTU3ZTNkNDA5ZTc3OTA1ZTgxZDM1ZDJkZTdkM2NiMjFmNDk4YjUxZDYzMDA5ZmNjM2ZlMzg1OGJkOSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.oXl3TRchnmVfx-TGngli0D7tXotG2LMTZ8k8D0i3QNk)
However, if I issue the following statement in R console:
cars |> flextable() |> set_caption("THIS TEST") |> print(preview="docx")
I obtain the following Word document which produces the appropriate caption above the table:
![image](https://private-user-images.githubusercontent.com/9097516/267561849-39f589fd-ece1-4258-8bbe-ddd9631c5490.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxNDY0NTYsIm5iZiI6MTczOTE0NjE1NiwicGF0aCI6Ii85MDk3NTE2LzI2NzU2MTg0OS0zOWY1ODlmZC1lY2UxLTQyNTgtOGJiZS1kZGQ5NjMxYzU0OTAucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTBUMDAwOTE2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NmJkZDRlNWIxZGNkNmE5MmNhYmQ5ZmExMDE1OTcwMWYzODcxYThiODgxZDMwOTQ4YmFkYTE0MzIxNDMwMTNmMyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.ReY01OkKb3LHNXAkMBFgthqTvQSPXutuzkGAz6cr_2Q)
I assume this should work since the
set_caption()
documentation reads:Is this a bug with
flextable
,Quarto
, or am I missing something?The text was updated successfully, but these errors were encountered: