Forgot password?
 Create new account
View 109|Reply 1

在GitHub撰写+预览 数学公式

[Copy link]

3148

Threads

8489

Posts

610K

Credits

Credits
66148
QQ

Show all posts

hbghlyj Posted at 2025-3-29 12:37:20 |Read mode
在GitHub能够预览数学公式的格式有
  • md格式
    1. Inline equation: \( E = mc^2 \)
    2. Block equation:
    3. $$
    4. E = mc^2
    5. $$
    Copy the Code
  • rst格式,比md更复杂(tables, footnotes, citations)
    1. Inline equation: :math:`E = mc^2`
    2. Block equation:
    3. .. math::
    4.    E = mc^2
    Copy the Code
  • ipynb格式
    1. {
    2.   "cell_type": "markdown",
    3.   "metadata": {},
    4.   "source": [
    5.   "# Motivating Examples\n",
    6.   "\n",
    7.   "## The Lorenz Equations\n",
    8.   "### Source\n",
    9.   "```\n",
    10.   "\\begin{align}\n",
    11.   "\\dot{x} & = \\sigma(y-x) \\\\\n",
    12.   "\\dot{y} & = \\rho x - y - xz \\\\\n",
    13.   "\\dot{z} & = -\\beta z + xy\n",
    14.   "\\end{align}\n",
    15.   "```\n",
    16.   "### Display\n",
    17.   "\n",
    18.   "$\\begin{align}\n",
    19.   "\\dot{x} & = \\sigma(y-x) \\\\\n",
    20.   "\\dot{y} & = \\rho x - y - xz \\\\\n",
    21.   "\\dot{z} & = -\\beta z + xy\n",
    22.   "\\end{align}$"
    23.   ]
    24. },
    Copy the Code
ipynb用于执行代码来展示数据处理/交互图表,如果只是写写文档,没必要用它

3148

Threads

8489

Posts

610K

Credits

Credits
66148
QQ

Show all posts

 Author| hbghlyj Posted at 2025-3-29 12:40:24
hbghlyj 发表于 2025-3-29 04:37
rst格式,比md更复杂(tables, footnotes, citations)
rst格式支持文档模块化:以下可插入子文档intro.rst从第2行到第4行的内容
  1. .. include:: intro.rst
  2.    :start-line: 2
  3.    :end-line: 4
Copy the Code

手机版Mobile version|Leisure Math Forum

2025-4-20 12:23 GMT+8

Powered by Discuz!

× Quick Reply To Top Return to the list