From 76b14470d8de2ed78e2d0a751727916a1b768269 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Thu, 21 Jul 2022 08:21:54 +0200 Subject: [PATCH 01/20] Add MathML tutorial An introduction to basic MathML constructions, using similar structure as the lessons for HTML, CSS and JavaScript. This only introduces the "first steps" module but more advanced topics may be added in the future. --- .../first_steps/fractions_and_roots/index.md | 318 ++++++++++ .../fractions_and_roots/mfrac-msqrt-mroot.png | Bin 0 -> 6957 bytes .../first_steps/getting_started/index.md | 225 ++++++++ files/en-us/learn/mathml/first_steps/index.md | 53 ++ .../learn/mathml/first_steps/scripts/index.md | 544 ++++++++++++++++++ .../learn/mathml/first_steps/tables/index.md | 343 +++++++++++ .../first_steps/text_containers/index.md | 421 ++++++++++++++ .../text_containers/operator-spacing.png | Bin 0 -> 15626 bytes .../index.md | 142 +++++ .../xelatex-output.png | Bin 0 -> 29027 bytes files/en-us/learn/mathml/index.md | 47 ++ 11 files changed, 2093 insertions(+) create mode 100644 files/en-us/learn/mathml/first_steps/fractions_and_roots/index.md create mode 100644 files/en-us/learn/mathml/first_steps/fractions_and_roots/mfrac-msqrt-mroot.png create mode 100644 files/en-us/learn/mathml/first_steps/getting_started/index.md create mode 100644 files/en-us/learn/mathml/first_steps/index.md create mode 100644 files/en-us/learn/mathml/first_steps/scripts/index.md create mode 100644 files/en-us/learn/mathml/first_steps/tables/index.md create mode 100644 files/en-us/learn/mathml/first_steps/text_containers/index.md create mode 100644 files/en-us/learn/mathml/first_steps/text_containers/operator-spacing.png create mode 100644 files/en-us/learn/mathml/first_steps/three_famous_mathematical_formulas/index.md create mode 100644 files/en-us/learn/mathml/first_steps/three_famous_mathematical_formulas/xelatex-output.png create mode 100644 files/en-us/learn/mathml/index.md diff --git a/files/en-us/learn/mathml/first_steps/fractions_and_roots/index.md b/files/en-us/learn/mathml/first_steps/fractions_and_roots/index.md new file mode 100644 index 000000000000000..82b0bfef110dbb5 --- /dev/null +++ b/files/en-us/learn/mathml/first_steps/fractions_and_roots/index.md @@ -0,0 +1,318 @@ +--- +title: MathML fractions and roots +slug: Learn/MathML/First_steps/Fractions_and_roots +tags: + - Beginner + - MathML + - Landing +--- +{{LearnSidebar}}{{PreviousMenuNext("Learn/MathML/First_steps/Text_containers", "Learn/MathML/First_steps/Scripts", "Learn/MathML/First_steps")}} + +Relying on text containers, this article describes how to build more complex +MathML expressions by nesting fractions and roots. + + + + + + + + + + + + +
Prerequisites: + Basic computer literacy, + basic software installed, basic knowledge of + working with files, and HTML basics (study + Introduction to HTML.) +
Objective: + To get familiar with MathML elements used for writing fractions and + square roots. +
+ +## Subtrees of ``, `` and `` + +In the [getting started with MathML](/en-US/docs/Learn/MathML/First_steps/Getting_started) article, we've already met the `` element to describe a fraction. Let's consider a basic example which adds new elements for roots (`` and ``): + +```html + + + child1 + child2 + + +
+ + + child1 + child2 + ... + childN + + +
+ + + child1 + child2 + + +``` + +Below is a screenshot of how it is rendered by a browser: +* We already know that the `` element is rendered as a fraction: the first child (the numerator) and is drawn above the second child (the denominator) separated by a horizontal bar. +* The `` is rendered as a square root: its children are laid out like an [``](/en-US/docs/Learn/MathML/First_steps/Getting_started#grouping_with_the_mrow_element), prefixed by a root symbol √ and completely covered by an overbar. +* Finally, the `` element is rendered as an nth root: the first element is covered by the radical symbol while the second element is used as the degree of the root and rendered as a prefix superscript. + +![Screenshot of mfrac, msqrt, mroot](mfrac-msqrt-mroot.png) + +### Active learning: nesting different elements + +Here is a simple exercise to verify whether you understood the relation between a MathML subtree and its visual rendering. The document contains a MathML formula and you must check all subtrees corresponding to a subtree in that MathML formula. Once you are done, you can inspect the source of the MathML formula and verify if it matches your expectation.

+ +```html hidden + + + + + My page with math characters + + + +

+ + + + 2 + + + 4 + 3 + + + + + + 5 + + 6 + 7 + + + + + + 8 + + 9 + +

+ +
    +
  1. + + An mfrac with an mroot as its first child and an msqrt as its second child. +
  2. +
  3. + + An mroot with an mn as its first child and mfrac as its second child. +
  4. +
  5. + + An msqrt containing an mfrac element. +
  6. +
  7. + + An msqrt with one mn child. +
  8. +
  9. + + An mroot with an mfrac as its first child and mn as its second child. +
  10. +
  11. + + An msqrt with the following list of children: mn, mo, mn. +
  12. +
  13. + + An mfrac with an msqrt as its first child and an mroot as its second child. +
  14. +
  15. + + An mfrac with the following list of children: msqrt, mn, msqrt. +
  16. +
  17. + + An mroot with one mn child. +
  18. +
  19. + + An mfrac with two mn children. +
  20. +
  21. + + An msqrt with five mn children. +
  22. +
  23. + + An mroot with two mn children. +
  24. +
+

+ +

+

+ +

+ +``` + +```css hidden +math { + font-family: Latin Modern Math, STIX Two Math; + font-size: 200%; +} +math .highlight { + background: pink; +} +math [id] .highlight { + background: lightblue; +} +p { + padding: .5em; +} +``` + +```js hidden +const options = document.getElementById('options'); +const comment = document.getElementById('comment'); +const checkboxes = Array.from(options.getElementsByTagName("input")); +const status = document.getElementById('status'); +function verifyOption(checkbox) { + let mathml = checkbox.dataset.highlight; + if (mathml) + mathml = document.getElementById(mathml); + if (checkbox.checked) { + comment.textContent = checkbox.dataset.comment; + if (mathml) + mathml.classList.add('highlight'); + else + checkbox.checked = false; + } else { + comment.textContent = ""; + if (mathml) + mathml.classList.remove('highlight'); + } + let finished = true; + checkboxes.forEach(checkbox => { + if (!!checkbox.checked != !!checkbox.dataset.highlight) + finished = false; + }); + status.textContent = finished ? "Congratulations, you checked all the correct answers!" : ""; + +} +checkboxes.forEach(checkbox => { + checkbox.addEventListener('change', () => { verifyOption(checkbox); }); +}); +``` + +{{ EmbedLiveSample('Active_learning_nesting_different_elements', 700, 600, "", "") }} + +## Stretchy radical symbols + +As previously seen, the overbar of the `` and `` elements +stretches horizontally to cover their content. But actually the root symbol √ +also stretches to be as tall as their content. + +```html + + + + + My page with stretchy radical symbols + + + + + + + + 1 + 2 + + + 3 + + + + +``` + +{{ EmbedLiveSample('Stretchy_radical_symbols', 700, 200, "", "") }} + +> **Warning:** Special [math fonts](/en-US/docs/Web/MathML/Fonts) are generally required to make that stretching possible, the previous example relies on [web fonts](/en-US/docs/Learn/CSS/Styling_text/Web_fonts). + +## Fractions without bar + +Some mathematical concepts are sometimes written using fraction-like notations +such [binomial coefficients](https://en.wikipedia.org/wiki/Combination) or +[Legendre symbols](https://en.wikipedia.org/wiki/Legendre_symbol). It is +appropriate to use an `` element to markup such notations. For +fraction-like notations that don't draw a horizontal bar, attach a +linethickness="0" attribute to the `` element: + +```html + + + + + My binomial coefficient + + + + + + ( + + 3 + 2 + + ) + + = + 6 + + + 3 + 2 + + + + +``` + +{{ EmbedLiveSample('Fraction_without_bar', 700, 200, "", "") }} + +> **Note:** Although the `linethickness` attribute can be used to specify an arbitrary thickness, it is better to keep the default value, which is calculated from parameters specified in the math font. + +## Summary + +In this lesson, we've seen how to build fractions and roots using the +``, `` and `` elements. We noticed some special feature of +these elements, namely the fraction and radical symbol. We've seen how to use the `linethickness` attribute to draw fractions without bars. In the next article, we will continue with basic math notations and consider [scripts](/en-US/docs/Learn/MathML/First_steps/Scripts). + +{{LearnSidebar}}{{PreviousMenuNext("Learn/MathML/First_steps/Text_containers", "Learn/MathML/First_steps/Scripts", "Learn/MathML/First_steps")}} + +## See also + +* [The `` element](/en-US/docs/Web/MathML/Element/mfrac) +* [The `` element](/en-US/docs/Web/MathML/Element/msqrt) +* [The `` element](/en-US/docs/Web/MathML/Element/mroot) diff --git a/files/en-us/learn/mathml/first_steps/fractions_and_roots/mfrac-msqrt-mroot.png b/files/en-us/learn/mathml/first_steps/fractions_and_roots/mfrac-msqrt-mroot.png new file mode 100644 index 0000000000000000000000000000000000000000..71b083515240e282fb0b017e0c65875d2de0b711 GIT binary patch literal 6957 zcmV+|8`9*7P)EX>4Tx04R}tkv&MmKp2MKwn~du9PA*)AwzW#3!);9T7@E12(?114knlWL6e3g z#l=x@EjakISaoo5*44pP5Cnff9G#pLU8KbCl0u6Z?>O$^z3+Xw`ws9oDoi!I#sO8c zjC3*~WOJ)R@D(BS(i}xpVx~SPiYa)Gu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p9j(-olg^N99X+Zx$e;eFY&e_&_1^u81f}ys=Gl;D zi+!^z1BT3T9#=B-XoPsh%kJ27U=7!@_hPN*%D;Y(%T z6$Cc?XNL2cadmY?qehM3;^KlcXU^d6-Ma^78OG!Ag5|iB_Gy2+Zs(C0R9%ic*Y6dWj7q!$%$%6vd@`)8tkAP( zPx$-$BPJ#$_xO$-JK*5p0DXP^!Uiocby^RfLBNiwix3=_Gg1){cYXsdSPe%PU7+OY zcX?!H@*uf9pE0ONzpL{-7W+?Z9T)BcaZQ5Ykv}stgW(|0rN0TN^aQ5t37#kaZV2u6>S2it&=fz~0RI3Di z2|--L5w0V?gF)h1teoJDpnrmKKMpXl?SPg)xnkqsM68{$4W}+&L|CFGsy6u^-#N~N zPwNo4uGo(&f8E3jg)tg*=#1fuyx^kPhOsLT;Ge&4B3f>Q`t4hx+vs(e-@PI@5EAeC z!OiDy$P7&()f7Nl)zPk5Bqn!XjE6>z(W#RQ7XRUjX5|1rbQh+(oyVJ$D1= + + + Prerequisites: + + Basic computer literacy, + basic software installed, basic knowledge of + working with files, and HTML basics (study + Introduction to HTML.) + + + + Objective: + + To understand the basic syntax of MathML and how to integrate it in + HTML pages. + + + + + +## Inserting formulas in HTML via the `` element + +MathML uses the same syntax as HTML to represent a tree of elements and +attributes. In particular, each mathematical formula is represented by an +element `` which can be placed inside an HTML page. In the following +document, it is inside a paragraph of text: + +```html + + + + My first math page + + + +

The fraction + + + 1 + 3 + + + is not a decimal number.

+ + + +``` + +The `` element specifies a fraction with a numerator (its first child) +and a denominator (its second child). This is how it renders in your browser: + +{{ EmbedLiveSample('Inserting_formulas_in_HTML', 700, 100, "", "") }} + +> **Warning:** If you just see "1 3" instead of a fraction, then your browser may not support MathML. Check out the [browser compatibility table](/en-US/docs/Web/MathML/Element/math#browser_compatibility) for further details. + +### Inline and display modes + +Note that in the previous example, the formula is on the same line as the text +of the paragraph, this is called *inline* mode. However, it is quite common for +large mathematical formulas to use *display* mode: they are instead centered on +their own line as shown below. To achieve that, one only need to attach a +`display="block"` attribute on the `` element. + +```html hidden + + + + My first math page + + + +

The fraction + + + 1 + 3 + + + is not a decimal number.

+ + + +``` + +{{ EmbedLiveSample('Inline_and_display_modes', 700, 100, "", "") }} + +You may also notice some subtle change in the appearance: the text and vertical +spacing of the fraction becomes a bit bigger. +In *inline* mode, the height is minimized to avoid disturbing the flow +of the surrounding text. In *display* mode, priority is instead put on +legibility of the mathematical formula. + +> **Note:** This corresponds to the LaTeX's concept of *inline* formulas +> (delimited by dollar signs `$...$`) and *display* formulas (delimited by +> `\[...\]`). + +## Grouping with the `` element + +The `` element can actually contain an arbitrary number of children and +will essentially render them in a row. For instance, the simple formula +"1 + 2 + 3" would be be encoded like this in MathML: + +```html + + 1 + + + 2 + + + 3 + +``` + +The `` element is a generic container that performs similar layout but +can be placed anywhere in the MathML subtree. It is helpful to group several +elements together. For instance, the numerator of the following fraction (its +first child) is "one plus two". + +```html + + + + 1 + + + 2 + + 3 + + +``` + +### Active learning: nested expressions + +As an exercise, figure out how to write the following expressions using +only the MathML elements we've seen so far. If you are stuck or want to verify +the solution, check the source code of the example. + +```html hidden +
    +
  1. "one half" plus "two third": + + + + 1 + 2 + + + + + 2 + 3 + + +
  2. +
  3. "one plus two plus three" over "four plus five": + + + + 1 + + + 2 + + + 3 + + + 4 + + + 5 + + + +
  4. +
  5. "one quarter" over "two plus three": + + + + 1 + 4 + + + 2 + + + 3 + + + +
  6. +
+``` + +{{ EmbedLiveSample('Active_learning_nested_expressions', 700, 200, "", "") }} + +## Summary + +In this article, we have taken a look at how to use the `` element to insert a mathematical formula inside a HTML document. We have learned about the difference between *inline* and *display* formulas and how to specify them via the `display` attribute of the `` element. +In addition, we stumbled upon a couple of other MathML elements: `` for fractions, `` for grouping and finally a few text elements. We will analyze these [text containers](/en-US/docs/Learn/MathML/First_steps/Text_containers) further in the next article. + +{{LearnSidebar}}{{NextMenu("Learn/MathML/First_steps/Text_containers", "Learn/MathML/First_steps")}} + +## See also + +* [Using MathML](/en-US/docs/Web/MathML/Authoring#using_mathml) +* [The `` element](/en-US/docs/Web/MathML/Element/math) +* [The `` element](/en-US/docs/Web/MathML/Element/mfrac) +* [The `` element](/en-US/docs/Web/MathML/Element/mrow) +* [The `math-depth` property](/en-US/docs/Web/CSS/math-depth) diff --git a/files/en-us/learn/mathml/first_steps/index.md b/files/en-us/learn/mathml/first_steps/index.md new file mode 100644 index 000000000000000..a8f0f76261a5912 --- /dev/null +++ b/files/en-us/learn/mathml/first_steps/index.md @@ -0,0 +1,53 @@ +--- +title: MathML first steps overview +slug: Learn/MathML/First_steps +tags: + - Beginner + - MathML + - Landing + - first steps +--- +{{LearnSidebar}} + +MathML is the markup language used to write mathematical formulas in Web pages. This module provides a gentle beginning to your path towards MathML mastery with the basics of how it works, what the syntax looks like, and how you can start using it inside HTML. + +> **Callout:** +> +> #### Looking to become a front-end web developer? +> +> We have put together a course that includes all the essential information you need to +> work towards your goal. +> +> [**Get started**](/en-US/docs/Learn/Front-end_web_developer) + +## Prerequisites + +Before starting this module, you should have: + +1. Basic familiarity with using computers and using the Web passively (i.e. looking at it, consuming the content.) +2. A basic work environment set up, as detailed in [Installing basic software](/en-US/docs/Learn/Getting_started_with_the_web/Installing_basic_software), and an understanding of how to create and manage files, as detailed in [Dealing with files](/en-US/docs/Learn/Getting_started_with_the_web/Dealing_with_files). +3. Basic familiarity with HTML, as described in [Introduction to HTML](/en-US/docs/Learn/HTML/Introduction_to_HTML). + +> **Note:** If you are working on a computer/tablet/other device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as [JSBin](https://jsbin.com/) or [Glitch](https://glitch.com/). + +## Guides + +This module contains the following articles, which will take you through all the basic theory of MathML, and provide opportunities for you to test out some skills. + +- [Getting started with MathML](/en-US/docs/Learn/MathML/First_steps/Getting_started) + - : In this article, we will take a simple HTML document and view how to add MathML formulas into it, introducing a few elements along the way. +- [Text containers](/en-US/docs/Learn/MathML/First_steps/Text_containers) + - : Now that you get a better idea of MathML, we move focus on text containers (variables, numbers, operators, ...) which are used as building blocks of MathML formulas. +- [Fractions and roots](/en-US/docs/Learn/MathML/First_steps/Fractions_and_roots) + - : Relying on text containers, this article describes how to build more complex MathML expressions by nesting fractions and roots. +- [Scripts](/en-US/docs/Learn/MathML/First_steps/Scripts) + - : We continue the review of basic math notations and focuses on building MathML elements with scripts. +- [Tables](/en-US/docs/Learn/MathML/First_steps/Tables) + - : Once all basic math notations are known, it remains to consider tabular layout which can be used for matrix-like expressions and other advanced math layout. + +## Assessments + +The following assessment will test your understanding of the MathML basics covered in the guides above. + +- [Three famous mathematical formulas](/en-US/docs/Learn/MathML/First_steps/Three_famous_mathematical_formulas) + - : With the things you have learned in the last few articles, you should already be able to write relatively sophisticated MathML formulas. This assessment gives you a chance to do that. diff --git a/files/en-us/learn/mathml/first_steps/scripts/index.md b/files/en-us/learn/mathml/first_steps/scripts/index.md new file mode 100644 index 000000000000000..ee525feb25294d8 --- /dev/null +++ b/files/en-us/learn/mathml/first_steps/scripts/index.md @@ -0,0 +1,544 @@ +--- +title: MathML scripted elements +slug: Learn/MathML/First_steps/Scripts +tags: + - Beginner + - MathML + - Landing +--- +{{LearnSidebar}}{{PreviousMenuNext("Learn/MathML/First_steps/Fractions_and_roots", "Learn/MathML/First_steps/Tables", "Learn/MathML/First_steps")}} + +We continue the review of basic math notations and focuses on building MathML elements with scripts. + + + + + + + + + + + + +
Prerequisites: + Basic computer literacy, + basic software installed, basic knowledge of + working with files, and HTML basics (study + Introduction to HTML.) +
Objective: + To get familiar with basic MathML elements producing scripted elements. +
+ +## Subscripts and superscripts + +Similarly to what we saw in the [previous article](/en-US/docs/Learn/MathML/First_steps/Fractions_and_roots), the ``, `` and `` have a special structure expecting exactly two elements (for ``, ``) or three elements (for ``): + +```html +

msub: + + + child1 + child2 + + +

msup: + + + child1 + child2 + + +

+

msubsup: + + + child1 + child2 + child3 + + +

+``` + +Below is the rendering of the above example in your browser. You should notice +that: + +* The second child of the `` element is attached as a subscript of + its first child. +* The second child of the `` element is attached as a superscript of + its first child. +* The second and third children of the `` element are respectively + attached as a subscript and superscript of its first child. +* The text inside scripts is scaled down. + +{{ EmbedLiveSample('Subtrees_of_msub_msup_msubsup', 700, 200, "", "") }} + +> **Note:** The MathML elements `` and `` are different from the +> HTML elements [``](/en-US/docs/Web/HTML/Element/sup) and +> [``](/en-US/docs/Web/HTML/Element/sup). They allow to use an arbitrary +> MathML subtree as scripts, not just text. + +## Underscripts and overscripts + +The ``, `` and `` elements are very similar except +that they are used to attach underscripts and overscripts. Instead of giving +details, we will let you figure out their definitions yourself with the +following exercise. + +### Active learning: Recognize under/over scripts + +In the following example, +try to guess the names of the mystery elements (written as question +marks) and click the button to reveal the solution: + +```html hidden +

<????????> element + with exactly two children (child1, child2): + + + child1 + child2 + + +

+

<????????> element + with exactly three children (child1, child2 and child3): + + + child1 + child2 + child3 + + +

+

<????????> element + with exactly two children (child1, child2): + + + child1 + child2 + + +

+ +

