CHEMEQ(1)
π NAME π
okay so bestie, meet chemeq β the Chemical Equation Parser and Renderer. π
It lives in the User Manuals section (that's section 1, iykyk) and it is literally about to become your favorite little chemistry goblin. β¨
π¦ SYNOPSIS π¦
chemeq [-M] [-m] [-l] [-c] [-w] [-C] [-e] [-s] [-S] [-n] [-W]
chemeq [-h] [-v]
β¨ DESCRIPTION β¨
So chemeq is a chemical equation analyzer β and no cap, it's fast. It's a speedy lexical and syntaxic analyser whose whole thing is digging out the chemical information hidden inside your source chemical equations. π§ͺπ
Once it's got the tea, it can spill it in all kinds of sophisticated output formats, and which format you get depends on the options you pass. If you just run it with nothing, chemeq defaults to chemeq -mlcwCn. Periodt. π
π OPTIONS π
-Mβ outputs a list of space separated molecular weights. β¨-mβ outputs a minimal output. The whole point of this one is that it letschemeqbe idempotent, meaning the commandchemeq | chemeqis equivalent tochemeq. iconic behavior honestly π«Ά-lβ outputs a LaTeX string representing the chemical equation. πΈ-cβ outputs a message giving information about the Conservation of elements and charges in the equation.OKmeans that both elements and electric charges are balanced. β-wβ outputs the LaTeX string representing the Gulder-Waage equation related to the input chemical equation, or the Nernst equation, if the input equation is a redox semi-equation. β‘-Cβ outputs a detailed Count of the molecules and atoms contained in each member of the chemical equation. For example for the equation"H2_g + 1/2 O2_g --> H2O"it outputs:
H2_g|H:1*2, 1/2 O2_g|O:1/2*2; H2O|H:1*2 O:1*1
-eβ outputs a detailed count of the Electrical charges. π-sβ outputs a list of the chemical Species. π§¬-Sβ outputs a list of the chemical *S*tΕchiometric coefficients. π’-nβ outputs a Normalized string accounting for the input equation. Two chemical equations having the same normalized string are chemically equivalent, even if the molecules are scrambled around and the coefficient are not equal but proportionnal. π«-Wβ changes the behavior of the renderer for some versions of Wims: it works around a bug with the macro\rightarrow. π©Ή-hβ displays Help. π-vβ displays the Version number. π·οΈ
π ENVIRONMENT π
chemeq_inputβ if set, this variables's value overrides the standard input. If this variable is not set, the variablew_chemeq_inputis taken in account (useful for the WIMS server). π₯οΈw_chemeq_inputβ see above (useful for the WIMS server). πchemeq_optionβ if set, this variable's value overrides the options. If this variable is not set, the variablew_chemeq_optionis taken in account (useful for the WIMS server). ποΈw_chemeq_optionβ see above (useful for the WIMS server). π
π EXAMPLES π
echo "1/2 Cu^2+ + OH- -> 1/2Cu(OH)2s" | chemeq
will display information about the reaction of hydroxyde and Cu II ions. π§ͺ
echo "MnO4^- + 8H3O^+ + 5e- --> Mn^2+ + 12 H2O" | chemeq
will display information about the reaction of reduction of permanganate ions in an acid environment. π₯
echo "MnO4^- + 8H3O^+ + 5e- --> Mn^2+ + 12 H2O" | chemeq -w
will display the LaTeX format for the Nernst law related to the reduction of permanganate ions in an acid environment. β‘
echo "MnO4^- + 8H3O^+ + 5e- --> Mn^2+ + 8 H2O" | chemeq -c
will highlight the lack of conservation of elements H and O (water molecules are not well balanced). ππ¨
echo "func:html_table" | chemeq
outputs an HTML Element, featuring a periodic table of chemical elements, which contains the exact data used by chemeq itself for the molar masses. π
π NOTES π
π§ syntax of ions
although in some cases, shorter expressions are successfully parsed, it is safer to consider that an "up arrow" (^) must be put before the charge symbols of an ion. Examples: H3O^+, Fe(CN)6^4-, OH^-
π§© Composing chemical equations
Two operators are defined, # as an additive oprator and ~ (tilde) as a substractive operator: they allow one to compose several chemical equations.
echo "MnO4^- + 8H3O^+ + 5e- --> Mn^2+ + 8 H2O ~ 5Fe^3+ + 5e- -> 5Fe^2+" | chemeq
will display the pure redox equation from the first equation, minus the second one. Electrons are simplified. So it will be equivalent to:
echo "MnO4^- + 8H3O^+ + 5Fe^2+--> Mn^2+ + 8 H2O + 5Fe^3+" | chemeq
which is their combination.
βοΈ Mutiplying a chemical equation by one coefficient
The operator * permits one to multiply a whole equation by one coefficient which may be a fraction. Here is an example:
echo "5 * Fe^3+ + e- -> Fe^2+" | chemeq
will be equivalent to
echo "5Fe^3+ + 5e- -> 5Fe^2+" | chemeq
𧬠Combining chemical equations, with coefficients
The two previous techniques can be used at the same time, which enables you to make more comlicated combinations, like this one:
echo "Fe^3+ + e^- -> Fe^2+ (0.77 V) # Fe^2+ + 6CN^- -> Fe(CN)6^4- (Kfa=1e24) ~ Fe^3+ + 6CN^- -> Fe(CN)6^3- (Kfb=1e31)" | chemeq
which will work as expected, and yield a good value for the standard potential of the redox couple of hexacyanoferrate II and III ions. π
π KNOWN BUGS π
When not specified, chemical entities coming from the standard input are believed to be in aqueous solutions. Water is considered by default as the main solvent. Only one liquid (aqueous) phase is currently taken in account. All solid chemical entities are considered as parts of separated phases. Suffixes _s, _g and _aq can be used to enforce the type of some chemical entities. π§π§
There may be problemes when you write a standard potential with no decimal dot. For example, the entry Mn^2+ + 2e^- -> Mn_s (-1 V) would trigger an error. Then write Mn^2+ + 2e^- -> Mn_s (-1.0 V) or the more accurate value Mn^2+ + 2e^- -> Mn_s (-1.18 V) and there will be no error. β οΈ
fr fr, watch that decimal point β it's giving chaos otherwise π
π«Ά AUTHOR π«Ά
Georges Khaznadar <georgesk@debian.org>
- Wrote this manpage. βοΈ
π COPYRIGHT π
Copyright Β© 2000-2013 Georges Khaznadar
Redistribution and use of this manpage in source and binary forms, with or without modification, are permitted under the terms of the GNU General Public Licenses, version 2
THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
and that's the whole vibe, bestie π this little gem is chemeq 2.10, dated 07/11/2023, and it's the CHEMEQ(1) page β go balance some equations, you main character π§ͺβ¨π
π¦ where this page comes from
- debian trixie: chemeq 3.6-1
- ubuntu noble: chemeq 3.6-1
- ubuntu resolute: chemeq 3.7-1
- ubuntu stonking: chemeq 3.7-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms