Math & Sciencepreview-latex and mhchem

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
Tadeusz
Posts: 1
Joined: Fri Mar 02, 2012 2:34 am

preview-latex and mhchem

Post by Tadeusz »

Hi,

I am using the mhchem package for writing chemical formulas. Preview-latex displays them correctly in Emacs when the command \ce is inside the math environment, but not when \ce is inside the regular text. After reading documentation I have added:

Code: Select all

\PreviewMacro[{{}}]{\ce}
to the preamble and now the chemical formulas are displayed correctly both in regular text and in math environment. However, the rest of the math is not. For example, $\alpha \ce{Al2O3}$ is displayed as:
"$\alpha Al2O3$" (with 2 and 3 in subscripts), while without \PreviewMacro I can see the Greek letter alpha and correctly formatted formula. Is it possible to have a correct preview of everything in both text and math mode?

Thanks!
Tad

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

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

preview-latex and mhchem

Post by cgnieder »

This has also been asked here.

Regards
site moderator & package author
Post Reply