Add support for math in blastula_email rmarkdown format#298
Add support for math in blastula_email rmarkdown format#298
Conversation
|
Christoph this is great! I've been wanting the same thing in gt as well (SVG-based formulas in non-LaTeX, non-Word output) but I'm really happy to see this work here in this package. We can definitely discuss this a bit more :) |
rich-iannone
left a comment
There was a problem hiding this comment.
Looks good! I'm ready to accept this, testing in email clients could come later.
|
As you want. I really don't know how this behave from email. I just wanted to show here how this could be done in a R Markdown output format. Maybe you want to make this feature opt-in, and not opt-out in case of issues ? I used the default to I am thinking about this because it requires internet connection for webtex to work and generate the svg. Anyhow, if you feel good about this without testing some email client, feel free to add a news bullet and merge. |

This is a POC to test how we could support math easily in blastula rmardown fomat following the improved support in rmarkdown
This first test is using
webtexmethod which allow to use an online service to insert math as SVG (default) or PNG in HTML document. Hopefully self-contained image like SVG or PNG are ok to be included in email.Another possible method would be using the katex R package https://docs.ropensci.org/katex/index.html that we support through
math_method: r-katexin rmarkdown but this will require a specific CSS file.I don't how this CSS would behave in email client etc... This needs to be studied.
If none of this two solutions are possible for email format, this is harder and needs possibly specific adjustement somehow is possible.
Testing
Using this PR you can try rendering this document
Math formula will be inserted in email with a img and SVG data. It looks ok but require probably some CSS tweak.

HTML code looks like
I don't think anything else is inserted in the document - to check.
@rich-iannone sharing that so you see what is possible. Happy to discuss this with you