Math on the web

by Cristián Opazo

Since its inception, the World Wide Web has gradually evolved in order to accommodate user’s needs, particularly in regards to input and output of text and images. What started as very rudimentary displays based on the ASCII character set, has now become expanded, standardized systems like Unicode, HTML4 (and hopefully soon HTML5), CSS and all other web standards in use today. But what about the most universal of human languages, mathematics? The evidence tells us that the ability to display mathematical expressions on the web has evolved very slowly, and is very far from reaching a point of widespread adoption, which is somewhat surprising considering the great amounts of potential users around the world.

Even though a standard for math on the web, MathML, has existed since 1998, with its latest version MathML 3.0 adopted very recently, it is a tool with remarkably little use on the web. There are many reasons for this: the reluctance of users to learn a new coding language from scratch, the availability of “user-friendly” tools like MathType and Microsoft Equation Editor (now bundled into Office 2010), but particularly the widespread, cult-like use of TeX and LaTeX, the gold-standard of typesetting systems, which has been adopted by academics, scientists (and more importantly, publishers) since its development in the late 1970’s. As you may have experienced, the divide between those who are willing to publish some math (that may not look perfect but was generated with little effort), and those whose mathematical expressions must look nothing-less-than-perfect (no matter the effort), is enormous; the first camp prefers limited (but easy-to-use) equation editors, whereas the other favors TeX or LaTeX, and publish math online by rendering their documents into PDFs, in a way avoiding the web altogether.

So, in order to do the right thing we all should learn MathML, right? Wrong. The same way that most of us who publish web content on a regular basis (through blogs, Facebook, Twitter, etc.) do not type HTML code from scratch, there are many ways to generate MathML code from other sources. Here’s a nice list of software tools that will allow you to render (or convert) your math expressions into MathML. Just keep in mind that, in order to be able to display MathML code natively (i.e. without a special plug-in), you must use a good web browser (i.e. one that cares about open standards). Until recently, everybody’s favorite Firefox was the only browser that supported MathML natively, but since August, 2010, Safari and Google Chrome also do. (Perhaps unsurprisingly, Internet Explorer does not support MathML natively -only through the third-party plug-in MathPlayer.)

Now, how can we generate beautiful math expressions in WordPress sites— like this one? Sure, you could reconfigure your WordPress server by hacking into the the PHP, but there are easier ways. Since WordPress is an open-source application, developers are continuously creating new functionality for it: here’s the latest list of all LaTeX plugins for WordPress. We’ve only tried a few of these, but the main difference between them is the fact that most generate math expressions as graphics (GIFs or PNGs), whereas only a few of them generate proper MathML code. (Also, in some cases, the code compilation and rendering of images occurs locally, whereas in other cases, it happens remotely, which is a relevant point to discuss with your systems administrator.)

Here at Vassar, we have just installed the QuickLaTeX plug-in and are very happy with its performance— if what you want to do is typing or copy/pasting your good ‘ol LaTeX commands. All you need to do is to start your post with the expression “latexpage” (between square brackets), and then enter your LaTeX code below.

Here’s an example:

This is a really famous equation:

(1)   \begin{equation*} E=mc^{2} \end{equation*}

If you would like to include inline equations, you can just type them between ‘$’ signs, like this: a^{2}+b^{2}=c^{2}.

If you want to number only some of your equations, use the displaymath command instead of the equation command to skip those that should go un-numbered, like this one:

    \begin{displaymath} \sin^{2}\theta+\cos^{2}\theta=1 \end{displaymath}

Here are two nice, more sophisticated equations featuring an infinite sum and an indefinite integral:

(2)   \begin{equation*} \lim_{n \to \infty} \sum_{k=1}^n \frac{1}{k^{2}}=\frac{\pi^{2}}{6} \end{equation*}

(3)   \begin{equation*} \int\frac{d\theta}{1+\theta^2} = \tan^{-1} \theta+ C \end{equation*}

As you can see, the equations are rendered as PNG image files (sure, it’s not MathML, but it’s the next best thing.) Here’s the code that generates the expressions above:

QuickLaTeX can also render graphics on the fly through the pgfplots package. Here’s an example:

Rendered by QuickLaTeX.com

Here’s the code that generated the 3-D plot above:

Here’s a quick start guide to QuickLaTeX, featuring some neat examples.

As you can see from the results above, this plugin is already available on our WordPress production system. Please let us know what you think!

Share

Student Writing for a Global Audience

by Steve Taylor

It may be humbling for instructors to realize that they don’t necessarily inspire the highest quality of writing from their students. Of course, students are motivated by grades to submit good writing to their teachers, but many have found that the prospect of students having their papers read by their peers can be even more motivating. For years now, many instructors have had their students upload written assignments to a shared digital space and found that the expectation of that sharing significantly improved the quality of writing.

The ante is now raised, as some instructors require their classes to share their writing with the whole world, via a publicly accessible website, such as a blog. These students know that they not only have to assemble sentences well enough to avoid embarrassment among their classmates, but they have to get their information right or risk being called out by any number of experts in their topic.

Publishing to the world is more than just a challenge not to fail, though— it’s also an opportunity for students to put themselves out there as legitimate, albeit novice scholars. Instead of paying several years of dues in graduate school before daring to submit a bit of original work in a peer-reviewed scholarly journal, they’re publishing now, and getting feedback as well.

At an ACS symposium this fall, Profs. Lisa Paravisini and Jenny Magnes spoke about these and other benefits of student blogging. “If you define your assignment topic well,” Lisa said, “having students publish their writings to a blog ups the ante, in terms of audience. The potential audience is the world.”

Lisa Paravisini-Gebert

One assignment she uses is to have students completely re-write a Wikipedia article. Their research must be thorough, accurate, ethical, and original. Sometimes earlier contributors to an article will immediately undo the submission; other times, it will remain and possibly generate some discussion among different contributors.

It’s even more interesting for a student to be able to publish original material, something that’s more feasible than most people realize. Students in Lisa’s environmental studies project photographed and interviewed people adjacent to the Casperkill Creek and blogged their work. What they shared was unique materials, of interest to a potentially wide audience.

Jenny Magnes

Jenny Magnes assigned her students to propose and execute a simulation project related to electricity or magnetics. They had to write a proposal, then a plan, create the simulation, and finally post their reports on the blog, along with their data files.

All of it was original work. Jenny browsed the web to make sure none of the proposed ideas were already posted somewhere. Each student had to make substantive, constructive comments on each others’ posts. But classmates weren’t the only ones responding.

One of her students did a project on induction (as in induction ovens), including one video that she made and one that she found on YouTube and several simulations, depicted with thoughtfully designed graphs.  One of the reader comments was from an upstate firm that does work similar to what she had simulated— the student was invited to visit the plant and speak with the engineers!

Lisa has also seen some surprising responses to blog posts. In her own blog about Caribbean Studies, she mentioned some of Sean Penn’s work and promptly received a comment from Mr. Penn’s assistant. One student posted a critical analysis of a book and heard back from the book’s author!

As Lisa says, online publishing brings a sense of responsibility to students’ research methods; they have to carefully consider issues of integrity, ethics of attribution, and originality. Because you never know who might be watching.

Share