A “cite this paper, will you?” button?

Just for everyone's attention, a nice question has popped up in the MathOverflow meta: Formatting citations to the literature on MathOverflow, shooting towards a button that will insert a formatted citation given a DOI or arxiv link, or even pop up a search window to connect with some back end. It looks pretty preliminary but it's something to keep an eye on if it goes through, and maybe it's a nice project for some of our better coders (though I don't want to point fingers).

For your convenience, here's the question text:

We'd like to make it easier to cite articles from the literature, on MathOverflow.

I propose adding a single button to the edit toolbar while writing posts, which will pop up a search dialog, allow the user to select a result, and then insert a nicely formatted link to the paper back into the edit box.

The button would appear next to the current four icons for inserting hyperlinks, blockquotes, preformatted text, and images. (We could insert this button ourselves, via our allowed javascript footer, but eventually we'd want SE to insert it natively.)

To get a sense of how the search dialog might work, please look at this prototype. (Obviously this would need some polishing; suggestions for improvements welcome.)

Once a search result has been selected, I propose inserting into the edit box something like:

which will render simply as the hyperlink A mathematics paper. The hyperlink should be the 'best available URL', e.g. the DOI resolution address, a direct link to the published version, or the link to the corresponding record on MathSciNet.

I would like to include the extra <span> tag around the actual hyperlink for several reasons:

1. it makes the extra citation data available, in case the user wants to also show the authors or journal reference in the text,
2. it allows us to render citation links differently via the CSS selector .citation if desired,
3. it allows us to programmatically detect and reformat citation links after the fact, if desired (e.g. to provide links to your local library's resolver).

There are a number of things we'll need to do:

• verify we really can add a button to the edit interface
• pick a 'backend' for the search dialog (the prototype above is a hack; it would be nice to run off MathSciNet or Zentralblatt, etc, but this may require a lot of coordination)
• design and build the search dialog
• beta test with some users
• This would be nice to work on; but I'm really busy these days -- got a lot of academic commitments, and side projects (already planned a whole truckload of work for after the exams) – Manishearth Feb 17 '14 at 14:21
• This would be a nice feature on all the technical sites in the network. – dmckee --- ex-moderator kitten Feb 18 '14 at 16:52
• I like this idea quite a bit. – joshphysics Feb 19 '14 at 4:48
• – Shog9 Feb 24 '14 at 22:11