Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No variadic cartesian product symbol #3890

Open
rdong8 opened this issue Oct 28, 2023 · 1 comment
Open

No variadic cartesian product symbol #3890

rdong8 opened this issue Oct 28, 2023 · 1 comment

Comments

@rdong8
Copy link

rdong8 commented Oct 28, 2023

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.

@edemaine
Copy link
Member

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants