# Header wrapped over two lines with pgfplotstable

I have a table produced by pgfplotstable. I want to force two headers to wrap on two lines but I can't get it working.

This is in my script:

\documentclass{article}

% Set the values for the biblography
\usepackage[
isbn=false,
url=false,
doi=false,
eprint=false,
]{biblatex}

% For tables
\usepackage{pgfplotstable}
\usepackage{booktabs}
\usepackage{array}
\usepackage{caption}

\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}

\pgfplotstableset{
font={\small},
empty cells with={--}, %  replace empty cells with ’--’
every last row/.style={after row=\bottomrule}
}

\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}

%Set column width (This is my fix...)
\setlength{\tabcolsep}{3.5pt}

% Create command for paragraph style (new line after)
\newcommand{\myparagraph}[1]{\paragraph{#1}\mbox{}\\}

\begin{document}

\myparagraph{paragraph}
Blalalala

\begin{table}
\caption{My table}
\centering
\pgfplotstabletypeset[
columns/City/.style={string type},
columns/Wrap it/.style={column type=|C},
col sep=comma]{table.csv},
\end{table}

\end{document}

I got the error Paragraph ended before \NC@find was complete. before the \end{table} line.

This is my table.csv

City,Wrap it
London,12
Paris,12
Rome,323

I want the header "Wrap it" to be on two lines, so to reduce the width of only the second column.

• Can you make a MWE with a few lines of data? It's not clear from what you have described. – percusse Aug 13 '13 at 8:27
• Sorry what's a MWE? – Francesco Aug 13 '13 at 8:44
• Oops,sorry. That's a minimal working example that starts with \documentclass{...} all the way to \end{document} that replicates the issue. Here is more info about MWE – percusse Aug 13 '13 at 9:00
• Well, thank you for taking care of my misfortunes... – Francesco Aug 13 '13 at 9:18

You need to either remove the argument from the column declaration or use C{2.5em}. Then your example works without any problems.

\documentclass{article}
\usepackage{pgfplotstable,booktabs,array}

\newcolumntype{C}{>{\centering\arraybackslash}m{2.5em}}

\pgfplotstableset{
font={\small},
empty cells with={--}, %  replace empty cells with ’--’
every last row/.style={after row=\bottomrule}
}

\begin{document}

\begin{table}
\caption{My table}
\centering
\pgfplotstabletypeset[
columns/City/.style={string type},
columns/Wrap it/.style={column type=|C},
col sep=comma]{
City,Wrap it
London,12
Paris,12
Rome,323
},
\end{table}

\end{document}