mathjax 对齐环境中的链接(github 风格的 markdown)

问题描述 投票:0回答:1

在证明数学陈述的合理性时,我经常使用以下模式:

\begin{align*}
ax^2 + bx + c &= 0\\
x &= \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} & \text{applying the Quadratic Formula}
\end{align*}

我尝试在 github 风格的 markdown 中使用解释该过程的页面链接来执行此操作,如下所示:

\begin{align*}
ax^2 + bx + c &= 0\\
x &= \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} & \text{by the [Quadratic Formula](link/to/formula)}
\end{align*}

不幸的是,这似乎破坏了对齐环境,现在这个

.md
文件的渲染将乳胶代码显示为纯文本。有没有解决的办法?我尝试过相对链接、普通链接和许多其他解决方案。如果可能的话,我想继续使用对齐环境以及对齐环境中的某种链接。

如果相关,我会在 github-wiki 页面上执行此操作,并且执行链接的页面和链接的页面都存在于 wiki 中。

hyperlink markdown mathjax github-flavored-markdown
1个回答
0
投票

您可以使用

\href{}
LaTeX 宏来添加链接:

\begin{align*}
ax^2 + bx + c &= 0\\
x &= \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} & \text{by the }\href{link/to/formula}{\text{Quadratic Formula}}
\end{align*}

您的方法失败的原因是,当 Markdown 将

[Quadratic Formula](link/to/formula)
转换为链接时,会在公式中插入 HTML 标签,而 MathJax 无法处理其中包含 HTML 标签的数学。

© www.soinside.com 2019 - 2024. All rights reserved.