html - MathJax:如何使数学可复制?
问题描述
我正在使用 MathJax 在 HTML 文档中显示一些方程式。下面的代码片段解释了我想要做的事情:
<!DOCTYPE html>
<html>
<head>
<title>Math in HTML</title>
<meta charset="utf-8">
<script>
MathJax = {
tex: {
inlineMath: [['$', '$'], ['\\(', '\\)']]
},
svg: {
fontCache: 'global'
}
};
</script>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
</head>
<body>
<h1>Mathematic equations</h1>
<p>I cannot select this equation:
$$\intop_0^1f(x)dx=\pi$$
nor this one $x^2 + 3x - 2 = \zeta$.
</p>
<p>I would like that when someone copy-pastes the previous paragraph he/she would get:
<code>I cannot select this equation:
$$\intop_0^1f(x)dx=\pi$$
nor this one $x^2 + 3x - 2 = \zeta$.</code>
</body>
</html>
基本上我想让数学可以选择,并在复制到剪贴板以获取 Latex 代码时。这可能吗?
解决方案
推荐阅读
- java - 即使经过 SafetyNet 检查,电话身份验证仍然无法正常工作
- python - Numpy - 从二维数组中选择多个正方形
- java - DynamoDB QueryResultPage 仍然在伪造的独占开始键上返回结果
- c++ - QT:将 CSS 类分配给一些小部件
- docker - 无法从容器访问保管库
- c# - 通过 C# 中的程序 API 类创建新类(不被识别为程序的模型对象)
- google-apps-script - 删除 postMessage.. 来自意外窗口
- r - 计算 2 个数据帧中变量之间的相关性
- python - 如何模拟类级别参数
- xml - exi语法python方法