TransWikia.com

Custom label for subcompounds in chemnum

TeX - LaTeX Asked by szentsas on June 12, 2021

Chemnum v1.3 introduced setcmpdlabel and setcmpdproperty to set custom labels for compounds. I would like to do the same for subcompounds, i.e. to be able to set the label of a subcompound to any string that can include the main compound number anywhere in the string but does not necessarily have to do so. I tried setting the counter-representation of the subcompound but that is only a partial solution, as it only allows for strings starting with the main compound’s counter-representation. I know there are a couple of similar questions on TeX.SE already, but I think none of them addresses this issue fully.

Ideally I would like something like setsubcmpdlabel{[mainID]}{[subID]}{[label]} (and an analogous setsubcmpdproperty), where I can reference any (sub)compound(s) and use any other commands to recall text within [label].

Example: cmpd{one.Me} setsubcmpdlabel{one}{Me}{cmpd{one}-Me} cmpd{one.Me} would print 1a 1-Me and cmpd{two.cis} setsubcmpdlabel{two}{cis}{cis-cmpd{two}} cmpd{two.cis} would print 2a cis-2.

(cis is from chemmacros as an arbitrary example for an external command to recall text.)

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP