I have two separated documents, compiled independently and residing in two completely different folders. I heavily rely on the chemnum
package to assign numbers to the many molecules I have in both documents.
I would like to cross-reference this numbering system: if I create a compound label in document1 I would like document2 to recognise that such number has already been assigned and avoid the creation of a new label when \cmpd{...}
is invoked in document2.
If the cross-referencing worked both ways (possibly using some sort of auxiliary file shared between the two documents) it would be even better.
I already triedxr
, which seems to work fine for normal labels, i.e. the ones invoked by \label{...}
but it doesn't seem to be compatible with chemnum entries in the aux files.
I know I could use \setchemnum{init}
and define my compounds labels before using them but this defies the point of automatic labelling introduced by chemnum
Does anyone have any suggestions?
MWE:
document1.tex
\documentclass{article}
\usepackage{chemnum}
\begin{document}
\cmpd{compoundA, compoundB, compound C}
\end{document}
document2.tex
\documentclass{article}
\usepackage{chemnum}
\begin{document}
\cmpd{compoundB}
\end{document}
I would like document2 to print \cmpd{compoundB} as 2, not 1.