Document 285

How to import Excel tables

Version: 3.x, 4.x, 5.x - Scientific WorkPlace, Scientific Word, & Scientific Notebook

You can import Excel tables to your document using several methods, which are described here in order of preference. Make sure the method you choose is appropriate for the MacKichan Software product you have installed.

Method 1: Import information converted from Excel to LaTeX with Excel2LaTeX

For Scientific WorkPlace, Scientific Word, & Scientific Notebook

The Excel2LaTeX Version 2.0 package, written by Joachim Marder, converts Excel selections to LaTeX using tabular environments, maintaining most formatting. You can import the converted tables into your document. Please note that the Excel2LaTeX package is an external program that is not maintained by MacKichan Software.

  1. Obtain the package:

    1. Download the Excel2LaTeX Version 2.0 archive file xl2latex.zip to your local hard disk.

    2. Extract the files in the archive file.

    3. Install the package in your version of Excel according to the instructions in readme.txt.

      The installation creates a Convert Table to LaTeX toolbar with a single button and places a similar command on the Tools menu.

  2. Convert an Excel table to LaTeX:

    1. Open your Excel spreadsheet and select a portion of the spreadsheet

    2. Choose the Convert Table to LaTeX button or command.

    3. Follow the displayed instructions to send the selection to the clipboard or save it as a LaTeX file. (In SNB, saving as LaTeX file is the only option.)

  3. Import the table to SWP, SW, or SNB:

    1. In SWP, SW, or SNB, open the file to which you want to import the table.

    2. Place the insertion point where you want the table to appear.

    3. If you have copied the table to the clipboard (SWP and SW),

      1. From the Insert menu, choose Typeset Object and then choose TeX Field.

      2. Press Ctrl+v to insert the converted table in LaTeX form.

      3. Choose OK.

      4. Save, close, and reopen your document.

      5. Locate the table in your document and edit as necessary.

      or

      If you have saved the table as a LaTeX file (SWP, SW, and SNB),

      1. From the File menu, choose Import Contents.

      2. Specify the LaTeX table file and choose Open.

    4. Edit the table as necessary.

Method 2: Import an Excel table as a graphic

You can insert an Excel table into a document as an inline graphic. In SWP and SW, the graphic can also reside in a table environment that floats.

For Scientific WorkPlace & Scientific Word

  1. In Excel, format the table as you want it to appear in your document.

  2. Select the table and copy it to the clipboard.

  3. In SWP or SW, place the insertion point where you want the table to appear.

  4. From the Edit menu, choose Paste Special, select Picture, and choose OK.

    The program inserts a graphic image of the Excel table.

  5. If you want the graphic to appear inline or displayed,

    1. Select the graphic and choose Properties.

    2. In the Placement area of the Layout tab sheet, choose In Line or Displayed.

  6. If you want the graphic to appear in a floating environment, so that it can have an automatically numbered title,

    1. Select the graphic and choose Properties.

    2. In the Placement area of the Layout tab sheet, choose In Line.

      NoteThe other graphic placements will interfere with the table environment and will cause a LaTeX error.

    3. In Versions 3.5x and later, import the "Table - (4x3, floating)" fragment.

      or

      In Version 3.0, import the "table4_3" fragment.

    4. Select the graphic and place it inside the fragment, replacing the sample table that was introduced with the fragment.

    5. In the caption TeX field, replace the words Table Caption with the title you want for the table and choose OK.

      Special procedures are required if the caption contains mathematics.

  7. Save your file.

For Scientific Notebook

  1. In Excel, format the table as you want it to appear in your document.

  2. Select the table and copy it to the clipboard.

  3. In SNB, place the insertion point where you want the table to appear.

  4. From the Edit menu, choose Paste Special, select Picture, and choose OK.

    The program inserts a graphic image of the Excel table.

  5. Select the graphic and choose Properties.

  6. In the Placement area of the Layout tab sheet, choose In Line or Displayed.

  7. Save your file.

Method 3: Import information from Excel via Word and RTF

For Scientific WorkPlace, Scientific Word, & Scientific Notebook

This method takes advantage of the way Microsoft Word saves Excel tables as RTF files. Note, however, that because the conversion can alter the table formatting, this method should be used with caution. After you import the RTF files into your document, you may need to correct column widths and alignment specifications. Other editing may also be necessary. Check the content and appearance of the imported table carefully.

  1. In Excel, select the table and copy it to the clipboard.

  2. In Microsoft Word,

    1. Create a new blank document.

    2. Paste the table into the new document.

    3. From the File menu, choose Save As.

    4. Change the Save as type to Rich Text Format (*.rtf).

    5. Enter a file name and directory.

    6. Choose OK.

  3. In SWP, SW, or SNB:

    1. Place the insertion point where you want the table to appear.

    2. From the File menu, choose Import Contents.

    3. Change the Files of type to RTF (*.rtf).

    4. Select the .rtf file containing the table and choose Open.

      The program imports the contents of the file. The converted Excel table may have set column widths. The table cells will appear as TeX fields.

    5. Change the column widths to automatic widths:

      1. Select the table.

      2. From the Edit menu, choose Properties, and choose the Column Width tab.

      3. Check the box next to Use Automatic Width and choose OK.

      4. Remove any TeX fields containing alignment commands, such as \raggedleft or \raggedright.

    6. Save your file.

Last revised 09/14/07

This document was created with Scientific WorkPlace.