What is mhchem?

mhchem is a specialized input syntax designed for typesetting chemical equations and formulas. It provides an intuitive way to write complex chemical notation-like subscripts, superscripts, arrows, and charges-using simple text commands. The syntax is widely used in scientific documentation through systems like MathJax and KaTeX, making it a standard for displaying chemistry on the web and in academic papers.

Tool Description

This tool converts chemical equations from mhchem syntax to LaTeX format. It parses mhchem notation and generates the corresponding LaTeX code that can be used in scientific documents, presentations, or web pages. The tool uses the official mhchemParser library to ensure accurate and consistent conversion.

Features

  • Convert chemical equations from mhchem to LaTeX syntax
  • Support for complex chemical formulas with subscripts and superscripts
  • Handle reaction arrows and equilibrium symbols
  • Process chemical states and charges
  • Parse stoichiometric coefficients
  • Support for electron transfer notation
  • Real-time conversion as you type

Use Cases

  • Academic Writing: Convert chemistry equations for LaTeX documents and research papers
  • Web Publishing: Generate LaTeX code for chemistry content on websites using MathJax or KaTeX
  • Educational Materials: Prepare chemistry formulas for teaching materials and presentations
  • Technical Documentation: Format chemical reactions and compounds for scientific documentation
  • Chemistry Study: Practice writing chemical equations in standard notation
  • Formula Verification: Check if your mhchem syntax is correct by viewing the LaTeX output

Conversion Examples

Simple Compound: H2O → Subscript formatting for water

Chemical Reaction: CO2 + C -> 2 CO → Carbon dioxide reduction reaction

Ionic Charge: H+ → Hydrogen ion notation

Equilibrium: A <=> B → Reversible reaction arrow

Complex Formula: CuSO4.5H2O → Copper sulfate pentahydrate

Oxidation States: Fe^{II} → Iron in +2 oxidation state