thomasp85 / patchwork

The Composer of ggplots
https://patchwork.data-imaginist.com
Other
2.46k stars 162 forks source link

Add hyperlink to patch? #328

Closed stuvet closed 1 year ago

stuvet commented 1 year ago

Hi, thanks for a very useful & intuitive package.

I'm trying to produce an Rmarkdown => single page pdf template to provide standard headers & footers for arbitrary combinations of graphs & tables.

The best option seems to be a single output code chunk, set to the size of the page, with patchwork controlling layout of all content, converting incompatible content to appropriate grobs.

I'd really like to be able to add a hyperlink to a qr code displayed within the patchwork. I've tried wrapping the grob gridSVG::hyperlinkGrob without luck.

Any ideas how this might be done from within patchwork, or do you think I'm looking at an rmarkdown issue here?

Thanks,

Stuart

stuvet commented 1 year ago

Hmm, isn't that always the way? After a couple of hours trying to work around this I raise an issue & find a strong potential workaround 5min later!

I'll have a play to see if I can adapt this approach: https://stackoverflow.com/a/42262407

stuvet commented 1 year ago

OK I figured this out - it's as simple as setting the chunk output device to gridSVG. Works in Quarto too.

Closing as patchwork wasn't involved.