# Introducing: Markdown Shortcuts for StackExchange

Inserting Mathjax and making posts look nice is rewarding, but it can often be, well, repetitive and boring :( Well, not any more. I have been testing and improving this userscript for quite some time now, and here it is in its first release! :D

### Markdown Shortcuts for StackExchange

Because textual descriptions are boring, here's a video demo of the ninja capabilities: Video demo. In short:

• Alt-your choice => insert LaTeX command (text => \mathrm{text})
• prepend Ctrl (Ctrl-Alt-your choice) => inserts LaTeX command with $ surrounded ($\mathrm{text}$) • Alt-Z => dollar-ifying (text => $text\$)
• Alt-C => double dollar-ifying (text => $$text$$)
• Alt-S => frac-ify (A/B => \frac{A}{B})
• Alt-A => align-ify (image demo)

All the commands (hotkeys, insertions) are completely customizable. It supports wrapping and unwrapping text, as well as custom caret positioning via the pipe character. If this wasn't enough, this also works in comment boxes and in chat! :D

If you're interested in detail in the ninja editor capabilities, here's the detailed StackApps entry for this userscript.

### List of default LaTeX commands

Keycode Command
Alt-I   \pi
Alt-R   \mathrm{}
Alt-E   \ce{}
Alt-W   \pu{}
Alt-T   \text{}

Alt-Z   dollarify
Alt-C   double dollarify
Alt-S   frac-ify
Alt-A   align-ify


Finally, your feedback is encouraged! What more additional features or improvements would you like to see incorporated in the userscript, to make editing even easier? Remember, this is a userscript, almost everything is possible, so feel free to ask ;)

• Seems similar to stackapps.com/questions/3373/mathjax-buttons ? That script also adds buttons -- perhaps you'd like to roll the extra buttons into that? I'm not actually sure if it still works, but if it does would love to keep it maintained. – ManishEarth Jul 19 '18 at 19:00
• @Manish hello! Yep, both of these userscripts have the same motivation, but the newer one has several features more than the original one. I had also thought about the buttons, but the problem with them is that the latex command list is user-editable in this case, so it is possible that the number of buttons would overflow into two lines on the toolbar and clutter it :/ if you've anyway of avoiding that, i'm open to suggestions. Perhaps, I could add a button just for the top 4-5 latex commands? – Gaurang Tandon Jul 20 '18 at 0:29