View Zhirong Zhao's profile on LinkedIn

Blogroll

My pages

Visitors

Powered by

UThinkrunning MT v.4.25

Header image of Hong Kong financial center courtesy of hleung on flickr.

Excel2LaTeX: tricks in my Mac

This is the official introduction to Excel2LaTeX (2.0):  

"It's difficult to create tables in LaTeX, especially if some columns are calculated. Excel2LaTeX tool will allow you to transform the current selection from Excel to Latex. Most of the formatting will be kept (bold, italic, border lines, multicolumn cells, etc.). The LaTeX code can be copied to the clipboard or saved as a LaTeX file, which then can be included in an existing LaTeX document using the input command."

However, the program seems to be written primarily for Windows. For several reasons, it took me quite a while to get it work in my MacBook Pro. These tricks may be helpful for you too. 

❑ The Visual Basic add-in doesn't work for Mac Excel 2008. You may use Mac Excel 2004 for the purpose.

❑ I place the downloaded file "Excel2LaTeX.xla" under "/Applications/Microsoft Office 2004/Office/Add-Ins.

❑ I manually open the xla file once in order for Excel 2004 to recognize the location for the add-in file; only then can I turn on the Excel2LaTeX button under Toolbars.

❑ After converting a selected area in Excel to LaTeX codes, additional tricks are needed to apply the codes. To use the clipboard function, I have to copy things to TextEdit and then recopy them to TeXShop to get them work -- otherwise, TeXshop is confused with some "invalid character." To use the "Save to File" function, I change "Desktop\Sheet1.text" to ":Desktop\Sheet1.tex" in order to get the file landed correctly in my Desktop.

------------------
p.s: With Mike’s suggestion, I found that NeoOffice has a macro called Cal2LaTeX, which is a lot easier to used than Excel2LaTeX (12/26/2008).

Comments

Hi Jerry,

This is a great post! Thank you.

By the way, how are you doing this blog? (Are you using some sort of template, or...)

It looks exceptionally nice.

Best,

Bill Gleason

Hi
I was just wondering whether there is a version of ecxel2latex for mac:office2008 coming up soon, or whether there is another way to extract data from excel to latex.
thanks
felix

Felix,

I don't know for the first question.

An alternative way is through R if you use it. Save Excel as CSV, read it into R and then apply "xtable" -- see the link below:

http://cran.r-project.org/web/packages/xtable/index.html

This works well for me if I don't need to rearrange the table a lot.

All best,

Jerry

hi. i tried as what you have suggested (copy to texedit and copy to texshop) but it does not work. Can you help me on this?

thanks

Rita, see the newly added ps above. Now I prefer to use Cal2LaTeX.

hi....managed to solve that!!! thanks

Thanks mike,

the NeoOffice has a macro called Cal2LaTeX, works very nice.

Post a comment

Hubert H. Humphrey Institute of Public Affairs