I use the \pgfplotstableread{}
command of the pgfplotstable
package and manually type in a table.
\documentclass{article}
\usepackage{pgfplotstable}
\begin{document}
\pgfplotstableread{
Col1 Col2
p0 Text0
p1 Text1%blabla
p2 Text2
p3 Text3
}\mytable
\end{document}
There seems to be a bug with comments at the end of rows. With the provided example, I am getting the following error:
Package pgfplots Error: Table '<inline_table>' appears to have too many columns in line 3: Ignoring 'Text2'. PGFPlots found that the number of columns is larger than the previously determined number of columns. Please verify that every cell entry is separated correctly (use braces {} if necessary. Also verify that column names are plain ASCII.). This error is not critical.
I am not sure what's going on but when I remove %blabla
, the document compiles just fine. Until now, I thought that comments at the end of lines were "invisible" in Latex.
pgfplots
, but what I think is happening is that the%
is suppressing the line ending, which is needed to make a correct column count. Try adding a space before the%
. (Just a guess; not tested.)p1 Text1^^M%blabla
%
may end up removing a space, if it is not preceded by a space character. // The effect is more pronounced when you are in\obeylines
where the end of line character is converted to\par
instead of a space. // Your question is about another context where the presence of the end of line character matters.%
does not solve the issue but I now understand the issue.