Some places hosting academic documents want to have all figures, tables and their captions provided in separate files.
Of course, I can copy everything from my ready-made PDF by hand, but I'd love to have a way to do this in a more programmatic fashion. Also, there are some inherent problems, like references and citations not working correctly, as even though packages like xr or xcite are probably useful, with a sufficiently complicated setup (biblatex+biber+backref) they don't really work.
Here's what I'm thinking:
I could try to patch the table and figure environments to, in addition to displaying their contents, write them to one (or more) external files, using \documentclass{standalone}.
These patched environments could then provide a patched \caption command that would again write it's content to a text file.
For this, I would need to pay attention to fully expand the contents of the figure and table environments as well as the captions, to make sure that all the references and citations map to the correct numbers, labels, etc, and of course, the result will never be perfect, but editing the files by hand will probably still be less work than doing everything from the beginning.
I'm unsure if this is a reasonable project to attempt, and if there are any obvious pitfalls I'm overlooking, or if there might be a package that already does what I'm hoping for.