-
Notifications
You must be signed in to change notification settings - Fork 57
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
Caption formatting issues when using knitr::kable() and when using symbols in chunk name #46
Comments
Okay, I've modified the CSS for table captions to appear as follows: Note that for In terms of the other cross references, this is a known limitation of bookdown cross-references: https://bookdown.org/yihui/bookdown/figures.html I'll add a note about that to the documentation. |
kable captions are now working, but adding extra formatting via kableExtra::kable_styling still breaks it. Actually, simply loading the package breaks it unless the user sets I have no idea how pratical it is to ensure this formatting works for all package combinations (formattable comes to mind, since it works with kableExtra - https://haozhu233.github.io/kableExtra/use_kableExtra_with_formattable.html), but since kableExtra is recommended in the documentation (https://bookdown.org/yihui/rmarkdown/r-code.html#tables) I think it's worth ensuring it works. The caption apearing above the table is proper scientific writing behaviour (atleast in most fields and from my experience) so that makes sense and it's exactly as I expect it. I never realized that bookdown had that issue as well - thank you for the heads up and for the super quick fix - I will simply avoid extra table formatting until everything can be worked out. |
Yeah, it's difficult to run down every table formatting package and imbue all of their output with correct behavior. So far we've focused on pagedtable and plain kable. We'd welcome contributions to help support others so long as they don't make our core codebase too complicated and/or fragile. |
EDIT: I just submitted my proposed change as a pull request. I noticed that you can actually break the caption formatting with the base This is because in Wouldn't it be more efficient to set the style for the I tried changing line 835 - currently You could also just set style for all captions, regardless of where they are used by removing the parent. If you have no need for differently formatted captions this might be the best. |
https://haozhu233.github.io/kableExtra/using_kableExtra_in_radix.html I just added a quick example of how to use kableExtra in radix. @MarcioFCMartins I hope it helps you feel better. :) I really love the design of radix! |
I'm still having this issue with table captions using the following:
The bad captions: |
o man! @jrgant thank you. I've been stuck on this issue and could not figure out why my captions were rendering |
Thank you for this post and the discussion. Changing my chunk label allowed the bookdown kable_extra rendered as PDF to correctly add table headings. You have helped my day so much. Thanks! |
How do I change things like the caption colour and size, etc? There seems to be no documentation on this |
You could probably use CSS for this - the exact CSS could depend on which format of table you are using. CSS and distill is documented in https://rstudio.github.io/distill/basics.html#theming and https://rstudio.github.io/distill/website.html#custom-style and https://rstudio.github.io/distill/website.html#theming We don't have built in way to change this using variable, you need to use custom CSS for this. Hope it helps |
I have also found that a caption can not contain some other symbols. I was trying with % in my caption for a while and then found this issue. |
I have been adding captions to my documents in radix and noticed some issues with them:
Table captions inserted using knitr::kable are formated as standard text. Would it be possible to make it so that captions inserted this way are formated like captions from fig.cap chunk option?
Table/figure numbering and naming does not work if your chunk name includes a space, underscore or point.
See attachment for simple examples :
Test_captions.txt
The text was updated successfully, but these errors were encountered: