Description
Issue Summary
When using an operator before the starred version of a command made with \DeclarePairedDelimiter
(or its variants), an extra space is added between them. This is true in both MathJax v3 and MathJax v4. I would expect this when using scaled delimiters manually, such as in \sin\left(x\right)
, but the mathtools documentation mentions fixing this:
Within the starred version of \DeclarePairedDelimiter and \DeclarePairedDelimiterX we make a few changes such that the auto scaled \left and \right fences behave as opening and closing fences, i.e.
$\sin(x)$ vs.$\sin\left(x\right)$ (the later made via$\sin\left(x\right)$
), notice the gap between ‘sin’ and ‘(’.
Technical details:
- MathJax Versions: 3.2.2, 4.0.0-beta.4
- Client OS: macOS 14.3
- Browsers: Obsidian 1.5.3 (which uses Chromium), Firefox 122.0.1
I'm not sure how Obsidian configures and loads MathJax, but for MathJax v4.0.0-beta.4 in Firefox, I'm using the following configuration:
MathJax = {
loader: { load: ["[tex]/mathtools"] },
tex: { packages: { "[+]": ["mathtools"] } },
};
and loading MathJax via
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected]/tex-mml-chtml.js"></script>
Supporting information:
The following screenshots show what I'm referring to. I'd expect the brackets on both lines to align, like in LaTeX.
And here's the TeX used in those screenshots:
\DeclarePairedDelimiterXPP\Prob[1]{\Pr}[]{}{#1}
\begin{align}
\text{unstarred:}\qquad & \Prob{A} \Prob{B} \\
\text{starred:}\qquad & \Prob*{A} \Prob*{B} \\
\end{align}