huxtable
huxtable copied to clipboard
Feature request - insert image into table
Is it possible to or could you add the capacity to insert images into a huxtable? Ideally as a column variable. There are some questions on SO which address the issue of images in a table using xtable: https://stackoverflow.com/questions/25106481/add-an-image-to-a-table-like-output-in-r https://stackoverflow.com/questions/52482682/add-images-to-table-column-and-increase-row-height-in-rmarkdown-pdf-document huxtable seems to offer a more flexible environment within which to achieve this.
I'm open to this. Tell me though, is there any reason you can't do (e.g. in HTML), something like:
escape_contents(my_hux)[1, 1] <- FALSE
my_hux[1, 1] <- '<img src="my-image.png">'
Only because of the need to produce reports as pdfs rather than html.
Sorry closed in error
So, isn't there a TeX equivalent?
Even if there is an equivalent TeX code, there might be a case for this feature if the code is complicated (and the use case is common enough).
Sent from Gmail Mobile
I found a Tex example which I could happily adapt: https://tex.stackexchange.com/questions/53061/insert-image-and-list-inside-a-table#53062. However, it looks as if I would have to manually input information for each cell; I'm not sure I'm at a stage where I could program this. Also slightly complicated (possibly) as this example is based on minipages.
Ok. On the face of it, this seems like a legit issue for which there is some demand. Thanks for reporting. Upvotes and +1s welcome.
Sent from Gmail Mobile
Is this option available now in Huxtable @pm321 @hughjonesd or is there any other way to insert an image inside the huxtable especially while having a docx output.
Not yet. If you use as.flextable, then you may be able to do this from
within flextable, using e.g. flextable::as_image. If you find a way to do
it, come back and tell me. Or even submit a pull request :-)
This is now partly fixed with markdown support in cells, including images like .