TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am still generating a table from a cvs file with the pgfplotstable package. In my text I will reference to the generated table but I did not know how to do this. Normal your make a \label{tab:foo} and in the text you can reference to \ref{tab:foo}. How can I do this with the pgfplotstable? For more you can see my code


    Here should be a text which is referencing to the Table~\ref{tab:foo}. But I did not know how to make a label at the table.

        begin table=\begin{longtable},
        end table=\end{longtable},

            col sep=semicolon,
            string type,
            columns/Hersteller/.style={column name=Hersteller, column type={l}},
            columns/Produktname/.style={column name=Produktname, column type={l}},
            columns/Betriebssystem/.style={column name=Betriebssystem, column type={l}},
            columns/Version/.style={column name=Version, column type={l}},
            every head row/.style={before row=\toprule,after row=\toprule},
            every last row/.style={after row=\hline caption={foo}},
share|improve this question
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. A tip: You can use backticks ` to mark your inline code as I did in my edit. – hpesoj626 Dec 29 '12 at 15:03
up vote 7 down vote accepted

You can do it just as with standard LaTeX tabular environments: using the table environment. The referencing mechanism is independent of pgfplotstable (which is nothing more but a generator of tabular environments).

It looks like this:

\pgfplotstabletypeset ...

\caption{The caption}
share|improve this answer
Thanks It is workig fine – felix Dec 29 '12 at 15:26

Your Answer


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.