用户工具

站点工具


playground:math

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

后一修订版
前一修订版
playground:math [2024/01/02 06:42] – 创建 penggeplayground:math [2026/07/30 04:09] (当前版本) – 外部编辑 127.0.0.1
行 1: 行 1:
 +~~DISCUSSION:off~~
 ===== 在 dokuwiki 中使用数学公式 ===== ===== 在 dokuwiki 中使用数学公式 =====
  
行 5: 行 6:
 ==== Inline Math ==== ==== Inline Math ====
  
-使用 $ 符号+使用 ''$'' 符号
  
 $a^2 + b^2 = c^2$ $a^2 + b^2 = c^2$
行 12: 行 13:
 </code> </code>
  
-或 \ 转义+或 ''\('', ''\)'' 转义
  
-\(1+2+\dots+n=\frac{n(n+1)}{2}\)  +\(1+2+\dots+n=\frac{n(n+1)}{2}\)
 <code> <code>
-\(1+2+\dots+n=\frac{n(n+1)}{2}\)  +\(1+2+\dots+n=\frac{n(n+1)}{2}\)
 </code> </code>
  
 ==== Display Math ==== ==== Display Math ====
 +
 +使用 ''$$'' 符号, 在单独的行显示数学公式
  
 $$ \frac{d}{dx}\left( \int_{0}^{x} f(u)\,du\right)=f(x) $$ $$ \frac{d}{dx}\left( \int_{0}^{x} f(u)\,du\right)=f(x) $$
行 26: 行 29:
 $$ \frac{d}{dx}\left( \int_{0}^{x} f(u)\,du\right)=f(x) $$ $$ \frac{d}{dx}\left( \int_{0}^{x} f(u)\,du\right)=f(x) $$
 </code> </code>
 +
 +或使用 ''\['' , ''\]'' 转义
 +
 +\[ \sin A \cos B = \frac{1}{2}\left[ \sin(A-B)+\sin(A+B) \right] \]
 +
 +<code>
 +\[ \sin A \cos B = \frac{1}{2}\left[ \sin(A-B)+\sin(A+B) \right] \]
 +</code>
 +
 +A wide range of math environments((Accepted math environments (specified [[https://github.com/liffiton/dokuwiki-plugin-mathjax/blob/master/syntax/protecttex.php#L27|here]] in the code): align, align*, alignat, alignat*, displaymath, eqnarray, eqnarray*, equation, equation*, flalign, flalign*, gather, gather*, math, multline, multline*)) will work as well:
 +
 +\begin{align*}
 +e^x & = 1 + x + \frac{x^2}{2} + \frac{x^3}{6} + \cdots \\
 +    & = \sum_{n\geq 0} \frac{x^n}{n!}
 +\end{align*}
 +
 +  \begin{align*}
 +  e^x & = 1 + x + \frac{x^2}{2} + \frac{x^3}{6} + \cdots \\
 +      & = \sum_{n\geq 0} \frac{x^n}{n!}
 +  \end{align*}
 +
 +
 +
 +Note that the math environments //should not// be inside the dollar sign delimiters; the environments should stand on their own with just the ''\begin'' and ''\end'' statements in order to be parsed correctly.
 +
 +
playground/math.1704177765.txt.gz · 最后更改: 2024/01/02 06:42 由 pengge