Add support for math in blastula_email rmarkdown format #298
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
webtex
method 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-katex
in 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