3

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.

carsten
  • 2,966
  • I'd like a package that would do that – Elad Den Oct 26 '20 at 10:21
  • Take a look here https://tex.stackexchange.com/a/140869/90297 – Elad Den Oct 26 '20 at 10:27
  • 1
    I think that the suggested solutions do not apply to my case, as they mostly focus on having one additional file with all the figures and tables, whereas I would need one file per figure and table. From looking at the solution, it doesn't look like it can be easily adjusted to my usecase, but if you think it's possible, I'm happy to try if you can give a few pointers. – carsten Oct 26 '20 at 12:11
  • You can use endfloat to pull all tables and figures (source) into ttt and fff files (respekctively), albeit in a separate run. See https://tex.stackexchange.com/questions/423109/export-each-figure-as-a-separate-pdf-file/423253?r=SearchResults&s=10|24.8772#423253. – John Kormylo Oct 26 '20 at 15:02
  • What you are looking for is done by tikz externalize, but only for tikz figures! – Simon Dispa Oct 26 '20 at 17:32

0 Answers0