问题
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