Separately Formatting Tags in Environments Versus References (`tagformat`)
Created by: geometrian
Is your feature request related to a problem? Please describe.
The tagformat
option is really great as far as it goes, but (as far as I can tell) it's missing a way to format the reference and the referent separately.
To clarify: the particular use-case would be something like having the equation number inside the \begin{equation}
/\end{equation}
block be "(1)", but the equation reference \eqref{...}
be "Equation 1" (the whole thing linked to the equation). That is, the following source:
\begin{equation}
f(x) = x^2
\label{eq:quadratic}
\end{equation}
<p>A simple quadratic function is given in \eqref{eq:quadratic}.</p>
Would render something like:
f(x) = x^2 (1)
A simple quadratic function is given in Equation 1.
This evokes established LaTeX style in some fields.
However, as it is, the configured function MathJax.tex.tagformat.tag
is used for both places, making this apparently impossible.
Describe the solution you'd like
Put simply, I would like to see a way to do this added into MathJax.
I don't want to say how this must be done, but perhaps the way it might be exposed would be to make another function (reftag
? eqref
?) inside tagformat
that by default calls tag
. This solution has the advantage of preserving backward-compatibility.
The config for the above use-case would then be something like:
MathJax = {
loader: { load: [ "[tex]/tagformat" ] },
tex: {
//...
tags: "ams",
packages: { "[+]": [ "tagformat" ] },
tagformat: {
tag: (tag) => "("+tag+")",
reftag: (tag) => "Equation "+tag,
}
}
//...
};
Describe alternatives you've considered
Not really applicable; the alternative is to not support this feature. As before, that would be a shame since certain fields require this formatting.
If this feature is already supported, then it should be documented.
Additional context
Not applicable.