stefnotch / aftermath-editor

A WYSIWYG mathematics editor that understands your formulas!
https://stefnotch.github.io/aftermath-editor
MIT License
14 stars 0 forks source link

Cosmetic Annotations #45

Open stefnotch opened 1 year ago

stefnotch commented 1 year ago

Major feature that won't be implemented for now: Non-semantic annotations

e.g. Selecting part of a formula and setting its background color. And that annotation should get preserved through edits, and shouldn't suffer from unpredictability like MS Word background/font/... settings.

Non-semantic annotations

Should follow the MathLayout tree. Should never have overlapping ranges (but smaller ranges inside larger ranges is fine). Multiple nested equally large ranges is also fine, like "annotation border > annotation blue background > annotation padding > actual math formula".

Annotation example

<math display="block">
            <mover>
              <mrow>
                <mi>x</mi>
                <mo>+</mo>
                <mo>...</mo>
                <mo>+</mo>
                <mi>x</mi>
              </mrow>
              <mover>
                <mo>⏞</mo>
                <mrow>
                  <mi>k</mi>
                  <mspace width="0.1111111111111111em"></mspace>
                  <mtext>times</mtext>
                </mrow>
              </mover>
            </mover>
          </math>

Open question: Writing 123.45 and then highlighting (aka adding an annotation) to .45 should be possible. Do I slap that into the rendered mathml, and if so, how?

from #20