Skip to content

Instantly share code, notes, and snippets.

@butchi
Last active February 3, 2017 12:33
Show Gist options
  • Save butchi/8c7370bc84f6b5e3a49a5972ce691091 to your computer and use it in GitHub Desktop.
Save butchi/8c7370bc84f6b5e3a49a5972ce691091 to your computer and use it in GitHub Desktop.
MathML簡略化案
# https://ja.wikipedia.org/wiki/Mathematical_Markup_Language
```replace-list--math-ml
replace mrow(/(.+)/) -> ($1)
replace mfrac(/(.+) (.+)/) -> ($1 / $2)
replace msup(/(.+) (.+)/) -> ($1 ^ $2)
replace msqrt(/(.+)/) -> √($1)
replace mi(/([a-z]+)/) -> $1
replace mn(([1-9][0-9]*)) -> $1
replace mo(=) -> =
replace mo(-) -> -
replace mo(⁢) ->  
replace mo(±) -> ±
```
```math
include replace-list--math-ml
return (x=(((-b)±√((b ^ 2)-(4 a c)))/(2 a)))
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment