LaTeX forum ⇒ Math & ScienceError after Superscripts or Subscripts

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

Error after Superscripts or Subscripts

Postby Sassi86 » Wed Jul 31, 2013 10:18 am

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


User avatar
Site Moderator
Posts: 1988
Joined: Sat Apr 16, 2011 7:27 pm

Postby cgnieder » Wed Jul 31, 2013 11:35 am

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
    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.

chemmacros · chemformula · leadsheets · xsim

Return to “Math & Science”

Who is online

Users browsing this forum: No registered users and 2 guests