借助 <devsite-mathjax>
自定义元素,您可以在 DevSite 内容中显示数学表示法。
一般用法
在文件顶部添加具有 config
属性的 <devsite-mathjax>
自定义元素。<devsite-mathjax>
元素是自包含的,因此在网页上只需添加一次。
这是爱因斯坦的广义相对场方程示例,其中 <devsite-mathjax>
元素和 config
属性设置为 TeX-AMS-MML_SVG
。
分隔符
数学符号用分隔符括起来,可单独显示,也可内嵌显示。
独立版本
以下勾股定理被 $$
delimiters and wrapped
in a <div>
element. It is displayed on its own line.
The following Pythagorean theorem is surrounded by
\\[
and \\]
delimiters
and isn't wrapped in a <div>
element. It is displayed on its own line.
\[
a^2 + b^2 = c^2
\]
The following Pythagorean theorem is surrounded by \[
and \]
delimiters and
is wrapped in a <div>
element. It is displayed on its own line.
\[
a^2 + b^2 = c^2
\]
Inline
This inline equation of the area of a circle $ A = \pi{r^2} $ is displayed in
this Markdown paragraph by using $
delimiters.
This inline equation of a summation expression \( \sum_{i=1}^n X_i \) is
displayed in this Markdown paragraph by using \\(
and \\)
delimiters.
This inline equation of a straight line \(y=mx+b\) is displayed in this HTML
paragraph by using \(
and \)
delimiters.
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2022-03-14。