Balance chemical equations.
After installing the package (or copying it to your load-path), add this to your init file:
(require 'chembalance)
It works interactively (entering your equation at the minibuffer) and also with region.
M-x chembalance
=> goes to the minibuffer. Enter equation.
Ex. FeS + O2 => Fe2O3 + SO2
It returns:
Balanced reaction : 4 FeS + 7 O2 => 2 Fe2O3 + 4 SO2
You can also use it to check if a reaction is already balanced.
You can mark a region with a chemical equation and then M-x chembalance
.
It will give you the balanced equation.
Chembalance supports formulas with parentheses.
Ex: 3 Hg(OH)2 + 2 H3PO4 => Hg3(PO4)2 + 6 H2O
To customize chembalance, do M-x customize-group RET chembalance
.
There are two custom variables:
chembalance-arrow-syntax
(list of accepted arrows).
chembalance-insert-string
(if non-nil, when you call chembalance with selected
region, chembalance will kill that region and insert the balanced
reaction).
Please, email me your comments, bugs, improvements or opinions on this package to sergi@aloe-associacio.org
- Allow sign · or * in complex compounds
- Allow redox reactions
If there is an error in the calculation process, you will see a buffer with the error and the calc buffer opened (— Emacs Calculator Mode —).