I like using pgfplotstable because I can feed data in tables directly to it and generate a latex table. However, not all of my coauthors have the right packages to compile pgf-enabled latex.

Since pgfplotstable merely generates latex source for the tabular environment, I was wondering if there was a way to extract the output source and plug that directly into a latex file ?

Update: I thought Christian's answer would work, but it doesn't appear to. Here's an MWE - the original file compiles and produces output, but the source code is not captured in the file tablespace.tex

 \pgfplotstabletypeset[outfile=tablespace.tex,columns = {a,b}]{
a b
    5000 1.234e5
    6000 1.631e5
    7000 2.1013e5
    9000 1000000

Up-Update: problem solved although I'm not sure how.

  • My intent with this MWE was to capture the LaTeX source for the table in the file tablespace.tex. that file is not created. – Suresh Nov 11 '12 at 22:10
  • hmm. I'm using pdflatex/latex as the command, with or without -shell-escape (doesn't make a difference) – Suresh Nov 11 '12 at 22:26
  • There isn't: in fact there's no mention of tablespace at all, which is what's confusing me. – Suresh Nov 11 '12 at 22:38
  • let us continue this discussion in chat – Suresh Nov 11 '12 at 22:40

Yes: use the outfile={<outputfilename>} option.

If your coauthors do not have PGF installed, you can set


and the resulting output file will be completely independent of pgfplotstable.

You can even use the feature to modify the output files manually - and to tell pgfplotstable that the existing output file should be included as-is, without considering the input data. If you need that as well (perhaps in order to get a first starting point of the conversion), you can use the option include outfiles.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.