-
Notifications
You must be signed in to change notification settings - Fork 22.5k
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
Improve MathML examples #36925
Improve MathML examples #36925
Conversation
Preview URLs
External URLs (4)URL:
URL:
(comment last updated: 2024-11-27 11:48:25) |
files/en-us/web/mathml/examples/deriving_the_quadratic_formula/index.md
Outdated
Show resolved
Hide resolved
<!-- Representation in TeX format --> | ||
<annotation encoding="application/x-tex"> | ||
\begin{aligned} | ||
ax^2 + bx + c &= 0 \\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should use &
, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that it’s not rendered and you’re supposed to copy-paste it from the source, it might be better to store TeX annotations as they are. Otherwise, it would be hard to reproduce MathML with them, especially the bigger ones. Not sure why GitHub is concerned with naked &
: browsers render it just fine, and the HTML validator doesn’t mind it either.
<!-- Representation in TeX format --> | ||
<annotation encoding="application/x-tex"> | ||
\begin{aligned} | ||
(a + b)^2 &= c^2 + 4 \cdot \left( \frac{1}{2} ab \right) \\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, &
immediately followed by something other than #
or an alphanum seems ok if I read the parsing algo correctly:
https://html.spec.whatwg.org/multipage/parsing.html#character-reference-state
https://html.spec.whatwg.org/multipage/parsing.html#flush-code-points-consumed-as-a-character-reference
and indeed the validator does not complain.
The non-normative section https://html.spec.whatwg.org/#syntax-errors mentions it as non-conforming in "Errors involving fragile syntax constructs". The path causing error would be:
https://html.spec.whatwg.org/multipage/parsing.html#parse-error-unknown-named-character-reference
https://html.spec.whatwg.org/multipage/parsing.html#named-character-reference-state
https://html.spec.whatwg.org/multipage/parsing.html#ambiguous-ampersand-state
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are only two cases in annotations: &
and &=
, surrounded by spaces. So it should be fine then. Thanks!
Description
font-size: smaller
for inline annotations (it nicely aligns with the\small
key in TeX).Motivation
To make examples more useful and allow playing with them.