microsoft / xaml-standard

XAML Standard : a set of principles that drive XAML dialect alignment
Other
804 stars 50 forks source link

Proposal Add MathView Control #192

Open insinfo opened 7 years ago

insinfo commented 7 years ago
birbilis commented 7 years ago

Obviously needs to support binding inside the formula string too, probably with some escape start/end syntax if latex/MathML has such

insinfo commented 7 years ago

@birbilis yes

dotMorten commented 7 years ago

IMHO this is too specialized and should stay out of the common basic set and be offered as a 3rd party control or extension.

Duranom commented 7 years ago

I agree with @dotMarten that this an extremely specialized concept which use can be found only in specialized applications, not to mention you would have to support many variant of notations.

insinfo commented 7 years ago

@dotMorten I do not agree with you, a robust and complete markup language standard to develop graphical inteface can not be limited to buttons... For example the web standards, it has support for MathML

crutkas commented 7 years ago

@insinfo while yes it is in the HTML5 spec, I believe only Firefox supports it. Also quickly glancing, it does not seem like either iOS or Android also support this inbox.

I think it is a great idea. How would you stack rank this control in terms of other controls you've been asking for?

birbilis commented 7 years ago

SVG backend, which renders MathML into SVG. http://helm.cs.unibo.it/mml-widget/

Wonder if Edge team has MathML or if in the works, if they made a renderer to SVG. From that one could get XAML Paths I guess (there's issue logged here for SVG support btw) Some related discussion is at: https://wpdev.uservoice.com/forums/257854-microsoft-edge-developer/suggestions/6508572-mathml

Wikipedia article on MarhML says Chrome has promised MathML too and has some example XML syntax for it and comparison to other formats. Among those I'd prefer AsciiMath, not sure how flexible it is though.

Btw, latex syntax is different beast, MathML can just contain it in an annotation but it's not to be parsed from there (see example at wikipedia)

MathiasMagnus commented 7 years ago

While I do agree with the initiative, I do have a few questions/suggestions:

insinfo commented 7 years ago

I totally agree with you, @MathiasMagnus

I'd say go bold and put as much awesome into XAML Standard as possible.

I think it's an excellent suggestion.

insinfo commented 7 years ago

I added your suggestion to my initial proposal

insinfo commented 7 years ago

I believe in the idea that there are already many standards and a lot of segmentation, what is lacking, in my opinion is a robust and complete standard, enough to reinvest the wheel with each new project. We need a universal UI standard that is robust and complete in all areas of software development, whether in physics, math, entertainment, business, education, government, health, etc. Because with a robust base and complete graphic interface controls it is possible to embrace all these areas, which needs software with fast, beautiful, fluid and intuitive graphic interface. A standard that can be used in both Desktop, Mobile, WEB, Embedded Devices, self-service machines etc. With the introduction of WebAssembly this is made easier, implementing a Universal UI Framework in XAML.

Duranom commented 7 years ago

A thing that worries me is that should there be a new version of the MathML standard, when and how to have it updated in the xaml standard. It is not unknown that there have been, and still are, standards in the framework(s) that have not been updated and now outdated in such a way that in almost all new cases should be avoided, for example like XSLT. For MathML that would be really undesirable seeing as the fields it is used in.

birbilis commented 7 years ago

When something is mature enough it can be trusted to not change all the time

Happypig375 commented 6 years ago

Why MathML? Why not the more standard LaTeX format?

MathiasMagnus commented 6 years ago

Three reasons:

  1. Well, because MathML is far easier to implement. It's format is XML, so the parser is done.
  2. It would be 100% portable with HTML content. Though LaTeX is portable with LaTeX documents, but I think the audience of that is far smaller than the web in itself.
  3. You say LaTeX format, I say Unicode linear format (found in MS Word), others say something else...

MathML is a W3C standard and deserves better.

Happypig375 commented 6 years ago

Four opposing arguments:

  1. https://tex.stackexchange.com/questions/57717/relationship-between-mathml-and-tex

MathML is very verbose and is a pain to write manually, which is no problem if your code is automatically generated. For programs it is easy to parse, since it is XML.

TeX math code was designed to be written by humans and results in much shorter code. I cannot answer your question if one format will replace the other. As I mentioned they serve different purposes.

Sure, MathML is easy for computers to parse. What about humans? Can humans parse MathML effeciently? I cannot. Instead, LaTeX looks more natural and I can understand what a piece of LaTeX means, far better than MathML. Using MathML instead of LaTeX just increases maintenance costs.

  1. https://developer.mozilla.org/en-US/docs/Web/MathML/Authoring

There are many simple notations (e.g. wiki or markdown syntaxes) to generate HTML pages. The same is true for MathML: for example ASCII syntaxes as used in calculators or the more powerful LaTeX language, very popular among the scientific community.

Even Mozilla describes LaTeX as being very popular and it is used to generate MathML. Therefore, I don't agree with you saying that MathML is far more popular than LaTeX - People don't write MathML, they generate them using LaTeX or other similar formats.

  1. https://support.office.com/en-us/article/Linear-format-equations-using-UnicodeMath-and-LaTeX-in-Word-2e00618d-b1fd-49d8-8cb4-8d17f25754f8

Linear format equations using UnicodeMath and LaTeX in Word

Besides UnicodeMath, LaTeX is supported in Word too. Also, MathML is not there.

A quick Google search shows that there is a LaTeX renderer for WPF , but no relevant material shows up for the search on UnicodeMath , so the difference in popularity is so obvious. Therefore, I picked LaTeX over other formats.

  1. Just because MathML is a W3C standard does not mean that it should deserve better. https://www.theregister.co.uk/2015/07/29/dnt_dead_in_the_water/

W3C's failed Do Not Track crusade tumbles to ad-blockers' Vietnam

Here is an example of a failed W3C standard. So, we should not determine what a format deserves just based on whether it is a standard or not.

Any rebuttals?

insinfo commented 6 years ago

My sugestion This control can be implemented more generally, and an interface is provided so that it can easily be extended to other mathematical languages. Initially, it would come with a basic implementation for LaTeX and MathML

I updated my post, to leave the idea of the most generic control.

Happypig375 commented 6 years ago

Hi everyone, there is an implementation of this right now for Xamarin.iOS and Xamarin.Forms (via SkiaSharp): https://github.com/verybadcat/CSharpMath

Although only Xamarin.iOS and Xamarin.Forms (via SkiaSharp) is supported right now, there is a shared front end which can be extended to support other platforms. Can anybody here take a look at this and give some feedback? @verybadcat would like some help.

Although only LaTeX is supported now, a MathML-to-LaTeX converter in the library could be added in the future. With this library, we won't need to wait Microsoft to implement this.

What do you think?

insinfo commented 6 years ago

@Happypig375 Thanks for looking at this control, I believe this control is very important for a robust and complete XAML Standard, and for modern next-generation software that involves visual programming, interactivity with neural networks, and more. I think your initiative is very good, we need more initiatives like this, because it seems that if we are to wait for Microsoft that will not leave the paper.