Skip to main content
Create professional chemistry documents with LaTeX, including chemical formulas, reaction equations, and molecular structures.

Essential Chemistry Packages

\usepackage{chemfig}         % Molecular structures
\usepackage{mhchem}          % Chemical formulas and equations
\usepackage{chemmacros}      % Chemistry macros
\usepackage{siunitx}         % SI units
\usepackage{chemformula}     % Alternative to mhchem
\usepackage{mol2chemfig}     % Convert SMILES to chemfig

Chemical Formulas with mhchem

Basic Formulas

% Simple molecules
\ce{H2O}        % Water
\ce{CO2}        % Carbon dioxide
\ce{H2SO4}      % Sulfuric acid
\ce{Ca(OH)2}    % Calcium hydroxide

% Ions
\ce{Na+}        % Sodium ion
\ce{SO4^2-}     % Sulfate ion
\ce{NH4+}       % Ammonium ion

% Isotopes
\ce{^{14}C}     % Carbon-14
\ce{^{235}U}    % Uranium-235

Rendered Output

Water: \ceH2O\ce{H2O}Carbon dioxide: \ceCO2\ce{CO2}Sulfuric acid: \ceH2SO4\ce{H2SO4}Sodium ion: \ceNa+\ce{Na+}Sulfate ion: \ceSO42\ce{SO4^{2-}}

States and Phases

% Physical states
\ce{H2O(l)}     % Liquid water
\ce{CO2(g)}     % Gaseous CO2
\ce{NaCl(s)}    % Solid salt
\ce{Na+(aq)}    % Aqueous sodium ion

% Crystal structures
\ce{CaCO3.H2O}  % Hydrate
\ce{Fe^{II}Fe^{III}2O4}  % Mixed oxidation states

Chemical Reactions

Basic Reactions

% Simple reaction
\ce{2H2 + O2 -> 2H2O}

% With conditions
\ce{N2 + 3H2 ->[\text{Fe cat.}][450°C, 200 atm] 2NH3}

% Equilibrium
\ce{N2O4 <=> 2NO2}

% With heat
\ce{CaCO3 ->[\Delta] CaO + CO2}

% Precipitation
\ce{AgNO3(aq) + NaCl(aq) -> AgCl v + NaNO3(aq)}

Rendered Output

Simple reaction: \ce2H2+O2>2H2O\ce{2H2 + O2 -> 2H2O}Equilibrium: \ceN2O4<=>2NO2\ce{N2O4 <=> 2NO2}Precipitation: \ceAgClv\ce{AgCl v} (silver chloride precipitate)

Complex Reactions

% Multi-step reactions
\begin{align}
\ce{CH4 + Cl2 &->[\text{UV}] CH3Cl + HCl}\\
\ce{CH3Cl + Cl2 &->[\text{UV}] CH2Cl2 + HCl}
\end{align}

% Organic reactions
\ce{R-OH + R'-COOH <=>[H+] R'-COO-R + H2O}

% Redox reactions
\ce{MnO4- + 8H+ + 5e- -> Mn^2+ + 4H2O}

Molecular Structures with chemfig

Simple Molecules

% Methane
\chemfig{C(-[2]H)(-[4]H)(-[6]H)-H}

% Ethanol
\chemfig{H-C(-[2]H)(-[6]H)-C(-[2]H)(-[6]H)-OH}

% Benzene
\chemfig{*6(=-=-=-)}

% Cyclohexane (chair conformation)
\chemfig{*6(---(-[,,,,line width=2pt])---)}

Rendered Output

Methane: CH4\mathrm{CH_4} - tetrahedral structure with central carbon bonded to four hydrogensBenzene: C6H6\mathrm{C_6H_6} - hexagonal aromatic ring with alternating double bonds

Complex Structures

% Glucose
\chemfig{
  HO-[2,0.5,2]?<[7,0.7](-[2,0.5]OH)-[,,,,line width=2pt]
  (-[6,0.5]OH)>[1,0.7](-[6,0.5]OH)-[3,0.7]
  (-[4,0.5]OH)-[1,0.7]O-[7,0.7]?
}

% Aspirin
\chemfig{
  *6(=-*6(-(=O)-O-(-=[:30]O)-CH_3)=-=-)
}

% DNA base pairing
\chemfig{
  N**6(--N--C(=[::60]O)--*5(-N=-N(-H)-))
  @{a1}.|[,3.0]|@{a2}.
  N**6(-C(-H_3)-C(=[::60]O)-N(-H)--*5(=N--N=))
}
\chemmove{\draw[dashed] (a1) -- (a2);}

Rendered Output

Glucose: C6H12O6\mathrm{C_6H_{12}O_6} - six-membered ring structure with hydroxyl groupsAspirin: C9H8O4\mathrm{C_9H_8O_4} - acetylsalicylic acid with benzene ring and ester group

Reaction Mechanisms

Arrow Pushing

% Nucleophilic substitution
\schemestart
\chemfig{R-X} + \chemfig{\charge{90=\|}{Nu}}
\arrow{->[$S_N2$]}
\chemfig{R-Nu} + \chemfig{X^-}
\schemestop

% Elimination reaction
\schemestart
\chemfig{H-C(-[2]H)(-[6]H)-C(-[2]H)(-[6]X)-H}
\arrow{->[$E2$][-HX]}
\chemfig{H-C(-[2]H)=C(-[6]H)-H}
\schemestop

