hughjonesd / huxtable

An R package to create styled tables in multiple output formats, with a friendly, modern interface.
http://hughjonesd.github.io/huxtable
Other
322 stars 28 forks source link

Enable handling footnotes in the same way that e.g. captions are handled #228

Open PatrickRWright opened 2 years ago

PatrickRWright commented 2 years ago

Describe what is missing Currently it is complicated to remove footnotes because one "just has to know" that they are there and there is no way to explicitly check if they have been set.

Describe your proposed solution It would be great if handling of footnotes was exactly like handling of captions.

Additional context For an HTML report written in Rmd we may want to set a footnote in a huxtable, but also export the same huxtable to an individual file. For the export we may not want to show that same footnote. Thus our export wrapper needs to know - explicitly - if a footnote is there or not to work in an automated manner

We were talking about this on stack overflow:
https://stackoverflow.com/questions/72612734/how-do-i-remove-a-footnote-from-a-huxtable-in-r/73203462#comment129339009_73203462

Another stack overflow thread that may be a little off-topic but also goes into the direction of wanting to handle footnotes like captions:
https://stackoverflow.com/questions/72966877/huxtable-footnote-how-to-set-bold-italic-etc-html-coding-does-not-work

Thank you!

hughjonesd commented 2 years ago

The correct fix is to rewrite how huxtable handles headers, footnotes etc. The quick fix is to add a footnote attribute.

I think I need to be persuaded that this will be useful to more people than just you. What's the best case for that?

PatrickRWright commented 2 years ago

Given the second stackoverflow question the number would be at least 2. Also we are using huxtable as standard table package where I work (we decided this based on huxtable's perceived versatility), so if we add all those people the number increases to over 10. Having said that, this feature, or rather the lack of it, is no show stopper for us. Its just "something that came up" that I was not able to solve.