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

binary/unary operator in TeX-like math mode #1642

Open
Omikhleia opened this issue Dec 2, 2022 · 0 comments
Open

binary/unary operator in TeX-like math mode #1642

Omikhleia opened this issue Dec 2, 2022 · 0 comments
Labels
bug Software bug issue modules:packages Issue relates to core or 3rd party packages
Milestone

Comments

@Omikhleia
Copy link
Member

Omikhleia commented Dec 2, 2022

SILE 0.14.5

Using the regular minus dash (-) or the minus unicode symbol U+2212 (−) in TeX-like math:

\begin{document}
\use[module=packages.math]

\math[mode=display]{\pi=\sum_{k=0}^\infty\frac{1}{16^k}(\frac{4}{8k+1} - \frac{2}{8k+4} - \frac{1}{8k+5} - \frac{1}{8k+6})}

\math[mode=display]{\pi=\sum_{k=0}^\infty\frac{1}{16^k}(\frac{4}{8k+1} − \frac{2}{8k+4} − \frac{1}{8k+5} − \frac{1}{8k+6})}

\math[mode=display]{e^{i\pi} = -1}

\math[mode=display]{e^{i\pi} = −1}

\end{document}

image

Both cases apparently use U+2212 for the rendering of the formula (which seems great).

However:

  • In the case U+2212 is used, it is better-looking as a binary operator, but badly looking as a unary operator.
  • Inversely for the regular minus (which, theoretically at least, is probably the only valid option in TeX), looking better as unary operator, but being too close to the content as binary operator.

More generally perhaps, both \pm and + work well as binary operators, but are not so nicely placed as unary operator.

Experimenting with online renderers to MathJax and LaTeX, all cases with regular -, + or \pm look consistent with my expectations, so perhaps there would be a way to better handle unary vs. binary use of such operators in SILE's math implementation?

@alerque alerque added this to the v0.x.y milestone Dec 2, 2022
@alerque alerque added the bug Software bug issue label Dec 2, 2022
@Omikhleia Omikhleia added the modules:packages Issue relates to core or 3rd party packages label Mar 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Software bug issue modules:packages Issue relates to core or 3rd party packages
Projects
Status: To do
Development

No branches or pull requests

2 participants