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 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

\usepackage{pgfplotstable}
\usepackage{booktabs}
    \begin{document}

    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.

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

        \pgfplotstabletypeset[
            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}},
            ]{./files/NFCDeviceTabletStand20121230.csv}
\end{document}
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

1 Answer 1

up vote 3 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:

\begin{table}
\pgfplotstabletypeset ...

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

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.