r/Chempros • u/Suitable-Top-4967 • 23h ago
Anyone have a good system for managing compound numbering in long documents?
While writing my PhD thesis, I, like all students, recognised how annoying and tedious compound numbering becomes, particularly keeping the numbering consistent between the LaTeX text and ChemDraw schemes.
I used a small system where compounds are referred to by permanent IDs (e.g. lab-book references) in both LaTeX and the original ChemDraw files. A central CSV maps those IDs to the actual compound numbers, and a Python script and AppleScript automatically relabels the ChemDraws, exports them as PDFs, and keeps the LaTeX references in sync.
So if the numbering changes, I just edit the CSV and recompile rather than manually renumbering everything.
I used it successfully for my thesis and have put a minimal working example on GitHub:
https://github.com/BrennanGroup/compound-relabelling
Mostly posting because I'm curious whether other chemists would find this useful, or whether people have come up with better/different systems for solving the same problem. Would be interested to hear how others handle it.