Closed renlund closed 8 years ago
I have put some thought into it, but haven't decided what to do about it yet. With a fairly simple hook, captions can be added to HTML and LaTeX tables with knitr
already. Unfortunately, that hook wouldn't apply to console output. The other advantage to the hook is that it would keep track of table numbers, whereas if I wrote something from the ground up, I'd eventually get roped into writing something to track the table numbers. From past experience, that's not something I'm keen to do again.
All that said, how strongly do you feel about the following:
knitr
?Yes, I can see that there might be some complications here. Probably I haven't examined knitr
hook options for captions enough to have a feeling for a "right" way to go here. At the moment I'm using your package for rmarkdown, and one way to add the caption is easy enough:
t <- print(dust(object) + ... <sprinkles> ... + sprinkle_print_method("markdown"))
cat(t, "\n\n Table: My caption.")
But of course in the end I want a system for numbering all tables generated (independent of the generating package) and a way to reference them (in "pure" rmarkdown).
Regarding your questions:
knitr
that it would be pointless to have an independent system.Added in v 6.0.1, currently in the new-latex-tables
branch.
Have you considered having a sprinkle for adding captions to the tables?