7

I generate data plots in my LaTeX documentation using a combination of TikZ and pgfplots. Many of the plots are generated using script files which can also include the raw data if data is being plotted. Is there anyway to embed the script files in the plot itself (these could be pgfplots scripts or python code etc)?

The idea is that if someone obtains the pdf file they can extract the script and/or data that actually generated the plot and therefore will be able to reproduce the figure themselves and have at hand the original data that was used.

I saw the message on pdfcomment and it looks very promising. Would pdfcomment be a good way to embed text in plots or are other other possible approaches?

A comment on those who might suggest why not just supply the raw LaTeX file. These documents get submitted to journals, archives (e.g. arXiv) and other repositories where the raw LaTeX file cannot usually be included with the submission.

rhody
  • 1,020

1 Answers1

3

There are a number of existing packages that can be used to attach data (in the form of files) to a pdf file generated from a LaTeX document. pdfcomment is a package that can be used to annotate a LaTeX file with user annotation and comments. The other possibility includes the packages attachfile and attachfile2. Files can be attached to specific points in the PDF file using these packages. Thus a graph can have the raw data attached to it. In the final pdf, attachments are indicated with icons and double clicking on the icon will bring up the appropriate external application to view the attached file.

rhody
  • 1,020