# MathJax buttons/hotkeys script

I've written a script that lets you insert dollar symbols automatically(via a keyboard shortcut or button) in the editor window on Stack Exchange sites that support MathJax. You guys also get a special NP button(Alt-S, S for sansserif) that encloses the selection in $\mathsf{...}$.

Also, note that Alt-Z lets you exit math mode--this lets you type math smoothly. For example, you can use Alt-S, type PSPACE, and then use Alt-Z to bring the cursor out of math mode, where you can continue typing. (It's been a big help to me on chem.SE, with the \ce{...} button--I can type chemical formulae within the flow of the code).

Also, you have Alt-O for Big O notation, but I doubt you'll use it.

Feel free to check it out!

Installation instructions and details here

• Nice idea. It can imo be improved by entering mathmode with ALT-Z, too, and then providing several shortcuts for common stuff until the next ALT-Z.
– Raphael Mod
May 9 '12 at 19:38
• @Raphael interesting idea.. I'd have to teach it to differentiate between inside and outside math mode. Common stuff as in? Examples? May 10 '12 at 2:06
• Note that Alt-Z enters math mode as well already. May 10 '12 at 2:07
• Cool, that was not clear from your explanation. Certainly mathsf, mathrm and operatorname. Maybe frac. Environments like cases and align (maybe with two lines prefilled?) might be good, too. The possibilities are endless! I imagine it should be easy to build it such that users can easily edit their own combinations in?
– Raphael Mod
May 10 '12 at 7:22
• @Raphael: I am thinking of adding customizability, but that's not in the too near future. I imagine that localStorage would make it easy. Note that this isn't supposed to be a catch-all LaTeX editor. This is just for the common ones. Too many and the editor bar explodes (I can add stuff as only-keyboard-shortcuts, though--you guys already have a big O hidden shortcut [Alt-O]). I think what I'll do is leave it as-is for now, and pre-program some extra buttons which you can custom-add (as well as an option to create your own). That'll take a while, though. May 10 '12 at 7:30
• Oh, I was thinking only about shortcuts. Buttons are way too slow, anyway, and only useful if you don't know LaTeX. I imagine the what macros you use most depends heavily on where you write most your answers, topic-wise, so it is probably hard to make general recommendations.
– Raphael Mod
May 10 '12 at 7:40
• @Raphael: Alright. I'll be sure to let you know when I add customizability --though since the script auto-updates, you may find out yourself :) May 10 '12 at 7:42