【发布时间】:2019-05-13 14:33:13
【问题描述】:
我在 MathJax 文档中读到自动换行符
仅在公式最初排版时计算一次,并且如果用户更改窗口大小则不会更改
如何在每次改变窗口大小时动态计算它们?
例如我有以下代码:
<!DOCTYPE html>
<html>
<head>
<title>MathJax auto line-breaking</title>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
CommonHTML: { linebreaks: { automatic: true } },
"HTML-CSS": { linebreaks: { automatic: true } },
SVG: { linebreaks: { automatic: true } }
});
</script>
<script type="text/javascript" async src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_CHTML"></script>
<style>
#site-content {
width: 70%;
margin: 0 auto;
border: 1px solid black;
}
</style>
</head>
<body>
<div id="site-content">
<p>Some cool text about math</p>
\begin{equation}
f(u_1) = f(u_0) + hf'(u_0)+{h^2\over 2!}f''(u_0) + \cdots + {h^{n+1}\over (n+1)!}f^{(n+1)}(u_0) + o(h^{n+1})
\end{equation}
<p>More cool text</p>
\begin{equation}
f(u_1) = f(u_0) + hf'(u_0)+{h^2\over 2!}f''(u_0) + \cdots + {h^{n+1}\over (n+1)!}f^{(n+1)}(u_0) + o(h^{n+1})
\end{equation}
<p>More cool text</p>
\begin{equation}
f(u_1) = f(u_0) + hf'(u_0)+{h^2\over 2!}f''(u_0) + \cdots + {h^{n+1}\over (n+1)!}f^{(n+1)}(u_0) + o(h^{n+1})
\end{equation}
<p>...</p>
</div>
</body>
</html>
如果我以全宽加载此页面然后调整窗口大小会发生什么:
如果可以的话,我想动态添加换行符:
【问题讨论】:
-
未来注意事项:cdn.mathjax.org 即将结束生命周期,请查看mathjax.org/cdn-shutting-down 了解迁移提示。