Referencing theorems in HTML like you can with LaTeX

倾然丶 夕夏残阳落幕 提交于 2019-12-11 01:59:34

问题


I am writing some webpages containing math content (using MathJax), and I am looking for a way to do the equivalent of the LaTeX theorem referencing, as in the following example:

\begin{theorem} \label{thm:commute}
    a+b=b+a
\end{theorem} 
According to Theorem (\ref{thm:commute}), $2+3=3+2$.

I am using the following CSS/HTML code to produce automatic theorem numbering:

.theorem:before {
    font-style: normal; 
    font-weight: bold; 
    content: "Theorem " counter(chap)"."counter(sect)"."counter(thm)" ";  
}
.theorem {
    counter-increment: theorem ;  
}
<div class="theorem">     
    \(a+b=b+a\)
</div>

I need the equivalent of the LaTeX \label, and \ref commands to assign a name to a theorem so that it can be referenced later on the webpage, and that will display counter(chap)"."counter(sect)"."counter(thm).

来源:https://stackoverflow.com/questions/49520365/referencing-theorems-in-html-like-you-can-with-latex

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!