Jupyter 笔记本 Markdown 输出在具有内联 MathJax 表达式的行上添加了额外的垂直填充
我的 Jupyter Notebook 的 Markdown 单元格中的内联 MathJax 通常(特别是涉及超级/下标时)会导致渲染的行具有与段落分隔符一样多的垂直空间,尽管没有此类输入。
以下是呈现的版本,显示了似乎是多个段落分隔符的内容:
以及输入,在“It”之前显示单个段落中断(尽管包裹在 SO 上):
The solutions the to polynomial $x^d = 1$ are then the powers of *a*, and there are only *d* unique powers of *a* in $Z/(P))^{\times}$ - synergistically, since a polynomial of degree *d* under a multiplicative group has at most *d* roots (or equivalently, solutions, in this case), then all *d* powers of *a*, or the subgroup *A* represent the *only* possible solutions to the polynomial.
It is possible that an element of the subgroup generated by *a* contains elements with orders less than *d* (but never greater than).
这完全破坏了流程,看起来很丑,并且使预期的段落无效间距。更糟糕的是,它似乎正在创造表达甚至不需要的空间。有没有办法在我的单元格/笔记本中实现一致的垂直线填充?我不记得这总是一个问题。
Inline MathJax in the Markdown cells of my Jupyter Notebook often (especially when super/subscripts are involved) will cause the rendered line to have as much vertical space as a paragraph break despite no such input.
Here is the rendered version showing what appear to be multiple paragraph breaks:
And the input, which shows a single paragraph break (though wrapped on SO) right before "It":
The solutions the to polynomial $x^d = 1$ are then the powers of *a*, and there are only *d* unique powers of *a* in $Z/(P))^{\times}$ - synergistically, since a polynomial of degree *d* under a multiplicative group has at most *d* roots (or equivalently, solutions, in this case), then all *d* powers of *a*, or the subgroup *A* represent the *only* possible solutions to the polynomial.
It is possible that an element of the subgroup generated by *a* contains elements with orders less than *d* (but never greater than).
This completely breaks the flow, looks ugly, and nullifies intended paragraph spacing. Even worse, it seems to be creating space which isn't even required for the expression. Is there a way to achieve a consistent vertical line padding throughout my cell/notebook? I don't remember this always being a problem.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以更改位于
~/.jupyter/custom
的custom.css
文件的此片段,以删除占据 Markdown 单元格中行高的 MathJax 表达式。对我来说,它位于第 3201 行。我确信这可以防止当垂直扩展的 MathJax 表达式内联使用时发生一些非常丑陋的剪辑,但我宁愿在出现这些问题时处理它们,而不是句子中间经常出现不一致和意外的换行符。
You can change this snippet of the
custom.css
file located at~/.jupyter/custom
to remove MathJax expressions taking over the line height in your Markdown cells. For me this was located at line 3201.I'm sure this prevents some very ugly clipping that can happen when vertically expansive MathJax expressions are used inline, but I would rather deal with those issues as they arise than constantly having inconsistent and unintended line breaks mid sentence.