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

Math more fixes and features #2151

Draft
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

Omikhleia
Copy link
Member

@Omikhleia Omikhleia commented Oct 26, 2024

WIP1

WARNING:
Currently on top of a raw merge of my previous math-related PRs.

Footnotes

  1. "Grandpa, how did you end up on such an adventure in the perilous Land of Math?"
    "Well, it all began with a simple, amusing task involving square roots, nth roots, and the like..."
    "And that went smoothly, didn’t it?"
    "At first, yes. But then I started picking out random formulas, sure I could typeset anything that came my way. Little did I know, I had wandered into the lair of the Hydra."
    "The Hydra? That beast with countless heads that regrows two for every one that's cut off?"
    "Exactly. The great monster, relentless devourer of formulas"
    "And did you manage to defeat it?"
    "I can’t say for sure. But I stopped complaining and making issues. I just drew my sword and kept fighting the beast. Pouring commits into the lair, one after another."

MathML Core 3.3.2: "To avoid visual confusion between the fraction bar
and another adjacent items (e.g. minus sign or another fraction's bar)"
Similar to the `\text` command in amsmath, but does not support internal
embedding of math equations. Yet it covers the usual need for some bits
of regular text inside math formula.
As in amsmath: lim, limsup, liminf, projlim, injlim.
One-letter identifiers are in italic as per MathML, but in TeX-like math
the Gamma is upright ("normal"). Thus, change the "normal" math variant in
the MathML example, so tha tboth MathML and TeX-like math end up resulting
in the same output.
Math formula in block quotes, footnotes, and even headers
shall use the current document font size, not some hard-coded
10pt default.
These tests use document font size at 11pt, but formulas would be
typeset at 10pt as the math.font.size default was hard-coded.
It now follows the current document font size, so enforce it back
to 10pt in order for the test to pass unchanged.
…ont size

I don't really mind us using the (non-Core) rowspacing and columnspacing
attributes, but the default values must be a ratio of the current math font
size, not some hard-coded value in pt.
Legit MathML elements for which a naive implementation is better than
nothing and paves the way to check other more important elements from
the MathML test suite.
…ike math

So that stretching occurs on the relevant spans of content.
One wants `\vec{v}`, `\hat{n}` etc. to result in proper stacking of
the corresponding symbol over the argument, instead of the symbol
alone and the argument being lost :)
@Omikhleia Omikhleia self-assigned this Oct 26, 2024
@Omikhleia Omikhleia requested review from a team and alerque as code owners October 26, 2024 01:13
@Omikhleia Omikhleia marked this pull request as draft October 26, 2024 01:16
We long did without it, but MathML examples may contain lengths in px.
And we'll be happy too with other uses cases such as Markdown etc.
This might break some code as SILE.types.length can ignore the unknown
unit and the raw number value would thus be regarded as being in pt.
But that's rather a parsing bug anyway, and SILE.types.measurement spits
an error, so let's not care.
In particular, in most MathML examples, tests, or results from other
converters, a zero line thickness is used for binomial coefficients
and stacked subscript/superscript on big operators such as sums, etc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

1 participant