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

feat(math): Support square roots #2119

Merged
merged 1 commit into from
Oct 1, 2024

Conversation

Omikhleia
Copy link
Member

@Omikhleia Omikhleia commented Sep 29, 2024

Closes #1604

My dear math friends... Do you really expect SILE will thrive without the square root? I don't know for other countries, but in France, at least when I was younger, the solution to second-degree equations was taught in school much earlier than integrals, matrices and other advanced stuff.

So we shall all want square roots, even if it has to be a hack of some sort.

Not supporting these is detrimental to SILE, when other worse solutions are proposed to typists (pun intended and completely assumed)

As I just said...

image

@Omikhleia Omikhleia requested a review from a team as a code owner September 29, 2024 22:13
@Omikhleia Omikhleia self-assigned this Sep 29, 2024
@Omikhleia Omikhleia added the modules:packages Issue relates to core or 3rd party packages label Sep 29, 2024
@Omikhleia Omikhleia added this to the v0.15.6 milestone Sep 29, 2024
@Omikhleia
Copy link
Member Author

Omikhleia commented Sep 29, 2024

Note: I would have wished for the "inline" (text mode) last formula to make the an smaller and smaller. Would you help, oh my great math friends?

EDIT: LaTeX (below) does not seem to make roots in roots smaller, actually.

image

We are all good then. Well LaTeX shows the radical also extending below the baseline (even more so for display math), but there doesn't seem to be an openType property corresponding to this feature... (EDIT: And using for reference the depth the radical symbol would possibly have in the current font doesn't lead to such huge expansion - So I am unsure we want to care.)

@Omikhleia
Copy link
Member Author

Be my guests:

\begin[class=book, papersize=a6]{document}
\use[module=packages.math]
\font[family=Libertinus Serif]

We want square roots...
\math[mode=display, numbered=true]{\sqrt{-1} = i}

Display:
\math[mode=display, numbered=true]{x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}}

Or inline: \math{x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}}

\math[mode=display, numbered=true]{c = \sqrt{\frac{E}{m}}}

Or inline: \math{c = \sqrt{\frac{E}{m}}}

Let's go mad, for any sequence \math{a_n > 0}:
\math[mode=display, numbered=true]{\sqrt{a_1 + \sqrt{a_2 + \sqrt{a_3 + \sqrt{a_4 + \sqrt{a_5 ...}}}}}
 = e^{\sum_{n=1}^{\infty} \frac{\mi{ln}\, a_n}{2^n}}
}

Inline: \math{\sqrt{a_1 + \sqrt{a_2 + \sqrt{a_3 + \sqrt{a_4 + \sqrt{a_5 ...}}}}}
 = e^{\sum_{n=1}^{\infty} \frac{\mi{ln}\, a_n}{2^n}}}

\end{document}

alerque
alerque previously approved these changes Sep 30, 2024
@alerque alerque merged commit aebe021 into sile-typesetter:master Oct 1, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
modules:packages Issue relates to core or 3rd party packages
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

MathML msqrt not supported
3 participants