3

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:

functional group

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.

1
  • 2
    You could use \ch{Cl\bond{sb}}, see the manual of the chemformula package (which is the one defining \ch) – cgnieder Nov 8 '20 at 10:52
3

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

enter image description here

\documentclass{article}
\usepackage{chemmacros}

\begin{document}
\ch{Cl-Cl}

\ch{Cl{-}}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.