Skip to the Main Content

Note:These pages make extensive use of the latest XHTML and CSS Standards. They ought to look great in any standards-compliant modern browser. Unfortunately, they will probably look horrible in older browsers, like Netscape 4.x and IE 4.x. Moreover, many posts use MathML, which is, currently only supported in Mozilla. My best suggestion (and you will thank me when surfing an ever-increasing number of sites on the web which have been crafted to use the new standards) is to upgrade to the latest version of your browser. If that's not possible, consider moving to the Standards-compliant and open-source Mozilla browser.

December 10, 2013

A Technical Innovation

Posted by Tom Leinster

Here’s a new feature of the Café, thanks to our benevolent host Jacques Distler. If you ever want to see how someone has created some mathematical expression on this blog, there’s an easy way to do it.

With Firefox, you simply double-click on the expression. Try it: A×B ABA \times B^A \to B or x mnx_{m n} or (1 2 3 4). \Biggl( \begin{matrix} 1 & 2 \\ 3 & 4 \end{matrix} \Biggr). A window should pop up showing the TeX source.

With other browsers, I’m not so sure. Try double-clicking. If that doesn’t work, then, according to Jacques’s instructions, you “bring up the MathJax context-menu for the formula, and choose Show Math As \to Annotation \to TeX”. I don’t know how one brings up this menu. Does anyone else know? (Update: right-click in Chrome, Explorer and Opera, and control-click in Safari. Thanks to those who responded.)

Once you’ve made the TeX source appear, you can cut and paste to your heart’s content. Of course, most users here are fluent in LaTeX. But like most math-oriented websites, we use a variant of TeX that’s a little different from standard LaTeX, so this should turn out to be a helpful feature.

Posted at December 10, 2013 1:41 AM UTC

TrackBack URL for this Entry:   https://golem.ph.utexas.edu/cgi-bin/MT-3.0/dxy-tb.fcgi/2675

18 Comments & 0 Trackbacks

Re: A Technical Innovation

In Chrome you can right-click with the mouse (or two-finger click on the touchpad) to bring up a context menu. Works here, shows the MathJax annotations no problem.

Posted by: Peter on December 10, 2013 2:37 AM | Permalink | Reply to this

Re: A Technical Innovation

In Internet Explorer 10, I was able to right click on the formula to get the content menu; double clicking does not give the content menu in IE 10.

Posted by: MikeFinn on December 10, 2013 6:55 AM | Permalink | Reply to this

Re: A Technical Innovation

I can get this to work here, but not at the nLab or nForum. I’ve checked in Firebug that both are loading the javascript, and the retrieveTexSource() function is getting run at document load (well, I’ve checked this for the nForum, not the nLab). But somehow the double click event isn’t getting passed through.

I don’t know enough about javascript to figure out what’s going on. Anyone care to help?

(I’m on a Mac with a trackpad and the double-click is a bit iffy as well.)

Posted by: Andrew Stacey on December 10, 2013 9:28 AM | Permalink | Reply to this

Re: A Technical Innovation

(Of course, we don’t need this at the nForum since each comment comes with its own “view source” functionality. Nonetheless, it would be nice to have so that all the nSites are in step with each other.)

Posted by: Andrew Stacey on December 10, 2013 9:30 AM | Permalink | Reply to this

Re: A Technical Innovation

For my Firefix on Ubuntu, the view LaTeX source feature works on nLab and nForum and does not work for the nCafe.

Posted by: zoran skoda on December 16, 2013 5:53 PM | Permalink | Reply to this

Re: A Technical Innovation

That’s a shame. I’m using Firefox (26) on Kubuntu (Ubuntu 12.04) and it works at all three places for me, with a double-click. What happens when you double-click at the Café?

Posted by: Tom Leinster on December 16, 2013 11:53 PM | Permalink | Reply to this

Re: A Technical Innovation

Yesterday it started working for my firefox, I do not know what changed.

Posted by: zoran skoda on December 20, 2013 11:09 AM | Permalink | Reply to this

Re: A Technical Innovation

If anyone is having problems, try reloading the page; I couldn’t get this to work at the Cafe until I hit Ctrl+R. Perhaps a javascript file was being cached or something.

Posted by: Mike Shulman on December 10, 2013 3:27 PM | Permalink | Reply to this

Re: A Technical Innovation

Reloading doesn’t always help. Cleaning the cache does.

Posted by: Alexander Shamov on December 10, 2013 8:14 PM | Permalink | Reply to this

Re: A Technical Innovation

Just for the sake of completeness:

In Safari neither double-clicking nor right-clicking work. There one seems to need to hold down “control” and click.

Posted by: Guest on December 13, 2013 11:07 AM | Permalink | Reply to this

Re: A Technical Innovation

Thanks, Guest, and thanks to others who have said how things work on their browsers.

Posted by: Tom Leinster on December 13, 2013 12:26 PM | Permalink | Reply to this

Re: A Technical Innovation

Right-clicking successfully brings up the MathJax context-menu with the Opera browser, if anyone’s curious. (Maybe not too many use Opera, but I like it.) Nice feature, thanks!

Posted by: Franciscus Rebro on December 15, 2013 11:01 PM | Permalink | Reply to this

Re: A Technical Innovation

This info has always been available in Firefox (modulo situations where it didn’t work) since MathMl was introduced, by right clicking on a MathML formula and then selecting “view MathMl source”.

Then again that approach depends that the translation from LaTex to MathMl embeds an “annotation” such as [annotation encoding="application/x-tex">A \times B^A \to B</annotation] and looking for that annotation in the MathMl tree, which the new trick automates.

The current situation in Firefox is suboptimal. You have to know that a double-click on a formula will pop-up the underlying LaTex without any hints.

