I would like to propose the addition of a $\LaTeX$ button. It would be very similar to the "code" button that formats the highlighted text into code, the $\LaTeX$ button would surround the highlighted text in $....$. This would make life a lot easier when you are editing posts.

What do you think about this?


I am thinking about building a very small java application for the time being that will allow you to press, for example, CTRL +1 and it will surround the text in $..$. Will people be interested in using such an application?

  • 7
    $\begingroup$ I'd go even further and request a nice keyboard shortcut as well. If it's not too much trouble to add to the system, of course... $\endgroup$ Commented May 19, 2013 at 15:21
  • $\begingroup$ @J.M. Yes, definitely. If this feature is implementable then a keyboard shortcut would also make a lot of sense. $\endgroup$
    – Jeel Shah
    Commented May 19, 2013 at 15:28
  • 2
    $\begingroup$ Shift + (4 4) - it's in my blood. $\endgroup$
    – Git Gud
    Commented May 19, 2013 at 16:48
  • 1
    $\begingroup$ Could this not be solved by a browser plug-in? (Which would, of course, be required to be written by someone. However, if what @75064 points out is true, that "this idea [won't get] any further than "Type: Enhancement | Status: New | Priority: Low" on the Pagedown issues list", then this seems like the only solution...) $\endgroup$
    – user1729
    Commented May 20, 2013 at 12:18
  • $\begingroup$ @user1729 Browser plug-in ... That is a very good idea. I hadn't thought about that. Maybe if the answer suggested by 75054 doesn't get "chosen" then we can opt for that. $\endgroup$
    – Jeel Shah
    Commented May 20, 2013 at 15:20
  • 3
    $\begingroup$ This has an added benefit of alerting new users to the existence of $\LaTeX$. $\endgroup$
    – apnorton
    Commented May 21, 2013 at 15:22
  • 3
    $\begingroup$ I prefer typing the dollar signs explicitly. This doesn’t mean that it shouldn’t be done; it just means that I see no need for it and wouldn’t use it. $\endgroup$ Commented May 23, 2013 at 22:54
  • $\begingroup$ @J.M. I have one. MIDI Keyboard + Max/MSP or Bome's MIDI Translator. $\endgroup$
    – Red Banana
    Commented May 25, 2013 at 15:05

1 Answer 1


I like the idea. When entering a long post with many formulas, the constant re-rendering of MathJax can be a drag on the browser; in such cases it is preferable to type formulas first and add $ $ later. Having a button/shortcut for this would be handy. Ideally, it would loop between text, $text$, and $$text$$, like the current Ctrl+I shortcut loops between text and *text*.

Drawing in an extra button takes a designer's effort but is not a big obstacle: button images differ between sites already. For example:

Math.SE editor buttons mse buttons

Travel.SE editor buttons travel buttons

The bigger deal is the script that handles the button clicks and keyboard shortcuts, along with all Markdown processing. It currently stands at $2459$ lines of JavaScript code named wmd.js (not WMD). Officially called Pagedown, it is being developed by SE as an open-source project. At some point of its history, it was reverse-engineered from seemingly abandoned obfuscated code (the original author could never be contacted again). See:

The editor is the same on all SE sites; maintaining separate versions would be rather painful, I imagine. But there is no need for that; the script can determine if the site has MathJax enabled, and activate the button and shortcut in this case only:

 if (StackExchange.mathjaxEditing) { enable $ button and shortcut }

Done! :) And it's now $2460$ lines of code.

  • $\begingroup$ That said, I'll be surprised if this idea gets any further than "Type: Enhancement | Status: New | Priority: Low" on the Pagedown issues list. $\endgroup$
    – 75064
    Commented May 20, 2013 at 6:52
  • $\begingroup$ If that is the case then do you think there is a way to create some sort of plugin in Firefox/Chrome? $\endgroup$
    – Jeel Shah
    Commented May 21, 2013 at 14:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .