Sunday, June 29, 2008

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 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.

No comments: