Gregor Gorjanc has a post on Excel and LaTeX that lists four ways to convert and Excel table into LaTeX. I’ve used two of the methods he lists: brute force and excel2latex. I recommend excel2latex. I used it frequently until I upgraded to Office 2007 and the plug-in quit working. The only bug I remember with it was that sometimes it would give you a warning saying it didn’t work, but it did; the LaTeX code you wanted was waiting for you on the Windows clipboard.
I plan to try out Gregor’s other two suggestions. Creating tables in Excel is far easier than doing so in LaTeX and I miss the functionality that excel2latex provided. Maybe there’s a way to use excel2latex with Excel 2007. If you know of a way, please leave a comment.
Save the table as a .csv and write a perl script to do the conversion?
Hi there
The best solution I’ve found so far is to copy the table to Gnumeric and then save the file as a .tex table fragment, works a treat!
Ian
If you’re open to jumping over to the OpenOffice side of the fence, at least to export your data, you might try the calc2latex macro from the OpenOffice website here. It works very nicely and gives you basic formatting options.
It works on Excel 2007 for me. After running the .xla file, the convert function can be found under the ‘Add-Ins’ tab, “Custom toolbars”.
Works on Excel 2007 for me too. Just did exactly as Yun, and works like a charm!
Did you guys do anything in particular? In which folder did you place the .xla file, for example? And did you try to convert from xls or xlsx files? Im’ getting a visual basic error: “compile error: cannot find project or library”. A visual basic screen is opened and the word “CurDir” is highlighted in the code. Did you guys have this problem?
Thanks!
Hi
I have the same problem getting the error: “compile error: cannot find project or library”. A visual basic screen is opened and the word “CurDir” is highlighted in the code.
Anyone have any ideas on how to get excel2latex running on excel 2007? I’m having the same issue — installing it results in an icon appearing under ad-ins, but simply pressing it opens up a visual basics sheet or something with the compile error. Is there a step we are just missing?
I just installed it to Excel 2007. Just put the ‘.xla’ file in any folder preferably the add-in folder under “C:Documents and Settings\Application DataMicrosoftAddIns” then open up Excel > Office Button > Excel Options > Add-ins > Go and select it from the menu that appears, or browse to the folder where you put it. That should give you a button under Add-ins in Excel which works fine. At least it works for me. I am running Win XP.
Hi,
For myself, having tried many aspects of excel2latex, and seeing that once a table is coded in Latex, it is very difficult to modify, I decided to do the following: I make a table in Excel, and format it the way I like, and then I just print it as a pdf file with pdf995, and then I add it to my Latex document as if it were a picture. Looks a bit less neat than real Latex tables though, but it’s the easiest way to do it I find.
Jeremie
I tried the ‘solution’ from here:
http://www.idautomation.com/kb/vba-compile-error.html
Just remove the link to the missing package and it started working (on a little test-table).
Now I have to test it on bigger and more complex ones but for now it is working.
Oh, I am using win7 and excel2007 and excel2latex 2.1
Hope it helps anyone here.
unfortunately, mac office does not support visual basic macros. i use the built-in concatenate function in excel. requires a few keystrokes, but this is the quickest i’ve found.
=A1&” & “A2&””
Alex is right, it helped! Thank you a lot!! Just remove the “missing” items from the list, as said in the link (provided by Alex).
Thanks! I tried Ernest’s solution by downloading the Excel2LaTeX.xla and ‘adding in’ in Excel 2007 and it worked.
Direct download link for the xla file: http://mirror.ctan.org/support/excel2latex/Excel2LaTeX.xla
I’m using Excel2Latex with Excel 2007. It works fine, but I need to not only export the data, but clearify the commands used in Excel. For this, I would like to include coloumn and row headings, and export the cells as they are when the “show formulas” option is used. I can’t find an easy way to do this. Anybody know one?
@rune
The simplest solution, though not temporary, would be to:
Use ‘search & replace’ ([CTRL]+H) and replace ‘=’ with ”=’ (add an apostrophe in front of the = ).
But this will mess up your calculations since Excel will think that there is now only text…
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 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
I think LaTable is the best tool for you. :)
With best regards,
Yubaraj
I am using Excel2Latex v3.0, I can save the selected excel tables to a .tex file, but I used “import content” in Scientific Work Place to import in the saved .tex file into a Beamer file. I was prompted “The marker ‘tab:addlabel’ occurs more than once in the document’.
When I typeset, preview pdf file, there was a problem and it cannot proceed.
I used Excel 2007.
Could anyone kindly tell me how to solve the problem?
Many thanks in advance
Hi,
I tried all above and I see the convert button. But when I click it says cannot run the macro? Any solutions?
Best regards,
A.D
Hi A.D.,
have you activated Macros in Excel?
Excel 2003
Excel 2007
I’m too lazy to look for the links to other Excel versions.
Greetings,
Alex
Hi Alex,
I’ve solved the problem. I changed the folder of the xla file and updated it three times : ) Now it works fine. Although the conversion is not always satisfactory.
Best,
A.
Am still having trouble with it myself. I have authorized macros to run, and I have loaded the file using Excel Options | Manage | Add-ins … and it says it is loaded.
However, I do not get any menu tab which says “Add-ins” and so I don’t have access to the functionality.
Any suggestions?
Hi Ennis,
which Excel version are you using?
For Excel 2007 I found a workaround to access the add-in without using the add-in tab. Try to use the Quick Access Toolbar.
Go to ‘Excel options | Customize’. In the pull down menu for ‘Choose commands from:’ select ‘All Commands’.
In the list select ‘Custom Toolbars’ and then click ‘Add >>’.
When closing the menu there SHOULD be a further button on your QAT. When you click it, there SHOULD be the Excel2Latex button.
All without any guarantees. It works for me, but I got the Add in tab too :-)
This workaround is derived from here.
Good Luck,
Alex
Hi, The LaTable really works and I think it is the easiest way to do this work. 1-Just google to download the “LaTable download”
2-Download the zip file and unzip it.
3-Go to the LaTable folder.
4.DOuble click on the LaTable.exe.
5. Copy your table from the excel file.
6.Don’t Don’t Don’t use ctrl+V……..use the edit option from the Latable window and click on the paste.
7.Do your formatting as you wish on the LaTable file.
8. Then go to edit option again and copy it by the option “copy as Latec code” and paste it to the latex file. Also write begin{table} & end{table}….before and after the pasted code.{Incase}
9. It took 1 min to write the processor but it will not take more than 5 secs to generate the table in latex.
Cheers
just a possible solution for those who have error message”compile error: cannot find project or library”.
1) open an application, then press ALT+F11 to VBA editor
2)open toolreference, check if ref edit is missing
3)if missing, go the install folder, reload it.
4)open a new application, now excel2latex should be working.
ref: http://www.pcreview.co.uk/forums/error-loading-dll-missing-ref-edit-control-t3782107.html
cheers,
sammy
Dear Ladies and Gentlemen :
I exported table created by SPSS to excel then I converted ti Latex document. The table looks good ( in PDF) but there is an error message:
! Extra alignment tab has been changed to cr
endtemplate.
How can I remove the error ?
Thank you
K. Kuntoro
Me again…
have you checked on this site, if something applies to your case?
Hi Kuntoro,
It could be, that there are too many ‘&’s in a row of the table. Or that there isn’t a column format at the beginning of the table (begin{table}{ll}).
Have you tried to zero in on the error by creating a minimal example?
Greetings,
Alex
Check out EditGrid. It’s an online spreadsheet program that exports to .tex
LaTable works superbly well! Thank you so much!!
Thans Ernest, it works great!
The method of opening in Open Office (v3.0.1 for me), and using the plugin Calc2Latex worked perfectly, with no hiccups!!!
Download from here:
http://calc2latex.sourceforge.net/
double-click the file Calc2Latex.oxt – Open Office will ask you if you want to install it.
Follow the instruction at the bottom of the page to use it – essentially, select the cells to convert; Go to Tools > Macro > Run…; Choose My macros>Calc2Latex>Calc2Latex>Main; Set the conversion options you want (eg. label, caption etc. etc.)
Pretty Nice, saved me hours of work already… doesn’t appear to copy colors of cells though, but I haven’t run it more than once so far, so perhaps this is possible with more tinkering of the options.
Hi,
Can you please help me out how i have to copy the Excel spread sheet in to Word as a table format
Have you heard of the package
pgfplotstable
? It is part ofpgfplots
and has a very good documentation. Pre- and post-processing and also typesetting of cell contents is very easy! All you have to do is to save your MS Excel/LibreOffice Calc sheet as a CSV and typeset it withpgfplotstabletypeset[col sep=comma, OTHER_OPTIONS]{PATH/TO/CSV_FILE}
. I even succeeded doing pretty fancy tables spanning a couple of pages (packagelongtable
) with colored rows (using packagecolortbl
) and of course the rule commands of the packagebooktabs
— all of these working together like a charm. ;)in excel : just add a column in excel full with “&” between each of the columns of your table and add another column full of “//” after the last column of your table
in .tex: copy and paste the excel table into your .tex between begin{tabular} and end{tabular}
and add format to your tabular as you wish!
enjoy!
Since having switched to using mac (and office 2008), the excel2latex add-on doesn’t work. However, someone has generously created this webpage for cutting and pasting excel tables directly, and converting to Tex delimited output. It works wonderfully, and have been using it for all my tables ever since:
http://www.acsu.buffalo.edu/~gregoryt/exceltolatex.html
using R:
save as csv, import into R as a dataframe using the function read.csv, use xtable to convert the dataframe into latex
there are certain ways through which you can convert excel tables into latex. I have used excel2latex which easily converted. In ms excel 7 it doesn’t require as it provides the plugin to the add-in.
Can also be converted online: https://tableconvert.com/?output=latex