markdown - 内联 mathjax 公式后不需要的单词中断
问题描述
我正在使用 Mathjax 在 Jekyll 站点中嵌入公式,使用 Kramdown 作为我的渲染器。
它工作得很好,除了总是在内联公式之后插入一个隐式换行符,这意味着换行可以在公式和标点符号之间插入换行符。这导致了这样的事情:
Where this fell down was that my representation was very limited as to what
numbers it can represent. The _smallest_ number possible was the integer `1`,
which represented $$\frac{1}{64} \approx 0.016$$; the _largest_ number was
the integer `127` (the top bit is used for the sign), which represented $$1
\frac{63}{64} \approx 1.98$$.
...被渲染为:
这看起来很糟糕。
有什么办法可以防止这种情况发生吗?
解决方案
在 MathJax 和任何降价处理器(我知道)中都没有解决这个问题的内置方法。
解决此问题的两种方法:
- 移动等式内的标点符号
- 在您的工具链中的某处添加一个后处理启发式方法,该方法将由非空格包围的方程式包装在样式包括的元素中
white-space: nowrap;
;这将确保内部不会出现中断。
推荐阅读
- python - 如何在 python 中通过 Selenium 停止传出 PHP 脚本请求?
- python - 不适合模型 lenet
- regex - 正则表达式:在数学表达式中捕获带有参数的函数
- jquery - jquery .change() 在 laravel 循环中
- list - 无法理解飞镖中的列表考虑提供的示例
- java - 在 Java 8 中从 Date 迁移到 LocalDate 的正确方法是什么?
- java - 无法使用 By.xpath 定位元素
- node.js - Quasar 应用程序无法连接到 heroku socket.io 服务器
- entity - Sulu:实体没有字段或关联错误
- python - 使用归并排序对多维数组进行排序?