Calc2LaTeX - Macro for converting OpenOffice.org Calc spreadsheets into LaTeX tables

(7 votes)

Calc2LaTeX is an OpenOffice.org Calc (Spreadsheet) macro for converting tables. It makes making tables on LaTeX very easy.

This extension will allow you to select a region in a spreadsheet, and generate a LaTeX tabular format of the spreadsheet.

Supports:

Embedding the tabular environment in a table float
Caption on top or bottom
Label
Placement options [htbp], etc.
Horizontal position (center, left, right)
Include/exclude ruled lines in table
Include formatting (bold, italic)
Escape special characters (#, $, %, &, _, {, })
Output to a results window or to a file
Horizontally and vertically merged cells (uses multicolumn, but not multirow)

The code was taken from http://calc2latex.sourceforge.net/, installed in OpenOffice.org 3.0, and exported as an extension.

Download extension
Operating System: System Independent | Windows | Solaris Sparc | Solaris x86 | Linux | MacOS X | Linux x86-64
Official release: 0.2.4
Date: 2009-Jul-15
Size: 9.63 KB
License: opensource | Read license
Source code: Browse source code
Further product information: Screenshots | Product details

Comments

Bravo ! Excellent !

Hello,
I just downloaded & tried your extension. It works very fine, giving perfect results.
Please note :
- a button would be really useful
- the macro also works on Linux (and OSX I suppose), so you shouldn't restrict it to Windows.

How to add a button and/or menu item

I couldn't figure out (read: didn't take the time yet) how to include the button and menu entry in the extension, but it is pretty easy to do in the OpenOffice.org interface.

To add a toolbar button (or Menu item):

Tools -> Customize -> Toolbars (or Menu to add a menu item)
Select the toolbar you want to add the button to, then click "Add..."
Scroll down to expand "OpenOffice.org Macros" in the left pane.
My Macros -> Calc2LaTeX -> Calc2LaTeX
Then select "Main" in the right hand, and click Add
Back in the Toolbars (or Menus) tab, select Modify, and Rename to Calc2LaTeX
I changed the Icon to something that looks like a table.

If someone knows how to include the menu item and/or the toolbar button in an extension, let me know and I'll update the extension.

after selecting the area of

after selecting the area of the table, what do we have to do to convert in latex syntax?
Thanks
[Ed: links removed as unrelated to OpenOffice.org]

I hope you like this. It has really helped me

I find making tables in LaTeX painful and error-prone. This macro makes it blindingly simple.

Let me know if you have problems installing or running it. This is my first extension, so I expect there to be at least a little trouble, and I would enjoy figuring out the system to make it work.

how do we use it?

after selecting the area of the table, what do we have to do to convert in latex syntax?
Thanks

How to use:

Select the cells in the spreadsheet that you want to put into LaTeX syntax.

In Calc, go to Tools -> Macros -> Run Macro... -> My Macros
Expand Calc2LaTeX, select Calc2LaTeX, and select Main, then click Run

The settings dialog will come up where you can select how you want the table to be created in LaTeX syntax, and whether the results should be output to a results window (for copy/paste) or saved to a file (for LaTeX import command).

One thing I have done is to add a button so this macro can be run from a toolbar. You can create a button very easily:
Go to View -> Toolbars -> Customize
Select the toolbar you want to add the button
Click Add
Under Category, expand OpenOffice.org Macros -> My Macros -> Calc2LaTeX -> Calc2LaTeX
Under Commands, select Main and click Add

Under Customize Toolbars, click Modify, Rename "Main" to "Calc2LaTeX", and select an appropriate icon (or create your own).

Some day, I will try to add this button to the extension.