I'm currently trying to import a set of data from a file (comma or tabbed delimited, doesn't matter) for creating a table. Below is an example of this data (DH parameters in case you're curious):

Link    \alpha      a   \theta      d
0   0               0   0           0
1   \frac{\pi}{2}   0   \theta_{1}  340
2   \frac{-\pi}{2}  0   \theta_{2}  0
3   \frac{-\pi}{2}  0   \theta_{3}  400
4   \frac{\pi}{2}   0   \theta_{4}  0
5   \frac{\pi}{2}   0   \theta_{5}  400
6   \frac{-\pi}{2}  0   \theta_{6}  0
7   0               0   \theta_{7}  0

I've tried both pgfplots and csvsimple without any success. From the errors I receive, they always seem to have difficulty with the special characters. Interestingly, csvsimple's example with "Weißbäck" only works if "Weißbäck" isn't in the header row.

Would anyone happen to have a workflow for import non-standard data with special symbols for tables?

*** EDIT: Simple Test Cases Below...

= Given Tex file:






= Given test.csv (to prove simple case works):


= Given test2.csv:

  • ERROR: ! Package csvsimple Error: File './csv/test2.csv' starts with an empty line!.

= Given test2.csv:


ERROR: ! Missing \endcsname inserted. \OT1\ss l.9 \csvautotabular{./csv/test2.csv} The control sequence marked should not appear between \csname and \endcsname. ! Extra \endcsname.

= Given test2.csv (similar to csvsimple example, but special character is in header row):


ERROR: ! Package csvsimple Error: File './csv/test2.csv' starts with an empty line!.

= Given test2.csv (similar to csvsimple example, special character is in the body):


Works as expected!

  • 2
    Welcome to TeX.SX! Could you show your attempt with pgfplots and csvsimple?
    – egreg
    Apr 14, 2015 at 20:53
  • Is this specific to tables or are non-English characters a general problem? What font encoding or other (language-related) packages are you using?
    – Fato39
    Apr 14, 2015 at 21:37

1 Answer 1


Your question is quite general and such not easy to answer. But, if I understand you right, you want to use special characters in your table head and you want to read them from your csv file.

The \csvautotabular macro is intended for quick survey only and not for productive tables, since it is quite restricted. \csvreader or \csvloop are indented for normal usage.

To use the first line of a csv file as normal data line, you have to say no head and also to give column count since this first line is not read as pattern. Then, this line can be used as data line.

Still, there is and will be an important restriction: A line is not allowed to start with a backslash \.

Now, here comes an example:





  no head,              % no special treatment of first line
  column count=3,       % since no first line is given, tell about column count
  before reading=\begin{tabular}{|l|l|l|}\hline,
  late after line=\\,
  late after first line=\\\hline,
  late after last line=\\\hline,
  after reading=\end{tabular}


enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .