2

I have asked simmilar question (Pgfplotstable using longtabu), but unforunately with no answer/solution...

There is most simple (but for me still important) example I can provide:

\documentclass[10pt, a4paper]{article}
\usepackage{filecontents}
\usepackage{pgfplotstable}
\usepackage{longtable}  
\pagestyle{empty}
\pgfplotstableset{
    col sep=semicolon,
    string type,
    trim cells,
    header=has colnames,
    skip coltypes=true,
     every head row/.append style={
        after row=\endhead},
     every last row/.style={after row=\hline},
}
\begin{filecontents}{data.csv}
date;       grade
2016-01-01; \textbf{A}
2016-01-15; B
2016-01-01; A
2016-01-15; B
2016-01-01; A
2016-01-15; B
\end{filecontents}

\begin{document}    
\vspace*{19.7cm}

\pgfplotstabletypeset[
    begin table=\begin{longtable}{@{}|c|c|@{}},
    end table=\end{longtable},
    columns={%
        date,
        grade},
    columns/date/.style={column name={Date}},
    columns/grade/.style={column name={Grade}},
]{data.csv}

\end{document}

What is the correct way to define longtable header/footer inside pgfplotstable environment to avoid "duplicated header" showed in this exaplmple??

Thank you VERY much in advance for any help or suggestion!!

Best regards,

Lubos

1

That's not really a pgfplotstable problem. You can get it with a simple longtable too when the start of the table is near the bottom of the page:

\documentclass[10pt, a4paper]{article}

\usepackage{longtable}
\usepackage{needspace}
\begin{document}
\vspace*{19.7cm}

%\Needspace{4\baselineskip} 
\begin{longtable}{@{}|c|c|@{}}
date;       grade\endhead
2016-01-01; A\\
2016-01-15; B\\
2016-01-01; A\\
2016-01-15; B\\
2016-01-01; A\\
2016-01-15; B
\end{longtable}
\end{document}

enter image description here

Use e.g. \Needspace to force a page break before the table.

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.