Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
    
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
add comment

1 Answer 1

up vote 5 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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