# Chemical functional groups: in chemmacros package, selectively interpret dash or similar as a bond, not as a charge

I am using the ch command in the chemmacros package to typeset chemical formulas. I would like to typeset chemical functional groups. Here is my MWE:

\documentclass{article}
\usepackage{chemmacros}

\begin{document}

\noindent%
\ch{Cl-Cl}\\
\ch{Cl-}\\
\ch{-Cl}\\
\noindent%
How do I obtain Cl-- using \verb=\ch=?

\end{document}


... which gives this output:

How can I get ch to interpret Cl- or similar as the functional group Cl, rather than the ion Cl? The dash - here is a bond, not a charge? If possible, I would like this to be done selectively (i.e., when I specify), not every time.

• You could use \ch{Cl\bond{sb}}, see the manual of the chemformula package (which is the one defining \ch) Nov 8, 2020 at 10:52

You can enclose the - in a set of {} to "hide" it from chemmacros/chemformula:
\documentclass{article}