Let's say I have a table like


which I save as a .csv

and then import with latex like so:



\begin{adjustbox}{max width=0.9\textwidth}
\caption{blah blah blah etc.}

This won't compile (see error message below).

But if I move the formulae from the header cells to some other cells, e.g.

experiment,N,Z[ms],X[requests/ms],R [ms],N/X-Z,difference[ms],rel.difference
S=3 write-to-1,690,0,15.0258730823,47.8550460251,45.9207925038,-1.9342535213,-4.0419008693
S=3 write-to-2,690,0,14.8651324965,48.817562994,46.4173461059,-2.4002168881,-4.9167077193
S=3 write-to-3,690,0,14.6532775453,49.1099377034,47.088441331,-2.0214963724,-4.1162674337
S=5 write-to-1,690,0,13.0724002789,55.1449088796,52.7829614514,-2.3619474282,-4.2831649852
S=5 write-to-3,690,0,13.1264672245,54.9158028824,52.5655523452,-2.3502505371,-4.2797344549
S=5 write-to-5,690,0,12.5929567643,57.5819507206,54.7925330734,-2.7894176472,-4.8442569455
S=7 write-to-1,690,0,11.9808507671,59.7164732682,57.5919033977,-2.1245698706,-3.5577617938

things work fine:

enter image description here

So I guess this has something to do with the way autobooktabular is treating the headers.

How do I get the table to parse the headers correctly?

Error msg:

<to be read again>
l.198 \csvautobooktabular[]{csvs/test.csv}
The control sequence marked <to be read again> should
not appear between \csname and \endcsname.
! Missing } inserted.
<inserted text>
l.198 \csvautobooktabular[]{csvs/test.csv}
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.
! Missing $ inserted.
<inserted text>
l.198 \csvautobooktabular[]{csvs/test.csv}
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.
! Extra }, or forgotten $.
<argument> ...ad/${\begingroup N\endgroup \over X}
l.198 \csvautobooktabular[]{csvs/test.csv}
I've deleted a group-closing symbol because it seems to be
spurious, as in `$x}$'. But perhaps the } is legitimate and
you forgot something else, as in `\hbox{$x}'. In such cases
the way to recover is to insert both the forgotten and the
deleted material, e.g., by typing `I$}'.
! Extra \endcsname.
\pgfkeyslet ...ter \let \csname pgfk@#1\endcsname
l.198 \csvautobooktabular[]{csvs/test.csv}
I'm ignoring this, since I wasn't doing a \csname.
Runaway argument?
\pgfkeyssetvalue {/csv head/${\begingroup N\endgroup \over X}-Z$/.@bo\ETC.
! File ended while scanning use of \pgfkeys@temp.
<inserted text>
<*> myFile.tex
I suspect you have forgotten a `}', causing me
to read past where you wanted me to stop.
I'll try to recover; but if the error is serious,
you'd better type `E' or `X' now and fix your file.
! Emergency stop.
<*> myFile.tex
*** (job aborted, no legal \end found)
Here is how much of TeX's memory you used:
10433 strings out of 495000
168406 string characters out of 6181170
367801 words of memory out of 5000000
13477 multiletter control sequences out of 15000+600000
10920 words of font info for 39 fonts, out of 8000000 for 9000
14 hyphenation exceptions out of 8191
54i,12n,92p,1177b,330s stack positions out of 5000i,500n,10000p,200000b,80000s
! ==> Fatal error occurred, no output PDF file produced!
  • 1
    Please post code people can compile to reproduce the error message you report. It cannot be reproduced from mere fragments. – cfr Dec 24 '16 at 4:28

It seems \frac is too fragile to put it in a header that is interpreted by the csv reader. You could change the header entry to N/X-Z and then specify the nice header yourself.

\csvautobooktabular[table head={\toprule  experiment &  N &  Z[ms] &  X[requests/ms] &  R [ms] & $\frac{N}{X}-Z$ & difference[ms] & rel.difference \\\midrule}]{table.csv}

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.