# Extracting source from pgfplotstable

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

\documentclass{article}
\usepackage{pgfplotstable}
\begin{document}
\pgfplotstabletypeset[outfile=tablespace.tex,columns = {a,b}]{
a b
5000 1.234e5
6000 1.631e5
7000 2.1013e5
9000 1000000
}
\end{document}


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
–  Suresh Nov 11 '12 at 22:40

## 1 Answer

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

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

\let\pgfutilensuremath=\ensuremath


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.

-