A better presentation in today’s technology would be for a “mouse over” to pop up a tool tip that shows the source LaTex. However in current tech one cannot select and copy from a tool-tip, so that tip should also say how to get pop-up window that can be copied.

This is all from the point of view of FireFox. Making stuff work for all browsers is a real pain.

Posted by: RodMcGuire on December 22, 2013 7:49 AM | Permalink | Reply to this

Tooltips

I hate cluttering up the text with unnecessary tooltips. That’s just ugly.

Eventually, there will be native support in Firefox for copying (the LaTeX source of) formulæ directly to the clipboard. (No stupid popup window required.)

In the meantime, try double-clicking on any of the formulæ here, regardless of whether they are MathML or ugly pictures.

Posted by: Jacques Distler on December 23, 2013 10:34 PM | Permalink | PGP Sig | Reply to this

Re: A Technical Innovation

Very nice! It works even with Lynx. I always found the MathML source hard to read. The Tex source in the annotation is much more comfortable.

Posted by: Marc Olschok on December 25, 2013 10:08 PM | Permalink | Reply to this

Re: A Technical Innovation

WYSIWYG SVG-Editing in comments?

Layer 1 ( ) \bigl(\bigotimes\bigr) ρ = σ \rho=\sigma Δ \Delta \frac{\longrightarrow}{\textsize{\nabla}} \frac{\longleftarrow}{\textsize{\nabla}} \begin{svg}<svg width=”163” height=”237” xmlns=”http://www.w3.org/2000/svg” xmlns:svg=”http://www.w3.org/2000/svg” xmlns:se=”http://svg-edit.googlecode.com” xmlns:math=”http://www.w3.org/1998/Math/MathML” se:nonce=”93068”> <g> <title>Layer 1</title> <ellipse fill=”#ffaaaa” stroke=”#000000” stroke-width=”2” cx=”104” cy=”170” id=”svg_93068_1” rx=”58” ry=”66”/> <g id=”svg_93068_5”> <path fill=”#00bf5f” stroke=”#000000” stroke-width=”2” d=”m48.16666,149.833328c11,-24 79.499996,-44.5 92.499996,-31.5c13,13 -94.999996,-101.999998 -94.999996,-101.999998l2.5,133.499998z” id=”svg_93068_2”/> <path fill=”#ff0000” d=”m46.75,18.875l16.25,114.375l13.375,-7.5l-29.625,-106.875z” id=”svg_93068_3”/> <path fill=”#ff0000” d=”m46.75,19.25l47.125,99.875l14.625,-3.875l-61.75,-96z” id=”svg_93068_4”/> </g> <foreignObject x=”87” y=”191” id=”svg_93068_6” font-size=”16” width=”40” height=”24”> <math xmlns=”http://www.w3.org/1998/Math/MathML” display=”inline”> <semantics> <mrow> <mo maxsize=”1.2em” minsize=”1.2em”>(</mo> <mo>&#10754;</mo> <mo maxsize=”1.2em” minsize=”1.2em”>)</mo> </mrow> <annotation encoding=”application/x-tex”>\bigl(\bigotimes\bigr)</annotation> </semantics> </math> </foreignObject> <foreignObject x=”0” y=”0” id=”svg_93068_7” font-size=”16” width=”48” height=”20”> <math xmlns=”http://www.w3.org/1998/Math/MathML” display=”inline”> <semantics> <mrow> <mi>&#961;</mi> <mo>=</mo> <mi>&#963;</mi> </mrow> <annotation encoding=”application/x-tex”>\rho=\sigma</annotation> </semantics> </math> </foreignObject> <foreignObject x=”101” y=”162” id=”svg_93068_8” font-size=”16” width=”12” height=”20”> <math xmlns=”http://www.w3.org/1998/Math/MathML” display=”inline”> <semantics> <mrow> <mi>&#916;</mi> </mrow> <annotation encoding=”application/x-tex”>\Delta</annotation> </semantics> </math> </foreignObject> <foreignObject x=”76” y=”142” id=”svg_93068_9” font-size=”16” width=”24” height=”30”> <math xmlns=”http://www.w3.org/1998/Math/MathML” display=”inline”> <semantics> <mrow> <mfrac> <mo>&#10230;</mo> <mstyle scriptlevel=”0”> <mo>&#8711;</mo> </mstyle> </mfrac> </mrow> <annotation encoding=”application/x-tex”>\frac{\longrightarrow}{\textsize{\nabla}}</annotation> </semantics> </math> </foreignObject> <foreignObject x=”115” y=”141” font-size=”16” width=”24” height=”30” id=”svg_93068_16”> <math xmlns=”http://www.w3.org/1998/Math/MathML” display=”inline” id=”svg_93068_17”> <semantics> <mrow> <mfrac> <mo>&#10229;</mo> <mstyle scriptlevel=”0”> <mo>&#8711;</mo> </mstyle> </mfrac> </mrow> <annotation encoding=”application/x-tex”>\frac{\longleftarrow}{\textsize{\nabla}}</annotation> </semantics> </math> </foreignObject> </g> </svg>\end{svg}

Yeah, that would work.

Posted by: Jacques Distler on December 28, 2013 3:49 AM | Permalink | PGP Sig | Reply to this

Re: A Technical Innovation

I get “invalid markup” when I view this post via the atom feed using Digg reader.

Posted by: John on February 17, 2014 2:25 PM | Permalink | Reply to this

Re: A Technical Innovation

That’s strange. The comment feed is valid, too. You should complain.

Posted by: Jacques Distler on February 17, 2014 2:53 PM | Permalink | PGP Sig | Reply to this

Post a New Comment