This question was already asked on GitHub. The author of the great chemnum package initially proposed that one can define custom labels for chemical compounds. This is very useful when referencing compounds with only slightly differing substituents.
A MWE looks like this:
% arara: pdflatex
\documentclass{article}
\usepackage{chemnum}
\usepackage{chemformula}
\usepackage{hyperref}
\ExplSyntaxOn
\NewDocumentCommand \setcmpdlabel {mm}
{ \chemnum_compound_set_property:nnn {#1} {counter-representation} {#2} }
\ExplSyntaxOff
\cmpd*{Me2bdc}
\setcmpdlabel{Me2bdc}{\ch{Me2L^1}}
\cmpd*{H2bdc}
\setcmpdlabel{H2bdc}{\ch{H2L^1}}
\begin{document}
\section{About \texorpdfstring{\cmpd{Me2bdc}}{\cmpdplain{Me2bdc}}}
Lorem ipsum.
\section{About \texorpdfstring{\cmpd{H2bdc}}{\cmpdplain{H2bdc}}}
Lorem ipsum.
\end{document}
and will produce the following PDF output:
Within the section titles, the compounds Me2L1 and H2L1 (which are internally assigned by chemnum to <ID> 1 and 2, respectively) are represented as desired. However, the PDF bookmarks (left column) show the values of <ID> instead of Me2L1 (H2L1). How can I bring the user-defined values to PDF bookmarks? \cmpdproperty{H2bdc}{counter-representation} will also not print the value of counter-representation.
I'm aware that the inclusion of subscripts/superscripts within PDF bookmarks may need conversion to appropriate Unicode chars and maybe somebody has an idea on how to achieve this. It may be preferable to define a PDF bookmark representation for every user-defined compound, I guess?
Thanks for your help!


chemnumpackage, i.e. automatic numbering of "compounds". Why not just usemhchem?\section{About \ce{Me2L^1}}does exactly what you want, I think. – schtandard Jun 07 '20 at 13:02L^1andL^2when they are defined in the preamble to reflect the order of occurrence within the document. Using\ce{Me2L^1}(or, using chemformula:\ch{Me2L^1}) would require to adjust every single occurrence of everyLthroughout the document. – tstone-1 Jun 07 '20 at 18:21