Adds some math/science buttons to the editor on science SE sites. These buttons are useful for converting selected text to math, formatting SI units, and formatting chemical equations. There are also keyboard shortcuts for them, which are IMO more useful than the buttons themselves.
(The SI units and chem buttons are only enabled on certain sites)
Currently, it runs on the SE sites listed on the site matrix here.
There also is an exit-inline-math-mode hotkey (Alt-Z). This one moves the cursor just after the next instance of $
. It's useful if you want to keep the flow of typing. For example, on Chem.SE, formatting H2O becomes Alt-C+type H2O
+Alt-Z and you can immediately continue typing(no need to rightarrow-out of math mode). On CStheory/CS, typing "I like NP-complete problems!", where "NP" is sansserif, becomes: type 'I like'
+Alt-S+type NP
+Alt-Z+type '-complete problems!'
. Once you're used to the shortcut, typing math fluidly becomes much easier!
If you want your mathjax-enabled SE site to be supported, please let me know!
My long term goal is to make this script a part of it (I'm still working on that script, though--so it will be a while)
Installation
Click here to install (requires Greasemonkey on Firefox). If you have trouble installing (like the Chrome blocking), or if you wish to install it on another browser, please see here for full step-by-step instructions on installation.
Buttons supported
Dollarify ($
)
- Encloses selection in
$...$
- Enabled on all supported sites
- Keyboard shortcut: Alt-M
Double Dollarify ($$
)
- Encloses selection in
$$...$$
- Enabled on all supported sites
- Keyboard shortcut: Alt-D
SI-ify (SI
)
- Encloses selection in
\:\mathrm{...}
(upright text with an extra separator space for SI units) - Enabled on Physics,Chemistry, and Biology
- Keyboard shortcut: Alt-S
chem-ify (O
2
)
- Encloses selection in
$\ce{...}$
(mhchem chemical equation formatter) - Use the
$
button on the\ce
'd text to make this a block element (use Alt-M) - Enabled on Chemistry only
- Keyboard shortcut: Alt-C
(Full button list below for more site-specific buttons)
Screenshots
Chem
Before:
After:
Dollarify
Before:
After:
SI-ify
Before:
After (first dollarifying, then SI-ifying)
After:
{,}
to avoid that space. Maybe the script could take care of that as well.