I want to have my numbered compounds in bold throughout my text but I want them to have a different format when used in section headers. I tried using the command \cmpd+[format=\normalfont]{label} but the format option doesn't work with \cmpd+ (or \refcmpd).
MWE:
\documentclass{report}
\usepackage{chemnum}
\usepackage{titlesec}
\titleformat{\section}{\slshape}{\thesubsection}{1em}{}{}
\begin{document}
\section{Preparation of \cmpd+{compoundA}}
We made \cmpd{compoundA}.
\section{Preparation of \cmpd+[format=\slshape]{compoundA}}
We made \cmpd{compoundA}.
\section{Preparation of \cmpd[format=\slshape]{compoundA}}
We made \cmpd{compoundA}.
\end{document}
Is there a way to get the format options to work with \cmpd+?
As mentioned in the comments the problem arises when one wants a Table of Contents. My format style prevents me from using bold in the table of contents, yet the compound numbers should be bolded in the text. Clearly I must use \cmpd+ to avoid numbering the compound at the beginning, but no matter what I do it does not take any format arguments.
\cmpd*and then use the formatted\cmpdin the section title (and subsequently the regular\cmpdin the section text)? – Marijn May 28 '19 at 14:00\cmpd+was to avoid it defining the compound in the Table of Contents, which is what I'm having trouble with. – ralk912 Jun 15 '19 at 02:36