protect_inline_math | R Documentation |
Find and protect all inline math elements
protect_inline_math(body, ns)
body |
an XML document |
ns |
an XML namespace |
a modified copy of the original XML document
txt <- commonmark::markdown_xml(
"This sentence contains $I_A$ $\\frac{\\pi}{2}$ inline $\\LaTeX$ math."
)
txt <- xml2::read_xml(txt)
cat(tinkr::to_md(list(body = txt, yaml = "")), sep = "\n")
ns <- tinkr::md_ns()
if (requireNamespace("withr")) {
protxt <- withr::with_namespace("tinkr", protect_inline_math(txt, ns))
cat(tinkr::to_md(list(body = protxt, yaml = "")), sep = "\n")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.