Document 175

How to import the LaTeX output of a Maple worksheet into Scientific WorkPlace

Version: 2.5 - Scientific WorkPlace & Scientific Word

You can use SW version 2.5 to edit a Maple VR4 worksheet that has been output as a LaTeX file, but you must first make certain changes to your SW 2.5 installation and to the Maple LaTeX file.

  1. Copy the \etc\maple2e.sty file from your MapleV4 directory to your swp25\tex\macros\misc directory.

    The maple2e.sty file is the MapleVR4 style file for the worksheet.

  2. Modify the misc.lat file in your swp25\styles\misc directory to add a new section for the maple2e style:

    1. Use an ASCII editor to open the swp25\styles\misc\misc.lat file.

    2. In the file, find the [maple] group, which looks like this:

      [maple]

      DESCRIPTION=Maple Worksheet - Import Style

      DOCSTYLE=[12pt,maplems]{article}

      SHELLFILE=empty

      CSTFILE=maplems

      DOCCLASS=[12pt]{article}

      PACKAGES={maplems}

      Several lines in the group use a file called maplems, which is a Maple VR3 style file and which will not work with the output from Maple VR4.

    3. Copy the section to the clipboard, then paste it back into the misc.lat file just below the original [maple] section.

    4. Modify the copied section:

      1. Change the section name from [maple] to [mapleR4].

      2. Change the DESCRIPTION line so that it reads DESCRIPTION=Maple R4 Worksheet.

      3. Change the DOCSTYLE line so that it reads DOCSTYLE=[12pt,maple2e]{article}

      4. Change the PACKAGES line so that it reads PACKAGES={maple2e}

      5. Change the CSTFILE line so that it reads CSTFILE=maple2e

        The new [mapleR4] group should now look like this:

        [mapleR4]

        DESCRIPTION=Maple R4 Worksheet

        DOCSTYLE=[12pt,maple2e]{article}

        SHELLFILE=empty

        CSTFILE=maple2e

        DOCCLASS=[12pt]{article}

      6. PACKAGES={maple2e}

      7. Save and close the swp25\styles\misc\misc.lat file.

  3. Create a new .cst file for the maple2e style by modifying the maplems.cst file in the swp25\styles directory:

    1. Use an ASCII editor to open the swp25\styles\maplems.cst file.

    2. In the [FILTER] section at the first of the file, find the line that reads \newverbatim{mapleinput}{}{}

    3. Place a semicolon at the beginning of the line so that it reads ;\newverbatim{mapleinput}{}{}.

    4. Save the file as maple2e.cst in the \sw25\styles directory.

    5. Close the file.

  4. Modify the Maple VR4 LaTeX file for your Maple worksheet:

    1. Use an ASCII editor to open the file.

    2. Use the Search/Replace function of the editor to delete the lines that read

      \begin{maplegroup}

      and the lines that read

      \end{maplegroup}

    3. Save and close the file.

  5. Import the Maple VR4 LaTeX file to SW 2.5:

    1. Open SW.

    2. Start a new document:

      1. From the File menu, choose New.

      2. In the Style List Filters section, check Other.

      3. In the Document Type section of the Predefined Styles dialog box, select Miscellaneous.

      4. In the Style section, select Maple R4 Worksheet.

      5. Choose OK.

    3. From the File menu, choose Import Contentsand select the Maple VR4 LaTeX file.

      The contents of the document will appear on the SW screen as a series of gray boxes.

    4. Save the file, then close and reopen it.

      Your Maple worksheet should now appear correctly on the screen. Note that the Maple Input lines appear as in this example:

      \mapleinline{active}{1d}{ Int(x^2,x=1..2);}{%

      }

      The part of the Maple Input line shown in bold above consists of formatting instructions to Maple. Do not edit this part of the line. The rest of the line is your input to Maple; this is the only part of the Maple Input line that your should edit. You can edit any part of the Maple results.

You need to complete steps 1-3 only once. However, you must complete steps 4 and 5 each time you want to import a Maple LaTeX worksheet.

Added 0814/96

This document was created with Scientific WorkPlace.