KaTeX/KaTeX

No variadic cartesian product symbol

rdong8 opened this issue · 1 comments

rdong8 commented

Before requesting a feature, please search for existing issues.

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

I would like to denote the cartesian product of an arbitrary number of sets, similarly to how $\bigcup_i A_i$ gives the union of $n$ sets.

Describe the solution you'd like:
A clear and concise description of what you want to happen.

Possibly extract the code from the mathabx package that provides the $\bigtimes$ symbol and include it into KaTeX? That is the recommended solution here.

Link to or name of a (La)TeX package that provides the same feature:
KaTeX's general goal is to render as LaTeX does.

mathabx: https://ctan.org/pkg/mathabx?lang=en

Describe alternatives you've considered:
A clear and concise description of any alternative solutions or features you've considered.

Using the regular $\times$ symbol, but it doesn't look right: $D_y = \{ (x_i)_{i=1}^n \in \times_{i=1}^n \operatorname{range}(X_i) : g(x_i)_{i=1}^n = y \}$.

Additional context:
Add any other context or screenshots about the feature request here.

I am using the KaTeX included in Notion if that is relevant.

I believe \prod is somewhat standard for this setting, and supported by KaTeX.

\bigtimes is a reasonable ask, though. mathabx seems to implement it with a font, which is complicated to add to KaTeX. But mathtools seems to do it with "simple" macros:

https://github.com/latex3/mathtools/blob/58d14613fc469718fe85849dfcfcee2a605c2b2b/mathtools.dtx#L5877-L5916

Basically, some resizing (different in different styles) and some vertical centering. KaTeX doesn't support \vcenter though, so this is a little tricky. Here's an approximation in your example:

D_y = \{ (x_i)_{i=1}^n \in {\raisebox{-.2em}{\LARGE$\times$}}_{i=1}^n \operatorname{range}(X_i) : g(x_i)_{i=1}^n = y \}

image

Probably we could write a general macro (with \mathchoice) that gets the size and vertical spacing right. Feel free to submit a PR!