2008-09-16

Excel and LaTeX?

If you want to use Excel table in LaTeX document you can:
  • retype it in LaTeX syntax --> not recommended, especially if a table can change
  • save as CSV and use csv2latex
  • use excel2latex addon for Excel --> this is a very handy solution
  • open Excel file in some other spreadsheet that has the ability to save as LaTeX file, e.g., Gnumeric
  • a related soultion is offered by Spreadsheet2latex
See also PC -> LaTeX Converter Quick Comparison List

10 comments:

Yihui Xie said...

You can also read the data into R and use the R package "xtable" to get the LaTeX code from a matrix/data.frame; that's what I usually do :-)

Anonymous said...

The simplest way, for small tables anyway. Is to just add a column of "&" between each entry and a column of "\\" at the end. Then just paste this in between your table and tabular commands.

Gorjanc Gregor said...

Finnaly, one could also use LyX where one can insert table and its content much more easily than directly in LaTeX. At the end one can then export to LaTeX.

Anonymous said...

Yes, you can export tables from excel to LaTeX. Previously I had used excel2latex addon of excel to import selected tables in latex but I had to modify the LaTeX codes according to my requirement.

Later, I accidentally came to know a beautiful GUI tool for importing excel tables to LaTeX and modifying the table according to the requirement in a What You See Is What You Get fashion. The tool is LaTable. Just simply select your excel table without any modification and paste it to LaTable. Then modify the table like bordering cell, merging horizontal cells, text alignment etc and then copy LaTeX code for table into your LaTeX editor. The details about it is given in my blog with pictures as well.
Here’s the link

http://zigzag00.blogspot.com/2010/08/latable-easy-way-to-write-tables-in.html

With best regards,
Yubaraj

Anonymous said...

Yes, you can export tables from excel to LaTeX. Previously I had used excel2latex addon of excel to import selected tables in latex but I had to modify the LaTeX codes according to my requirement.

Later, I accidentally came to know a beautiful GUI tool for importing excel tables to LaTeX and modifying the table according to the requirement in a What You See Is What You Get fashion. The tool is LaTable. Just simply select your excel table without any modification and paste it to LaTable. Then modify the table like bordering cell, merging horizontal cells, text alignment etc and then copy LaTeX code for table into your LaTeX editor. The details about it is given in my blog with pictures as well.
Here’s the link
http://zigzag00.blogspot.com/2010/08/latable-easy-way-to-write-tables-in.html

With best regards,
Yubaraj

Stefan said...

Here it adds the necessary &s and //s online after pasting in cells from excel: http://www.acsu.buffalo.edu/~gregoryt/exceltolatex.html#

Ara Vartanian said...

I wrote an Emacs procedure to do the conversion. It's been very useful for me, at least. Might help someone else.

Anonymous said...

Stefan, the link http://www.acsu.buffalo.edu/~gregoryt/exceltolatex.html# you posted doesn't work. Do you have an alternative link that does the same? Thanks.

Anonymous said...

I tried to use Excel2Latex but it does not work with Excel 2011 on Mac. :( The link for CSV2latex does not lead anywhere either. I was so frustrated because I really do not want to type my long table in Latex....

After some search I fount this site. http://ericwood.org/excel2latex/

Hope it can help others as well. :)

Ayayo said...

convert csv, markdown table, excel, html to latex table online: https://tableconvert.com