## LaTeX forum ⇒ Math & Science ⇒ Error after Superscripts or Subscripts

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Sassi86
Posts: 1
Joined: Wed Jul 31, 2013 10:04 am

### Error after Superscripts or Subscripts

Hello all

I've a huge problem. I'm writing my bachelor thesis in LyX and because I'm doing sciences I have a lot numbers to superscript or subscript like in CO2 or H2O the 2 has to be smaller and down.

After superscripts or subscripts I always get an error message and this leads to the fact, that I can't open my document in PDF anymore. What can I do?

Would be nice if somebody could help me

Tags:

cgnieder
Site Moderator
Posts: 1993
Joined: Sat Apr 16, 2011 7:27 pm
Hi Sassi86,

Welcome to the LaTeX community!

It is impossible to tell what is happening unless you show as a minimal example document that let's us reproduce the error.

However, there are two packages that allow easy input of chemical formulae:

1. \usepackage[version=3]{mhchem}

to the preamble.
In the document you can then use ERT \ce{H2O} to get the formula of water.
2. package chemmacros (or rather it's subpackage chemformula) -- needs an up to date TeX distribution: this is loaded by adding
1. \usepackage{chemmacros}

In the document you can then use ERT \ch{H2O} to get the formula of water.

Regards
site moderator & package author