=Paper=
{{Paper
|id=Vol-1186/paper-08
|storemode=property
|title=Firefox OS Web Apps for Science
|pdfUrl=https://ceur-ws.org/Vol-1186/paper-08.pdf
|volume=Vol-1186
|dblpUrl=https://dblp.org/rec/conf/mkm/SilvaW14
}}
==Firefox OS Web Apps for Science==
https://ceur-ws.org/Vol-1186/paper-08.pdf
Firefox OS Web Apps for Science
Raniere Silva and Frédéric Wang
Mozilla MathML Project
June 10, 2014
Abstract
In this document, we describe recent work made by the Mozilla MathML team to help publishing
scientific content using Web technologies. We focus on the Firefox OS platform currently being developed
by Mozilla that provides a good framework to create mathematical user interfaces on mobile devices.
Contents
1 The Web Platform 3
1.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Basic HTML5 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 Styling of Mathematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.4 TeXZilla . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.5 Advanced HTML5 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2 Firefox OS 6
2.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2 Math Suite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.3 Math Cheat Sheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.4 TeXZilla App . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.5 DynAlgebra . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
A The Web Platform 12
A.1 1-mathml-in-html . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
A.2 2-mathml-in-svg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
A.3 3-mathml-javascript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
A.4 4-mathml-fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
A.5 5-canvas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
A.6 6-mathml-in-webgl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
A.7 7-web-component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
B Firefox OS Apps 17
B.1 Math Cheat Sheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
B.2 TeXZilla App . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
B.3 DynAlgebra . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
1
Introduction
The Web has become an integral part of our daily life. Some of the reasons for its success are its open
nature and the way it enables anyone to get access to knowledge and to create his own projects. The Mozilla
community has worked since the early days of the Web to guarantee openness, innovation and opportunity
[Moz1].
The Web was created at the CERN to share knowledge between researchers [W3C1]. But although it
was invented by scientists, we still have not seen the same positive impact on scientific practice. There are
two main reasons that could explain this situation and they are actually related to each other.
The first one is a human problem. Researchers have kept teaching students to write papers for publication
in journals and to avoid sharing their detailed results because of competition between academic groups. This
means that most scientists ignore how to use tools to publish Web content and do not have the culture of
openness and collaboration. Mozilla Science Lab was launched last year to remedy that problem and build
educational resources, tools and prototypes for the research community [Moz2].
The second one is more technical. At the beginning of the Web, we had no tools to write scientific
documents that could effectively replace the traditional authoring tools for publication on papers. Even if
some tools are now available 1 they are still not used during the early years of undergraduate and graduate
courses. In science, there is one extra technical problem: we still lack a cross-compatible way to publish
mathematics on the Web despite the publication of the MathML standard in 1998 [W3C2]. The Mozilla
MathML Project [Moz3] was launched in 1999 and in a few years, the team produced a good MathML
implementation in Gecko together with tools to publish mathematics on the Web. MathML finally became
part of HTML5 thanks to Mozilla’s effort [Moz4], but other Web rendering engines still have limited support
or even no support at all [Oreilly1]. This means that scientists either stay outside the Web (e.g. exchange
only PDF documents) or rely on some workarounds (PNG images, CSS stylesheet, Javascript polyfills 2 ) to
publish mathematical content on the Web, with their inherent limitations and issues.
In recent years, the mobile market has grown considerably and more and more people are using mobile
devices to access the Web. Mozilla has been working on Firefox OS, an open-source operating system for
these mobile devices that relies exclusively on open standards and in particular Web technologies [Moz5].
Thanks to Gecko’s good support for MathML and HTML5 in general as well as Mozilla’s long experience
with community involvement, we now have the opportunity to build a family of scientific Web applications
compatible with Firefox OS devices. Some of the early prototypes created by the Mozilla MathML team are
presented in this paper.
In a first part, we will review the Web platforms and focus on how the technologies can be used for
science. We will present the classical features as well as more recent improvements that have been integrated
into Mozilla projects recently such as the Open Type MATH table, WebGL, Web Components or TeXZilla.
Some of this work has been made during the crowdfunding project “Mathematics in ebooks” which has also
resulted in the creation of a collection of scientific documents using advanced Web technologies [Wang1].
In a second part, we will study how to use these technologies to write Firefox OS Web apps for science.
We will give an overview of the general format, which is essentially just an archive of Web pages together
with a manifest. We will discuss the big picture for a Math Suite and present three Web apps we started
to develop: a math cheat sheet, a note-taking app for math and finally an app to help doing algebraic
calculations similar to Epsilonwriter at MathUI’13 [Nicaud2].
The authors have written this paper using collaboration tools like GitHub and all the sources, programs
and tools presented here are open. Because PDF format has been requested for submission to the MathUI
workshop, we had to provide our demos separately instead of integrating them directly into the document.
We try to provide some screenshots in appendix but they will not replace real testing and we strongly invite
the reader to test the demos in a Gecko browser. A Web version of that document is also available for online
reading.
1 For example, the authors used git for version control and LaTeXML to produce HTML pages from LaTeX
2 This is a term used by Web developers to describe code providing a technology that is expected to be supported natively
by browsers
2
1 The Web Platform
1.1 Overview
All the technologies presented in this section are based on Web standards and should be supported by any
Web rendering engine. We will particularly be interested in Gecko which has the best native MathML
support and is the core of Firefox OS. We will present some of the improvements that have been made by
the Mozilla MathML team.
All these technologies should be usable in HTML documents. This obviously includes Web pages but also
EPUB ebooks, HTML mails, browser add-ons or Firefox OS Web apps. For example, it is possible to receive
and send emails with mathematical equations using Thunderbird or Seamonkey’s mail client [Wang2]. In
this paper, we will mainly focus on Firefox OS Web apps but one should keep in mind that all the features
apply in other contexts too.
1.2 Basic HTML5 Features
The main language is HTML5, which allows to create pages with headers, paragraphs, tables, hyperlinks,
etc. The well-known CSS language is used to apply specific style to HTML5 and is powerful enough to pro-
duce advanced designs. Finally, DOM/Javascript provides a programming language and enables interactive
documents and complex user interfaces. New HTML5 elements gives other possibilities. For example the
document pendulum-20131125 of [Wang1] uses the the