Math & ScienceError after Superscripts or Subscripts

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

Error after Superscripts or Subscripts

Post by Sassi86 »

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 :-)

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Error after Superscripts or Subscripts

Post by cgnieder »

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. package mhchem: this is loaded by adding

    Code: Select all

    \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

    Code: Select all

    \usepackage{chemmacros}
    In the document you can then use ERT \ch{H2O} to get the formula of water.
Regards
site moderator & package author
Post Reply