Discussion:
Amsmath problem
(too old to reply)
db
2024-06-23 14:49:17 UTC
Permalink
I wrote this mini-example:

\documentclass[12pt,fleqn,A4,danish]{article}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[text={14cm,20cm},centering]{geometry}
\begin{document}
\title{Amsmath problem}
\author{}
\date{}
\maketitle
Bla bla $\mathrm{AuCl_4^−}$ and $\mathrm{TOA^+}$

\end{document}

and get this result:

...
! Missing { inserted.
<to be read again>
\begingroup
l.10 bla bla $\mathrm{AuCl_4^−}
$ and $\mathrm{TOA^+}$
?

On a suggestion of a friend I tried ${\mathrm{AuCl_4^−}}$

with the same result. I also tried his suggestion
to use mhchem, i.e.

\ce{[AuCl4]^-}

and this didn't work either (yes, I did add
\usepackage{mhchem} )

This is supposed to work, and does on my
friend's machine. Could this be a defective
texlive, or am I really doing something
wrong?
--
db
Marckus
2024-06-23 16:29:40 UTC
Permalink
Hi!

If I compile your example I get the same error message too.
Post by db
Bla bla $\mathrm{AuCl_4^−}$ and $\mathrm{TOA^+}$
Whilst disassembling your lines, I get an error code for the -:
Unicode character − (U+2212) not set up for use with LaTeX.

Does this help you?

Cheers
Marckus
Post by db
\documentclass[12pt,fleqn,A4,danish]{article}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[text={14cm,20cm},centering]{geometry}
\begin{document}
\title{Amsmath problem}
\author{}
\date{}
\maketitle
Bla bla $\mathrm{AuCl_4^−}$ and $\mathrm{TOA^+}$
\end{document}
...
! Missing { inserted.
<to be read again>
\begingroup
l.10 bla bla $\mathrm{AuCl_4^−}
$ and $\mathrm{TOA^+}$
?
On a suggestion of a friend I tried ${\mathrm{AuCl_4^−}}$
with the same result. I also tried his suggestion
to use mhchem, i.e.
\ce{[AuCl4]^-}
and this didn't work either (yes, I did add
\usepackage{mhchem} )
This is supposed to work, and does on my
friend's machine. Could this be a defective
texlive, or am I really doing something
wrong?
Denis Bitouzé
2024-06-23 18:55:23 UTC
Permalink
Post by db
\documentclass[12pt,fleqn,A4,danish]{article}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[text={14cm,20cm},centering]{geometry}
\begin{document}
\title{Amsmath problem}
\author{}
\date{}
\maketitle
Bla bla $\mathrm{AuCl_4^−}$ and $\mathrm{TOA^+}$
\end{document}
The following, relying on `chemformula`, works nicely with an up to
date TeX Live 2024:

--8<---------------cut here---------------start------------->8---
\documentclass{article}
\usepackage{chemformula}
\begin{document}
Bla bla \ch{AuCl4^−} and \ch{TOA^+}.
\end{document}
--8<---------------cut here---------------end--------------->8---
--
Denis
Mauro Orlandini
2024-06-25 06:41:38 UTC
Permalink
\maketitle Bla bla $\mathrm{AuCl_4^−}$ and $\mathrm{TOA^+}$
The problems comes from the minus sign on the first chemical formula. You
did not use the keyboard minus sign but the slash symbol.

Your minus sign: −
Keyboard minus sign: -

If you substitute it, then it will work.

Ciao, Mauro

Loading...