Document 679

Modifying the program interface for added LaTeX packages

Version: 5.x - Scientific WorkPlace & Scientific Word

To simplify the use of a package that isn't provided with SWP or SW, you can modify the program interface so the package and its options are available from the Options and Packages dialog box. The modification is optional. If you don't modify the interface, you can go native to specify package options.

Modifying the interface for an added package involves adding information to two files (classes.pkg and packgs.opt) in the Typeset directory of your program installation. The file classes.pkg contains a section for each available document class listing packages that are available to be added to documents of that class. A typical listing begins like this:

[article]
acronym
afterpage
algorithm
algorithmic
alltt
amscd
 :

The packgs.opt file lists the options available for each file in the program installation, as shown in this example for the titletoc package:

[titletoc]
1=Label alignment
1.1=Left-default,leftlabels
1.2=Right,rightlabels
2=Dot after label
2.1=No - default,nodotinlabels
2.2=Yes,dotinlabels

The first-level numbers indicate the option category. The second-level numbers indicate the option as it appears in the Options for package dialog box, followed by a comma and the name of the option as defined in the package itself. Read the package documentation to determine the available options for new packages, then modify the interface to include the new package:

  1. Modify the classes.pkg file:

    1. Using an ASCII editor, open the classes.pkg file in the Typeset directory of your program installation.

    2. For each document class, add a new line and enter the package name.

    3. Save and close the file.

    The package name will appear in the list of available packages the next time you open the Options and Packages dialog box.

  2. Modify the packgs.opt file:

    1. Using an ASCII editor, open the packgs.opt file in the Typeset directory of your program installation.

    2. On a new line, enter the package name in square brackets and press Enter.

    3. For each option category, type a first-level entry in the form x=categoryname, where x is the number of the category and categoryname is the category name as you want it to appear in the Options for package dialog box.

    4. For each option category, type a series of second-level entries in the form x.y=optionname, option where x is the number of the category, y is the number of the option within the category, optionname is the description of the option as you want it to appear in the Options for package dialog box, and option is the name of the option as it is defined in the package.

    5. Save and close the file.

The next time you open the Options and Packages dialog box, the categories and their corresponding options will appear in the Options for package dialog box.

Last revised 06/15/06