## 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 \times B^A \to B$ or $x_{m n}$ or $\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:   http://golem.ph.utexas.edu/cgi-bin/MT-3.0/dxy-tb.fcgi/2675

### 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

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

$\bigl(\bigotimes\bigr)$

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