+``` + +```css hidden +p { + padding: .5em; +} +``` + +```js hidden +document.getElementById("showSolution").addEventListener("click", () => { + const maths = Array.from(document.getElementsByTagName("math")); + Array.from(document.getElementsByTagName("span")).forEach( (span, index) => { + span.textContent = maths[index].firstElementChild.tagName; + }); +}); +``` + +{{ EmbedLiveSample('Subtrees_of_munder_mover_munderover', 700, 400, "", "") }} + +### Active learning: Recognize scripted elements + +The following MathML formula contains a more complex expression, nesting +fractions, roots and scripts. Try to guess the elements laid out with scripted +elements ``, ``, ``, ``, ``, ``. +Each time you click such an element, it is highlighted and a confirmation +message is displayed. Finally, read the MathML source to verify whether that +corresponds to your expectation. + +```html hidden + + + + + My page with scripted elements + + + + + + + + β + + + + 3 + + + + + | + + α + + + | + + + s + 3 + + + + + + + + i + = + 1 + + n + + + + + a + i + + + + K + 0 + i + + + + + + +
+ + +``` + +```css hidden +.highlight { + color: red; +} +math { + font-size: 200%; +} +``` + +```js hidden + const scriptedElements = Array.from(document.querySelectorAll('msub, msup, msubsup, munder, mover, munderover')); + const outputDiv = document.getElementById("output"); + function clearHighlight() { + scriptedElements.forEach(scripted => { + scripted.classList.remove('highlight'); + }); + } + scriptedElements.forEach(scripted => { + scripted.addEventListener('click', () => { + clearHighlight(); + scripted.classList.add('highlight'); + outputDiv.insertAdjacentHTML('beforeend', + `

You clicked an <${scripted.tagName}> element.

`); + }); + }); + document.getElementById("clearOutput").addEventListener("click", () => { + clearHighlight(); + outputDiv.innerHTML = ""; + }); +``` + +{{ EmbedLiveSample('Active_learning_recognize_scripted_elements', 700, 400, "", "") }} + +## More operator properties + +We have previously seen some [properties of the `` element](/en-US/docs/Learn/MathML/First_steps/Text_containers#operator_properties_of_mo) +namely stretching in the vertical direction and spacing. Now that scripted +elements are available, we can extend that list. We will do that by tweaking +our [previous example](#active_learning_recognize_scripted_elements). + +### Stretching in horizontal direction + +Let's first perform the substitutions + + β + + + + z + 1 + + + + + z + 2 + + + +and + + α + + + + v + 1 + + + + + v + 2 + + +: + +```html hidden + + + + + My page with horizontal stretchy operators + + + + + + + + + + z + 1 + + + + + z + 2 + + + + + + 3 + + + + + | + + + + v + 1 + + + + + v + 2 + + + + + | + + + s + 3 + + + + + + + + i + = + 1 + + n + + + + + a + i + + + + K + 0 + i + + + + + + + +``` + +```css hidden +.highlight { + color: red; +} +math { + font-size: 200%; +} +``` + +{{ EmbedLiveSample('Stretching_in_horizontal_direction', 700, 200, "", "") }} + +We now realize that the bottom bracket "⎵" and the rightward arrow "→" +stretch horizontally to cover the width of the substitued values. Recall that +[some vertical operators can stretch](/en-US/docs/Learn/MathML/First_steps/Text_containers#active_learning_stretchy_operators) to cover the height of +non-stretchy siblings inside an ``. +Similarly some horizontal operators can stretch +to cover the width of non-stretchy siblings in an ``, `` or +`` element. + +> **Note:** Stretching can happen for any child of the +> ``, `` or `` element, not just the underscript +> or overscript. + +### Large operator and limits + +So far our example has actually been rendered in [*display* mode](/en-US/docs/Learn/MathML/First_steps/Getting_started#inline_and_display_modes). Let's detach the +`display="block"` attribute from the `` element to show up some +interesting changes: + +```html hidden + + + + + My page with moved limits and small largeop + + + + + + + + + + z + 1 + + + + + z + 2 + + + + + + 3 + + + + + | + + + + v + 1 + + + + + v + 2 + + + + + | + + + s + 3 + + + + + + + + i + = + 1 + + n + + + + + a + i + + + + K + 0 + i + + + + + + + +``` + +```css hidden +.highlight { + color: red; +} +math { + font-size: 200%; +} +``` + +{{ EmbedLiveSample('Large_operator_and_limits', 700, 200, "", "") }} + +As expected, the formula is no longer centered and the rendering is modified to +minimized the height. Focusing on the summation symbol, one can notice that +the sigma is drawn smaller and that the scripts of the `` element +are now attached as a subscript and a superscript! This is due to two +properties of the "∑" operator: + +* *largeop*: The operator is drawn with a bigger glyph in *display* mode. +* *movablelimits*: The underscripts and overscripts attached to the + operator are respectively rendered as subscripts and superscripts in + *inline* mode. + +> **Note:** The *largeop* property is actually unrelated to scripts, even though +> operators having this property are typically scripted. The *movablelimits* +> property is taken into account for `` and `` elements too. + +## Summary + +In this article, we've finished reviewing basic layout introducing elements +``, ``, ``, ``, ``, `` for +subscripts, superscripts, underscripts and overscripts. Using these elements, +we were able to briefly introduce new properties of the `` element. +In the next article, we +will continue focus on [tabular layout](/en-US/docs/Learn/MathML/First_steps/Tables). + +{{LearnSidebar}}{{PreviousMenuNext("Learn/MathML/First_steps/Fractions_and_roots", "Learn/MathML/First_steps/Tables", "Learn/MathML/First_steps")}} + +## See also + +* [The `` element](/en-US/docs/Web/MathML/Element/msub) +* [The `` element](/en-US/docs/Web/MathML/Element/msup) +* [The `` element](/en-US/docs/Web/MathML/Element/msubsup) +* [The `` element](/en-US/docs/Web/MathML/Element/munder) +* [The `` element](/en-US/docs/Web/MathML/Element/mover) +* [The `` element](/en-US/docs/Web/MathML/Element/munderover) diff --git a/files/en-us/learn/mathml/first_steps/tables/index.md b/files/en-us/learn/mathml/first_steps/tables/index.md new file mode 100644 index 000000000000000..bc31d4ddbe34df3 --- /dev/null +++ b/files/en-us/learn/mathml/first_steps/tables/index.md @@ -0,0 +1,343 @@ +--- +title: MathML tables +slug: Learn/MathML/First_steps/Tables +tags: + - Beginner + - MathML + - Landing +--- +{{LearnSidebar}}{{PreviousMenuNext("Learn/MathML/First_steps/Scripts", "Learn/MathML/First_steps/Three_famous_mathematical_formulas", "Learn/MathML/First_steps")}} + +Once all basic math notations are known, it remains to consider tabular layout which can be used for matrix-like expressions and other advanced math layout. + + + + + + + + + + + + +
Prerequisites: + Basic computer literacy, + basic software installed, basic knowledge of + working with files, and HTML basics (study + Introduction to HTML. and HTML tables) +
Objective: + To get familiar with MathML tabular elements and be aware of some + use cases. +
+ +## MathML tabular elements + +The MathML tabular elements are similar to the ones for [HTML tables](/en-US/docs/Learn/HTML/Tables): the `` element represents a table, the +`` element represents a row and the `` element represents a cell. +An `` table can be inserted anywhere in a MathML formula. The `` +cell can contain any number of MathML children and will lay them out +as an `` container. + +Tables are typically used for matrix-like expressions (including vectors). +Here is a basic example taken from the [article about the CSS +`matrix()` function](/en-US/docs/Web/CSS/transform-function/matrix): + +```html + + + + + My first matrix + + + + + + ( + + + + a + + + c + + + 0 + + + + t + x + + + + + + b + + + d + + + 0 + + + + t + y + + + + + + 0 + + + 0 + + + 1 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 1 + + + + ) + + + + +``` + +{{ EmbedLiveSample('MathML_tabular_elements', 700, 200, "", "") }} + +## Allowing cells to span multiple rows and columns + +This is again similar to [HTML's article](/en-US/docs/Learn/HTML/Tables/Basics#allowing_cells_to_span_multiple_rows_and_columns). The `` element accepts +the `columnspan` and `rowspan` attributes to indicate that the cell spans +multiples rows and columns. Below the inner matrix spans two columns of +the outer matrix: + + +```html hidden + + + + + My matrix with columnspan + + + + + + ( + + + + + ( + + + + a + + + c + + + + + b + + + d + + + + ) + + + + 0 + + + T + + + + + 0 + + + 0 + + + 1 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 1 + + + + ) + + + + +``` + +{{ EmbedLiveSample('allowing_cells_to_span_multiple_rows_and_columns', 700, 200, "", "") }} + +> **Note:** For historical reason, the MathML attribute for column spaning is +> called `columnspan` not `colspan`. + +## Usage for advanced layout + +Besides representing matrix-like objects, MathML tables are sometimes used for +advanced layout inside mathematical formulas, +for example in [Wikipedia's definition of +Legendre symbol](https://en.wikipedia.org/wiki/Legendre_symbol). Here, the +different cases are written on three different rows while the values and +conditions are placed on two different columns. + +```html hidden + + + + + My first matrix + + + + + + + ( + + a + b + + ) + + = + + { + + + + 1 + + + if  + a +  is a quadratic residue modulo  + p +  and  + a +  is not a multiple of  + p + ; + + + + + + 1 + + + if  + a +  is a non-quadratic residue modulo  + p + ; + + + + + 0 + + + if  + a +  is a multiple of  + p + . + + + + + + + + +``` + +{{ EmbedLiveSample('Usage_for_advanced_layout', 700, 200, "", "") }} + +> **Warning:** The [`` article](/en-US/docs/Web/MathML/Element/mtable) +> provides more advanced layout options via special attributes such as +> alignment or spacing. This is inherited from the original design of MathML, +> that was supposed to work in +> engines that are not CSS-aware. However, these attributes may not be +> implemented in all browsers. In the future, it is likely that usages of +> `` for layout-only purpose (i.e. not actual matrix-like objects) +> can be replaced with CSS-based alternatives. + +## Summary + +In this article, we've reviewed the +``, `` and `` elements which are the equivalent of HTML +elements for tables. We have seen how to use them for representing matrix-like +objects and how it is sometimes used for advanced layout. + +You've nearly finished this module — we only have one more thing to do. In the [three famous mathematical formulas assessment](/en-US/docs/Learn/MathML/First_steps/Three_famous_mathematical_formulas) you'll use your new knowledge to rewrite a small mathematical article using HTML and MathML. + +{{LearnSidebar}}{{PreviousMenuNext("Learn/MathML/First_steps/Scripts", "Learn/MathML/First_steps/Three_famous_mathematical_formulas", "Learn/MathML/First_steps")}} + +## See also + +* [Learning about HTML tables](/en-US/docs/Learn/HTML/Tables) +* [The `` element](/en-US/docs/Web/MathML/Element/mtable) +* [The `` element](/en-US/docs/Web/MathML/Element/mtr) +* [The `` element](/en-US/docs/Web/MathML/Element/mtd) diff --git a/files/en-us/learn/mathml/first_steps/text_containers/index.md b/files/en-us/learn/mathml/first_steps/text_containers/index.md new file mode 100644 index 000000000000000..1497143279d2d4c --- /dev/null +++ b/files/en-us/learn/mathml/first_steps/text_containers/index.md @@ -0,0 +1,421 @@ +--- +title: MathML Text Containers +slug: Learn/MathML/First_steps/Text_containers +tags: + - Beginner + - MathML + - Landing +--- +{{LearnSidebar}}{{PreviousMenuNext("Learn/MathML/First_steps/Getting_started", "Learn/MathML/First_steps/Fractions_and_roots", "Learn/MathML/First_steps")}} + +Now that you get a better idea of MathML, we move focus on text containers (variables, numbers, operators, ...) which are used as building blocks of MathML formulas. + + + + + + + + + + + + +
Prerequisites: + Basic computer literacy, + basic software installed, basic knowledge of + working with files, HTML basics (study + Introduction to HTML) and some CSS notions on text styling (read fundamental text and font styling and + web fonts). +
Objective: + To get familiar with MathML elements used for writing text and be aware + of special behaviors. +
+ +## Unicode characters for mathematics + +Mathematical formulas involve many special characters, for example greek letters (e.g. Δ), fraktur letters (e.g. 𝔄), double-struck letter (e.g. ℂ), binary operators (e.g. ≠), arrows (e.g. ⇒), integral symbols (e.g. ∮), summation symbols (e.g. ∑), logical symbols (e.g. ∀), fences (e.g. ⌊) and many more. Wikipedia's article [Mathematical operators and symbols in Unicode](https://en.wikipedia.org/wiki/Mathematical_operators_and_symbols_in_Unicode) provides a good overview of the characters used. + +Since most of these characters are not part of Basic Latin Unicode block, it is recommended to specify your [document's character encoding](/en-US/docs/Learn/HTML/Introduction_to_HTML/The_head_metadata_in_HTML#specifying_your_documents_character_encoding) and to serve it with appropriate [web fonts](/en-US/docs/Learn/CSS/Styling_text/Web_fonts). Here is a basic template to use UTF-8 encoding and the [Latin Modern Math](/en-US/docs/Web/MathML/Fonts#fonts_with_a_math_table) font: + +```html + + + + + My page with math characters + + + +

∀A∊𝔰𝔩(n,𝔽),TrA=0

+ + +``` + +{{ EmbedLiveSample('Unicode_characters_for_mathematics', 700, 100, "", "") }} + +## A bit of semantics... + +We noticed in the [getting started with MathML](/en-US/docs/Learn/MathML/First_steps/Getting_started) article that the text in MathML formulas are wrapped in specific container elements such as the `` or ``. More generally, every text in MathML formulas must be included inside such container elements, called *token* elements. In addition, MathML provides multiple token elements in order to distinguish different meanings of the text content: + +* The `` element, which represents a symbolic name or arbitrary text that should be rendered as an identifier. Examples: `x` (variable), `cos` (function name) and `π` (symbolic constant). +* The `` element represents a "numeric literal" or other data that should be rendered as a numeric literal. Examples: `2` (integer), `0.123` (decimal number) or `0xFFEF` (hexadecimal value). +* The `` element represents an operator or anything that should be rendered as an operator. For example `+` (binary operation), `` (binary relation), `` (summation symbol) or `[` (fence). +* The `` element is used to represent arbitrary text. For example short words in formulas such as `if` or `maps to`. + +### Active learning: recognize token elements + +Below is a more complex example, which says that the absolute value of a real +number is equal to that number if and only if it is nonnegative. Spot the +different token elements and what they are used for. +Each time you click the corresponding text, it is highlighted and a confirmation +message is displayed. Finally, read the MathML source to verify whether that +corresponds to your expectation. + +```html hidden + + + + + My page with math characters + + + + + + + | + x + | + + = + x + +  iff  + + x + + 0 + + + +
+ + +``` + + +```css hidden +.highlight { + color: red; +} +math { + font-size: 200%; +} +``` + + +```js hidden + const tokenElements = Array.from(document.querySelectorAll('mi, mo, mn, mtext')); + const outputDiv = document.getElementById("output"); + function clearHighlight() { + tokenElements.forEach(token => { + token.classList.remove('highlight'); + }); + } + tokenElements.forEach(token => { + token.addEventListener('click', () => { + clearHighlight(); + token.classList.add('highlight'); + outputDiv.insertAdjacentHTML('beforeend', + `

You clicked an <${token.tagName}> element.

`); + }); + }); + document.getElementById("clearOutput").addEventListener("click", () => { + clearHighlight(); + outputDiv.innerHTML = ""; + }); +``` + +{{ EmbedLiveSample('Active_learning_recognize_token_elements', 700, 400, "", "") }} + + +> **Note:** It is sometimes difficult to decide the token element to use for +> a given text content. In practice, choosing the wrong element should not cause +> major issues because all token elements are generally +> rendered the same by browser implementations (for visual display and for +> assistive technologies). However, the `` and `` elements have special +> distinguishing features that one should be aware of. They are explained +> in the following sections. + +## Automatic italicization of `` + +One typographic convention in mathematics is to use italic letters for variables. +In order to help with that, `` elements with a single character may be +automatically rendered as italic. This is the case for all the letters from the +latin and greek alphabets. Compare the rendering of the two `` +elements in the following formula: + +```html + + sin + x + +``` + +> **Note:** [This table from MathML Core](https://w3c.github.io/mathml-core/#italic-mappings) +> provide the exhaustive list of characters that are subject to italicization, +> together with the corresponding italic characters. + +It is sometimes needed to revert this default italic transformation. For that purpose, just attach a `mathvariant="normal"` attribute on the `` element. +Compare the rendering of the uppercase gamma letters in the following formula: + +```html + + Γ + Γ + +``` + +> **Note:** Although the [`mathvariant`](/en-US/docs/Web/MathML/Global_attributes/mathvariant) provides other values to perform such transformations, it is recommended to just pick the desired [Mathematical Alphanumeric Symbols](https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols) when possible. + +## Operator properties of `` + +MathML contains an [operator dictionary](https://w3c.github.io/mathml-core/#operator-dictionary-human) that defines default properties of `` elements depending on their content and the position within its container (prefix, infix or postfix). Let's consider a concrete example: + +```html + + + + + + + + + + + + + +
Prefix plus + + + + i + +
Infix plus + + j + + + i + +
Prefix sum + + + i + +
+``` + +This example should render similarly to the screenshot below. Observe the spacing between the `i` elements and its preceding ``: no spacing for the prefix plus, some spacing for the infix plus and some smaller spacing for the prefix summation symbol. + +![Screenshot of the MathML formula with different operator spacing](operator-spacing.png) + +Operators have many other properties that we will see in more details later. For now, remember to use an `` container for characters in the operator dictionary and to properly group subexpressions with `` elements in order to help MathML renderers to provide a good rendering. + +### Active learning: spot the difference + +Now that you are a bit familiar with special features of `` and ``, +let's rewrite the `

` element in the +[example at the top of the page](#unicode_characters_for_mathematics) with some +actual MathML. Compare the visual rendering in your browser and explain +the differences with the text-only version. + +```html + + + + + My page with math characters + + + +

∀A∊𝔰𝔩(n,𝔽),TrA=0

+

+ + + + A + + + 𝔰𝔩 + + ( + n + , + 𝔽 + ) + + + + , + + + Tr + A + + = + 0 + + +

+ +
+ + +``` + +```css hidden +div { + padding: .5em; +} +``` + +```js hidden +document.getElementById('showSolution').addEventListener('click', () => { + document.getElementById('solution').insertAdjacentHTML( + "beforeEnd", + `
    +
  • The <mi> elements containing the "A" and "n" variables are rendered in italic. However, the <mi> elements with multiple characters "𝔰𝔩" or whose character is "𝔽" are still rendered upright.
  • +
  • Spacing is automatically added around the <mo> elements whose text is "∀", "∊", "=" or a comma. However, some of them have no spacing added before while the parentheses still have no spacing around them.
  • +
` + ); +}, {once: true}); +``` + +{{ EmbedLiveSample('active_learning_spot_the_difference', 700, 500, "", "") }} + +> **Note:** An obvious difference is that the source code became much more verbose with MathML. Recall that this tutorial is about learning the language but in practice MathML content is generally not written manually. See the [Authoring MathML](/en-US/docs/Web/MathML/Authoring) page for more information. + +### Active learning: stretchy operators + +The operator dictionary defines a default *stretchy* property as well as +corresponding *stretch axis* for some operators. For example, an operator +can stretch vertically by default to cover the maximum height of non-stretchy +siblings within its `` container. By tweaking a bit the +[previous exercise](#active_learning_recognize_token_elements), one can +make operators stretch vertically. Can you find them? As usual, you are invited +to read the source code when you are done. + +```html hidden + + + + + My page with stretchy operators + + + + + + + | + + 1 + x + + | + + = + + 1 + + | + x + | + + + = + + 1 + x + + +  iff  + + x + + 0 + + + +
+ + +``` + + +```css hidden +.highlight { + color: red; +} +math { + font-size: 200%; +} +``` + + +```js hidden + const tokenElements = Array.from(document.querySelectorAll('mi, mo, mn, mtext')); + const stretchyMoElements = Array.from(document.getElementsByTagName("mo")).slice(0, 2); + const outputDiv = document.getElementById("output"); + function clearHighlight() { + tokenElements.forEach(token => { + token.classList.remove('highlight'); + }); + } + tokenElements.forEach(token => { + token.addEventListener('click', () => { + clearHighlight(); + token.classList.add('highlight'); + let message = ""; + let tagName = `<${token.tagName}>`; + if (token.tagName !== "mo") + message = `No, this is an ${tagName} element!`; + else if (!stretchyMoElements.includes(token)) + message = `No, this is an ${tagName} element, but it's not vertically stretched.`; + else + message = `Correct, this ${tagName} element is indeed stretched to the height of its <mfrac> sibling.` + outputDiv.insertAdjacentHTML('beforeend', + `

${message}

`); + }); + }); + document.getElementById("clearOutput").addEventListener("click", () => { + clearHighlight(); + outputDiv.innerHTML = ""; + }); +``` + +{{ EmbedLiveSample('Active_learning_stretchy_fences', 700, 400, "", "") }} + +> **Warning:** Special [math fonts](/en-US/docs/Web/MathML/Fonts) are generally required to make that stretching possible, the previous example relies on [web fonts](/en-US/docs/Learn/CSS/Styling_text/Web_fonts). + +## Summary + +In this article, we have learnt about a few *token* elements that are used as text containers as well as their different semantics, namely `` (identifier), `` (numbers), `` (operators), `` (generic text). We have seen special Unicode characters that are commonly found in math formulas and given an overview of some observable behaviors of the `` and `` elements. In the next article, we will see how to rely on *token* elements to build much complex expressions such as [fractions and roots](/en-US/docs/Learn/MathML/First_steps/Fractions_and_roots). + +{{LearnSidebar}}{{PreviousMenuNext("Learn/MathML/First_steps/Getting_started", "Learn/MathML/First_steps/Fractions_and_roots", "Learn/MathML/First_steps")}} + +## See also + +* [The `` element](/en-US/docs/Web/MathML/Element/mi) +* [The `` element](/en-US/docs/Web/MathML/Element/mn) +* [The `` element](/en-US/docs/Web/MathML/Element/mo) +* [The `` element](/en-US/docs/Web/MathML/Element/mtext) diff --git a/files/en-us/learn/mathml/first_steps/text_containers/operator-spacing.png b/files/en-us/learn/mathml/first_steps/text_containers/operator-spacing.png new file mode 100644 index 0000000000000000000000000000000000000000..9e328ee75463442aaab7722bc99673ecb7e19685 GIT binary patch literal 15626 zcmbW8bx<8oyP$z!!R27Vg1fuBySux~!7T)L*MqyeyByp-XmAMb!IS0p?cHyy?%vwk zy?;#A^jkGOZ%_5~Oh5f}q_UzEGQt-G2nYyd8EJ7<2neW;b4WUP=#L22oY~w*fz(D! zOj$-u?5ne@lckNl1q1|jVopMXELa&3)~7yi>aI$#L=tQ_Ff7lgK?09uT5aqun+%AS zL6VWZLH5J+&p-*!CyjC*8Kt85~ zRDN#oVVhRpjF9E&Ac%q`-6|zBK+Q_rPDz3bbyBer@dZQ+>>CN0-P zRJG#|dz8|~AADh}*5@*B`PNrsGE!mn=Xr#w`j@iQWqdBm$3ufMm6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ps/three_famous_mathematical_formulas/index.md new file mode 100644 index 000000000000000..cee554163e2f7ed --- /dev/null +++ b/files/en-us/learn/mathml/first_steps/three_famous_mathematical_formulas/index.md @@ -0,0 +1,142 @@ +--- +title: Three famous mathematical formulas +slug: Learn/MathML/First_steps/Three_famous_mathematical_formulas +tags: + - Beginner + - MathML + - Landing +--- +{{LearnSidebar}}{{PreviousMenu("Learn/MathML/First_steps/Tables", "Learn/MathML/First_steps")}} + + + + + + + + + + + + +
Prerequisites: + Before attempting this assessment you should have already worked through + all the articles in this module, and also have an understanding of HTML + basics (study + Introduction to HTML). +
Objective:To have a play with some MathML and test your new-found + knowledge.
+ + +## A small math article + +The goal is to rewrite the following math article using HTML and MathML: + +![Screenshot of the PDF output generated by XeLaTeX](xelatex-output.png) + +Although you don't need to be familiar with +[LaTeX](https://en.wikipedia.org/wiki/LaTeX), it might be useful to know the +LaTeX source from which it was generated: + +``` +\documentclass{article} + +\usepackage{amsmath} +\usepackage{amssymb} + +\begin{document} + +To solve the cubic equation $t^3 + pt + q = 0$ (where the real numbers +$p, q$ satisfy ${4p^3 + 27q^2} > 0$) one can use Cardano's formula: + +\[ + \sqrt[{3}]{ + -\frac{q}{2} + +\sqrt{\frac{q^2}{4} + {\frac{p^{3}}{27}}} + }+ + \sqrt[{3}]{ + -\frac{q}{2} + -\sqrt{\frac{q^2}{4} + {\frac{p^{3}}{27}}} + } +\] + +For any $u_1, \dots, u_n \in \mathbb{C}$ and +$v_1, \dots, v_n \in \mathbb{C}$, the Cauchy–Bunyakovsky–Schwarz +inequality can be written as follows: + +\[ + \left| \sum_{k=1}^n {u_k \bar{v_k}} \right|^2 + \leq + { + \left( \sum_{k=1}^n {|u_k|} \right)^2 + \left( \sum_{k=1}^n {|v_k|} \right)^2 + } +\] + +Finally, the determinant of a Vandermonde matrix can be calculated +using the following expression: + +\[ + \begin{vmatrix} + 1 & x_1 & x_1^2 & \dots & x_1^{n-1} \\ + 1 & x_2 & x_2^2 & \dots & x_2^{n-1} \\ + 1 & x_3 & x_3^2 & \dots & x_3^{n-1} \\ + \vdots & \vdots & \vdots & \ddots & \vdots \\ + 1 & x_n & x_n^2 & \dots & x_n^{n-1} \\ + \end{vmatrix} + = {\prod_{1 \leq {i,j} \leq n} {(x_i - x_j)}} +\] + +\end{document} +``` + +## Starting point + +To get this assessment started, you can rely on our usual HTML template. +By default it uses UTF-8 encoding, special Web fonts for the `` +and `` tags (with similar look & feel as the LaTeX output). The goal +is to replace the question marks `???` with actual MathML content. + +```html + + + + + Three famous mathematical formulas + + + +

To solve the cubic equation ??? (where the real numbers ??? + satisfy ???) one can use Cardano's formula: ???

+ +

For any ??? and ???, the Cauchy–Bunyakovsky–Schwarz + inequality can be written as follows: ???

+ +

Finally, the determinant of a Vandermonde matrix can be calculated + using the following expression: ???

+ + +``` + +## Hints and tips + +* Start by distinguishing the *inline* and *display* formulas and set the + `display` attribute accordingly. +* Check the text used and + find their [Unicode characters](https://en.wikipedia.org/wiki/Mathematical_operators_and_symbols_in_Unicode) ("−", "ℂ", "∑", ...). +* Analyze the semantics of each portion of text (variable? operator? number?) + and determine the proper token element to use for each of them. +* Look for advanced constructions (fractions? roots? scripts? matrices?) and + determine the proper MathML element to use for each of them. +* Don't forget to rely on `` for grouping subexpressions. +* Pay attention to stretchy and large operators! +* Use the [W3C validator](https://validator.w3.org/nu/) to catch unintended + mistakes in your HTML/MathML markup. +* If you are stuck, or realize how painful it is to write MathML by hand, + feel free to use tools to help + [write MathML](/en-US/docs/Web/MathML/Authoring) such as + [TeXZilla](https://fred-wang.github.io/TeXZilla/). + +{{LearnSidebar}}{{PreviousMenu("Learn/MathML/First_steps/Tables", "Learn/MathML/First_steps")}} diff --git a/files/en-us/learn/mathml/first_steps/three_famous_mathematical_formulas/xelatex-output.png b/files/en-us/learn/mathml/first_steps/three_famous_mathematical_formulas/xelatex-output.png new file mode 100644 index 0000000000000000000000000000000000000000..c0c08ba3f97801c8be40417216b7067d422f9a92 GIT binary patch literal 29027 zcmb@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_nAm z@|sPKA^fJ+Vs(&)p1LhR-5Sci7h&%~KbGD#TSPd$3Gs2m2HyUveE2*2P?CJepyDg) zsc`eAYZO1f!lm7U){|WzV#O&=ZWc*T^RBH?2N%_5vM=lwR`=(neIrfUUl!caULd@- z&8Im-GH)12fg_r|A4_}%A5d?7h_T(GaPprq*!T)Rb4%Q7#%niW)lH$6e?oEUIO01J z7k}7*EdNA~JDlG72^GE&6m?S}A%0R$!`bpbEO-5HLxoze@W<|x%8R~pXug(IkX4l_ Jk^1=M{{RAQJsSW3 literal 0 HcmV?d00001 diff --git a/files/en-us/learn/mathml/index.md b/files/en-us/learn/mathml/index.md new file mode 100644 index 000000000000000..9ef2effa8f00f0d --- /dev/null +++ b/files/en-us/learn/mathml/index.md @@ -0,0 +1,47 @@ +--- +title: Writing mathematics with MathML +slug: Learn/MathML +tags: + - Beginner + - Guide + - MathML + - Intro + - Learn + - Topic +--- +{{LearnSidebar}} + +Mathematical Markup Language — or {{glossary("MathML")}} — is the markup language used to write mathematical formulas in Web pages using fractions, scripts, radicals, matrices, integrals, series, etc. Although it was originally designed as an independent XML language, MathML is generally directly embedded inside {{Glossary('HTML')}} documents and can be seen as an extension of HTML. + +> **Warning:** In practice, MathML content is generated from [lightweight markup languages](https://en.wikipedia.org/wiki/Lightweight_markup_language) (e.g. [LaTeX](https://fr.wikipedia.org/wiki/LaTeX)) or using [graphical user interface](https://en.wikipedia.org/wiki/Graphical_user_interface): if you just need to integrate mathematical formulas in your web pages, the tips from the [Authoring MathML](/en-US/docs/Web/MathML/Authoring) page should be enough. + +> **Callout:** +> +> #### Looking to become a front-end web developer? +> +> We have put together a course that includes all the essential information you need to +> work towards your goal. +> +> [**Get started**](/en-US/docs/Learn/Front-end_web_developer) + +## Prerequisites + +Before attempting to learn MathML, it is assumed that you have some basic knowledge of [HTML](/en-US/docs/Learn/HTML) and [CSS](/en-US/docs/Learn/CSS). Consequently, you are strongly advised to get familiar with at least these two technologies first. Start by working through the following modules: + +- [Getting started with the Web](/en-US/docs/Learn/Getting_started_with_the_web) +- [Introduction to HTML](/en-US/docs/Learn/HTML/Introduction_to_HTML) +- [Introduction to CSS](/en-US/docs/Learn/CSS/First_steps) + +Some familarity with mathematical notations and [TeX](https://fr.wikipedia.org/wiki/TeX) rendering rules might also come in handy, even though required concepts will be explained as needed. + +## Modules + +This topic contains the following modules, in a suggested order for working through them. You should definitely start with the first one. + +- [MathML first steps](/en-US/docs/Learn/MathML/First_steps) + - : MathML is the markup language used to write mathematical formulas in Web pages. This module provides a gentle beginning to your path towards MathML mastery with the basics of how it works, what the syntax looks like, and how you can start using it inside HTML. + +## See also + +- [MathML on MDN](/en-US/docs/Web/MathML) + - : The main entry point for MathML documentation on MDN, where you'll find detailed reference documentation for all features of the MathML language. Want to know all the values a property can take? This is a good place to go. From a21c0b949e5d51231cdb2864f88424433fb94ed4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Fri, 12 Aug 2022 21:08:57 +0200 Subject: [PATCH 02/20] fix typo with sub/supp --- files/en-us/learn/mathml/first_steps/scripts/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/en-us/learn/mathml/first_steps/scripts/index.md b/files/en-us/learn/mathml/first_steps/scripts/index.md index ee525feb25294d8..1bfd5bd77a93119 100644 --- a/files/en-us/learn/mathml/first_steps/scripts/index.md +++ b/files/en-us/learn/mathml/first_steps/scripts/index.md @@ -83,8 +83,8 @@ that: {{ EmbedLiveSample('Subtrees_of_msub_msup_msubsup', 700, 200, "", "") }} > **Note:** The MathML elements `` and `` are different from the -> HTML elements [``](/en-US/docs/Web/HTML/Element/sup) and -> [``](/en-US/docs/Web/HTML/Element/sup). They allow to use an arbitrary +> HTML elements [``](/en-US/docs/Web/HTML/Element/sub) and +> [``](/en-US/docs/Web/HTML/Element/sup). They allow to use an arbitrary > MathML subtree as scripts, not just text. ## Underscripts and overscripts From f459b8cdd7a8702b9aa1b45aaed4cf4363d3db7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Fri, 12 Aug 2022 21:10:58 +0200 Subject: [PATCH 03/20] find -type f -name *.md | xargs sed -i 's///g' --- .../learn/mathml/first_steps/fractions_and_roots/index.md | 6 +++--- .../learn/mathml/first_steps/getting_started/index.md | 4 ++-- files/en-us/learn/mathml/first_steps/scripts/index.md | 6 +++--- files/en-us/learn/mathml/first_steps/tables/index.md | 6 +++--- .../learn/mathml/first_steps/text_containers/index.md | 8 ++++---- .../three_famous_mathematical_formulas/index.md | 2 +- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/files/en-us/learn/mathml/first_steps/fractions_and_roots/index.md b/files/en-us/learn/mathml/first_steps/fractions_and_roots/index.md index 82b0bfef110dbb5..cf813245bd3a300 100644 --- a/files/en-us/learn/mathml/first_steps/fractions_and_roots/index.md +++ b/files/en-us/learn/mathml/first_steps/fractions_and_roots/index.md @@ -82,7 +82,7 @@ Here is a simple exercise to verify whether you understood the relation between ```html hidden - + My page with math characters @@ -234,7 +234,7 @@ also stretches to be as tall as their content. ```html - + My page with stretchy radical symbols @@ -271,7 +271,7 @@ fraction-like notations that don't draw a horizontal bar, attach a ```html - + My binomial coefficient diff --git a/files/en-us/learn/mathml/first_steps/getting_started/index.md b/files/en-us/learn/mathml/first_steps/getting_started/index.md index 8cc95e83bd12535..fd32b1cb013dc94 100644 --- a/files/en-us/learn/mathml/first_steps/getting_started/index.md +++ b/files/en-us/learn/mathml/first_steps/getting_started/index.md @@ -48,7 +48,7 @@ document, it is inside a paragraph of text: ```html - + My first math page @@ -84,7 +84,7 @@ their own line as shown below. To achieve that, one only need to attach a ```html hidden - + My first math page diff --git a/files/en-us/learn/mathml/first_steps/scripts/index.md b/files/en-us/learn/mathml/first_steps/scripts/index.md index 1bfd5bd77a93119..dc72e71633e1641 100644 --- a/files/en-us/learn/mathml/first_steps/scripts/index.md +++ b/files/en-us/learn/mathml/first_steps/scripts/index.md @@ -161,7 +161,7 @@ corresponds to your expectation. ```html hidden - + My page with scripted elements @@ -302,7 +302,7 @@ and ```html hidden - + My page with horizontal stretchy operators @@ -415,7 +415,7 @@ interesting changes: ```html hidden - + My page with moved limits and small largeop diff --git a/files/en-us/learn/mathml/first_steps/tables/index.md b/files/en-us/learn/mathml/first_steps/tables/index.md index bc31d4ddbe34df3..0476400cf297227 100644 --- a/files/en-us/learn/mathml/first_steps/tables/index.md +++ b/files/en-us/learn/mathml/first_steps/tables/index.md @@ -55,7 +55,7 @@ Here is a basic example taken from the [article about the CSS ```html - + My first matrix @@ -148,7 +148,7 @@ the outer matrix: ```html hidden - + My matrix with columnspan @@ -243,7 +243,7 @@ conditions are placed on two different columns. ```html hidden - + My first matrix diff --git a/files/en-us/learn/mathml/first_steps/text_containers/index.md b/files/en-us/learn/mathml/first_steps/text_containers/index.md index 1497143279d2d4c..e63e2e60abb9141 100644 --- a/files/en-us/learn/mathml/first_steps/text_containers/index.md +++ b/files/en-us/learn/mathml/first_steps/text_containers/index.md @@ -48,7 +48,7 @@ Since most of these characters are not part of Basic Latin Unicode block, it is ```html - + My page with math characters @@ -82,7 +82,7 @@ corresponds to your expectation. ```html hidden - + My page with math characters @@ -240,7 +240,7 @@ the differences with the text-only version. ```html - + My page with math characters @@ -316,7 +316,7 @@ to read the source code when you are done. ```html hidden - + My page with stretchy operators diff --git a/files/en-us/learn/mathml/first_steps/three_famous_mathematical_formulas/index.md b/files/en-us/learn/mathml/first_steps/three_famous_mathematical_formulas/index.md index cee554163e2f7ed..7d1d59bf37333d9 100644 --- a/files/en-us/learn/mathml/first_steps/three_famous_mathematical_formulas/index.md +++ b/files/en-us/learn/mathml/first_steps/three_famous_mathematical_formulas/index.md @@ -101,7 +101,7 @@ is to replace the question marks `???` with actual MathML content. ```html - + Three famous mathematical formulas From b973607eaa9fc2723e34057257f96022b5afe06f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Fri, 12 Aug 2022 21:19:19 +0200 Subject: [PATCH 04/20] for x in $(find files/en-us/learn/mathml/first_steps -name *.png); do yarn filecheck "$x" --save-compression; done --- .../fractions_and_roots/mfrac-msqrt-mroot.png | Bin 6957 -> 3204 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/files/en-us/learn/mathml/first_steps/fractions_and_roots/mfrac-msqrt-mroot.png b/files/en-us/learn/mathml/first_steps/fractions_and_roots/mfrac-msqrt-mroot.png index 71b083515240e282fb0b017e0c65875d2de0b711..f1fb314732fee95cb7362c1065727102c66d0e49 100644 GIT binary patch delta 3176 zcmV-u443n*HiQ|F83+Ra004^qIH;5C0VjU|32;bRa{vG?BLDy{BLR4&KXw2B0{~D= zR7L;)|Kk1s1_)B?oJjxw`~Uy=`v3m`00960{-^Z+20oJh|Ns5rlmGg>A#lU@|No)x z|FK*S{MCg2{o|eL{#vm3|Nrm^0v9j^3IYgG|NiR+2ub5DB|MLI;3JEFJ{QtN4{{#qC>i++)`2TCZ`v3T@FbW>`uv=>#1f`{> z1_K5k1s;CT`~(kJE-o%-yZIPlwR(DbTwGqma3KvPa)B@g_^ek%mE!x)fp5b4Iv)=x z69}H&{ey;zZ;RFc`rF#q*$xg94h(+|`~3Z@ULqS3OhO6=ZMpC}5=K;0RjPwtR1yTN zR}FS42;Gi6XlG}-W*Q3_WK|PTw)6ik6<>pbf57_xDL_>1rBRgQ{jIF3IZSGi#_jpc zlltVY%lrT2l|sJh{rvIQM@36yZFTyBJicdFcaeS$+IY<-BO+L=tn!pP&eg#PNF z(4~4D7bKHF2fvbme_l_dQ4Rj>y0hQTF2IVbt~`M0;Xqr$6#m!OZ` z{fnKXl2$@ff29BW?_G|?Bsf%py6WGVW^iw!V~N6|z{GOJ`qA~+aXNn)qO#PYgoRLT zgy*h}u6uHmZ9>1lzn`Oe>)Fv8Fh@CKiCS!*QDBrL1rjG*s_DX*D`~pS)#?4)poG)> z!Gug+l+74Ij=}c-fXMpq^#0V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X?!H@*uf9pE0ONzpL{-7W+?Z9T)BcaZQ5Ykv}stgW(|0rN0TN^aQ5t37#kaZV2u6>S2it&=fz~0RI3Di z2|--L5w0V?gF)h1teoJDpnrmKKMpXl?SPg)xnkqsM68{$4W}+&L|CFGsy6u^-#N~N zPwNo4uGo(&f8E3jg)tg*=#1fuyx^kPhOsLT;Ge&4B3f>Q`t4hx+vs(e-@PI@5EAeC z!OiDy$P7&()f7Nl)zPk5Bqn!XjE6>z(W#RQ7XRUjX5|1rbQh+(oyVJ$D1= Date: Sat, 13 Aug 2022 12:01:52 +0800 Subject: [PATCH 05/20] format files --- .../first_steps/fractions_and_roots/index.md | 95 +++--- .../first_steps/getting_started/index.md | 209 ++++++------ files/en-us/learn/mathml/first_steps/index.md | 3 +- .../learn/mathml/first_steps/scripts/index.md | 320 ++++++++---------- .../learn/mathml/first_steps/tables/index.md | 69 ++-- .../first_steps/text_containers/index.md | 224 ++++++------ .../index.md | 63 ++-- files/en-us/learn/mathml/index.md | 3 +- 8 files changed, 444 insertions(+), 542 deletions(-) diff --git a/files/en-us/learn/mathml/first_steps/fractions_and_roots/index.md b/files/en-us/learn/mathml/first_steps/fractions_and_roots/index.md index cf813245bd3a300..95faa8b24e4d4a1 100644 --- a/files/en-us/learn/mathml/first_steps/fractions_and_roots/index.md +++ b/files/en-us/learn/mathml/first_steps/fractions_and_roots/index.md @@ -8,8 +8,7 @@ tags: --- {{LearnSidebar}}{{PreviousMenuNext("Learn/MathML/First_steps/Text_containers", "Learn/MathML/First_steps/Scripts", "Learn/MathML/First_steps")}} -Relying on text containers, this article describes how to build more complex -MathML expressions by nesting fractions and roots. +Relying on text containers, this article describes how to build more complex MathML expressions by nesting fractions and roots. @@ -40,7 +39,7 @@ MathML expressions by nesting fractions and roots.
-## Subtrees of ``, `` and `` +## Subtrees of \, \ and \ In the [getting started with MathML](/en-US/docs/Learn/MathML/First_steps/Getting_started) article, we've already met the `` element to describe a fraction. Let's consider a basic example which adds new elements for roots (`` and ``): @@ -51,7 +50,7 @@ In the [getting started with MathML](/en-US/docs/Learn/MathML/First_steps/Gettin child2 -
+
child1 @@ -60,7 +59,7 @@ In the [getting started with MathML](/en-US/docs/Learn/MathML/First_steps/Gettin childN -
+
child1 @@ -70,15 +69,16 @@ In the [getting started with MathML](/en-US/docs/Learn/MathML/First_steps/Gettin ``` Below is a screenshot of how it is rendered by a browser: -* We already know that the `` element is rendered as a fraction: the first child (the numerator) and is drawn above the second child (the denominator) separated by a horizontal bar. -* The `` is rendered as a square root: its children are laid out like an [``](/en-US/docs/Learn/MathML/First_steps/Getting_started#grouping_with_the_mrow_element), prefixed by a root symbol √ and completely covered by an overbar. -* Finally, the `` element is rendered as an nth root: the first element is covered by the radical symbol while the second element is used as the degree of the root and rendered as a prefix superscript. + +- We already know that the `` element is rendered as a fraction: the first child (the numerator) and is drawn above the second child (the denominator) separated by a horizontal bar. +- The `` is rendered as a square root: its children are laid out like an [``](/en-US/docs/Learn/MathML/First_steps/Getting_started#grouping_with_the_mrow_element), prefixed by a root symbol √ and completely covered by an overbar. +- Finally, the `` element is rendered as an nth root: the first element is covered by the radical symbol while the second element is used as the degree of the root and rendered as a prefix superscript. ![Screenshot of mfrac, msqrt, mroot](mfrac-msqrt-mroot.png) ### Active learning: nesting different elements -Here is a simple exercise to verify whether you understood the relation between a MathML subtree and its visual rendering. The document contains a MathML formula and you must check all subtrees corresponding to a subtree in that MathML formula. Once you are done, you can inspect the source of the MathML formula and verify if it matches your expectation.

+Here is a simple exercise to verify whether you understood the relation between a MathML subtree and its visual rendering. The document contains a MathML formula and you must check all subtrees corresponding to a subtree in that MathML formula. Once you are done, you can inspect the source of the MathML formula and verify if it matches your expectation. ```html hidden @@ -187,40 +187,44 @@ math [id] .highlight { background: lightblue; } p { - padding: .5em; + padding: 0.5em; } ``` ```js hidden -const options = document.getElementById('options'); -const comment = document.getElementById('comment'); +const options = document.getElementById("options"); +const comment = document.getElementById("comment"); const checkboxes = Array.from(options.getElementsByTagName("input")); -const status = document.getElementById('status'); +const status = document.getElementById("status"); function verifyOption(checkbox) { let mathml = checkbox.dataset.highlight; - if (mathml) + if (mathml) { mathml = document.getElementById(mathml); + } if (checkbox.checked) { comment.textContent = checkbox.dataset.comment; - if (mathml) - mathml.classList.add('highlight'); - else + if (mathml) { + mathml.classList.add("highlight"); + } else { checkbox.checked = false; + } } else { comment.textContent = ""; - if (mathml) - mathml.classList.remove('highlight'); + if (mathml) { + mathml.classList.remove("highlight"); + } } - let finished = true; - checkboxes.forEach(checkbox => { - if (!!checkbox.checked != !!checkbox.dataset.highlight) - finished = false; - }); - status.textContent = finished ? "Congratulations, you checked all the correct answers!" : ""; - + const finished = checkboxes.every( + (checkbox) => !!checkbox.checked === !!checkbox.dataset.highlight, + ); + status.textContent = finished + ? "Congratulations, you checked all the correct answers!" + : ""; } -checkboxes.forEach(checkbox => { - checkbox.addEventListener('change', () => { verifyOption(checkbox); }); +checkboxes.forEach((checkbox) => { + checkbox.addEventListener("change", () => { + verifyOption(checkbox); + }); }); ``` @@ -228,17 +232,18 @@ checkboxes.forEach(checkbox => { ## Stretchy radical symbols -As previously seen, the overbar of the `` and `` elements -stretches horizontally to cover their content. But actually the root symbol √ -also stretches to be as tall as their content. +As previously seen, the overbar of the `` and `` elements stretches horizontally to cover their content. But actually the root symbol √ also stretches to be as tall as their content. ```html - + My page with stretchy radical symbols - + @@ -262,20 +267,18 @@ also stretches to be as tall as their content. ## Fractions without bar -Some mathematical concepts are sometimes written using fraction-like notations -such [binomial coefficients](https://en.wikipedia.org/wiki/Combination) or -[Legendre symbols](https://en.wikipedia.org/wiki/Legendre_symbol). It is -appropriate to use an `` element to markup such notations. For -fraction-like notations that don't draw a horizontal bar, attach a -linethickness="0" attribute to the `` element: +Some mathematical concepts are sometimes written using fraction-like notations such [binomial coefficients](https://en.wikipedia.org/wiki/Combination) or [Legendre symbols](https://en.wikipedia.org/wiki/Legendre_symbol). It is appropriate to use an `` element to markup such notations. For fraction-like notations that don't draw a horizontal bar, attach a `linethickness="0"` attribute to the `` element: ```html - + My binomial coefficient - + @@ -305,14 +308,12 @@ fraction-like notations that don't draw a horizontal bar, attach a ## Summary -In this lesson, we've seen how to build fractions and roots using the -``, `` and `` elements. We noticed some special feature of -these elements, namely the fraction and radical symbol. We've seen how to use the `linethickness` attribute to draw fractions without bars. In the next article, we will continue with basic math notations and consider [scripts](/en-US/docs/Learn/MathML/First_steps/Scripts). +In this lesson, we've seen how to build fractions and roots using the ``, `` and `` elements. We noticed some special feature of these elements, namely the fraction and radical symbol. We've seen how to use the `linethickness` attribute to draw fractions without bars. In the next article, we will continue with basic math notations and consider [scripts](/en-US/docs/Learn/MathML/First_steps/Scripts). {{LearnSidebar}}{{PreviousMenuNext("Learn/MathML/First_steps/Text_containers", "Learn/MathML/First_steps/Scripts", "Learn/MathML/First_steps")}} ## See also -* [The `` element](/en-US/docs/Web/MathML/Element/mfrac) -* [The `` element](/en-US/docs/Web/MathML/Element/msqrt) -* [The `` element](/en-US/docs/Web/MathML/Element/mroot) +- [The `` element](/en-US/docs/Web/MathML/Element/mfrac) +- [The `` element](/en-US/docs/Web/MathML/Element/msqrt) +- [The `` element](/en-US/docs/Web/MathML/Element/mroot) diff --git a/files/en-us/learn/mathml/first_steps/getting_started/index.md b/files/en-us/learn/mathml/first_steps/getting_started/index.md index fd32b1cb013dc94..484b097344da8ff 100644 --- a/files/en-us/learn/mathml/first_steps/getting_started/index.md +++ b/files/en-us/learn/mathml/first_steps/getting_started/index.md @@ -39,36 +39,32 @@ In this article, we will take a simple HTML document and view how to add MathML -## Inserting formulas in HTML via the `` element +## Inserting formulas in HTML via the \ element -MathML uses the same syntax as HTML to represent a tree of elements and -attributes. In particular, each mathematical formula is represented by an -element `` which can be placed inside an HTML page. In the following -document, it is inside a paragraph of text: +MathML uses the same syntax as HTML to represent a tree of elements and attributes. In particular, each mathematical formula is represented by an element `` which can be placed inside an HTML page. In the following document, it is inside a paragraph of text: ```html - - My first math page - - - -

The fraction - - - 1 - 3 - - - is not a decimal number.

- - + + My first math page + + +

+ The fraction + + + 1 + 3 + + + is not a decimal number. +

+ ``` -The `` element specifies a fraction with a numerator (its first child) -and a denominator (its second child). This is how it renders in your browser: +The `` element specifies a fraction with a numerator (its first child) and a denominator (its second child). This is how it renders in your browser: {{ EmbedLiveSample('Inserting_formulas_in_HTML', 700, 100, "", "") }} @@ -76,50 +72,38 @@ and a denominator (its second child). This is how it renders in your browser: ### Inline and display modes -Note that in the previous example, the formula is on the same line as the text -of the paragraph, this is called *inline* mode. However, it is quite common for -large mathematical formulas to use *display* mode: they are instead centered on -their own line as shown below. To achieve that, one only need to attach a -`display="block"` attribute on the `` element. +Note that in the previous example, the formula is on the same line as the text of the paragraph, this is called _inline_ mode. However, it is quite common for large mathematical formulas to use _display_ mode: they are instead centered on their own line as shown below. To achieve that, one only need to attach a `display="block"` attribute on the `` element. ```html hidden - - My first math page - - - -

The fraction - - - 1 - 3 - - - is not a decimal number.

- - + + My first math page + + +

+ The fraction + + + 1 + 3 + + + is not a decimal number. +

+ ``` {{ EmbedLiveSample('Inline_and_display_modes', 700, 100, "", "") }} -You may also notice some subtle change in the appearance: the text and vertical -spacing of the fraction becomes a bit bigger. -In *inline* mode, the height is minimized to avoid disturbing the flow -of the surrounding text. In *display* mode, priority is instead put on -legibility of the mathematical formula. +You may also notice some subtle change in the appearance: the text and vertical spacing of the fraction becomes a bit bigger. In _inline_ mode, the height is minimized to avoid disturbing the flow of the surrounding text. In _display_ mode, priority is instead put on legibility of the mathematical formula. -> **Note:** This corresponds to the LaTeX's concept of *inline* formulas -> (delimited by dollar signs `$...$`) and *display* formulas (delimited by -> `\[...\]`). +> **Note:** This corresponds to the LaTeX's concept of _inline_ formulas (delimited by dollar signs `$...$`) and _display_ formulas (delimited by `\[...\]`). -## Grouping with the `` element +## Grouping with the \ element -The `` element can actually contain an arbitrary number of children and -will essentially render them in a row. For instance, the simple formula -"1 + 2 + 3" would be be encoded like this in MathML: +The `` element can actually contain an arbitrary number of children and will essentially render them in a row. For instance, the simple formula "1 + 2 + 3" would be be encoded like this in MathML: ```html @@ -131,10 +115,7 @@ will essentially render them in a row. For instance, the simple formula ``` -The `` element is a generic container that performs similar layout but -can be placed anywhere in the MathML subtree. It is helpful to group several -elements together. For instance, the numerator of the following fraction (its -first child) is "one plus two". +The `` element is a generic container that performs similar layout but can be placed anywhere in the MathML subtree. It is helpful to group several elements together. For instance, the numerator of the following fraction (its first child) is "one plus two". ```html @@ -151,59 +132,60 @@ first child) is "one plus two". ### Active learning: nested expressions -As an exercise, figure out how to write the following expressions using -only the MathML elements we've seen so far. If you are stuck or want to verify -the solution, check the source code of the example. +As an exercise, figure out how to write the following expressions using only the MathML elements we've seen so far. If you are stuck or want to verify the solution, check the source code of the example. ```html hidden
    -
  1. "one half" plus "two third": - - - - 1 - 2 - - + - - 2 - 3 - - -
  2. -
  3. "one plus two plus three" over "four plus five": - - - - 1 +
  4. + "one half" plus "two third": + + + + 1 + 2 + + - 2 - + - 3 - - - 4 - + - 5 - - - -
  5. -
  6. "one quarter" over "two plus three": - - - - 1 - 4 - - - 2 - + - 3 - - - -
  7. + + 2 + 3 + + + +
  8. + "one plus two plus three" over "four plus five": + + + + 1 + + + 2 + + + 3 + + + 4 + + + 5 + + + +
  9. +
  10. + "one quarter" over "two plus three": + + + + 1 + 4 + + + 2 + + + 3 + + + +
``` @@ -211,15 +193,16 @@ the solution, check the source code of the example. ## Summary -In this article, we have taken a look at how to use the `` element to insert a mathematical formula inside a HTML document. We have learned about the difference between *inline* and *display* formulas and how to specify them via the `display` attribute of the `` element. +In this article, we have taken a look at how to use the `` element to insert a mathematical formula inside a HTML document. We have learned about the difference between _inline_ and _display_ formulas and how to specify them via the `display` attribute of the `` element. + In addition, we stumbled upon a couple of other MathML elements: `` for fractions, `` for grouping and finally a few text elements. We will analyze these [text containers](/en-US/docs/Learn/MathML/First_steps/Text_containers) further in the next article. {{LearnSidebar}}{{NextMenu("Learn/MathML/First_steps/Text_containers", "Learn/MathML/First_steps")}} ## See also -* [Using MathML](/en-US/docs/Web/MathML/Authoring#using_mathml) -* [The `` element](/en-US/docs/Web/MathML/Element/math) -* [The `` element](/en-US/docs/Web/MathML/Element/mfrac) -* [The `` element](/en-US/docs/Web/MathML/Element/mrow) -* [The `math-depth` property](/en-US/docs/Web/CSS/math-depth) +- [Using MathML](/en-US/docs/Web/MathML/Authoring#using_mathml) +- [The `` element](/en-US/docs/Web/MathML/Element/math) +- [The `` element](/en-US/docs/Web/MathML/Element/mfrac) +- [The `` element](/en-US/docs/Web/MathML/Element/mrow) +- [The `math-depth` property](/en-US/docs/Web/CSS/math-depth) diff --git a/files/en-us/learn/mathml/first_steps/index.md b/files/en-us/learn/mathml/first_steps/index.md index a8f0f76261a5912..7c13dd92bdfaff3 100644 --- a/files/en-us/learn/mathml/first_steps/index.md +++ b/files/en-us/learn/mathml/first_steps/index.md @@ -15,8 +15,7 @@ MathML is the markup language used to write mathematical formulas in Web pages. > > #### Looking to become a front-end web developer? > -> We have put together a course that includes all the essential information you need to -> work towards your goal. +> We have put together a course that includes all the essential information you need to work towards your goal. > > [**Get started**](/en-US/docs/Learn/Front-end_web_developer) diff --git a/files/en-us/learn/mathml/first_steps/scripts/index.md b/files/en-us/learn/mathml/first_steps/scripts/index.md index dc72e71633e1641..77cc1f5c326c993 100644 --- a/files/en-us/learn/mathml/first_steps/scripts/index.md +++ b/files/en-us/learn/mathml/first_steps/scripts/index.md @@ -40,17 +40,21 @@ We continue the review of basic math notations and focuses on building MathML el ## Subscripts and superscripts -Similarly to what we saw in the [previous article](/en-US/docs/Learn/MathML/First_steps/Fractions_and_roots), the ``, `` and `` have a special structure expecting exactly two elements (for ``, ``) or three elements (for ``): +Similarly to what we saw in the [previous article](/en-US/docs/Learn/MathML/First_steps/Fractions_and_roots), the ``, `` and `` have a special structure expecting exactly two elements (for ``, ``) or three elements (for ``): ```html -

msub: +

+ msub: child1 child2 -

msup: +

+ +

+ msup: child1 @@ -58,7 +62,8 @@ Similarly to what we saw in the [previous article](/en-US/docs/Learn/MathML/Firs

-

msubsup: +

+ msubsup: child1 @@ -69,40 +74,29 @@ Similarly to what we saw in the [previous article](/en-US/docs/Learn/MathML/Firs

``` -Below is the rendering of the above example in your browser. You should notice -that: +Below is the rendering of the above example in your browser. You should notice that: -* The second child of the `` element is attached as a subscript of - its first child. -* The second child of the `` element is attached as a superscript of - its first child. -* The second and third children of the `` element are respectively - attached as a subscript and superscript of its first child. -* The text inside scripts is scaled down. +- The second child of the `` element is attached as a subscript of its first child. +- The second child of the `` element is attached as a superscript of its first child. +- The second and third children of the `` element are respectively attached as a subscript and superscript of its first child. +- The text inside scripts is scaled down. {{ EmbedLiveSample('Subtrees_of_msub_msup_msubsup', 700, 200, "", "") }} -> **Note:** The MathML elements `` and `` are different from the -> HTML elements [``](/en-US/docs/Web/HTML/Element/sub) and -> [``](/en-US/docs/Web/HTML/Element/sup). They allow to use an arbitrary -> MathML subtree as scripts, not just text. +> **Note:** The MathML elements `` and `` are different from the HTML elements [``](/en-US/docs/Web/HTML/Element/sub) and [``](/en-US/docs/Web/HTML/Element/sup). They allow to use an arbitrary MathML subtree as scripts, not just text. ## Underscripts and overscripts -The ``, `` and `` elements are very similar except -that they are used to attach underscripts and overscripts. Instead of giving -details, we will let you figure out their definitions yourself with the -following exercise. +The ``, `` and `` elements are very similar except that they are used to attach underscripts and overscripts. Instead of giving details, we will let you figure out their definitions yourself with the following exercise. ### Active learning: Recognize under/over scripts -In the following example, -try to guess the names of the mystery elements (written as question -marks) and click the button to reveal the solution: +In the following example, try to guess the names of the mystery elements (written as question marks) and click the button to reveal the solution: ```html hidden -

<????????> element - with exactly two children (child1, child2): +

+ <????????> element with exactly two children + (child1, child2): child1 @@ -110,8 +104,9 @@ marks) and click the button to reveal the solution:

-

<????????> element - with exactly three children (child1, child2 and child3): +

+ <????????> element with exactly three children + (child1, child2 and child3): child1 @@ -120,8 +115,9 @@ marks) and click the button to reveal the solution:

-

<????????> element - with exactly two children (child1, child2): +

+ <????????> element with exactly two children + (child1, child2): child1 @@ -130,19 +126,19 @@ marks) and click the button to reveal the solution:

-

+

``` ```css hidden p { - padding: .5em; + padding: 0.5em; } ``` ```js hidden document.getElementById("showSolution").addEventListener("click", () => { const maths = Array.from(document.getElementsByTagName("math")); - Array.from(document.getElementsByTagName("span")).forEach( (span, index) => { + Array.from(document.getElementsByTagName("span")).forEach((span, index) => { span.textContent = maths[index].firstElementChild.tagName; }); }); @@ -152,20 +148,18 @@ document.getElementById("showSolution").addEventListener("click", () => { ### Active learning: Recognize scripted elements -The following MathML formula contains a more complex expression, nesting -fractions, roots and scripts. Try to guess the elements laid out with scripted -elements ``, ``, ``, ``, ``, ``. -Each time you click such an element, it is highlighted and a confirmation -message is displayed. Finally, read the MathML source to verify whether that -corresponds to your expectation. +The following MathML formula contains a more complex expression, nesting fractions, roots and scripts. Try to guess the elements laid out with scripted elements ``, ``, ``, ``, ``, ``. Each time you click such an element, it is highlighted and a confirmation message is displayed. Finally, read the MathML source to verify whether that corresponds to your expectation. ```html hidden - + My page with scripted elements - + @@ -180,7 +174,8 @@ corresponds to your expectation.
+ - | + | α @@ -219,7 +214,7 @@ corresponds to your expectation.
- +
@@ -230,100 +225,73 @@ corresponds to your expectation. color: red; } math { - font-size: 200%; + font-size: 200%; } ``` ```js hidden - const scriptedElements = Array.from(document.querySelectorAll('msub, msup, msubsup, munder, mover, munderover')); - const outputDiv = document.getElementById("output"); - function clearHighlight() { - scriptedElements.forEach(scripted => { - scripted.classList.remove('highlight'); - }); - } - scriptedElements.forEach(scripted => { - scripted.addEventListener('click', () => { - clearHighlight(); - scripted.classList.add('highlight'); - outputDiv.insertAdjacentHTML('beforeend', - `

You clicked an <${scripted.tagName}> element.

`); - }); +const scriptedElements = Array.from( + document.querySelectorAll("msub, msup, msubsup, munder, mover, munderover"), +); +const outputDiv = document.getElementById("output"); +function clearHighlight() { + scriptedElements.forEach((scripted) => { + scripted.classList.remove("highlight"); }); - document.getElementById("clearOutput").addEventListener("click", () => { +} +scriptedElements.forEach((scripted) => { + scripted.addEventListener("click", () => { clearHighlight(); - outputDiv.innerHTML = ""; + scripted.classList.add("highlight"); + outputDiv.insertAdjacentHTML( + "beforeend", + `

You clicked an <${scripted.tagName}> element.

`, + ); }); +}); +document.getElementById("clearOutput").addEventListener("click", () => { + clearHighlight(); + outputDiv.innerHTML = ""; +}); ``` {{ EmbedLiveSample('Active_learning_recognize_scripted_elements', 700, 400, "", "") }} ## More operator properties -We have previously seen some [properties of the `` element](/en-US/docs/Learn/MathML/First_steps/Text_containers#operator_properties_of_mo) -namely stretching in the vertical direction and spacing. Now that scripted -elements are available, we can extend that list. We will do that by tweaking -our [previous example](#active_learning_recognize_scripted_elements). +We have previously seen some [properties of the `` element](/en-US/docs/Learn/MathML/First_steps/Text_containers#operator_properties_of_mo) namely stretching in the vertical direction and spacing. Now that scripted elements are available, we can extend that list. We will do that by tweaking our [previous example](#active_learning_recognize_scripted_elements). ### Stretching in horizontal direction -Let's first perform the substitutions - - β - - - - z - 1 - - + - - z - 2 - - - -and - - α - - - - v - 1 - - + - - v - 2 - - -: +Let's first perform the substitutions β z 1 + z 2 and α v 1 + v 2 : ```html hidden - + My page with horizontal stretchy operators - + - - - z - 1 - - + - - z - 2 - - + + + z + 1 + + + + + z + 2 + + @@ -331,19 +299,20 @@ and + - | + | - - - v - 1 - - + - - v - 2 - - + + + v + 1 + + + + + v + 2 + + | @@ -389,54 +358,47 @@ and color: red; } math { - font-size: 200%; + font-size: 200%; } ``` {{ EmbedLiveSample('Stretching_in_horizontal_direction', 700, 200, "", "") }} -We now realize that the bottom bracket "⎵" and the rightward arrow "→" -stretch horizontally to cover the width of the substitued values. Recall that -[some vertical operators can stretch](/en-US/docs/Learn/MathML/First_steps/Text_containers#active_learning_stretchy_operators) to cover the height of -non-stretchy siblings inside an ``. -Similarly some horizontal operators can stretch -to cover the width of non-stretchy siblings in an ``, `` or -`` element. +We now realize that the bottom bracket "⎵" and the rightward arrow "→" stretch horizontally to cover the width of the substitued values. Recall that [some vertical operators can stretch](/en-US/docs/Learn/MathML/First_steps/Text_containers#active_learning_stretchy_operators) to cover the height of non-stretchy siblings inside an ``. Similarly some horizontal operators can stretch to cover the width of non-stretchy siblings in an ``, `` or `` element. -> **Note:** Stretching can happen for any child of the -> ``, `` or `` element, not just the underscript -> or overscript. +> **Note:** Stretching can happen for any child of the ``, `` or `` element, not just the underscript or overscript. ### Large operator and limits -So far our example has actually been rendered in [*display* mode](/en-US/docs/Learn/MathML/First_steps/Getting_started#inline_and_display_modes). Let's detach the -`display="block"` attribute from the `` element to show up some -interesting changes: +So far our example has actually been rendered in [_display_ mode](/en-US/docs/Learn/MathML/First_steps/Getting_started#inline_and_display_modes). Let's detach the `display="block"` attribute from the `` element to show up some interesting changes: ```html hidden - + My page with moved limits and small largeop - + - - - z - 1 - - + - - z - 2 - - + + + z + 1 + + + + + z + 2 + + @@ -444,19 +406,20 @@ interesting changes: + - | + | - - - v - 1 - - + - - v - 2 - - + + + v + 1 + + + + + v + 2 + + | @@ -502,43 +465,30 @@ interesting changes: color: red; } math { - font-size: 200%; + font-size: 200%; } ``` {{ EmbedLiveSample('Large_operator_and_limits', 700, 200, "", "") }} -As expected, the formula is no longer centered and the rendering is modified to -minimized the height. Focusing on the summation symbol, one can notice that -the sigma is drawn smaller and that the scripts of the `` element -are now attached as a subscript and a superscript! This is due to two -properties of the "∑" operator: +As expected, the formula is no longer centered and the rendering is modified to minimized the height. Focusing on the summation symbol, one can notice that the sigma is drawn smaller and that the scripts of the `` element are now attached as a subscript and a superscript! This is due to two properties of the "∑" operator: -* *largeop*: The operator is drawn with a bigger glyph in *display* mode. -* *movablelimits*: The underscripts and overscripts attached to the - operator are respectively rendered as subscripts and superscripts in - *inline* mode. +- _largeop_: The operator is drawn with a bigger glyph in _display_ mode. +- _movablelimits_: The underscripts and overscripts attached to the operator are respectively rendered as subscripts and superscripts in _inline_ mode. -> **Note:** The *largeop* property is actually unrelated to scripts, even though -> operators having this property are typically scripted. The *movablelimits* -> property is taken into account for `` and `` elements too. +> **Note:** The _largeop_ property is actually unrelated to scripts, even though operators having this property are typically scripted. The _movablelimits_ property is taken into account for `` and `` elements too. ## Summary -In this article, we've finished reviewing basic layout introducing elements -``, ``, ``, ``, ``, `` for -subscripts, superscripts, underscripts and overscripts. Using these elements, -we were able to briefly introduce new properties of the `` element. -In the next article, we -will continue focus on [tabular layout](/en-US/docs/Learn/MathML/First_steps/Tables). +In this article, we've finished reviewing basic layout introducing elements ``, ``, ``, ``, ``, `` for subscripts, superscripts, underscripts and overscripts. Using these elements, we were able to briefly introduce new properties of the `` element. In the next article, we will continue focus on [tabular layout](/en-US/docs/Learn/MathML/First_steps/Tables). {{LearnSidebar}}{{PreviousMenuNext("Learn/MathML/First_steps/Fractions_and_roots", "Learn/MathML/First_steps/Tables", "Learn/MathML/First_steps")}} ## See also -* [The `` element](/en-US/docs/Web/MathML/Element/msub) -* [The `` element](/en-US/docs/Web/MathML/Element/msup) -* [The `` element](/en-US/docs/Web/MathML/Element/msubsup) -* [The `` element](/en-US/docs/Web/MathML/Element/munder) -* [The `` element](/en-US/docs/Web/MathML/Element/mover) -* [The `` element](/en-US/docs/Web/MathML/Element/munderover) +- [The `` element](/en-US/docs/Web/MathML/Element/msub) +- [The `` element](/en-US/docs/Web/MathML/Element/msup) +- [The `` element](/en-US/docs/Web/MathML/Element/msubsup) +- [The `` element](/en-US/docs/Web/MathML/Element/munder) +- [The `` element](/en-US/docs/Web/MathML/Element/mover) +- [The `` element](/en-US/docs/Web/MathML/Element/munderover) diff --git a/files/en-us/learn/mathml/first_steps/tables/index.md b/files/en-us/learn/mathml/first_steps/tables/index.md index 0476400cf297227..8fddd8b9af146ea 100644 --- a/files/en-us/learn/mathml/first_steps/tables/index.md +++ b/files/en-us/learn/mathml/first_steps/tables/index.md @@ -43,23 +43,20 @@ Once all basic math notations are known, it remains to consider tabular layout w ## MathML tabular elements -The MathML tabular elements are similar to the ones for [HTML tables](/en-US/docs/Learn/HTML/Tables): the `` element represents a table, the -`` element represents a row and the `` element represents a cell. -An `` table can be inserted anywhere in a MathML formula. The `` -cell can contain any number of MathML children and will lay them out -as an `` container. +The MathML tabular elements are similar to the ones for [HTML tables](/en-US/docs/Learn/HTML/Tables): the `` element represents a table, the `` element represents a row and the `` element represents a cell. An `` table can be inserted anywhere in a MathML formula. The `` cell can contain any number of MathML children and will lay them out as an `` container. -Tables are typically used for matrix-like expressions (including vectors). -Here is a basic example taken from the [article about the CSS -`matrix()` function](/en-US/docs/Web/CSS/transform-function/matrix): +Tables are typically used for matrix-like expressions (including vectors). Here is a basic example taken from the [article about the CSS `matrix()` function](/en-US/docs/Web/CSS/transform-function/matrix): ```html - + My first matrix - + @@ -140,19 +137,18 @@ Here is a basic example taken from the [article about the CSS ## Allowing cells to span multiple rows and columns -This is again similar to [HTML's article](/en-US/docs/Learn/HTML/Tables/Basics#allowing_cells_to_span_multiple_rows_and_columns). The `` element accepts -the `columnspan` and `rowspan` attributes to indicate that the cell spans -multiples rows and columns. Below the inner matrix spans two columns of -the outer matrix: - +This is again similar to [HTML's article](/en-US/docs/Learn/HTML/Tables/Basics#allowing_cells_to_span_multiple_rows_and_columns). The `` element accepts the `columnspan` and `rowspan` attributes to indicate that the cell spans multiples rows and columns. Below the inner matrix spans two columns of the outer matrix: ```html hidden - + My matrix with columnspan - + @@ -229,25 +225,22 @@ the outer matrix: {{ EmbedLiveSample('allowing_cells_to_span_multiple_rows_and_columns', 700, 200, "", "") }} -> **Note:** For historical reason, the MathML attribute for column spaning is -> called `columnspan` not `colspan`. +> **Note:** For historical reason, the MathML attribute for column spaning is called `columnspan` not `colspan`. ## Usage for advanced layout -Besides representing matrix-like objects, MathML tables are sometimes used for -advanced layout inside mathematical formulas, -for example in [Wikipedia's definition of -Legendre symbol](https://en.wikipedia.org/wiki/Legendre_symbol). Here, the -different cases are written on three different rows while the values and -conditions are placed on two different columns. +Besides representing matrix-like objects, MathML tables are sometimes used for advanced layout inside mathematical formulas, for example in [Wikipedia's definition of Legendre symbol](https://en.wikipedia.org/wiki/Legendre_symbol). Here, the different cases are written on three different rows while the values and conditions are placed on two different columns. ```html hidden - + My first matrix - + @@ -315,21 +308,11 @@ conditions are placed on two different columns. {{ EmbedLiveSample('Usage_for_advanced_layout', 700, 200, "", "") }} -> **Warning:** The [`` article](/en-US/docs/Web/MathML/Element/mtable) -> provides more advanced layout options via special attributes such as -> alignment or spacing. This is inherited from the original design of MathML, -> that was supposed to work in -> engines that are not CSS-aware. However, these attributes may not be -> implemented in all browsers. In the future, it is likely that usages of -> `` for layout-only purpose (i.e. not actual matrix-like objects) -> can be replaced with CSS-based alternatives. +> **Warning:** The [`` article](/en-US/docs/Web/MathML/Element/mtable) provides more advanced layout options via special attributes such as alignment or spacing. This is inherited from the original design of MathML, that was supposed to work in engines that are not CSS-aware. However, these attributes may not be implemented in all browsers. In the future, it is likely that usages of `` for layout-only purpose (i.e. not actual matrix-like objects) can be replaced with CSS-based alternatives. ## Summary -In this article, we've reviewed the -``, `` and `` elements which are the equivalent of HTML -elements for tables. We have seen how to use them for representing matrix-like -objects and how it is sometimes used for advanced layout. +In this article, we've reviewed the ``, `` and `` elements which are the equivalent of HTML elements for tables. We have seen how to use them for representing matrix-like objects and how it is sometimes used for advanced layout. You've nearly finished this module — we only have one more thing to do. In the [three famous mathematical formulas assessment](/en-US/docs/Learn/MathML/First_steps/Three_famous_mathematical_formulas) you'll use your new knowledge to rewrite a small mathematical article using HTML and MathML. @@ -337,7 +320,7 @@ You've nearly finished this module — we only have one more thing to do. In the ## See also -* [Learning about HTML tables](/en-US/docs/Learn/HTML/Tables) -* [The `` element](/en-US/docs/Web/MathML/Element/mtable) -* [The `` element](/en-US/docs/Web/MathML/Element/mtr) -* [The `` element](/en-US/docs/Web/MathML/Element/mtd) +- [Learning about HTML tables](/en-US/docs/Learn/HTML/Tables) +- [The `` element](/en-US/docs/Web/MathML/Element/mtable) +- [The `` element](/en-US/docs/Web/MathML/Element/mtr) +- [The `` element](/en-US/docs/Web/MathML/Element/mtd) diff --git a/files/en-us/learn/mathml/first_steps/text_containers/index.md b/files/en-us/learn/mathml/first_steps/text_containers/index.md index e63e2e60abb9141..0516c63aebe82c4 100644 --- a/files/en-us/learn/mathml/first_steps/text_containers/index.md +++ b/files/en-us/learn/mathml/first_steps/text_containers/index.md @@ -50,9 +50,12 @@ Since most of these characters are not part of Basic Latin Unicode block, it is - + My page with math characters - +

∀A∊𝔰𝔩(n,𝔽),TrA=0

@@ -64,29 +67,27 @@ Since most of these characters are not part of Basic Latin Unicode block, it is ## A bit of semantics... -We noticed in the [getting started with MathML](/en-US/docs/Learn/MathML/First_steps/Getting_started) article that the text in MathML formulas are wrapped in specific container elements such as the `` or ``. More generally, every text in MathML formulas must be included inside such container elements, called *token* elements. In addition, MathML provides multiple token elements in order to distinguish different meanings of the text content: +We noticed in the [getting started with MathML](/en-US/docs/Learn/MathML/First_steps/Getting_started) article that the text in MathML formulas are wrapped in specific container elements such as the `` or ``. More generally, every text in MathML formulas must be included inside such container elements, called _token_ elements. In addition, MathML provides multiple token elements in order to distinguish different meanings of the text content: -* The `` element, which represents a symbolic name or arbitrary text that should be rendered as an identifier. Examples: `x` (variable), `cos` (function name) and `π` (symbolic constant). -* The `` element represents a "numeric literal" or other data that should be rendered as a numeric literal. Examples: `2` (integer), `0.123` (decimal number) or `0xFFEF` (hexadecimal value). -* The `` element represents an operator or anything that should be rendered as an operator. For example `+` (binary operation), `` (binary relation), `` (summation symbol) or `[` (fence). -* The `` element is used to represent arbitrary text. For example short words in formulas such as `if` or `maps to`. +- The `` element, which represents a symbolic name or arbitrary text that should be rendered as an identifier. Examples: `x` (variable), `cos` (function name) and `π` (symbolic constant). +- The `` element represents a "numeric literal" or other data that should be rendered as a numeric literal. Examples: `2` (integer), `0.123` (decimal number) or `0xFFEF` (hexadecimal value). +- The `` element represents an operator or anything that should be rendered as an operator. For example `+` (binary operation), `` (binary relation), `` (summation symbol) or `[` (fence). +- The `` element is used to represent arbitrary text. For example short words in formulas such as `if` or `maps to`. ### Active learning: recognize token elements -Below is a more complex example, which says that the absolute value of a real -number is equal to that number if and only if it is nonnegative. Spot the -different token elements and what they are used for. -Each time you click the corresponding text, it is highlighted and a confirmation -message is displayed. Finally, read the MathML source to verify whether that -corresponds to your expectation. +Below is a more complex example, which says that the absolute value of a real number is equal to that number if and only if it is nonnegative. Spot the different token elements and what they are used for. Each time you click the corresponding text, it is highlighted and a confirmation message is displayed. Finally, read the MathML source to verify whether that corresponds to your expectation. ```html hidden - + My page with math characters - + @@ -106,63 +107,54 @@ corresponds to your expectation. 0
- +
``` - ```css hidden .highlight { color: red; } math { - font-size: 200%; + font-size: 200%; } ``` - ```js hidden - const tokenElements = Array.from(document.querySelectorAll('mi, mo, mn, mtext')); - const outputDiv = document.getElementById("output"); - function clearHighlight() { - tokenElements.forEach(token => { - token.classList.remove('highlight'); - }); - } - tokenElements.forEach(token => { - token.addEventListener('click', () => { - clearHighlight(); - token.classList.add('highlight'); - outputDiv.insertAdjacentHTML('beforeend', - `

You clicked an <${token.tagName}> element.

`); - }); +const tokenElements = Array.from( + document.querySelectorAll("mi, mo, mn, mtext"), +); +const outputDiv = document.getElementById("output"); +function clearHighlight() { + tokenElements.forEach((token) => { + token.classList.remove("highlight"); }); - document.getElementById("clearOutput").addEventListener("click", () => { +} +tokenElements.forEach((token) => { + token.addEventListener("click", () => { clearHighlight(); - outputDiv.innerHTML = ""; + token.classList.add("highlight"); + outputDiv.insertAdjacentHTML( + "beforeend", + `

You clicked an <${token.tagName}> element.

`, + ); }); +}); +document.getElementById("clearOutput").addEventListener("click", () => { + clearHighlight(); + outputDiv.innerHTML = ""; +}); ``` {{ EmbedLiveSample('Active_learning_recognize_token_elements', 700, 400, "", "") }} +> **Note:** It is sometimes difficult to decide the token element to use for a given text content. In practice, choosing the wrong element should not cause major issues because all token elements are generally rendered the same by browser implementations (for visual display and for assistive technologies). However, the `` and `` elements have special distinguishing features that one should be aware of. They are explained in the following sections. -> **Note:** It is sometimes difficult to decide the token element to use for -> a given text content. In practice, choosing the wrong element should not cause -> major issues because all token elements are generally -> rendered the same by browser implementations (for visual display and for -> assistive technologies). However, the `` and `` elements have special -> distinguishing features that one should be aware of. They are explained -> in the following sections. +## Automatic italicization of \ -## Automatic italicization of `` - -One typographic convention in mathematics is to use italic letters for variables. -In order to help with that, `` elements with a single character may be -automatically rendered as italic. This is the case for all the letters from the -latin and greek alphabets. Compare the rendering of the two `` -elements in the following formula: +One typographic convention in mathematics is to use italic letters for variables. In order to help with that, `` elements with a single character may be automatically rendered as italic. This is the case for all the letters from the latin and greek alphabets. Compare the rendering of the two `` elements in the following formula: ```html @@ -171,12 +163,9 @@ elements in the following formula: ``` -> **Note:** [This table from MathML Core](https://w3c.github.io/mathml-core/#italic-mappings) -> provide the exhaustive list of characters that are subject to italicization, -> together with the corresponding italic characters. +> **Note:** [This table from MathML Core](https://w3c.github.io/mathml-core/#italic-mappings) provide the exhaustive list of characters that are subject to italicization, together with the corresponding italic characters. -It is sometimes needed to revert this default italic transformation. For that purpose, just attach a `mathvariant="normal"` attribute on the `` element. -Compare the rendering of the uppercase gamma letters in the following formula: +It is sometimes needed to revert this default italic transformation. For that purpose, just attach a `mathvariant="normal"` attribute on the `` element. Compare the rendering of the uppercase gamma letters in the following formula: ```html @@ -187,7 +176,7 @@ Compare the rendering of the uppercase gamma letters in the following formula: > **Note:** Although the [`mathvariant`](/en-US/docs/Web/MathML/Global_attributes/mathvariant) provides other values to perform such transformations, it is recommended to just pick the desired [Mathematical Alphanumeric Symbols](https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols) when possible. -## Operator properties of `` +## Operator properties of \ MathML contains an [operator dictionary](https://w3c.github.io/mathml-core/#operator-dictionary-human) that defines default properties of `` elements depending on their content and the position within its container (prefix, infix or postfix). Let's consider a concrete example: @@ -232,19 +221,18 @@ Operators have many other properties that we will see in more details later. For ### Active learning: spot the difference -Now that you are a bit familiar with special features of `` and ``, -let's rewrite the `

` element in the -[example at the top of the page](#unicode_characters_for_mathematics) with some -actual MathML. Compare the visual rendering in your browser and explain -the differences with the text-only version. +Now that you are a bit familiar with special features of `` and ``, let's rewrite the `

` element in the [example at the top of the page](#unicode_characters_for_mathematics) with some actual MathML. Compare the visual rendering in your browser and explain the differences with the text-only version. ```html - + My page with math characters - +

∀A∊𝔰𝔩(n,𝔽),TrA=0

@@ -276,28 +264,32 @@ the differences with the text-only version.

- +
- + ``` ```css hidden div { - padding: .5em; + padding: 0.5em; } ``` ```js hidden -document.getElementById('showSolution').addEventListener('click', () => { - document.getElementById('solution').insertAdjacentHTML( - "beforeEnd", - `
    +document.getElementById("showSolution").addEventListener( + "click", + () => { + document.getElementById("solution").insertAdjacentHTML( + "beforeEnd", + `
    • The <mi> elements containing the "A" and "n" variables are rendered in italic. However, the <mi> elements with multiple characters "𝔰𝔩" or whose character is "𝔽" are still rendered upright.
    • Spacing is automatically added around the <mo> elements whose text is "∀", "∊", "=" or a comma. However, some of them have no spacing added before while the parentheses still have no spacing around them.
    • -
    ` - ); -}, {once: true}); +
`, + ); + }, + { once: true }, +); ``` {{ EmbedLiveSample('active_learning_spot_the_difference', 700, 500, "", "") }} @@ -306,26 +298,23 @@ document.getElementById('showSolution').addEventListener('click', () => { ### Active learning: stretchy operators -The operator dictionary defines a default *stretchy* property as well as -corresponding *stretch axis* for some operators. For example, an operator -can stretch vertically by default to cover the maximum height of non-stretchy -siblings within its `` container. By tweaking a bit the -[previous exercise](#active_learning_recognize_token_elements), one can -make operators stretch vertically. Can you find them? As usual, you are invited -to read the source code when you are done. +The operator dictionary defines a default _stretchy_ property as well as corresponding _stretch axis_ for some operators. For example, an operator can stretch vertically by default to cover the maximum height of non-stretchy siblings within its `` container. By tweaking a bit the [previous exercise](#active_learning_recognize_token_elements), one can make operators stretch vertically. Can you find them? As usual, you are invited to read the source code when you are done. ```html hidden - + My page with stretchy operators - + - + | 1 @@ -355,52 +344,55 @@ to read the source code when you are done. 0 - +
``` - ```css hidden .highlight { color: red; } math { - font-size: 200%; + font-size: 200%; } ``` - ```js hidden - const tokenElements = Array.from(document.querySelectorAll('mi, mo, mn, mtext')); - const stretchyMoElements = Array.from(document.getElementsByTagName("mo")).slice(0, 2); - const outputDiv = document.getElementById("output"); - function clearHighlight() { - tokenElements.forEach(token => { - token.classList.remove('highlight'); - }); - } - tokenElements.forEach(token => { - token.addEventListener('click', () => { - clearHighlight(); - token.classList.add('highlight'); - let message = ""; - let tagName = `<${token.tagName}>`; - if (token.tagName !== "mo") - message = `No, this is an ${tagName} element!`; - else if (!stretchyMoElements.includes(token)) - message = `No, this is an ${tagName} element, but it's not vertically stretched.`; - else - message = `Correct, this ${tagName} element is indeed stretched to the height of its <mfrac> sibling.` - outputDiv.insertAdjacentHTML('beforeend', - `

${message}

`); - }); +const tokenElements = Array.from( + document.querySelectorAll("mi, mo, mn, mtext"), +); +const stretchyMoElements = Array.from( + document.getElementsByTagName("mo"), +).slice(0, 2); +const outputDiv = document.getElementById("output"); +function clearHighlight() { + tokenElements.forEach((token) => { + token.classList.remove("highlight"); }); - document.getElementById("clearOutput").addEventListener("click", () => { +} +tokenElements.forEach((token) => { + token.addEventListener("click", () => { clearHighlight(); - outputDiv.innerHTML = ""; + token.classList.add("highlight"); + let message = ""; + let tagName = `<${token.tagName}>`; + if (token.tagName !== "mo") message = `No, this is an ${tagName} element!`; + else if (!stretchyMoElements.includes(token)) + message = `No, this is an ${tagName} element, but it's not vertically stretched.`; + else + message = `Correct, this ${tagName} element is indeed stretched to the height of its <mfrac> sibling.`; + outputDiv.insertAdjacentHTML( + "beforeend", + `

${message}

`, + ); }); +}); +document.getElementById("clearOutput").addEventListener("click", () => { + clearHighlight(); + outputDiv.innerHTML = ""; +}); ``` {{ EmbedLiveSample('Active_learning_stretchy_fences', 700, 400, "", "") }} @@ -409,13 +401,13 @@ math { ## Summary -In this article, we have learnt about a few *token* elements that are used as text containers as well as their different semantics, namely `` (identifier), `` (numbers), `` (operators), `` (generic text). We have seen special Unicode characters that are commonly found in math formulas and given an overview of some observable behaviors of the `` and `` elements. In the next article, we will see how to rely on *token* elements to build much complex expressions such as [fractions and roots](/en-US/docs/Learn/MathML/First_steps/Fractions_and_roots). +In this article, we have learnt about a few _token_ elements that are used as text containers as well as their different semantics, namely `` (identifier), `` (numbers), `` (operators), `` (generic text). We have seen special Unicode characters that are commonly found in math formulas and given an overview of some observable behaviors of the `` and `` elements. In the next article, we will see how to rely on _token_ elements to build much complex expressions such as [fractions and roots](/en-US/docs/Learn/MathML/First_steps/Fractions_and_roots). {{LearnSidebar}}{{PreviousMenuNext("Learn/MathML/First_steps/Getting_started", "Learn/MathML/First_steps/Fractions_and_roots", "Learn/MathML/First_steps")}} ## See also -* [The `` element](/en-US/docs/Web/MathML/Element/mi) -* [The `` element](/en-US/docs/Web/MathML/Element/mn) -* [The `` element](/en-US/docs/Web/MathML/Element/mo) -* [The `` element](/en-US/docs/Web/MathML/Element/mtext) +- [The `` element](/en-US/docs/Web/MathML/Element/mi) +- [The `` element](/en-US/docs/Web/MathML/Element/mn) +- [The `` element](/en-US/docs/Web/MathML/Element/mo) +- [The `` element](/en-US/docs/Web/MathML/Element/mtext) diff --git a/files/en-us/learn/mathml/first_steps/three_famous_mathematical_formulas/index.md b/files/en-us/learn/mathml/first_steps/three_famous_mathematical_formulas/index.md index 7d1d59bf37333d9..fcbbcdf7cb89519 100644 --- a/files/en-us/learn/mathml/first_steps/three_famous_mathematical_formulas/index.md +++ b/files/en-us/learn/mathml/first_steps/three_famous_mathematical_formulas/index.md @@ -29,16 +29,13 @@ tags: - ## A small math article The goal is to rewrite the following math article using HTML and MathML: ![Screenshot of the PDF output generated by XeLaTeX](xelatex-output.png) -Although you don't need to be familiar with -[LaTeX](https://en.wikipedia.org/wiki/LaTeX), it might be useful to know the -LaTeX source from which it was generated: +Although you don't need to be familiar with [LaTeX](https://en.wikipedia.org/wiki/LaTeX), it might be useful to know the LaTeX source from which it was generated: ``` \documentclass{article} @@ -94,49 +91,47 @@ using the following expression: ## Starting point -To get this assessment started, you can rely on our usual HTML template. -By default it uses UTF-8 encoding, special Web fonts for the `` -and `` tags (with similar look & feel as the LaTeX output). The goal -is to replace the question marks `???` with actual MathML content. +To get this assessment started, you can rely on our usual HTML template. By default it uses UTF-8 encoding, special Web fonts for the `` and `` tags (with similar look & feel as the LaTeX output). The goal is to replace the question marks `???` with actual MathML content. ```html - + Three famous mathematical formulas - + -

To solve the cubic equation ??? (where the real numbers ??? - satisfy ???) one can use Cardano's formula: ???

- -

For any ??? and ???, the Cauchy–Bunyakovsky–Schwarz - inequality can be written as follows: ???

- -

Finally, the determinant of a Vandermonde matrix can be calculated - using the following expression: ???

+

+ To solve the cubic equation ??? (where the real numbers ??? satisfy ???) + one can use Cardano's formula: ??? +

+ +

+ For any ??? and ???, the Cauchy–Bunyakovsky–Schwarz inequality can be + written as follows: ??? +

+ +

+ Finally, the determinant of a Vandermonde matrix can be calculated using + the following expression: ??? +

``` ## Hints and tips -* Start by distinguishing the *inline* and *display* formulas and set the - `display` attribute accordingly. -* Check the text used and - find their [Unicode characters](https://en.wikipedia.org/wiki/Mathematical_operators_and_symbols_in_Unicode) ("−", "ℂ", "∑", ...). -* Analyze the semantics of each portion of text (variable? operator? number?) - and determine the proper token element to use for each of them. -* Look for advanced constructions (fractions? roots? scripts? matrices?) and - determine the proper MathML element to use for each of them. -* Don't forget to rely on `` for grouping subexpressions. -* Pay attention to stretchy and large operators! -* Use the [W3C validator](https://validator.w3.org/nu/) to catch unintended - mistakes in your HTML/MathML markup. -* If you are stuck, or realize how painful it is to write MathML by hand, - feel free to use tools to help - [write MathML](/en-US/docs/Web/MathML/Authoring) such as - [TeXZilla](https://fred-wang.github.io/TeXZilla/). +- Start by distinguishing the _inline_ and _display_ formulas and set the `display` attribute accordingly. +- Check the text used and find their [Unicode characters](https://en.wikipedia.org/wiki/Mathematical_operators_and_symbols_in_Unicode) ("−", "ℂ", "∑", ...). +- Analyze the semantics of each portion of text (variable? operator? number?) and determine the proper token element to use for each of them. +- Look for advanced constructions (fractions? roots? scripts? matrices?) and determine the proper MathML element to use for each of them. +- Don't forget to rely on `` for grouping subexpressions. +- Pay attention to stretchy and large operators! +- Use the [W3C validator](https://validator.w3.org/nu/) to catch unintended mistakes in your HTML/MathML markup. +- If you are stuck, or realize how painful it is to write MathML by hand, feel free to use tools to help [write MathML](/en-US/docs/Web/MathML/Authoring) such as [TeXZilla](https://fred-wang.github.io/TeXZilla/). {{LearnSidebar}}{{PreviousMenu("Learn/MathML/First_steps/Tables", "Learn/MathML/First_steps")}} diff --git a/files/en-us/learn/mathml/index.md b/files/en-us/learn/mathml/index.md index 9ef2effa8f00f0d..eff6253cbbecf14 100644 --- a/files/en-us/learn/mathml/index.md +++ b/files/en-us/learn/mathml/index.md @@ -19,8 +19,7 @@ Mathematical Markup Language — or {{glossary("MathML")}} — is the markup lan > > #### Looking to become a front-end web developer? > -> We have put together a course that includes all the essential information you need to -> work towards your goal. +> We have put together a course that includes all the essential information you need to work towards your goal. > > [**Get started**](/en-US/docs/Learn/Front-end_web_developer) From 1693c664fda554cfcf040d4e00f280a19964c912 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Sat, 13 Aug 2022 10:16:18 +0200 Subject: [PATCH 06/20] Don't introduce the display/inline term which are specific to LaTeX / math typesetting, but not mentioned in MathML and confusing with MathML display attribute CSS block/inline. Intead just say whether the has a display="block" attribute or not. Also add an initial note about CSS math-style. --- .../mathml/first_steps/getting_started/index.md | 15 ++++++++------- .../learn/mathml/first_steps/scripts/index.md | 6 +++--- .../three_famous_mathematical_formulas/index.md | 2 +- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/files/en-us/learn/mathml/first_steps/getting_started/index.md b/files/en-us/learn/mathml/first_steps/getting_started/index.md index 484b097344da8ff..e7a24b496eb5360 100644 --- a/files/en-us/learn/mathml/first_steps/getting_started/index.md +++ b/files/en-us/learn/mathml/first_steps/getting_started/index.md @@ -70,9 +70,9 @@ The `` element specifies a fraction with a numerator (its first child) an > **Warning:** If you just see "1 3" instead of a fraction, then your browser may not support MathML. Check out the [browser compatibility table](/en-US/docs/Web/MathML/Element/math#browser_compatibility) for further details. -### Inline and display modes +### The display attribute -Note that in the previous example, the formula is on the same line as the text of the paragraph, this is called _inline_ mode. However, it is quite common for large mathematical formulas to use _display_ mode: they are instead centered on their own line as shown below. To achieve that, one only need to attach a `display="block"` attribute on the `` element. +Note that in the previous example, the formula is on the same line as the text of the paragraph. However, it is quite common to instead render large mathematical formulas centered on their own line as shown below. To achieve that, one only need to attach a `display="block"` attribute on the `` element. ```html hidden @@ -95,12 +95,14 @@ Note that in the previous example, the formula is on the same line as the text o ``` -{{ EmbedLiveSample('Inline_and_display_modes', 700, 100, "", "") }} +{{ EmbedLiveSample('The_display_attribute', 700, 100, "", "") }} -You may also notice some subtle change in the appearance: the text and vertical spacing of the fraction becomes a bit bigger. In _inline_ mode, the height is minimized to avoid disturbing the flow of the surrounding text. In _display_ mode, priority is instead put on legibility of the mathematical formula. +You may also notice some subtle change in the appearance: the text and vertical spacing of the fraction becomes a bit bigger. Without the `display="block"` attribute, the height is minimized to avoid disturbing the flow of the surrounding text. With the `display="block"` attribute, priority is instead put on legibility of the mathematical formula. > **Note:** This corresponds to the LaTeX's concept of _inline_ formulas (delimited by dollar signs `$...$`) and _display_ formulas (delimited by `\[...\]`). +> **Note:** The appearance change mentioned above is actually controlled by the [`math-style`](/en-US/docs/Web/CSS/math-style) property which is initally `normal` for `` and `compact` otherwise. In some MathML subtrees, this property can then automatically become `compact` but we will ignore this subtility for this introductory tutorial. Again, this is similar to LaTeX. + ## Grouping with the \ element The `` element can actually contain an arbitrary number of children and will essentially render them in a row. For instance, the simple formula "1 + 2 + 3" would be be encoded like this in MathML: @@ -193,9 +195,7 @@ As an exercise, figure out how to write the following expressions using only the ## Summary -In this article, we have taken a look at how to use the `` element to insert a mathematical formula inside a HTML document. We have learned about the difference between _inline_ and _display_ formulas and how to specify them via the `display` attribute of the `` element. - -In addition, we stumbled upon a couple of other MathML elements: `` for fractions, `` for grouping and finally a few text elements. We will analyze these [text containers](/en-US/docs/Learn/MathML/First_steps/Text_containers) further in the next article. +In this article, we have taken a look at how to use the `` element to insert a mathematical formula inside a HTML document. We have learned about rendering differences between `` elements that use `display="block"` or not. In addition, we stumbled upon a couple of other MathML elements: `` for fractions, `` for grouping and finally a few text elements. We will analyze these [text containers](/en-US/docs/Learn/MathML/First_steps/Text_containers) further in the next article. {{LearnSidebar}}{{NextMenu("Learn/MathML/First_steps/Text_containers", "Learn/MathML/First_steps")}} @@ -205,4 +205,5 @@ In addition, we stumbled upon a couple of other MathML elements: `` for f - [The `` element](/en-US/docs/Web/MathML/Element/math) - [The `` element](/en-US/docs/Web/MathML/Element/mfrac) - [The `` element](/en-US/docs/Web/MathML/Element/mrow) +- [The `math-style` property](/en-US/docs/Web/CSS/math-style) - [The `math-depth` property](/en-US/docs/Web/CSS/math-depth) diff --git a/files/en-us/learn/mathml/first_steps/scripts/index.md b/files/en-us/learn/mathml/first_steps/scripts/index.md index 77cc1f5c326c993..d6ad6b3c10fdadc 100644 --- a/files/en-us/learn/mathml/first_steps/scripts/index.md +++ b/files/en-us/learn/mathml/first_steps/scripts/index.md @@ -370,7 +370,7 @@ We now realize that the bottom bracket "⎵" and the rightward arrow "→" stret ### Large operator and limits -So far our example has actually been rendered in [_display_ mode](/en-US/docs/Learn/MathML/First_steps/Getting_started#inline_and_display_modes). Let's detach the `display="block"` attribute from the `` element to show up some interesting changes: +So far our example has actually been rendered with the [`display="block"`](/en-US/docs/Learn/MathML/First_steps/Getting_started#the_display_attribute) attribute. Let's detach it from the `` element to show up some interesting changes: ```html hidden @@ -473,8 +473,8 @@ math { As expected, the formula is no longer centered and the rendering is modified to minimized the height. Focusing on the summation symbol, one can notice that the sigma is drawn smaller and that the scripts of the `` element are now attached as a subscript and a superscript! This is due to two properties of the "∑" operator: -- _largeop_: The operator is drawn with a bigger glyph in _display_ mode. -- _movablelimits_: The underscripts and overscripts attached to the operator are respectively rendered as subscripts and superscripts in _inline_ mode. +- _largeop_: The operator is drawn with a bigger glyph if the `` tag has a `display="block"` attribute. +- _movablelimits_: The underscripts and overscripts attached to the operator are respectively rendered as subscripts and superscripts if the `` tag does not have the `display="block"` attribute. > **Note:** The _largeop_ property is actually unrelated to scripts, even though operators having this property are typically scripted. The _movablelimits_ property is taken into account for `` and `` elements too. diff --git a/files/en-us/learn/mathml/first_steps/three_famous_mathematical_formulas/index.md b/files/en-us/learn/mathml/first_steps/three_famous_mathematical_formulas/index.md index fcbbcdf7cb89519..c4861805859d2d4 100644 --- a/files/en-us/learn/mathml/first_steps/three_famous_mathematical_formulas/index.md +++ b/files/en-us/learn/mathml/first_steps/three_famous_mathematical_formulas/index.md @@ -125,7 +125,7 @@ To get this assessment started, you can rely on our usual HTML template. By defa ## Hints and tips -- Start by distinguishing the _inline_ and _display_ formulas and set the `display` attribute accordingly. +- Start by inserting empty `` tags, deciding whether they should have a `display="block"` attribute or not. - Check the text used and find their [Unicode characters](https://en.wikipedia.org/wiki/Mathematical_operators_and_symbols_in_Unicode) ("−", "ℂ", "∑", ...). - Analyze the semantics of each portion of text (variable? operator? number?) and determine the proper token element to use for each of them. - Look for advanced constructions (fractions? roots? scripts? matrices?) and determine the proper MathML element to use for each of them. From 2e80f531559ed38c6b74f666dc6d89c0eeebb3cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Fri, 2 Sep 2022 16:46:04 +0200 Subject: [PATCH 07/20] Update files/en-us/learn/mathml/first_steps/index.md Co-authored-by: Ruth John --- files/en-us/learn/mathml/first_steps/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/learn/mathml/first_steps/index.md b/files/en-us/learn/mathml/first_steps/index.md index 7c13dd92bdfaff3..d7201a1f6a49f7c 100644 --- a/files/en-us/learn/mathml/first_steps/index.md +++ b/files/en-us/learn/mathml/first_steps/index.md @@ -9,7 +9,7 @@ tags: --- {{LearnSidebar}} -MathML is the markup language used to write mathematical formulas in Web pages. This module provides a gentle beginning to your path towards MathML mastery with the basics of how it works, what the syntax looks like, and how you can start using it inside HTML. +MathML is the markup language used to write mathematical formulas in web pages. This module provides a gentle beginning to your path towards MathML mastery with the basics of how it works, what the syntax looks like, and how you can start using it inside HTML. > **Callout:** > From 9021d5660a51b0cc0c0d362f487fb6a962975d61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Fri, 2 Sep 2022 16:49:22 +0200 Subject: [PATCH 08/20] Update files/en-us/learn/mathml/first_steps/index.md Co-authored-by: Ruth John --- files/en-us/learn/mathml/first_steps/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/learn/mathml/first_steps/index.md b/files/en-us/learn/mathml/first_steps/index.md index d7201a1f6a49f7c..6899395ddf6a9fe 100644 --- a/files/en-us/learn/mathml/first_steps/index.md +++ b/files/en-us/learn/mathml/first_steps/index.md @@ -34,7 +34,7 @@ Before starting this module, you should have: This module contains the following articles, which will take you through all the basic theory of MathML, and provide opportunities for you to test out some skills. - [Getting started with MathML](/en-US/docs/Learn/MathML/First_steps/Getting_started) - - : In this article, we will take a simple HTML document and view how to add MathML formulas into it, introducing a few elements along the way. + - : In this article, we will take a simple HTML document and see how to add MathML formulas into it, introducing a few elements along the way. - [Text containers](/en-US/docs/Learn/MathML/First_steps/Text_containers) - : Now that you get a better idea of MathML, we move focus on text containers (variables, numbers, operators, ...) which are used as building blocks of MathML formulas. - [Fractions and roots](/en-US/docs/Learn/MathML/First_steps/Fractions_and_roots) From 81e89385691b296910f034a084a0dcc8a4999164 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Fri, 2 Sep 2022 16:49:40 +0200 Subject: [PATCH 09/20] Update files/en-us/learn/mathml/first_steps/index.md Co-authored-by: Ruth John --- files/en-us/learn/mathml/first_steps/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/learn/mathml/first_steps/index.md b/files/en-us/learn/mathml/first_steps/index.md index 6899395ddf6a9fe..050ed21fff73d52 100644 --- a/files/en-us/learn/mathml/first_steps/index.md +++ b/files/en-us/learn/mathml/first_steps/index.md @@ -36,7 +36,7 @@ This module contains the following articles, which will take you through all the - [Getting started with MathML](/en-US/docs/Learn/MathML/First_steps/Getting_started) - : In this article, we will take a simple HTML document and see how to add MathML formulas into it, introducing a few elements along the way. - [Text containers](/en-US/docs/Learn/MathML/First_steps/Text_containers) - - : Now that you get a better idea of MathML, we move focus on text containers (variables, numbers, operators, ...) which are used as building blocks of MathML formulas. + - : Now that you get a better idea of MathML, we move on to text containers (variables, numbers, operators, ...) which are used as building blocks of MathML formulas. - [Fractions and roots](/en-US/docs/Learn/MathML/First_steps/Fractions_and_roots) - : Relying on text containers, this article describes how to build more complex MathML expressions by nesting fractions and roots. - [Scripts](/en-US/docs/Learn/MathML/First_steps/Scripts) From f476433e620cfdd71df1552be62b8a6b84017326 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Fri, 2 Sep 2022 16:49:51 +0200 Subject: [PATCH 10/20] Update files/en-us/learn/mathml/first_steps/getting_started/index.md Co-authored-by: Ruth John --- files/en-us/learn/mathml/first_steps/getting_started/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/learn/mathml/first_steps/getting_started/index.md b/files/en-us/learn/mathml/first_steps/getting_started/index.md index e7a24b496eb5360..a1efacb8ce2157d 100644 --- a/files/en-us/learn/mathml/first_steps/getting_started/index.md +++ b/files/en-us/learn/mathml/first_steps/getting_started/index.md @@ -8,7 +8,7 @@ tags: --- {{LearnSidebar}}{{NextMenu("Learn/MathML/First_steps/Text_containers", "Learn/MathML/First_steps")}} -In this article, we will take a simple HTML document and view how to add MathML formulas into it, introducing a few elements along the way. +In this article, we will take a simple HTML document and see how to add MathML formulas into it, introducing a few elements along the way. From f20f428bfa9d99461a7bfa32b29d1f97821a7e30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Fri, 2 Sep 2022 16:50:27 +0200 Subject: [PATCH 11/20] Update files/en-us/learn/mathml/first_steps/getting_started/index.md Co-authored-by: Ruth John --- files/en-us/learn/mathml/first_steps/getting_started/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/learn/mathml/first_steps/getting_started/index.md b/files/en-us/learn/mathml/first_steps/getting_started/index.md index a1efacb8ce2157d..7e4d61074e3009a 100644 --- a/files/en-us/learn/mathml/first_steps/getting_started/index.md +++ b/files/en-us/learn/mathml/first_steps/getting_started/index.md @@ -72,7 +72,7 @@ The `` element specifies a fraction with a numerator (its first child) an ### The display attribute -Note that in the previous example, the formula is on the same line as the text of the paragraph. However, it is quite common to instead render large mathematical formulas centered on their own line as shown below. To achieve that, one only need to attach a `display="block"` attribute on the `` element. +Note that in the previous example, the formula is on the same line as the text of the paragraph. However, it is quite common to instead render large mathematical formulas centered on their own line as shown below. To achieve that, you need to attach a `display="block"` attribute on the `` element. ```html hidden From d077f59ee5d3cf252e7e9ca3a7061b35ae58dd19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Fri, 2 Sep 2022 16:52:03 +0200 Subject: [PATCH 12/20] Update files/en-us/learn/mathml/index.md Co-authored-by: Ruth John --- files/en-us/learn/mathml/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/learn/mathml/index.md b/files/en-us/learn/mathml/index.md index eff6253cbbecf14..f3806fad276bc43 100644 --- a/files/en-us/learn/mathml/index.md +++ b/files/en-us/learn/mathml/index.md @@ -11,7 +11,7 @@ tags: --- {{LearnSidebar}} -Mathematical Markup Language — or {{glossary("MathML")}} — is the markup language used to write mathematical formulas in Web pages using fractions, scripts, radicals, matrices, integrals, series, etc. Although it was originally designed as an independent XML language, MathML is generally directly embedded inside {{Glossary('HTML')}} documents and can be seen as an extension of HTML. +Mathematical Markup Language — or {{glossary("MathML")}} — is the markup language used to write mathematical formulas in web pages using fractions, scripts, radicals, matrices, integrals, series, etc. Although it was originally designed as an independent XML language, MathML is generally embedded inside {{Glossary('HTML')}} documents and can be seen as an extension of HTML. > **Warning:** In practice, MathML content is generated from [lightweight markup languages](https://en.wikipedia.org/wiki/Lightweight_markup_language) (e.g. [LaTeX](https://fr.wikipedia.org/wiki/LaTeX)) or using [graphical user interface](https://en.wikipedia.org/wiki/Graphical_user_interface): if you just need to integrate mathematical formulas in your web pages, the tips from the [Authoring MathML](/en-US/docs/Web/MathML/Authoring) page should be enough. From 119694fc1908543ad453f3ed7cf10cc23d595763 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Fri, 2 Sep 2022 16:52:26 +0200 Subject: [PATCH 13/20] Update files/en-us/learn/mathml/first_steps/tables/index.md Co-authored-by: Ruth John --- files/en-us/learn/mathml/first_steps/tables/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/learn/mathml/first_steps/tables/index.md b/files/en-us/learn/mathml/first_steps/tables/index.md index 8fddd8b9af146ea..2db05816cd5534d 100644 --- a/files/en-us/learn/mathml/first_steps/tables/index.md +++ b/files/en-us/learn/mathml/first_steps/tables/index.md @@ -137,7 +137,7 @@ Tables are typically used for matrix-like expressions (including vectors). Here ## Allowing cells to span multiple rows and columns -This is again similar to [HTML's article](/en-US/docs/Learn/HTML/Tables/Basics#allowing_cells_to_span_multiple_rows_and_columns). The `` element accepts the `columnspan` and `rowspan` attributes to indicate that the cell spans multiples rows and columns. Below the inner matrix spans two columns of the outer matrix: +This is again similar to [HTML tables](/en-US/docs/Learn/HTML/Tables/Basics#allowing_cells_to_span_multiple_rows_and_columns). The `` element accepts the `columnspan` and `rowspan` attributes to indicate that the cell spans multiples rows and columns. Below the inner matrix spans two columns of the outer matrix: ```html hidden From 49be55db306bc8ec7a731fe5f683c5db444abc5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Fri, 2 Sep 2022 16:53:06 +0200 Subject: [PATCH 14/20] Update files/en-us/learn/mathml/first_steps/text_containers/index.md Co-authored-by: Ruth John --- files/en-us/learn/mathml/first_steps/text_containers/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/learn/mathml/first_steps/text_containers/index.md b/files/en-us/learn/mathml/first_steps/text_containers/index.md index 0516c63aebe82c4..3da421fbeb4406f 100644 --- a/files/en-us/learn/mathml/first_steps/text_containers/index.md +++ b/files/en-us/learn/mathml/first_steps/text_containers/index.md @@ -217,7 +217,7 @@ This example should render similarly to the screenshot below. Observe the spacin ![Screenshot of the MathML formula with different operator spacing](operator-spacing.png) -Operators have many other properties that we will see in more details later. For now, remember to use an `` container for characters in the operator dictionary and to properly group subexpressions with `` elements in order to help MathML renderers to provide a good rendering. +Operators have many other properties that we will see in more details later. For now, remember to use an `` container for characters in the operator dictionary and to properly group subexpressions with `` elements in order to help MathML renderers. ### Active learning: spot the difference From 5eba1aae8b57771aef422cf25150224fe9daddbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Fri, 2 Sep 2022 16:57:07 +0200 Subject: [PATCH 15/20] Update files/en-us/learn/mathml/first_steps/index.md Co-authored-by: Ruth John --- files/en-us/learn/mathml/first_steps/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/learn/mathml/first_steps/index.md b/files/en-us/learn/mathml/first_steps/index.md index 050ed21fff73d52..3b9b16019c041a3 100644 --- a/files/en-us/learn/mathml/first_steps/index.md +++ b/files/en-us/learn/mathml/first_steps/index.md @@ -27,7 +27,7 @@ Before starting this module, you should have: 2. A basic work environment set up, as detailed in [Installing basic software](/en-US/docs/Learn/Getting_started_with_the_web/Installing_basic_software), and an understanding of how to create and manage files, as detailed in [Dealing with files](/en-US/docs/Learn/Getting_started_with_the_web/Dealing_with_files). 3. Basic familiarity with HTML, as described in [Introduction to HTML](/en-US/docs/Learn/HTML/Introduction_to_HTML). -> **Note:** If you are working on a computer/tablet/other device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as [JSBin](https://jsbin.com/) or [Glitch](https://glitch.com/). +> **Note:** If you are working on a computer/tablet/other device where you don't have the ability to create your own files, you could try out the code examples in an online coding program such as [JSBin](https://jsbin.com/) or [Glitch](https://glitch.com/). ## Guides From c2aad4e4c5b4fd7cfc1e2900fe8f6b8e0bf8f2b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Fri, 2 Sep 2022 16:58:01 +0200 Subject: [PATCH 16/20] Update files/en-us/learn/mathml/first_steps/fractions_and_roots/index.md Co-authored-by: Ruth John --- .../en-us/learn/mathml/first_steps/fractions_and_roots/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/learn/mathml/first_steps/fractions_and_roots/index.md b/files/en-us/learn/mathml/first_steps/fractions_and_roots/index.md index 95faa8b24e4d4a1..ab16f38981671fc 100644 --- a/files/en-us/learn/mathml/first_steps/fractions_and_roots/index.md +++ b/files/en-us/learn/mathml/first_steps/fractions_and_roots/index.md @@ -70,7 +70,7 @@ In the [getting started with MathML](/en-US/docs/Learn/MathML/First_steps/Gettin Below is a screenshot of how it is rendered by a browser: -- We already know that the `` element is rendered as a fraction: the first child (the numerator) and is drawn above the second child (the denominator) separated by a horizontal bar. +- We already know that the `` element is rendered as a fraction: The first child (the numerator) is drawn above the second child (the denominator) separated by a horizontal bar. - The `` is rendered as a square root: its children are laid out like an [``](/en-US/docs/Learn/MathML/First_steps/Getting_started#grouping_with_the_mrow_element), prefixed by a root symbol √ and completely covered by an overbar. - Finally, the `` element is rendered as an nth root: the first element is covered by the radical symbol while the second element is used as the degree of the root and rendered as a prefix superscript. From 6f1410958078277cffb27657292a1ccd549a46d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Fri, 2 Sep 2022 17:00:11 +0200 Subject: [PATCH 17/20] Update files/en-us/learn/mathml/first_steps/fractions_and_roots/index.md Co-authored-by: Ruth John --- .../en-us/learn/mathml/first_steps/fractions_and_roots/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/learn/mathml/first_steps/fractions_and_roots/index.md b/files/en-us/learn/mathml/first_steps/fractions_and_roots/index.md index ab16f38981671fc..6aaa88b7145c57a 100644 --- a/files/en-us/learn/mathml/first_steps/fractions_and_roots/index.md +++ b/files/en-us/learn/mathml/first_steps/fractions_and_roots/index.md @@ -72,7 +72,7 @@ Below is a screenshot of how it is rendered by a browser: - We already know that the `` element is rendered as a fraction: The first child (the numerator) is drawn above the second child (the denominator) separated by a horizontal bar. - The `` is rendered as a square root: its children are laid out like an [``](/en-US/docs/Learn/MathML/First_steps/Getting_started#grouping_with_the_mrow_element), prefixed by a root symbol √ and completely covered by an overbar. -- Finally, the `` element is rendered as an nth root: the first element is covered by the radical symbol while the second element is used as the degree of the root and rendered as a prefix superscript. +- Finally, the `` element is rendered as an nth root: The first element is covered by the radical symbol while the second element is used as the degree of the root and rendered as a prefix superscript. ![Screenshot of mfrac, msqrt, mroot](mfrac-msqrt-mroot.png) From 8515468154d23357266e782bf98c810f4a0ff488 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Fri, 2 Sep 2022 17:01:11 +0200 Subject: [PATCH 18/20] Update files/en-us/learn/mathml/first_steps/scripts/index.md Co-authored-by: Ruth John --- files/en-us/learn/mathml/first_steps/scripts/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/learn/mathml/first_steps/scripts/index.md b/files/en-us/learn/mathml/first_steps/scripts/index.md index d6ad6b3c10fdadc..b181f70352f469d 100644 --- a/files/en-us/learn/mathml/first_steps/scripts/index.md +++ b/files/en-us/learn/mathml/first_steps/scripts/index.md @@ -8,7 +8,7 @@ tags: --- {{LearnSidebar}}{{PreviousMenuNext("Learn/MathML/First_steps/Fractions_and_roots", "Learn/MathML/First_steps/Tables", "Learn/MathML/First_steps")}} -We continue the review of basic math notations and focuses on building MathML elements with scripts. +We continue the review of basic math notations and focus on building MathML elements with scripts.
From c8bc2185e4d0df464303ce27766ab0a1c8f23c9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Fri, 2 Sep 2022 17:48:11 +0200 Subject: [PATCH 19/20] Address review comments from @Rumyra --- .../first_steps/fractions_and_roots/index.md | 100 +++++------- .../learn/mathml/first_steps/scripts/index.md | 8 +- .../learn/mathml/first_steps/tables/index.md | 154 +++++++++--------- .../first_steps/text_containers/index.md | 63 ++++++- files/en-us/learn/mathml/index.md | 2 - 5 files changed, 184 insertions(+), 143 deletions(-) diff --git a/files/en-us/learn/mathml/first_steps/fractions_and_roots/index.md b/files/en-us/learn/mathml/first_steps/fractions_and_roots/index.md index 6aaa88b7145c57a..6bb97f0fffcfe7e 100644 --- a/files/en-us/learn/mathml/first_steps/fractions_and_roots/index.md +++ b/files/en-us/learn/mathml/first_steps/fractions_and_roots/index.md @@ -70,12 +70,12 @@ In the [getting started with MathML](/en-US/docs/Learn/MathML/First_steps/Gettin Below is a screenshot of how it is rendered by a browser: +![Screenshot of mfrac, msqrt, mroot](mfrac-msqrt-mroot.png) + - We already know that the `` element is rendered as a fraction: The first child (the numerator) is drawn above the second child (the denominator) separated by a horizontal bar. - The `` is rendered as a square root: its children are laid out like an [``](/en-US/docs/Learn/MathML/First_steps/Getting_started#grouping_with_the_mrow_element), prefixed by a root symbol √ and completely covered by an overbar. - Finally, the `` element is rendered as an nth root: The first element is covered by the radical symbol while the second element is used as the degree of the root and rendered as a prefix superscript. -![Screenshot of mfrac, msqrt, mroot](mfrac-msqrt-mroot.png) - ### Active learning: nesting different elements Here is a simple exercise to verify whether you understood the relation between a MathML subtree and its visual rendering. The document contains a MathML formula and you must check all subtrees corresponding to a subtree in that MathML formula. Once you are done, you can inspect the source of the MathML formula and verify if it matches your expectation. @@ -234,31 +234,25 @@ checkboxes.forEach((checkbox) => { As previously seen, the overbar of the `` and `` elements stretches horizontally to cover their content. But actually the root symbol √ also stretches to be as tall as their content. +```html hidden + +``` + ```html - - - - - My page with stretchy radical symbols - - - - - - - - 1 - 2 - - - 3 - - - - + + + + + 1 + 2 + + + 3 + + ``` {{ EmbedLiveSample('Stretchy_radical_symbols', 700, 200, "", "") }} @@ -269,37 +263,31 @@ As previously seen, the overbar of the `` and `` elements stretche Some mathematical concepts are sometimes written using fraction-like notations such [binomial coefficients](https://en.wikipedia.org/wiki/Combination) or [Legendre symbols](https://en.wikipedia.org/wiki/Legendre_symbol). It is appropriate to use an `` element to markup such notations. For fraction-like notations that don't draw a horizontal bar, attach a `linethickness="0"` attribute to the `` element: +```html hidden + +``` + ```html - - - - - My binomial coefficient - - - - - - ( - - 3 - 2 - - ) - - = - 6 - - - 3 - 2 - - - - + + + ( + + 3 + 2 + + ) + + = + 6 + + + 3 + 2 + + ``` {{ EmbedLiveSample('Fraction_without_bar', 700, 200, "", "") }} diff --git a/files/en-us/learn/mathml/first_steps/scripts/index.md b/files/en-us/learn/mathml/first_steps/scripts/index.md index b181f70352f469d..b558289e1f0f26c 100644 --- a/files/en-us/learn/mathml/first_steps/scripts/index.md +++ b/files/en-us/learn/mathml/first_steps/scripts/index.md @@ -74,15 +74,17 @@ Similarly to what we saw in the [previous article](/en-US/docs/Learn/MathML/Firs

``` -Below is the rendering of the above example in your browser. You should notice that: +Below is the rendering of the above example in your browser. + +{{ EmbedLiveSample('Subtrees_of_msub_msup_msubsup', 700, 200, "", "") }} + +You should notice that: - The second child of the `` element is attached as a subscript of its first child. - The second child of the `` element is attached as a superscript of its first child. - The second and third children of the `` element are respectively attached as a subscript and superscript of its first child. - The text inside scripts is scaled down. -{{ EmbedLiveSample('Subtrees_of_msub_msup_msubsup', 700, 200, "", "") }} - > **Note:** The MathML elements `` and `` are different from the HTML elements [``](/en-US/docs/Web/HTML/Element/sub) and [``](/en-US/docs/Web/HTML/Element/sup). They allow to use an arbitrary MathML subtree as scripts, not just text. ## Underscripts and overscripts diff --git a/files/en-us/learn/mathml/first_steps/tables/index.md b/files/en-us/learn/mathml/first_steps/tables/index.md index 2db05816cd5534d..ac64bba6d8d2ca3 100644 --- a/files/en-us/learn/mathml/first_steps/tables/index.md +++ b/files/en-us/learn/mathml/first_steps/tables/index.md @@ -47,90 +47,84 @@ The MathML tabular elements are similar to the ones for [HTML tables](/en-US/doc Tables are typically used for matrix-like expressions (including vectors). Here is a basic example taken from the [article about the CSS `matrix()` function](/en-US/docs/Web/CSS/transform-function/matrix): -```html - - - - - My first matrix +```html hidden - - - - - ( - - - - a - - - c - - - 0 - - - - t - x - - - - - - b - - - d - - - 0 - - - - t - y - - - - - - 0 - - - 0 - - - 1 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 1 - - - - ) - - - - +``` + +```html + + + ( + + + + a + + + c + + + 0 + + + + t + x + + + + + + b + + + d + + + 0 + + + + t + y + + + + + + 0 + + + 0 + + + 1 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 1 + + + + ) + + ``` {{ EmbedLiveSample('MathML_tabular_elements', 700, 200, "", "") }} diff --git a/files/en-us/learn/mathml/first_steps/text_containers/index.md b/files/en-us/learn/mathml/first_steps/text_containers/index.md index 3da421fbeb4406f..108b6c5c9922a79 100644 --- a/files/en-us/learn/mathml/first_steps/text_containers/index.md +++ b/files/en-us/learn/mathml/first_steps/text_containers/index.md @@ -76,7 +76,7 @@ We noticed in the [getting started with MathML](/en-US/docs/Learn/MathML/First_s ### Active learning: recognize token elements -Below is a more complex example, which says that the absolute value of a real number is equal to that number if and only if it is nonnegative. Spot the different token elements and what they are used for. Each time you click the corresponding text, it is highlighted and a confirmation message is displayed. Finally, read the MathML source to verify whether that corresponds to your expectation. +Below is a more complex example, which says that the absolute value of a real number is equal to that number if and only if it is nonnegative. Spot the different token elements and what they are used for. Each time you click the corresponding text, it is highlighted and a confirmation message is displayed. ```html hidden @@ -150,6 +150,28 @@ document.getElementById("clearOutput").addEventListener("click", () => { {{ EmbedLiveSample('Active_learning_recognize_token_elements', 700, 400, "", "") }} +Finally, read the MathML source to verify whether that corresponds to your expectation: + +```xml + + + + | + x + | + + = + x + +  iff  + + x + + 0 + + +``` + > **Note:** It is sometimes difficult to decide the token element to use for a given text content. In practice, choosing the wrong element should not cause major issues because all token elements are generally rendered the same by browser implementations (for visual display and for assistive technologies). However, the `` and `` elements have special distinguishing features that one should be aware of. They are explained in the following sections. ## Automatic italicization of \ @@ -298,7 +320,7 @@ document.getElementById("showSolution").addEventListener( ### Active learning: stretchy operators -The operator dictionary defines a default _stretchy_ property as well as corresponding _stretch axis_ for some operators. For example, an operator can stretch vertically by default to cover the maximum height of non-stretchy siblings within its `` container. By tweaking a bit the [previous exercise](#active_learning_recognize_token_elements), one can make operators stretch vertically. Can you find them? As usual, you are invited to read the source code when you are done. +The operator dictionary defines a default _stretchy_ property as well as corresponding _stretch axis_ for some operators. For example, an operator can stretch vertically by default to cover the maximum height of non-stretchy siblings within its `` container. By tweaking a bit the [previous exercise](#active_learning_recognize_token_elements), one can make operators stretch vertically. Can you find them? ```html hidden @@ -397,6 +419,43 @@ document.getElementById("clearOutput").addEventListener("click", () => { {{ EmbedLiveSample('Active_learning_stretchy_fences', 700, 400, "", "") }} +As usual, you are invited to read the source code when you are done: + +```xml + + + + | + + 1 + x + + | + + = + + 1 + + | + x + | + + + = + + 1 + x + + +  iff  + + x + + 0 + + +``` + > **Warning:** Special [math fonts](/en-US/docs/Web/MathML/Fonts) are generally required to make that stretching possible, the previous example relies on [web fonts](/en-US/docs/Learn/CSS/Styling_text/Web_fonts). ## Summary diff --git a/files/en-us/learn/mathml/index.md b/files/en-us/learn/mathml/index.md index f3806fad276bc43..add0e50bbdf969c 100644 --- a/files/en-us/learn/mathml/index.md +++ b/files/en-us/learn/mathml/index.md @@ -35,8 +35,6 @@ Some familarity with mathematical notations and [TeX](https://fr.wikipedia.org/w ## Modules -This topic contains the following modules, in a suggested order for working through them. You should definitely start with the first one. - - [MathML first steps](/en-US/docs/Learn/MathML/First_steps) - : MathML is the markup language used to write mathematical formulas in Web pages. This module provides a gentle beginning to your path towards MathML mastery with the basics of how it works, what the syntax looks like, and how you can start using it inside HTML. From b08811e95d02f804ee2c567c60273616dab809a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Sat, 3 Sep 2022 07:31:21 +0200 Subject: [PATCH 20/20] address review comments from brian --- files/en-us/learn/mathml/first_steps/scripts/index.md | 4 ++-- files/en-us/learn/mathml/first_steps/tables/index.md | 4 ++-- files/en-us/learn/mathml/first_steps/text_containers/index.md | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/files/en-us/learn/mathml/first_steps/scripts/index.md b/files/en-us/learn/mathml/first_steps/scripts/index.md index b558289e1f0f26c..3c1a12add01e21f 100644 --- a/files/en-us/learn/mathml/first_steps/scripts/index.md +++ b/files/en-us/learn/mathml/first_steps/scripts/index.md @@ -85,7 +85,7 @@ You should notice that: - The second and third children of the `` element are respectively attached as a subscript and superscript of its first child. - The text inside scripts is scaled down. -> **Note:** The MathML elements `` and `` are different from the HTML elements [``](/en-US/docs/Web/HTML/Element/sub) and [``](/en-US/docs/Web/HTML/Element/sup). They allow to use an arbitrary MathML subtree as scripts, not just text. +> **Note:** The MathML elements `` and `` are different from the HTML elements [``](/en-US/docs/Web/HTML/Element/sub) and [``](/en-US/docs/Web/HTML/Element/sup). They allow authors to provide arbitrary MathML subtrees as scripts, not just text. ## Underscripts and overscripts @@ -372,7 +372,7 @@ We now realize that the bottom bracket "⎵" and the rightward arrow "→" stret ### Large operator and limits -So far our example has actually been rendered with the [`display="block"`](/en-US/docs/Learn/MathML/First_steps/Getting_started#the_display_attribute) attribute. Let's detach it from the `` element to show up some interesting changes: +So far our example has actually been rendered with the [`display="block"`](/en-US/docs/Learn/MathML/First_steps/Getting_started#the_display_attribute) attribute. Let's look at the same example, as rendered without that attribute: ```html hidden diff --git a/files/en-us/learn/mathml/first_steps/tables/index.md b/files/en-us/learn/mathml/first_steps/tables/index.md index ac64bba6d8d2ca3..69f1de2636a2977 100644 --- a/files/en-us/learn/mathml/first_steps/tables/index.md +++ b/files/en-us/learn/mathml/first_steps/tables/index.md @@ -43,7 +43,7 @@ Once all basic math notations are known, it remains to consider tabular layout w ## MathML tabular elements -The MathML tabular elements are similar to the ones for [HTML tables](/en-US/docs/Learn/HTML/Tables): the `` element represents a table, the `` element represents a row and the `` element represents a cell. An `` table can be inserted anywhere in a MathML formula. The `` cell can contain any number of MathML children and will lay them out as an `` container. +The MathML tabular elements are similar to the ones for [HTML tables](/en-US/docs/Learn/HTML/Tables): the `` element represents a mathematical table, it has `` elements as its children (representing rows), each of them having `` elements as its children (representing cells). An `` element can be inserted anywhere in a MathML formula. The `` element can contain any number of MathML children and will lay them out as an `` container. Tables are typically used for matrix-like expressions (including vectors). Here is a basic example taken from the [article about the CSS `matrix()` function](/en-US/docs/Web/CSS/transform-function/matrix): @@ -302,7 +302,7 @@ Besides representing matrix-like objects, MathML tables are sometimes used for a {{ EmbedLiveSample('Usage_for_advanced_layout', 700, 200, "", "") }} -> **Warning:** The [`` article](/en-US/docs/Web/MathML/Element/mtable) provides more advanced layout options via special attributes such as alignment or spacing. This is inherited from the original design of MathML, that was supposed to work in engines that are not CSS-aware. However, these attributes may not be implemented in all browsers. In the future, it is likely that usages of `` for layout-only purpose (i.e. not actual matrix-like objects) can be replaced with CSS-based alternatives. +> **Warning:** The [`` article](/en-US/docs/Web/MathML/Element/mtable) provides more advanced layout options via special attributes such as alignment or spacing. These originated before CSS equivalents and were originally designed and intended for renderers which were not-CSS aware. However, these attributes may not be implemented in all browsers. In the future, it is likely that usages of `` for layout-only purpose (i.e. not actual matrix-like objects) can be replaced with CSS-based alternatives. ## Summary diff --git a/files/en-us/learn/mathml/first_steps/text_containers/index.md b/files/en-us/learn/mathml/first_steps/text_containers/index.md index 108b6c5c9922a79..777f98e7e4f7768 100644 --- a/files/en-us/learn/mathml/first_steps/text_containers/index.md +++ b/files/en-us/learn/mathml/first_steps/text_containers/index.md @@ -69,7 +69,7 @@ Since most of these characters are not part of Basic Latin Unicode block, it is We noticed in the [getting started with MathML](/en-US/docs/Learn/MathML/First_steps/Getting_started) article that the text in MathML formulas are wrapped in specific container elements such as the `` or ``. More generally, every text in MathML formulas must be included inside such container elements, called _token_ elements. In addition, MathML provides multiple token elements in order to distinguish different meanings of the text content: -- The `` element, which represents a symbolic name or arbitrary text that should be rendered as an identifier. Examples: `x` (variable), `cos` (function name) and `π` (symbolic constant). +- The `` element, which represents an "identifier" which could be a symbolic name or arbitrary text. Examples: `x` (variable), `cos` (function name) and `π` (symbolic constant). - The `` element represents a "numeric literal" or other data that should be rendered as a numeric literal. Examples: `2` (integer), `0.123` (decimal number) or `0xFFEF` (hexadecimal value). - The `` element represents an operator or anything that should be rendered as an operator. For example `+` (binary operation), `` (binary relation), `` (summation symbol) or `[` (fence). - The `` element is used to represent arbitrary text. For example short words in formulas such as `if` or `maps to`.