1

Using mhchem version 4 (ubuntu 15.10), the simple \ce{CH2O} inserted in a report document results in CH[t]2O with "[t]2" being in subscript. Am I missing something obvious (cant' see nothing related in mhchem manual)?

\documentclass[french]{report}
\makeatletter \makeatletter
\@namedef{[email protected]}{}
\makeatother \usepackage{amstext}
\usepackage[version=4]{mhchem}
\usepackage[load-configurations = abbreviations]{siunitx}
\sisetup{locale = FR,detect-all}
\sisetup{inter-unit-product=\ensuremath{\cdot}}
\makeatother \usepackage{babel}
\begin{document}
\title{\textsc{Bla}}
\author{NiFe}
\maketitle
\chapter{Blabla}
Blabla
\section{1}
\ce{CH2O}
\end{document}
8
  • Hard to say, please provide a full minimal example that we can copy and test on our own systems (without having to add anything)
    – daleif
    Dec 1, 2015 at 13:42
  • @NiFe a minimal example would be \documentclass{article} \usepackage[version=4]{mhchem} \begin{document} \ce{CH2O} \end{document} (which works just fine for me)
    – cgnieder
    Dec 1, 2015 at 13:53
  • Thanks, hope the following example is minimal enough: \documentclass[french]{report} \makeatletter \makeatletter \@namedef{[email protected]}{} \makeatother \usepackage{amstext} \usepackage[version=4]{mhchem} \usepackage[load-configurations = abbreviations]{siunitx} \sisetup{locale = FR,detect-all} \sisetup{inter-unit-product=\ensuremath{\cdot}} \makeatother \usepackage{babel} \begin{document} \title{\textsc{Bla}} \author{NiFe} \maketitle \chapter{Blabla} Blabla \section{1} \ce{CH2O} \end{document}
    – NiFe
    Dec 1, 2015 at 13:55
  • 1
    What is that \@namedef{[email protected]}{} doing? Remove it and the example works just fine.
    – daleif
    Dec 1, 2015 at 14:01
  • 1
    @NiFe \@namedef{[email protected]}{} prevents mhchem from loading amsmath but it needs amsmath in order to work properly!
    – cgnieder
    Dec 1, 2015 at 14:04

1 Answer 1

2

\@namedef{[email protected]}{} fools \RequirePackage{amsmath} or \usepackage{amsmath} into thinking that amsmath is already loaded.

This prevents mhchem (or any other package) from loading amsmath but mhchem needs amsmath in order to work properly!

Remove the line and your example compiles file.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .