first my apologies for not providing a full minimum working example.


I have a large number of (mainly large) tables in the csv format that I wish to include in a LaTeX document.

The job itself is easily achieved with the csvsimple package, calling:


I include my tables using this command:

    \csvautolongtable[respect underscore=true]{table_file.csv}


Some of my tables are too wide to fit onto an A4 page, even in landscape mode. However, I have a number of columns that I do not need to include in the document. (They are nice to have, but not absolutely necessary.)


Can I exclude specific columns while retaining the use of the \cvsautotable command?

In case it helps, this is my header, consistent across the files. The columns I would want to drop are H to Br. Writing a custom header might work, but then I guess it needs a customization of the function to read in the table? (The header includes spaces as well...):

Name,dHf ref.(kJ/mol),DFT E0(Eh),DLPNO E0(Eh),ZPVE(J/mol),Htot(J/mol),H,C,N,O,F,Si,P,S,Cl,Br

(Yes, I saw the manual - and unfortunately I didn't extract a solution from it...)

Many thanks.

1 Answer 1


Thanks to a post from tex.stackexchange ( Importing CSV file as a table in Latex but file too long ), the following approach works:

Rather than excluding columns, only the desired columns are picked. Referring to columns by name would be difficult (due to use of the space character for example), so numbers can be used instead.

The "autotable" function is replaced with a manually defined layout, specifying a longtable and the header. Columns 1 to 6 are given a name and the name is used to specify the columns printed.

table head= Name & $\Delta Hf_{ref}$ (\si{kJ/mol}) & %
DFT $E_0$ (\si{E_h}) & DLPNO $E_0$ (\si{E_h}) & $ZPVE$ (\si{J/mol}) & $Htot$ (\si{J/mol}) \\ \hline\endhead,%
late after line=\\,%
,respect underscore=true]{csv_data_file.csv}
{\Name & \dHfref & \EzeroDFT & \EzeroDLPNO & \ZPVE & \Htot}%

Not the most elegant solution, but it works.

You must log in to answer this question.

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