fred-wang / Mathzilla

Collection of Mozilla MathML add-ons
35 stars 8 forks source link

Support for additional annotation #28

Closed physikerwelt closed 9 years ago

physikerwelt commented 9 years ago

I discussed with @HowardCohl, that it would be nice to allow coping of other annotations (http://www.w3.org/TR/MathML3/chapter5.html#mixing.elements.annotation) like for example OpenMath, Mathematica or a Semantic TeX markup.

fred-wang commented 9 years ago

When I looked into this a long time ago, it didn't seem very possible in the add-on sdk to pass the desired mime types from lib/main.js to data/*.js to implement a generic handler:

https://developer.mozilla.org/en-US/Add-ons/SDK/High-Level_APIs/context-menu

It seems that we can either:

Anyway, I was waiting that you told me exactly which mime type mapping you want before trying anything.

physikerwelt commented 9 years ago

@fred-wang good. I'll discuss that with @HowardCohl. If you look for example at http://drmf-beta.wmflabs.org/wiki/Definition:AffqKrawtchouk You see that there are two tex-annotations `...{\displaystyle{\displaystyle\mathop{K^{\mathrm{Aff}}{n}\/}\nolimits!\left(q^% {-x};p,N;q\right)=\mathop{{{}{3}\phi_{2}}\/}\nolimits!\left({q^{-n},0,q^{-x}% \atop pq,q^{-N}};q,q\right)}}

{\displaystyle \AffqKrawtchouk{n}@{q^{-x}}{p}{N}{q}=\qHyperrphis{3}{2}@@{q^{-n},0,q^{-x}}{pq,q^{-N}}{q}{q} } ...` We used to abouse the name OpenMath for the second option, which allowed us to copy the notation from the MathJax menu. The first notation can be used for copy and paste to standard latex documents. The second one requires "semantic" macros to be set up. Do you have a suggestion, how to call this annotation? I have no preferences.
fred-wang commented 9 years ago

I think I found a way to provide generic support. I sent you a mail with the XPI.

HowardCohl commented 9 years ago

I call it "Semantic LaTeX".

fred-wang commented 9 years ago

My mail with the XPI was rejected by NIST's server. Here is how it looks like:

copy-annotation

As you can see, I simply reuse the value of the "encoding" attribute, so now it's really up to decide how to call it.

physikerwelt commented 9 years ago

@fred-wang Thank you very much. It works for me... was not blocked by TUB. To make the content menu smaller one could remove the two default items and use the annotation name as localization key... but that's up to you

fred-wang commented 9 years ago

Note that the "copy annotation" only copies annotation to the text clipboard (either the text content of the annotation or the serialized annotation-xml). "Copy MathML" is different: it copies the whole MathML formula, both into the HTML clipboard (to paste into any HTML editor) or into the text clipboard (the source code). I think "copy TeX" is also a quick shorthand for the most popular case and it's better not to remove it.

fred-wang commented 9 years ago

OK, it has already been approved by the AMO reviewers: https://addons.mozilla.org/en-US/firefox/addon/mathml-copy/

fred-wang commented 8 years ago

think "copy TeX" is also a quick shorthand for the most popular case and it's better not to remove it.

@physikerwelt So I finally submitted for review a new verson removing that item to save space. Now we only have "copy MathML" (as source flavor + as HTML flavor) and the copy annotation submenu for tex and others.

physikerwelt commented 8 years ago

Yes, there is a lot of submenu items already. I'm not sure if the mathml font settings (from your other plugin) really deserve a submenu item. Especially since they are also displayed on pages without any math.

fred-wang commented 8 years ago

However, why do you need the math font settings plugin enabled? I basically only use it for testing purpose, but you can use the standard font preference menu or custom user stylesheet to configure your math font.