【问题标题】:math notation written in Markdown in Jupyter Notebook not rendered consistently on GitHub在 Jupyter Notebook 中用 Markdown 编写的数学符号在 GitHub 上的呈现不一致
【发布时间】:2020-01-05 04:19:10
【问题描述】:

我在 Jupyter Notebook 中使用 Markdown 编写了以下带有数学符号的文本:

* (linear regression model prediction) : y = $\theta_0$ + $\theta_1$$x_1$ + $\theta_2$$x_2$ + $\theta_n$$x_n$
* (...in vectorized form) ------------ : y = $h_\theta$(x) = $\Theta$.x

不知怎的,当这个notebook上传到GitHub时,第一部分没有正确渲染,而第二部分却正确渲染,如下图所示:

在 VSCode 中打开此笔记本时,正确呈现相同的 markdown 文本:

请问如何解决 Jupyter Notebook 中通过 Markdown 渲染数学符号时出现的这种不一致问题?

上面提到的有问题的 jupyter notebook 是 show here。

【问题讨论】:

    标签: math jupyter-notebook markdown


    【解决方案1】:

    如果您查看原始文件,您会发现它只包含一个带有该数学的降价单元格。所以 GitHub 的 Jupyter 渲染不会将其识别为数学(apparently 他们在后台使用旧的nbconvert 版本)。

    但也许你可以通过不使用双倍美元$$ 来避免这个问题。通常,你会在 markdown 中这样写:

    * linear regression model prediction: $y = \theta_0 + \theta_1x_1 + \theta_2x_2 + \theta_nx_n$
    * in vectorized form: $y = h_\theta(x) = \Theta.x$
    

    【讨论】:

      猜你喜欢
      • 2018-05-31
      • 2020-02-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-02-06
      • 2017-11-16
      • 2017-03-10
      相关资源
      最近更新 更多