I am quite new to LateX and I have been trying for the past few days to do a Shell escape in Miktex 2.9/ TeXworks in my pdflatex+Makeindex+bibtex typesetter so that I could be able to use the CSVsorter presented in the CSVsimple package.

I tried the methods presented Here, and Here.

When I try to compile my tex

\csvreader[sort by=table/namesort.xml,
head to column names,
table head=\toprule year of birth\\\midrule,
table foot=\bottomrule]

I obtain this error :

sort "./table/csvsimple-example.csv" by "./table/namesort.xml">

("C:...\My tex.csvtoken"

! Package csvsimple Error: Call of CSV-Sorter failed! Use '-shell-escape' optio n or check log file 'csvsorter.log'..

See the csvsimple package documentation for explanation. Type H for immediate help. ...

l.1 ...ption or check log file 'csvsorter.log'.}{}

But I have no log file to start with. So I don't know if it is a programming error or a problem to configure -shell-escape

Thank you

  • Have you been able to do the command line example from t-f-s.github.io/csvsorter ? That's everything between Example and Example (continued for LaTeX). If that does not work, the problem is, maybe, the Java installation and not LaTeX. – Thomas F. Sturm Mar 18 '15 at 7:12
  • CSVsorter works (I tried Example has ask) but I tried calling the csvsorter in latex has in the example (continued for LateX) and it didn't I received this log : <sort "songcontest.csv" by "./sumsort.xml"> runsystem(csvsorter -c "./sumsort.xml" -l "csvsorter.log" -t "csvcmdex.csvtoken " -i "songcontest.csv" -o "csvcmdex_sorted._csv" -q 1)...disabled (restricted). ("C:\Users\Simon.Aperture\Desktop\Test latex\cvs cdmex\csvcmdex.csvtoken" ! Package csvsimple Error: Call of CSV-Sorter failed! Use '-shell-escape' optio n or check log file 'csvsorter.log'.. – Simon Boucher Mar 19 '15 at 3:08

Since the command line version works for the OP, it looks like a TeXWorks setup problem.

The following additions to the TeXWorks compilation options work for me. I am sorry for german texts in the screenshots from my PC.

The first one is for setting up a pdfLaTeX compile option with --shell-escape:

enter image description here

The second one is for a pdfLaTeX+MakeIndex+BibTeX compile option with --shell-escape:

enter image description here

With both settings the example from http://t-f-s.github.io/csvsorter/ compile.

Prerequisite is that the CSVsorter program is found on the system path. Putting it into the source directory of the LaTeX example also works.

The files for the example are the following:



\csvreader[sort by=sumsort.xml,
  head to column names,
  table head=\toprule\textbf{Artist} & \textbf{Title} & \textbf{Country} &
             \textbf{Points} & \textbf{TV+JV}\\\midrule,
  table foot=\bottomrule]
{\Artist & \itshape''\Title'' & \Country &
 \bfseries\the\numexpr\Televote+\Juryvote\relax & $(\Televote+\Juryvote)$}



La la la la la,The Singers,United Kingdom,25,62
One and two and three,Hansi Unterober,Germany,47,35
Rarara,Channel Rats,Grand Fenwick,12,14
The green hills of the shire,Frodo and Friends,New Zealand,76,45
Paris e Calais,Chantal and Pascal,France,47,41
The bell rings,Baab,Sweden,87,24


<?xml version="1.0" encoding="UTF-8"?>
    <sum order="descending" type="integer">
      <column name="Televote"/>
      <column name="Juryvote"/>
    <column name="Country" order="ascending" type="string"/>

My example directory contains the following files:

enter image description here

  • I Tried exactly what you did and it worked but insode my main document it didn't. y file construction is a main tex file, and the xml and csv inside a seperate foleder named table – Simon Boucher Mar 19 '15 at 16:35
  • If it can help or change something, I can try to use winedt. Also I use the memoir class. – Simon Boucher Mar 19 '15 at 18:00
  • @SimonBoucher If my answer worked for you, the question about 'shell escpae in MikTeX' is solved. There has to be some programming error in your main file, I guess. To get help in this matter, you should file a new question with a MWE which allows to reconstruct the problem. – Thomas F. Sturm Mar 20 '15 at 7:02

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.