[uf-new] an equation/MathML/TeX microformat?
Benjamin Hawkes-Lewis
bhawkeslewis at googlemail.com
Sat Oct 27 10:45:01 PDT 2007
On Sat, 2007-10-27 at 08:46 -0700, Paul Topping wrote:
> Perhaps I should come at this from a slightly different angle.
Thanks for the second explanation. I've also just found your helpful
earlier reply, which I'm afraid I missed earlier, where you discuss
copying TeX/MathML data out of webpages and into MathML applications as
the main deliverable.
So would this be a fair outline of your goals?
1. Images are used to display equations in an HTML document.
2. The alternative text for the image is human-readable.
3. Latex/MathML data is associated with the equation image.
4. The Latex/MathML data is normally invisible.
5. The Latex/MathML data is inline in the HTML master document, not in
separate resource(s).
6. The user can discover and copy the data to the clipboard.
7. No browser add-on is required to discover and copy the data.
8. Works with all mainstream (by which I mean "A-grade" as defined by
http://developer.yahoo.com/yui/articles/gbs/) browsers.
These goals are tricky since browsers tend to focus on allowing users to
manipulate and copy visible not invisible data. And microformats tend to
rely on browser add-ons like the Operator toolbar to enable users to
extract data structured by microformats. So it seems to me that the big
question is this: what invisible data /do/ browsers allow easy access
to? All browsers seem to provide access to anchor URIs, and the
resources they reference. Christopher St John already suggested:
<a href="some_mathml.xml"><img src="some_math.png"></a>
In that scenario, users could right click on the equation image,
download a MathML file to their Desktop, and then open the MathML file
in their MathML software. Perhaps in some cases they could even drag the
anchor and drop the URI directly onto their MathML software.
If the MathML software you have in mind can actually process a URI,
rather than relying on browsers to download the resource for it, then it
might be possible to use data URIs or reference fragments of a MathML
document full of equations. Then users could right-click on the anchors,
copy the URIs to the clipboard, and paste them into their MathML
software. I'm guessing that MathML software can't be counted on to be
able to open URIs, in which case Christopher St John's solution would
probably be more practical. One of your objections was:
> What you suggest is close to what I'm looking for but lacks
> declaration
> of the kind of data the image/linked data bundle represents. Software
> working with the page would have to fetch the linked-to MathML or TeX
> and examine it to know it was an equation. As I understand it, what a
> microformat does is more than just hold the data, it declares a
> datatype.
>
That certainly sounds like something microformats could help with. :) At
the very crudest:
<span class="hequation"><a rel="equation" href="your-equation.xml"
type="application/xhtml+xml"><img alt="energy equals mass times velocity
squared" src="your-equation.png"></a></span>
Where the equation makes for too long or complex an alt, alt could
briefly describe the equation and longdesc could be used to point to a
document containing a full alternative (your-equation.html).
If you need to provide both MathML /and/ TeX versions you'd probably
need to provide little icons and hequation could scale to do that:
<span class="hequation"><img alt="energy equals mass times velocity
squared" src="your-equation.png"> (<a rel="equation"
href="your-equation.xml" type="application/xhtml+xml"><img
href="mathml.gif" alt="MathML for equation 5" title="MathML
version"></a>, <a href="your-equation.tex" type="text/tex"><img
href="mathml.gif" alt="TeX for equation 5" title="TeX
version"></a>)</span>
Such a microformat could also be the basis of online tools that look for
hequation anchors, extract all the equations from a URI or uploaded
document, and make a DL providing the MathML and TeX CODE blocks for
each IMG.
Except for the possibility of using data URIs, this suggestion doesn't
meet Goal 5 ("The Latex/MathML data is inline in the HTML master
document, not in separate resource(s)"). But it does meet the other
goals I attempted to itemize.
--
Benjamin Hawkes-Lewis
More information about the microformats-new
mailing list