I am new to LaTeX and am compiling a document right now using TeXworks. I am trying to create CSV tables into my document right now, and although I succeed in between I must have some small bug in the code which I just cannot spot (trust me I looked for hours).

My code is the following:


% Load packages


\usepackage{datatool} % Allows importing tables
\usepackage{enumerate} % Allows latin I option







Latex gives me the following errors:

Error 1

! Argument of \@dtl@trim has an extra }.
<inserted text> 
l.34 \beginstable}

Error 2

LaTeX Warning: Unused global option(s):

Error 3

Package geometry Warning: The marginal notes overrun the paper.
     Add 21.7975pt and more to the right margin.

closed as too localized by Jake, Stefan Kottwitz Apr 24 '12 at 17:02

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. If this question can be reworded to fit the rules in the help center, please edit the question.

  • I never even knew you could do that with LaTeX so I'm afraid I'm not of much help here but if you don't need to load changing tables over and over again but just have one table that you want to show in a document, you can import CSV in gnumeric and export it as LaTeX document or LaTeX fragment. That would also allow some formatting in the table (which you can then do WYSIWYG-style). – Christian Apr 24 '12 at 15:44
  • Welcome to TeX.sx! A tip: If you indent lines by 4 spaces, they'll be marked as a code sample. You can also highlight the code and click the "code" button (with "{}" on it). – topskip Apr 24 '12 at 15:48
  • 1
    @Max: Could you provide a dummy sample of your datafile? – Jake Apr 24 '12 at 15:51
  • Errors 2 & 3 are not really errors but warnings. That aside, Could you give more detail (in terms of the .log output) for error 1? What is written before "undefined"? – Werner Apr 24 '12 at 15:52
  • As Jake says, we really need the table_test.csv file. I understand if that you may not want to provide that complete file, but what I would recommend is that you start removing chunks of that file until the error goes away - then you know that the problem was in the last chunk you deleted. Repeat this process until you are able to get the table_test.csv as small as possible. If the problem is not obvious, you could post that here, and change any confidential text. – Peter Grill Apr 24 '12 at 16:47

May I suggest you to use pgfplotstable? It works great with CSV files and gives you a lot of control. Here's a nice example:


% recommended:

\pgfplotstableset{col sep=comma}


    % Sort the values 
    sort, sort key=error2,
    % The columns to be printed
    % Columns styles
        % Name
        column name=$L_2$,
        % Notation and padding
        sci,sci zerofill, sci subscript,
        sci, sci sep align, 
        column name=\textsc{Dof}},
        column name=slopes $L_2$,
        fixed, fixed zerofill,
        % Align decimal deparators
        dec sep align, 
    % Some colors.
    every even row/.style={
        before row={\rowcolor[gray]{0.9}}},
    every head row/.style={
        before row=\toprule,after row=\midrule},
    every last row/.style={
        after row=\bottomrule},


Nice and neat table

Not the answer you're looking for? Browse other questions tagged or ask your own question.