[OS X TeX] "Paste Spreadsheet Cells" and csv2latex

David Derbes loki at uchicago.edu
Sat Feb 20 23:39:40 CET 2010


Alan Munn put together a very nifty and perhaps easier solution called xl2latex, based on an earlier program by Tom Counsell. Apparently this is now renamed to csv2latex. Anyway, the version I used (and continue to use) is a Ruby program. Basically, you open up the Terminal and also your Excel file. You copy the cells into memory. In Terminal, you execute the command 

ruby xl2latex.rb

(making sure that the program xl2latex.rb is in your directory so that the Ruby interpreter can find it), and the terminal reports "OK. Data in memory". You then type Command-V at that point in your LaTeX source you want the table of Excel data, and there it is.

Perhaps the new version is the old one renamed with a few bells and whistles...

David Derbes
U of Chicago Lab Schools

On Feb 20, 2010, at 4:23 PM, Alain Schremmer wrote:

> 
> On Feb 20, 2010, at 3:05 PM, David Messerschmitt wrote:
> 
>> 
>> As one of those lazy users who just wants things to work without a lot of fuss, I was excited to find the Macros Help in TexShop 2.31 describing a Default Applescript Macro "Paste Spreadsheet Cells". With considerable excitement I went to the TexShop Macros->Applescript menu to look for it, and was disappointed that it was not listed. Assuming this refers to csv2latex, I then looked for csv2latex among the macro menus and could not find it either. Am I missing something simple? It would be great if this useful macro was available without a lot of installation fuss.
> 
> 
> Being one of the laziest users on this list, I certainly could not cast the first stone.
> 
> In the case of cvs2latex, I downloaded it, unzipped it, did something else and created the following macro in TeXShop:
> 
> --Applescript direct
> --If you change the location of the csv2latex script, you must change
> --this script accordingly to reflect the new location.
> set mainList to {"cells","booktabs", "simple","longtable" }
> choose from list mainList with prompt "Choose a table format"
> set tablestyle to result as text
> do shell script  "~/Library/texmf//csv2latex" & " " &  tablestyle
> tell application "System Events" to keystroke "v" using {command down}
> --End of Applescript
> 
> 
> At this point, though, I can't remember what the something else was but since I am terminally install-challenged ...
> 
> And, unless someone beats me to it, I should have the solution tomorrow.
> 
> Regards
> --schremmer
> 
> 
> ----------- Please Consult the Following Before Posting -----------
> TeX FAQ: http://www.tex.ac.uk/faq
> List Reminders and Etiquette: http://email.esm.psu.edu/mac-tex/
> List Archive: http://tug.org/pipermail/macostex-archives/
> TeX on Mac OS X Website: http://mactex-wiki.tug.org/
> List Info: http://email.esm.psu.edu/mailman/listinfo/macosx-tex
> 




More information about the macostex-archives mailing list