Well, this doesn't do everything Victor suggested, but it does implement (1) and (1)' that you requested. His suggestions for cross references are good ones, and it would be nice to see an extension that does that. In fact, this example should be made into an extension as well. Anyone want to give it a go?
In any case, here is an example that implements \section{n} and makes the equation tags format using the section number (it can actually be anything, not just a number). Perhaps that is sufficient for your needs.
<!DOCTYPE html>
<html>
<head>
<title>Equation numbers by section</title>
<script type="text/x-mathjax-config">
MathJax.Hub.Register.StartupHook("TeX AMSmath Ready",function () {
var sectionDefault = {name: "", num: 0};
var sections = {}, section = sectionDefault;
//
// The MathJax objects we need to modify
//
var TEX = MathJax.InputJax.TeX, PARSE = TEX.Parse;
var AMS = MathJax.Extension["TeX/AMSmath"];
//
// Add \section{n} and \seteqnumber{n} macros
//
TEX.Definitions.Add({
macros: {
section: "mySection",
seteqnumber: "mySetEqNumber"
}
});
PARSE.Augment({
//
// \section{n}
// Sets the current section. The n is used in tags and also in
// the anchor names. The equation numbers are set to 0 when the
// section is changed. If a section is reused, the numbers restart
// where we left off.
//
mySection: function (name) {
section.num = AMS.number;
var n = this.GetArgument(name);
if (n === "") {
section = sectionDefault;
} else {
if (!sections["_"+n]) sections["_"+n] = {name:n, num:0};
section = sections["_"+n];
}
AMS.number = section.num;
},
//
// \seteqnumber{n}
// sets the next equation number to be n (a positive integer).
//
mySetEqNumber: function (name) {
var n = this.GetArgument(name);
if (!n || !n.match(/^ *[0-9]+ *$/)) n = ""; else n = parseInt(n)-1;
if (n === "" || n < 1) TEX.Error("Argument to "+name+" should be a positive integer");
AMS.number = n;
}
});
//
// Configure the formatting of the tags and IDs. The IDs need to
// include the secetion number as well so that the equations in
// different sections get different anchors.
//
MathJax.Hub.Config({
TeX: {
equationNumbers: {
formatTag: function (n) {return "("+(
section.name+"."+n).replace(/^\./,"")+")"},
formatID: function (n) {
n = (
section.name+'.'+n).replace(/[:"'<>&]/g,"").replace(/^\./,"");
return 'mjx-eqn-' + n;
}
}
}
});
});
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
TeX: {
equationNumbers: {
autoNumber: "AMS"
}
}
});
</script>
</head>
<body>
\begin{align}
a+b &= c
\end{align}
<div style="display:none; position:absolute">
\(\section{E}\)
</div>
\begin{equation}
E=mc^2
\end{equation}
<div style="display:none; position:absolute">
\(\section{1}\)
</div>
\begin{align}
a+b &= c
\end{align}
\begin{align}
a+b &= c
\end{align}
<div style="display:none; position:absolute">
\(\section{1.1}\)
</div>
\begin{align}
a+b &= c
\end{align}
<div style="display:none; position:absolute">
<!-- back to the default numbering sequence -->
\(\section{}\)
</div>
\begin{align}
a+b &= c
\end{align}
<div style="display:none; position:absolute">
<!-- back to numbers starting with "E." starting where we left off -->
\(\section{E}\)
</div>
\begin{equation}
E=mc^2
\end{equation}
\begin{equation}
E=mc^2
\end{equation}
</body>
</html>
See if that does what you need.