Blog de Frédéric - Tag - latexmlFrédéric Wang's Blog, about mathematics and computer science / Blog de Frédéric Wang, sur les mathématiques et l'informatique.2015-04-25T07:56:23+02:00Frédéric Wangurn:md5:856637f86f94ed5243b6f6f713360bdaDotclearNew MathML Firefox add-ons on AMOurn:md5:a826b3f19e0974de4a033d453c5298102014-01-29T13:07:00+01:002014-01-29T14:18:10+01:00fredwlatexlatexmlmathmlmathzillamediawikimozillawikipediaxpcom <p>While the patches for MathML integration in MediaWiki are
<a href="https://gerrit.wikimedia.org/r/#/projects/mediawiki/extensions/Math,dashboards/default">progressively being reviewed and merged</a> and
while we are working on the
<a href="http://www.maths-informatique-jeux.com/ulule/mathml_torture_test/">support for Open Type fonts with a MATH table</a> in Gecko, I finally
found time to check the progress in Mozilla's
<a href="https://developer.mozilla.org/en-US/Add-ons/SDK">add-on
SDK</a>. In particular, since the last time I tried (some years ago)
they have introduced a cleaner interface for content scripts as well
as the possibility to use XPCOM for missing features.
Hence I have been able to update some of my experimental MathML add-ons.
I have submitted two new add-ons to Mozilla's AMO that I hope
could be useful to some people:</p>
<ul>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/mathjax-native-mathml/">MathJax Native MathML</a>, an add-on to <strong>force MathJax to
switch to Gecko's MathML support</strong>
without having to use the MathJax menu to change the output mode
and works even on Websites where that menu is disabled.
This also removes MathJax's automatic rescaling and inline-block
<code>span</code> that are currently causing random rendering bugs
with Gecko's native MathML (and will confuse possible future
line-breaking support anyway).
<div style="width: 600px; margin-left: auto; margin-right: auto;">
<img src="https://addons.cdn.mozilla.net/img/uploads/previews/full/123/123814.png?modified=1390414386" width="600" alt="MathJax Native MathML"/>
</div>
</li>
<li>
<a href="https://addons.mozilla.org/en-US/firefox/addon/mathml-copy/">MathML Copy</a> (at the moment only partially reviewed by the AMO team), an
add-on to <strong>copy MathML and TeX into the clipboard</strong>.
For MathML, two flavors are copied: the source as plain text
(to paste in your favorite text editor)
and the MathML as HTML
(to paste in Thunderbird, MDN, any Gecko-based
HTML editor etc). Copying TeX
is only possible when it is provided via the
<a href="https://developer.mozilla.org/en-US/docs/Web/MathML/Element/semantics">standard MathML
annotation method</a>, which is the case in e.g.
<a href="http://dlmf.nist.gov/LaTeXML/">LaTeXML</a> and
<a href="http://golem.ph.utexas.edu/wiki/instiki/show/Sandbox">Instiki</a>
documents as well as in <a href="https://gerrit.wikimedia.org/r/#/c/109486/">Wikipedia in the future</a>.
<div style="width: 600px; margin-left: auto; margin-right: auto;">
<img src="https://addons.cdn.mozilla.net/img/uploads/previews/full/124/124088.png?modified=1390660049" width="600" alt="MathML Copy"/>
</div>
</li>
</ul>
<p>As usual, there is room for <a href="https://github.com/fred-wang/Mathzilla/issues">improvements and bug fixes</a>, but that's a start. In particular
I would be happy to get
<a href="https://github.com/fred-wang/Mathzilla/issues/1">translations for the two strings of the
MathML Copy add-on</a>: "Copy MathML Formula" and "Copy TeX Source".
Also, because I used the add-on SDK these add-ons are unfortunately
only available for Firefox at the moment...
</p>Master Thesis, LaTeXML and Quantum Groups (part 1)urn:md5:e969612a6ea9961eb7cbe277ff8d2c8d2012-09-13T23:43:00+02:002012-09-14T00:38:29+02:00fredwlatexlatexmlmathjaxmathmlmozillaquantum groupswebsite updates <p>I wanted to wait for my oral defense before blogging about my master thesis
and how I manage to publish Web and paper versions of it. However, I finally met
my supervisor today and the oral defense is only likely to take
place next Wednesday. I do not want to delay too much this blog post and
thus decided to publish it today...</p>
<p>This year, I have taken the following approach to write my master thesis:
from LaTeX input files, I used XeLaTeX to generate a pdf document and LaTeXML
to generate HTML+MathML Web pages. I had to handle some small differences via
separate configuration files. However in general, these two tools are compatible
and accept more or less the same LaTeX input. I did not really have to make
graphics: I only used the <code>amscd</code> package to draw simple commutative
diagrams and did not try to draw schemas for representations of quantum groups.
Hence I did not get the opportunity to test how LaTeXML can generate
MathML inside SVG, although I saw on July something interesting for Firefox on
the LaTeXML mailing list.</p>
<p>The pdf version provides a good print layout which allows to workaround
some issues that I had two years ago when I printed
<a href="http://www.maths-informatique-jeux.com/blog/frederic/?post/2010/07/24/Using-Mozilla-to-print-a-scientific-report-based-on-Web-formats">my Master Thesis
in Computer Science</a> directly from Firefox. XeLaTeX also seems much faster
and so more convenient to use when you only want to check that your LaTeX code
is syntactically
correct and get a quick preview. It seems that XeLaTeX uses a kind of cache:
there are intermediary files that I guess are used again when you regenerate
the document. In contrast, LaTeXML seems to always regenerate one big XML file
in a first step and the Web pages in a second step. Perhaps LaTeXML has an
option to avoid that behavior or perhaps the idea of a cache system
does not work well in the case of Web pages.</p>
<p>The output of LaTeXML has the classical advantages of HTML+MathML for
publication on the Web and is much more comfortable to read on a screen.
Generally speaking, I think Firefox renders pretty well the LaTeXML output.
LaTeXML generates HTML rows to implement labelling and does not rely on
<code>mathvariant</code>, which allow to avoid issues with
<code><mlabeledtr></code> and token elements. However, I still note some
MathML's rendering imperfections which, not surprisingly, have already be
mentioned in the <a
href="http://www.maths-informatique-jeux.com/blog/frederic/?post/2012/09/01/Mozilla-MathML-Project%3A-Roadmap">MathML
project roadmap</a>:</p>
<ul>
<li>Linebreaking: bad line breaks inside some equations, apparently those
generated by some environments like <code>multline</code> or
<code>gathered</code>. Sometimes, I also see bad line breaks around
equations for example when they are inside parenthesis.</li>
<li>Spacing: the lack of support for
<code>mtable@rowspacing/columnspacing</code> seems to give wrong spacing
inside binom-like notations. For some reason LaTeXML generates
<code><mpadded></code> elements of zero width in some places and they
cause weird overlappings in some summations.</li>
<li>Operator Stretching: commutative diagrams in the definition of Hopf
algebras would look better if we support stretching operators in table
cells.</li>
</ul>
<p>This also gives me the opportunity to report various bugs and give some
suggestions to the LaTeXML team, including the use of MathJax (for
browsers without MathML support), the replacement of
<code><mfenced></code> by the equivalent <code><mrow></code>,
<code><mo></code> constructions (better rendering in Firefox),
improvement to the generation of headers in HTML5 and more.</p>
<p>The title of my master thesis is <a href="http://www.maths-informatique-jeux.com/maths/memoire_groupes_quantiques/">"Specialization of Quantum Groups at a Root of Unity and Finite Dimensional Representations"</a>. The concept of
<a href="http://en.wikipedia.org/wiki/Quantum_group">Quantum
Groups</a> is based on ideas from theoretical physics, but I studied these
structures from a purely algebraic point of view. That is not likely to be
interesting if you have never heard about Lie algebras or are not familiar with
representation theory, so I will present
<a href="http://www.maths-informatique-jeux.com/blog/frederic/?post/2012/09/13/Master-Thesis,-LaTeXML-and-Quantum-Groups-(part-2)">my contribution in a separate blog post</a>.</p>