Rendered Output

Nucleophilic substitution: R-X+NuSN2R-Nu+X\mathrm{R\text{-}X + Nu^- \xrightarrow{S_N2} R\text{-}Nu + X^-}Elimination reaction: R-CH2-CHX-RE2R-CH=CH-R+HX\mathrm{R\text{-}CH_2\text{-}CHX\text{-}R' \xrightarrow{E2} R\text{-}CH=CH\text{-}R' + HX}

Curved Arrows

\chemfig{
  @{a1}\charge{45=\|}{O}-H@{a2}
  \+ R-@{b1}\charge{180=\|}{Br}@{b2}
}
\chemmove{
  \draw[->] (a1) .. controls +(45:5mm) and +(135:5mm) .. (b1);
  \draw[->] (b1) .. controls +(0:5mm) and +(0:5mm) .. (b2);
}

Rendered Output

Curved arrow mechanism: Shows electron flow from nucleophile (O\mathrm{O^-}) attacking the electrophilic carbon, with leaving group (Br\mathrm{Br^-}) departure indicated by curved arrows.

Laboratory Equipment

Common Glassware

% Using TikZ for simple diagrams
\begin{tikzpicture}
  % Round bottom flask
  \draw (0,0) circle (1cm);
  \draw (-0.3,1) -- (-0.3,2);
  \draw (0.3,1) -- (0.3,2);
  
  % Beaker
  \draw (3,0) -- (3,2) -- (4,2) -- (4,0);
  \draw (3,0) arc (180:360:0.5cm);
\end{tikzpicture}

Chemical Tables

Periodic Table Elements

\begin{table}[h]
\centering
\begin{tabular}{|c|c|c|c|}
\hline
\textbf{Symbol} & \textbf{Name} & \textbf{Number} & \textbf{Mass} \\
\hline
H & Hydrogen & 1 & 1.008 \\
He & Helium & 2 & 4.003 \\
Li & Lithium & 3 & 6.941 \\
Be & Beryllium & 4 & 9.012 \\
\hline
\end{tabular}
\caption{First four elements}
\end{table}

Thermodynamic Data

% Using siunitx for proper formatting
\begin{table}[h]
\centering
\begin{tabular}{l S[table-format=3.1] S[table-format=3.1]}
\toprule
Compound & {$\Delta H_f°$ (\si{kJ/mol})} & {$$ (\si{J/(mol.K)})} \\
\midrule
\ce{H2O(l)} & -285.8 & 69.9 \\
\ce{CO2(g)} & -393.5 & 213.8 \\
\ce{O2(g)} & 0.0 & 205.0 \\
\bottomrule
\end{tabular}
\end{table}

Units and Measurements

Using siunitx

% Basic units
\SI{25.0}{°C}                    % Temperature
\SI{101.325}{kPa}                % Pressure
\SI{2.5e-3}{mol/L}               % Concentration
\SI{98.5}{\percent}              % Percentage

% Complex units
\SI{8.314}{J/(mol.K)}            % Gas constant
\SI{6.022e23}{mol^{-1}}          % Avogadro's number

% Ranges
\SIrange{20}{25}{°C}
\SIrange{1}{5}{mL}

Chemical Equations with chemformula

Alternative Syntax

% Using chemformula package
\ch{H2O}                         % Water
\ch{H+ + OH- <=> H2O}            % Equilibrium
\ch{CO2 + H2O -> H2CO3}          % Reaction

% With stoichiometry
\ch{!( 2 H2 + O2 -> 2 H2O )}

% Oxidation states
\ch{Fe^{III}Cl3}

Common Chemistry Symbols

Symbol Reference

SymbolLaTeXMeaning
\rightleftharpoons\ce{<=>}Equilibrium
\rightarrow\ce{->}Reaction arrow
\downarrow\ce{v}Precipitate
\uparrow\ce{^}Gas evolution
Δ\Delta\DeltaHeat
°°° or \degreeDegree
±\pm\pmPlus/minus
\cdot\cdotHydrate dot

Spectroscopy Notation

NMR Spectroscopy

% Chemical shifts
$\delta$ \SI{7.25}{ppm} (s, 5H, Ph)
$\delta$ \SI{3.65}{ppm} (q, $J = \SI{7.1}{Hz}$, 2H, \ce{CH2})

% Coupling constants
$^3J_\text{HH} = \SI{7.5}{Hz}$
$^1J_\text{CH} = \SI{125}{Hz}$

IR Spectroscopy

% Wavenumbers
\SI{3500}{cm^{-1}} (O--H stretch)
\SI{1715}{cm^{-1}} (C=O stretch)
\SI{2950}{cm^{-1}} (C--H stretch)

% Peak descriptions
$\tilde{\nu}$ = \SI{1650}{cm^{-1}} (s, br)

Best Practices

Consistent Notation

Use the same package throughout your document

Define Abbreviations

Define all chemical abbreviations when first used

Use SI Units

Always use siunitx for measurements

Clear Structures

Keep molecular structures simple and readable

Troubleshooting

Common issues:
  • Package conflicts: Don’t load both mhchem and chemformula
  • Font issues: Some chemistry fonts require special setup
  • Compilation: chemfig structures may need multiple passes

Further Reading