6

I'm looking for a program or web-service that

  • can convert Microsoft Excel 2013 spreadsheets to LATEX tables

And if possible:

  • free
  • works on Windows 7

The package Excel-to-LaTeX only works for Ex­cel 2010 and earlier versions.

  • 4
    I don't have experience with Excel 2013, but are the spreadsheets really that different? If not, you could just save the file as 2010 version and then do the conversion – Michiel Mar 18 '14 at 6:11
  • I just had the idea how to write such a tool, but: What are your expections? Only a simple table with easy rows and columns? Or complex tables with combined columns (\multicolumn in LaTeX) and rows. Any Colors in cells? Any formatting? Detect Header lines? – knut Jun 2 '15 at 8:05
  • I created a program and I think it should be able to concert Excel 2013 files into LaTeX tabulars. But I have no Excel 2013, so I can't check it myself. Can you try xlsx2latex.exe with your file? Just download it and try xlsx2latex <your xlsx-file>. If you confirm it works with Excel 2013 files I will post an answer. – knut Jun 12 '15 at 21:54
3

If the way via an intermediate CSV file is OK, I suggest the following workflow:

Conversion from Excel to CSV

Use xlsx2csv, a python script which is small, efficient and fast. In the most easiest case (Excel file with one sheet) you could get away with the command line:

python xlsx2csv.py data.xslx data.csv

Conversion from CSV to Markdown

Use csvtomd, another python script to get you to the Markdown format. Unfortunately it is a Python 3 script, so you need a separate Python 3 environment.(*) The command line here is:

> python3 path/to/your/csvtomd-dir/csvtomd.py  data.csv >data.md

Conversion from CSV to LaTeX

Use the excellent pandoc. Install it properly and make sure you have it on your path. Then call it like this:

> pandoc -f markdown -t latex -o data.tex data.md

And - voila! - if everything went well, data.tex contains your Excel table as a LaTeX table.(+) BTW, all tools mentioned work perfectly on Windows 7.


(*) You can use e.g. Anconda to have Python 2.7 and Python 3.4 next to each other.

(+) Please note, pandoc uses the flexible longtable package to format its tables.

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.