4

I have come across something weird with the chemnum package. I am trying to have my compound numbers in the pdf bookmarks. So I am using \texorpdfstring{}{} within my section titles. However, the sub-labels are not being printed when using \submaincmpdplain{}{} or \subcmpdplain{}{}. This only occurs when the compounds have been initiated with sub-labels within \initcmpd{}. For my document it is vital I use this.

Any ideas for a fix?

MWE:

\documentclass{article} 

\usepackage{chemnum}
\initcmpd{%
    cmpd.{aa,bb},
    cmpd.cc,
}

\begin{document}
    \cmpd{cmpd.aa}, \submaincmpdplain{cmpd}{aa}.

    \cmpd{cmpd.bb}, \submaincmpdplain{cmpd}{bb}.

    \cmpd{cmpd.cc}, \submaincmpdplain{cmpd}{cc}.

    \cmpd{cmpd.dd}, \submaincmpdplain{cmpd}{dd}.

    \cmpd{cmpd.ee}, \submaincmpdplain{cmpd}{ee}.

    \cmpd{cmpd.ff}, \submaincmpdplain{cmpd}{ff}.
\end{document}

enter image description here

PS: I have already reported this on GitHub.

1

This is a bug which is fixed in the currrent version v1.2c (2019/10/02):

\documentclass{article} 

\usepackage{chemnum}[2019/10/02] % v1.2c or newer

\initcmpd{
  cmpd.{aa,bb} ,
  cmpd.cc ,
}

\begin{document}

\cmpd{cmpd.aa}, \submaincmpdplain{cmpd}{aa}.

\cmpd{cmpd.bb}, \submaincmpdplain{cmpd}{bb}.

\cmpd{cmpd.cc}, \submaincmpdplain{cmpd}{cc}.

\cmpd{cmpd.dd}, \submaincmpdplain{cmpd}{dd}.

\cmpd{cmpd.ee}, \submaincmpdplain{cmpd}{ee}.

\cmpd{cmpd.ff}, \submaincmpdplain{cmpd}{ff}.

\end{document}

enter image description here

0

I ran into this as well. No matter what I did, I couldn't get the sublabels to work when initiated in the preamble. I used a little workaround instead:

in the preamble:

\initcmpd{%
    cmpd
}

and right after \begin{document}:

\cmpd*{cmpd.{aa,bb,...}}

Still doesn't fix the main issue, but works for now...

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.