r - 如何在 Rmarkdown github_document 中使用 MathJax?
问题描述
我想在 Rmarkdown 生成的 GitHub README 文件中包含一些数学符号。但是,将符号$
括起来并不会将它们呈现为符号:它只是在它们周围加上括号。根据这个文档,我想也许我可以使用 MathJax,但到目前为止我努力让它工作没有成功。任何帮助,将不胜感激!
尝试1:
---
output:
github_document
---
Here are some math symbols: $/alpha$ $A$ $1$
尝试2:
---
output:
github_document:
pandoc_args: "--mathjax"
---
Here are some math symbols: $/alpha$ $A$ $1$
尝试 3:
---
output:
github_document:
pandoc_args: [
"--mathjax", "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"
]
---
Here are some math symbols: $/alpha$ $A$ $1$
尝试4:
---
output:
github_document:
md_extensions: -tex_math_single_backslash+tex_math_dollars
---
Here are some math symbols: $/alpha$ $A$ $1$
到目前为止,所有这些尝试都产生了这样的结果:
解决方案
这是一个很难的问题,很多人之前都问过他们,例如 https://github.com/github/markup/issues/897
我为一些小公式找到了一个简单的解决方案,例如 alpha:
只需使用&alpha
您也可以使用...或...子或上标
(在此处查看更多信息:https ://www.w3schools.com/html/html_entities.asp )
在这里找到的解决方案: How to show math equations in general github's markdown(not github's blog)
推荐阅读
- java - 为什么我不能在 Android 中按片段标签创建片段
- android - 如何在Android中确定yolov4-tiny的mAP和FPS
- rest - 通过键名而不是键 ID 获取 Lokalize 项目
- regex - 我需要在我的表达式之后获取 2 个空格之间的所有数字
- c# - 如何在 C# 中将现有表单添加到新菜单表单中,因此通过单击按钮我可以从菜单屏幕打开它
- javascript - 如何使这个 owlcarousel 正确显示项目?
- c# - READER IS CLOSED 时调用 read 的尝试无效 .. 错误在每一行重复
- node.js - 将另一个集合中的文档保存在新文档的数组中
- r - 根据 R 中表的列数过滤列表
- python-3.x - 在 termux 中安装 pynput 时出现错误