Document 110

Technical Reference for Scientific WorkPlace and Scientific Word 2.5

Hypertext Links

Introduction

Changing the Printing of Hypertext Links

Palettes

Document View Settings

Predefined Styles

The LaTeX Filter

The Screen Appearance of Tags—CST Files

The Internal TeX Language

The .ini File

Section Headings

Scientific Word and LaTeX

Converting Documents from T3

User-Defined Tagged Runs

User-Defined \newfield

Using Plain \TeX

Using testfont.tex to Preview a Font

The Characters

Font Metric File Formats

The FRAME Macro

Swap File

Introduction

This document assumes a knowledge of LaTeX in certain sections. The explanations are extremely terse in places. If you need further clarification or information on a topic not covered here, please contact us at:

This document is included with Scientific Word 2.5, Scientific WorkPlace 2.5 and Scientific WorkPlace Student Edition 2.5. Some entries may not be relevant to Scientific Word since Scientific Word does not include the link to the Maple or Mathematica computational programs. The directory referenced in this document, \swp25, is the default directory for Scientific WorkPlace. The default directory for Scientific Word is \sw25 and the default directory for Scientific WorkPlace Student Edition is \swp25se.

Changing the Printing of Hypertext Links

SW uses the Screen Text on the screen, and uses the associated marker as the target. By default, the typeset version inserts the left text, a cross-reference to the marker, and the right text. However, since the hypertext link is stored as a macro

\hyperref{screen text}{left text}{right text}{marker name}

you are free to provide an alternative LaTeX definition. The default definition is in tcilatex.tex and it has the form:

%%%%%%%%%%%%%%%%%%%%%%

% macro for hyperref

\@ifundefined{hyperref}{\def\hyperref#1#2#3#4{#2\ref{#4}#3}}{}

This document, for example, provides an alternative definition that you can see in the Document Info Preamble:

\TeXButton{New hyperref macro}{\def\hyperref#1#2#3#4{#2{}#3}}

Note that the definition must be enclosed in a TeXButton to prevent it being expanded by SW. This version simply prints the left text and the right text, without the cross reference. Since these texts are empty in this document, nothing is printed.

If you insert the following into the preamble of your document,

\TeXButton{New hyperref macro}{\def\hyperref#1#2#3#4{#1}}

you'll print just the screen text while

\TeXButton{New hyperref macro}{\def\hyperref#1#2#3#4{}}

will print nothing at all.

Palettes

With many video display cards, it is necessary to trade the range of colors for screen resolution. Most often, the most desirable resolution forces you to reduce the available colors to 256. These colors are not fixed—the restriction is to 256 colors at any time. The current selection of colors is called a palette. Many images, such as flesh tone images, require the full set of available colors in a narrow range for good rendition.

If you want to work with a very wide range of colors, it is almost mandatory that you have a display card that allows "millions of colors"' at the resolution you want. Using a 256 color palette is a compromise. SW provides two methods. The first is a fixed "rainbow" palette. SW selects a rainbow of 256 colors equally distributed through the color spectrum. The second (dynamic) method optimizes the palette for the current image. This means that other images visible simultaneously may degrade as they are forced to use a palette optimized for a different selection of colors.

If you have more than 256 colors available, there is no need to choose between the two schemes.

The default scheme is the fixed rainbow. The palette scheme in effect is determined by the value of PaletteMode in the [EQConfig] section of the swp-pro.ini (or sciword.ini) file.

Set PaletteMode = 0 for the rainbow, and set PaletteMode = 1 for the dynamic mode.

With the rainbow palette, images are rendered somewhat faster.

The difference between the fixed rainbow and dynamic palette is most apparent with Mathematica plots. Note that Microsoft Word uses a fixed rainbow palette.

Document View Settings

You can make the settings for the first five items on the View menu local to a document. For example, to ensure that your document always opens with all items turned off, use a text editor to add the statement

%TCIDATA{ViewSettings=31}

before the \begin\{document} statement. The number is determined by adding together the "off" values for each of the menu items you want turned off. The values are:

Menu Item Off Value
Invisibles 1
Matrix lines 2
Input Boxes 4
Index Entries 8
Markers 16

Once this statement is added to a document, the current view settings are saved when the document is saved, so that they will be in effect the next time you open the document.

This feature was added so that you can create read-only documents that open in a known state.

Predefined Styles

Information about predefined styles is contained in files in the \swp25\styles directory and its subdirectories. All of these files are ASCII files that can be edited with Windows Write or Notepad.

styles.tci

This file is in the directory \swp25\styles. It contains two main sections. The first, [HIERARCHY], provides the list you see in the left hand side of the style selection dialog. A typical line in the [HIERARCHY] section has this form:

2=Book,Book/book.lat

This tells SW to display the word "Book" in the left hand side of the style dialog box, and to obtain the entries for the right hand side list from the file book.lat in the book subdirectory. You can check for yourself that there is indeed a file \swp25\styles\book\book.lat. There is a slightly more complicated structure for articles, where there are several categories. Each of these categories has its own .lat file in the article subdirectory of \swp25\styles. The contents of the .lat files are discussed in the next section.

The other section of styles.tci is the [OLDtoNEW] section. The entries in this section are used to map the style information in documents created with previous versions of SW to the new form. A typical entry in this section has the form:

qqaamitp=Article/ART1.LAT,mitp,mathart1

This tells SW that articles using the old qqaamitp option should be changed to the form described by the mitp entry in the file art1.lat in the directory \swp25\styles\article. The shell document for this style is mathart1.

.lat Files

The .lat files reside in subdirectories of \swp25\styles. For example, there are four .lat files in the \swp25\styles\article directory, art1.lat through art4.lat. These files correspond to the four groups of article styles you see in the style selection dialog box. Each section of this file describes a particular style. A typical entry has this form:

[mitp]

DESCRIPTION=A simple MIT Press style

DOCSTYLE=[12pt,sw20mitp]article

SHELLFILE=mathart1

CSTFILE=mathart1

DOCCLASS=[12pt]article

PACKAGES=sw20mitp

The DESCRIPTION line is what you seen in the right hand list box of the style selection dialog box.

The DOCSTYLE entry is for the LaTeX 2.09 form of the style, and the DOCCLASS and PACKAGES entries are for the LaTeX2e form. The DOCSTYLE entry is transformed into

\documentstyle[12pt,sw20mitp]{article}

and the DOCCLASS and PACKAGES entries are transformed into the statements

\documentclass[12pt]{article}

\usepackage{sw20mitp}

The SHELLFILE entry names a .shl file in the \swp25\styles directory. This file is loaded whenever you create a new file with this style using File New.

If the DOCSTYLE entry is empty (of the form DOCSTYLE=, with nothing following the =), this style does not appear in the list of LaTeX 2.09 styles. Similarly, if the DOCCLASS entry is empty, this style does not appear in the list of LaTeX2e styles.

There can exist the entry SHOW that could contain STD or SE (of the form SHOW=STD or SHOW=SE). This entry controls whether of not a style appears in the style selection dialog box when the checkbox for STD LaTeX or Style Editor is turned on. If the SHOW entry does not exist then the style will appear in the style selection dialog box when the Other checkbox is selected.

The CSTFILE entry names a .cst file in the \swp25\styles directory. The .cst files are used to control aspects of the screen appearance and tag choices when SW is editing a document with this style. Entries in the .cst file are modified when you make changes using the Tag Screen Appearance dialog box. The .cst files also control a number of other important aspects of SW's behavior that depend on the style you have chosen for a document.

Shell Documents

Whenever you create a new document using File New, SW initializes the document by loading a shell file. The shell file is determined by the SHELLFILE entry in the .lat file that contains the entry for the style you choose. All shell documents have the extension .shl and are found in the \swp25\styles directory.

Any SW document can be used as a shell.

To create a new shell,

  1. Create a new document with the appropriate front matter and main text items, and any other special items you need in the LaTeX section of the doc info.

  2. Copy this file to the \swp25\styles directory, giving it the extension .shl instead of .tex.

  3. Use an ASCII editor to edit the SHELLFILE line in the .lat file entry for the style that is to be associated with this shell file.

Preview Style

The directory \swp25\styles\samples contains a number of .tex and .dvi files. If there is a .dvi file with the file name that corresponds to a group entry in a .lat file ([mitp]) in the example above) then the Preview Sample button is available in the style selection dialog, and choosing it displays that .dvi file in the previewer.

The LaTeX Filter

The LaTeX filter is a separate .DLL file. It translates LaTeX documents to and from the internal SW form when documents are loaded or saved. Although it is primarily designed for documents created by SW, a serious attempt has been made to accommodate other LaTeX documents. The major cause of difficulties with non-SW documents is that the filter must convert a potentially very unstructured document to the structures supported by SW. We discuss some of the difficulties and how you can get around them.

Macros

If you define a macro with newcommand in the main document (not in any included file or in a style file), SW expands all instances of the macro. Macros defined with the \def command are also expanded—this was not the case with previous versions of SW. Macros that occur in a style file or any input file, are not recognized and are not expanded. SW will not know how many parameters such macros have and can incorrectly parse your document.

The macros \EXPAND and \NOEXPAND have the same syntax as newcommand. They are defined as no-ops in tcilatex.tex. SW expands the arguments of EXPAND and does not expand the arguments of NOEXPAND. You can use these two macros in your document preamble to tell SW about a macro that is already defined somewhere else. This way, SW handles the macro correctly. You should use EXPAND only when the macro in question begins or ends a group—that is, when the macro cannot stand on its own and SW needs to know that the environment is changed by it.

In order to handle documents correctly, SW must expand the arguments of all macros with parameters defined by newcommand, def, and EXPAND in the document preamble. The NOEXPAND macro provides a way to avoid the expansion but a macro declared this way must not start or end any environments whose scopes extend beyond the parameters of the macro.

Example. If you have a macro named Section which has a single argument and is defined in a separate style file, you should put the statement

\NOEXPAND{\Section}[1]{}

in the document preamble before reading the document with Scientific Word. All instances of the macro will then be placed into TeX fields correctly.

Example. If you have a macro defined by

\def\be{\begin{eqnarray}}

declared in a style file, you should put the statement

\EXPAND{\be}[0]{\begin{eqnarray}}

in your document preamble. Of course, there should be a matching ee to end the environment.

input Statements

There is no circumstance under which Scientific Word reads an input file.

All input statements in the preamble are preserved as is; input statements in the document body are processed as TeX fields. To convert LaTeX files with, say, chapters, to a large document, use the command

\input{filename}

in the body of a master document, and add the command

\LaTeXparent{master document name}

to the beginning of the subdocuments. The subdocument must reside in the same directory as the parent document.

The Screen Appearance of Tags—CST Files

What is a CST File?

These are files in the \swp25\styles directory with the extension .cst. In SW Version 2.5 or earlier, a CST file:

  1. controls the screen appearance of tags,

  2. determines which tags are available,

  3. determines the "class" and behavior of each tag,

  4. controls some aspects of the filtering of documents as they are loaded, and

  5. maps function keys to tags.

Why does SW use CST files? First, the task of determining the available tags and their types from an arbitrary LaTeX style file automatically is too problematic. Although comments in style files could be used to provide this information, it is important that the program use standard LaTeX style files in unmodified form. Finally, a design goal for SW is to have documents independent of a particular style and even of LaTeX. The tags and elements in a document are independent of a particular style and the CST file provides the necessary abstraction.

When you make changes using the Tag Function Keys dialog, the changes are stored in the currently active CST file. You see the name of the CST file in the LaTeX Style for Print and Preview dialog that appears when you choose File Style. We chose to store the function key assignments in the CST files because the available tags depend on the CST file itself. There is also an option to store assignments globally—these assignments are saved in the swp-pro.ini file.

There is a mapping from each LaTeX style to a CST file. When SW loads a document, it checks the first part of the document to determine which CST file to use. The algorithm used is explained in the "Location" section which follows. SW loads the CST file and then filters the file itself. Any special filter information relating to this style is therefore available during the filtering process. SW displays the message, "Loading screen style (.cst)" as it loads the CST file into memory. It displays paragraph numbers during the filtering process.

Historically, SW used two extensions, .cst and .mst. These stood for Color Screen sTyle and Monochrome Screen sTyle. There was code in the main startup portion of SW to determine whether the screen in use was color or monochrome. Depending on this determination, SW would use .cst files or .mst files. The reason for the two files was the fact that certain colors were rendered as invisible on monochrome screens. This is no longer necessary as all screens are now color or gray-scale. This scheme was therefore dropped in version 2.0.

Location

CST files are stored in the \swp25\styles directory. A CST file is associated with a .tex file when you choose File New, when you open an existing SW file, and when you open a LaTeX file that was not created with SW.

File New

When you choose File New, SW opens the file \swp25\styles\styles.tci. This file contains a section labeled HIERARCHY with the list of document types you see on the left-hand panel of the File New dialog. A typical HIERARCHY section is as follows:

[HIERARCHY]

1=Article

1.1=Math Articles,Article/art1.lat

1.2=Physics Articles,Article/art2.lat

1.3=Computer and Engineering Articles,Article/art3.lat

1.4=Other Articles,Article/art4.lat

2=Book,Book/book.lat

3=Exam,Exam/exam.lat

4=FAX,FAX/fax.lat

5=Letter,Letter/letter.lat

6=Memo,Memo/memo.lat

7=Press Release,PressRel/pressrel.lat

8=Report,Report/report.lat

9=Resume,Resume/resume.lat

10=Thesis,Thesis/thesis.lat

11=Literature,Literat/literat.lat

12=Miscellaneous,MISC/misc.lat

In this example, the first item you see in the left-hand panel is Math Articles. If you select this item, the right hand panel is filled by entries in the file \sw20\styles\article\art1.lat. The first entry in art1.lat looks like this:

\smallskip [bams]

DESCRIPTION=Similar to Bull. Amer. Math. Soc.

DOCSTYLE=[12pt,thmsa,sw20bams]{article}

SHELLFILE=mathart1

CSTFILE=mathart1

DOCCLASS=[12pt,thmsa]{article}

PACKAGES={sw20bams}

This entry is represented by its description "Similar to Bull. Amer. Math. Soc." in the right-hand panel. If you select this entry and choose OK, SW loads the CST file given in the CSTFILE line. It then loads the shell file mathart1.shl. This is a standard LaTeX file. If you chose LaTeX 2.09, the DOCSTYLE entry is used to set the \documentstyle statement and if you chose LaTeX2e, the DOCCLASS line is used for the \documentclass statement and any packages indicated by PACKAGES are placed in a \usepackage statement.

When the document is saved, SW adds a comment line that starts with %TCIDATA. This line tells SW which .lat file, and which entry in that file, was used in the File New process (or later, if the style is changed). The first part of the saved document (with LaTeX2e chosen) in our xample looks like this:

\smallskip %% This document created by Scientific Word (R) Version 2.5

%% Starting shell: mathart1

\documentclass[12pt,thmsa]{article}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage{sw20bams}

%TCIDATA{TCIstyle=article/art1.lat,bams,mathart1}

There is also a comment indicating the starting shell document. Incidentally, the row of extra comment (%) symbols provides a backpatch area that SW can use to modify the \documentclass statement without having to rewrite the file completely.

Opening an Existing SW File

When you reopen this file, SW uses the TCIDATA comment line to determine the CST file to be loaded before the document is loaded.

Opening a Non-SW File

If you open a LaTeX document that was not created by SW (and therefore does not have the TCIDATA comment), SW uses the DocumentTypes section of the main .ini file (\swp25\swp-pro.ini for Scientific WorkPlace) to determine which CST file to use. If all else fails, sciword.cst is used. The DocumentTypes section looks like this:

\smallskip [DocumentTypes]

ARTICLE=article,asaetr,deproc,csart,siamltex,tciart01,espart,laa

REVTEX=revtex

AMSLATEX=amsart,amsbook,conm-p-l,bull-l,ams-l,lam-l,jag-l,dimacs-l,mcom-l,proc-l,tran-l,memo-l

BOOK=book,tcibook

XAM=tciexam

LETTER=tcilett,tcimemo,tcifax

REPORT=report

THESIS=ucthesis,thesis

For example, if you open a non-SW file with the base style amsbook, SW will first load the CST file amslatex.cst.

Earlier versions of SW used auxiliary style files with names like qqaamitp.sty (the qqaa prefix was designed to avoid conflict with any other style names). There is an OLDtoNEW section in the styles.tci file that provides a mapping from these old names to the new scheme and the new CST files. The first part of this section is as follows:

\texttt{[OLDtoNEW]

}

\texttt{qqaamitp=Article/ART1.LAT,mitp,mathart1

}

\texttt{qqaadft1=Article/ART1.LAT,dft1,sw20dft1

}

The format of each entry is <old style name> = <name of new lat file>, <new style file name>, <name of cst file>

The styles.tci file also contains the heading of a section called NATIVEtoNEW. This section is not used.

Article.cst

We look at a typical CST file, article.cst. In the discussion following the complete listing of the contents of this file, we discuss the meaning of each entry and indicate other possible values and forms of the entries. Here are the contents of the file artcile.cst at the time this document was written:

\smallskip \ [FILTER]

\newtheorem{theorem}{Theorem}

\newtheorem{lemma}[theorem]{Lemma}

\newtheorem{proposition}[theorem]{Proposition}

\newtheorem{corollary}[theorem]{Corollary}

\newtheorem{conjecture}{Conjecture}

\newtheorem{example}{Example}

\newtheorem{definition}{Definition}

\newtheorem{remark}{Remark}

\newtheorem{exercise}{Exercise}

\newtheorem{axiom}{Axiom}

\TCIEnd

;TrueType font names with Blackboard Bold and Fraktur

[Defaults]

STYLE_name=Article

ITALICS_MODE=2

NORMAL_SLANT=0

ITALIC_SLANT=1

NORMAL_WEIGHT=400

BOLD_WEIGHT=700

FONT_FACE=Times New Roman

FONT_size=12

TEXT_COLOR=R0,G0,B0

FONT_WEIGHT=400

FONT_SLANT=0

MATH_FACE=Times New Roman

MATH_COLOR=R255,G0,B0

FUNCTION_COLOR=R128,G128,B128

ITALICS_IN_MATH=1

SCRIPT_size=70

SCRIPTSCRIPT_size=50

OPERATOR_size=120

BIGOPERATOR_size=150

PARAGRAPH_INDENT_RIGHT=18

PARAGRAPH_INDENT_LEFT=18

PARAGRAPH_INDENT_FIRST=0

PARAGRAPH_INDENT_REST=0

PARAGRAPH_LEADING_BEFORE=0

PARAGRAPH_LEADING_AFTER=0

LINE_LEADING_BEFORE=0

LINE_LEADING_AFTER=0

LINE_JUSTIFICATION=1

TAGLEVEL=2

[Body Text]

TAG_TYPE=PARA

PARAGRAPH_INDENT_FIRST=18

[section]

ALIAS=Section head

TAGLEVEL=1

TAG_TYPE=STRUCTURE

NEXT_TAG=Body Text

TAG_BEHAVIOR=NOENVTAGS

FONT_FACE=Times New Roman

FONT_WEIGHT=700

FONT_size=18

TEXT_COLOR=R:0 G:0 B:255

PARAGRAPH_LEADING_BEFORE=9

PARAGRAPH_LEADING_AFTER=3

[subsection]

ALIAS=Subsection head

TAGLEVEL=2

TAG_TYPE=STRUCTURE

NEXT_TAG=Body Text

TAG_BEHAVIOR=NOENVTAGS

FONT_FACE=Times New Roman

FONT_WEIGHT=700

FONT_size=14

TEXT_COLOR=R:0 G:0 B:255

PARAGRAPH_LEADING_BEFORE=6

PARAGRAPH_LEADING_AFTER=2

[subsubsection]

ALIAS=Subsubsection head

TAGLEVEL=3

TAG_TYPE=STRUCTURE

NEXT_TAG=Body Text

TAG_BEHAVIOR=NOENVTAGS

FONT_FACE=Times New Roman

FONT_WEIGHT=700

TEXT_COLOR=R:0 G:0 B:255

PARAGRAPH_LEADING_BEFORE=4

PARAGRAPH_LEADING_AFTER=1

[paragraph]

ALIAS=Subsubsub head

TAGLEVEL=4

TAG_TYPE=STRUCTURE

NEXT_TAG=Body Text

TAG_BEHAVIOR=NOENVTAGS

TEXT_COLOR=R:0 G:0 B:255

PARAGRAPH_LEADING_BEFORE=2

PARAGRAPH_LEADING_AFTER=1

[subparagraph]

ALIAS=Subsubsubsub head

TAGLEVEL=5

TAG_TYPE=STRUCTURE

NEXT_TAG=Body Text

TAG_BEHAVIOR=NOENVTAGS

TEXT_COLOR=R:0 G:0 B:255

[em]

ALIAS=Emphasize

TAG_TYPE=TEXT

FONT_SLANT=1

TEXT_COLOR=R255,G0,B255

MATH_COLOR=R255,G0,B255

[rm]

ALIAS=Roman

TAG_TYPE=TEXT

TEXT_COLOR=R0,G0,B255

MATH_COLOR=R0,G0,B255

[bf]

ALIAS=Bold

TAG_TYPE=TEXT

FONT_WEIGHT=700

[it]

ALIAS=Italic

TAG_TYPE=TEXT

FONT_SLANT=1

MATH_COLOR=R0,G255,B255

[sl]

ALIAS=Slanted

TAG_TYPE=TEXT

FONT_FACE=Times New Roman

FONT_SLANT=1

TEXT_COLOR=R0,G0,B255

[sf]

ALIAS=Sans serif

TAG_TYPE=TEXT

FONT_FACE=Arial

MATH_COLOR=R0,G0,B0

[sc]

ALIAS=Small caps

TAG_TYPE=TEXT

TAG_BEHAVIOR=FORCESTEXT

FONT_FACE=cmcsc10

TEXT_COLOR=R0,G128,B0

MATH_COLOR=R0,G128,B0

[tt]

ALIAS=Typewriter

TAG_TYPE=TEXT

FONT_FACE=Courier New

MATH_COLOR=R0,G0,B0

[description]

ALIAS=Custom item

TAG_TYPE=LISTENV

TAG_BEHAVIOR=NOSTRUCTURETAGS

PARAGRAPH_INDENT_LEFT=18

PARAGRAPH_INDENT_FIRST=0

[enumerate]

ALIAS=Numbered item

TAG_TYPE=LISTENV

TAG_LEADIN=#

TAG_BEHAVIOR=NOSTRUCTURETAGS

PARAGRAPH_INDENT_LEFT=18

PARAGRAPH_INDENT_FIRST=0

[itemize]

ALIAS=Bullet item

TAG_TYPE=LISTENV

TAG_LEADIN=\cdot

TAG_BEHAVIOR=NOSTRUCTURETAGS

PARAGRAPH_INDENT_LEFT=18

PARAGRAPH_INDENT_FIRST=0

[cal]

ALIAS=Calligraphic

TAG_TYPE=TEXT

TAG_BEHAVIOR=FORCESMATH

FONT_FACE=cmsy10

TEXT_COLOR=R192,G192,B192

MATH_COLOR=R255,G0,B255

[newtheorem]

TAG_TYPE=TLTEMPLATE

PARAGRAPH_INDENT_LEFT=36

PARAGRAPH_INDENT_FIRST=0

TAG_BEHAVIOR=LISTSTART

[newenvironment]

TAG_TYPE=TLTEMPLATE

PARAGRAPH_INDENT_LEFT=36

PARAGRAPH_INDENT_FIRST=0

PARAGRAPH_INDENT_REST=18

TAG_BEHAVIOR=LISTSTART

[tiny]

TAG_TYPE=TEXT

FONT_size=6

TEXT_COLOR=R255,G0,B255

[scriptsize]

TAG_TYPE=TEXT

FONT_size=8

TEXT_COLOR=R255,G0,B255

[footnotesize]

TAG_TYPE=TEXT

FONT_size=9

TEXT_COLOR=R255,G0,B255

[small]

TAG_TYPE=TEXT

FONT_size=10

TEXT_COLOR=R255,G0,B255

[normalsize]

TAG_TYPE=TEXT

FONT_size=12

TEXT_COLOR=R255,G0,B255

[large]

TAG_TYPE=TEXT

FONT_size=14

TEXT_COLOR=R255,G0,B255

[Large]

TAG_TYPE=TEXT

FONT_size=16

TEXT_COLOR=R255,G0,B255

[LARGE]

TAG_TYPE=TEXT

FONT_size=18

TEXT_COLOR=R255,G0,B255

[huge]

TAG_TYPE=TEXT

FONT_size=20

TEXT_COLOR=R255,G0,B255

[Huge]

TAG_TYPE=TEXT

FONT_size=22

TEXT_COLOR=R255,G0,B255

[thebibliography]

ALIAS=Bibliography item

TAG_TYPE=BIBENV

TAG_LEADIN=bibitem

TAG_BEHAVIOR=NOSTRUCTURETAGS\NOMULTIPARA

PARAGRAPH_INDENT_LEFT=18

PARAGRAPH_INDENT_FIRST=0

PARAGRAPH_INDENT_REST=18

[quotation]

TAG_TYPE=PARA

ALIAS=Body Quotation

PARAGRAPH_INDENT_RIGHT=24

PARAGRAPH_INDENT_LEFT=24

[quote]

TAG_TYPE=PARA

ALIAS=Body Quote

PARAGRAPH_INDENT_RIGHT=24

PARAGRAPH_INDENT_LEFT=24

[center]

TAG_TYPE=PARA

ALIAS=Body Center

LINE_JUSTIFICATION=2

[verbatim]

TAG_TYPE=PARA

ALIAS=Body Verbatim

PARAGRAPH_INDENT_RIGHT=0

PARAGRAPH_INDENT_LEFT=0

TAG_BEHAVIOR=FORCESTEXT\NOLINEBREAK\PRESERVESPACES

FONT_FACE=Courier New

FONT_size=10

[newfield]

TAG_TYPE=TLTEMPLATE

PARAGRAPH_INDENT_LEFT=70

PARAGRAPH_INDENT_FIRST=0

[f_0]

ALIAS=title

TAG_TYPE=FIELD

TAG_LEADIN=Title:

TAG_BEHAVIOR=FRONTMATTER\NOSTRUCTURETAGS\NOENVTAGS

PARAGRAPH_INDENT_LEFT=35

PARAGRAPH_INDENT_FIRST=0

[f_1]

ALIAS=author

TAG_TYPE=FIELD

TAG_LEADIN=Author:

TAG_BEHAVIOR=FRONTMATTER\NOSTRUCTURETAGS\NOENVTAGS

PARAGRAPH_INDENT_LEFT=35

PARAGRAPH_INDENT_FIRST=0

[f_2]

ALIAS=address

TAG_TYPE=FIELD

TAG_LEADIN=Address:

TAG_BEHAVIOR=FRONTMATTER\NOSTRUCTURETAGS\NOENVTAGS

PARAGRAPH_INDENT_LEFT=35

PARAGRAPH_INDENT_FIRST=0

[f_7]

ALIAS=date

TAG_TYPE=FIELD

TAG_LEADIN=Date:

TAG_BEHAVIOR=FRONTMATTER\NOSTRUCTURETAGS\NOENVTAGS

PARAGRAPH_INDENT_LEFT=35

PARAGRAPH_INDENT_FIRST=0

[abstract]

TAG_TYPE=FIELD

TAG_LEADIN=Abstract:

TAG_BEHAVIOR=FRONTMATTER\NOSTRUCTURETAGS

PARAGRAPH_INDENT_LEFT=35

PARAGRAPH_INDENT_FIRST=0

[f_11]

ALIAS=Make Title

TAG_TYPE=FIELD

TAG_LEADIN=Make Title

TAG_BEHAVIOR=FRONTMATTER\NOSTRUCTURETAGS\NOENVTAGS

PARAGRAPH_INDENT_LEFT=35

PARAGRAPH_INDENT_FIRST=0

[f_12]

ALIAS=Make LOF

TAG_TYPE=FIELD

TAG_LEADIN=Make LOF

TAG_BEHAVIOR=FRONTMATTER\NOSTRUCTURETAGS\NOENVTAGS

PARAGRAPH_INDENT_LEFT=35

PARAGRAPH_INDENT_FIRST=0

[f_13]

ALIAS=Make LOT

TAG_TYPE=FIELD

TAG_LEADIN=Make LOT

TAG_BEHAVIOR=FRONTMATTER\NOSTRUCTURETAGS\NOENVTAGS

PARAGRAPH_INDENT_LEFT=35

PARAGRAPH_INDENT_FIRST=0

[f_14]

ALIAS=Make TOC

TAG_TYPE=FIELD

TAG_LEADIN=Make TOC

TAG_BEHAVIOR=FRONTMATTER\NOSTRUCTURETAGS\NOENVTAGS

PARAGRAPH_INDENT_LEFT=35

PARAGRAPH_INDENT_FIRST=0

[frak]

ALIAS=Fraktur

TAG_TYPE=TEXT

TAG_BEHAVIOR=FORCESMATH

FONT_SLANT=1

FONT_FACE=EUFM10

TEXT_COLOR=R192,G192,B192

MATH_COLOR=R255,G0,B255

[Bbb]

ALIAS=Blackboard bold

TAG_TYPE=TEXT

TAG_BEHAVIOR=FORCESMATH

FONT_FACE=MSBM10

TEXT_COLOR=R192,G192,B192

[newlist]

TAG_TYPE=TLTEMPLATE

PARAGRAPH_INDENT_LEFT=70

PARAGRAPH_INDENT_FIRST=0

[Hyperlink]

TAG_TYPE=TEXT

TEXT_COLOR=R0,G128,B0

MATH_COLOR=R0,G128,B0

[ProgramCall]

TAG_TYPE=TEXT

TEXT_COLOR=R128,G0,B0

MATH_COLOR=R128,G0,B0

[FKEYS]

(Remove Item Tag)=0x0001

Body Text=0x0002

(Normal)=0x0003

bf=0x0004

em=0x0005

enumerate=0x0006

itemize=0x0007

cal=0x0008

section=0x000a

subsection=0x000b

The FILTER Section

The first section of the file, entitled FILTER, contains instructions for the filter to recognize certain environments as being of a particular type. For example, the line

\newtheorem{theorem}{Theorem}

tells the filter that the style file associated with this CST file declares a newtheorem environment called "theorem" with lead-in text "Theorem."

Other environments that can be declared here are newlist, newfield, and newenvironment.

You can also redefine SW's \text output using statements in the FILTER section. Normally, the output filter places any text within mathematics in the AMS \text macro. This macro is the most versatile way to treat text in mathematics (according to The LaTeX Companion). This macro is defined in tcilatex.tex and in the AmS-LaTeX package. Some users have objected to this because it means their files do not contain plain LaTeX. If you add a statement like this to the [FILTERS] section of the .cst file associated with any given style:

\REDEF\{\text}{\textrm}

The effect of this statement is to replace all \text{...} statements with \textrm{...}. Another choice instead of \textrm is \mbox. Please be aware that the change cannot be reversed—once \text statements have been converted to something else, there is no automatic way to change them back.

You can also add an entry like this to the [FILTERS] section:

\QTagDef{MakeTitle}{100}{}

The QTagDef defines a MakeTitle tag whose properties are defined later in the .cst file as [TAG100].

The Defaults Section

In the sections for each tag, you can specify the values of a large number of parameters that affect the screen appearance. Normally, you want to leave most of the values unchanged from some base or default value, and change only a few select ones. The defaults section contains values for parameters that are used for each tag that does not specify an override value.

The Individual Tag Sections

The sections entitled Body Text, section, etc. give descriptions and parameter values for individual tags. For example, the first tag, Body Text, in article.cst, has these entries.

[Body Text]

TAG_TYPE=PARA

PARAGRAPH_INDENT_FIRST=18

All other parameter values are set to the values in the Defaults section. Although any or all of the parameters you see in the Defaults section can be set for each tag, some tags do not make use of the values on the screen. Each tag has a type that indicates the general class to which it belongs. This determines the broad on-screen behavior of tags. The additional TAG_BEHAVIOR field provides modifications to this general behavior in specific instances.

The following table lists all possible tag types and an example of each.

Type Example
PARA Body Text
STRUCTURE Section
TEXT Emphasize
LISTENV Numbered Item
TLTEMPLATE newtheorem
LATEXSIXZE Large
BIBENV bibitem
FIELD Title
ENV Note
THEOREMENV Theorem

The TLTEMPLATE type is actually a template that is used for all tags declared with the newtheorem, newlist, newfield, and newenvironment tags.

Each tag type has a set of possible TAG\_BEHAVIOR values. These behaviors, the tags to which they apply, and their effects are as follows.

Behavior Applies to Effect
FORCESMATH TEXT Forces the tagged material to be contained within math
FORCESTEXT TEXT Forces the tagged material to be contained within text
NOSTRUCTURETAGS All ENV types Prevents mixing of structure and environment tags
NOENVTAGS PARA Prevent mixing of structure and environment tags
LISTSTART All ENV types Pressing enter starts a new environment, rather than a continuation
NOMULTIPARA Internal
FRONTMATTER FIELD Makes tags available for front matter only
NOLISTTAGS FIELD Prevents lists in fields
NOLINEBREAK PARA
PRESERVESPACES PARA Used for Body Verbatim and similar tags

Additional values that can be set in an individual tag section, and examples, are as follows:

FONT_FACE=Times New Roman

FONT_size=12

FONT_WEIGHT=700

FONT_SLANT=1

ITALICS_IN\_MATH=1

TEXT_COLOR=R127,G0,B0

MATH_COLOR=R100,G100,B100

FUNCTION_COLOR=R100,G0,B100

LEADIN_BACKGROUND_COLOR=R255,G0,B0

LEADIN_FONT_FACE=Arial

LEADIN_TEXT_COLOR=R0,G255,B0

LEADIN_MATH_COLOR=R0,G0,B127

LEADIN_FUNCTION_COLOR=R50,G50,B50

CAPTION_BACKGROUND_COLOR=R0,G0,B0

LEADIN_FONT_size=10

LEADIN_FONT_WEIGHT=400

LEADIN_FONT_SLANT=0

LEADIN_LABELSEP=4

LEADIN_LABELwidth=100

LEADIN_TEXTJUSTIFY=1

LEADIN_ALIGNLEFT=

PARAGRAPH_INDENT_RIGHT=9

PARAGRAPH_INDENT_LEFT=9

PARAGRAPH_INDENT_FIRST=9

PARAGRAPH_INDENT_REST=0

PARAGRAPH_LEADING_BEFORE=4

PARAGRAPH_LEADING_AFTER=4

LINE_LEADING_BEFORE=2

LINE_LEADING_AFTER=2

LINE_JUSTIFICATION=2

TAGLEVEL=2

TAG_name=mynewtag

ALIAS=My New Tag

TAG_LEADIN=Title:

NEXT_TAG=Body Text

All of the items with LEADIN in their name have to do with the appearance of the automatic or custom text that is placed before a list, theorem, or field environment. For example, the default for LEADIN_BACKGROUND is a pale yellow.

The FKEYS Section

The FKEYS section assigns function keys to tag names. These values are changed by the Tag Key Assignments dialog and should not be modified directly.

Some CST File Issues

Some customers have complained that the Tag Function Keys assignments seem to change at random. What is actually happening is that they are changing styles, and therefore CST files. The assignments they carefully made in one CST file are not present in another so it feels as though the assignments are changing at random. There is now the option to make key assignments globally, store in the swp-pro.ini file. Note that, since the available tags depend on the CST file, you can end up with global assignments that attempt to apply non-existent tags.

The style editor can rewrite the associated CST file every time a style is saved. It also regenerates the shell (.shl) file "from scratch." This means that any changes made using an editor or with the Tag Function Keys dialog are lost.

The Internal TeX Language

The internal language used by SW for the clipboard and for fragments is a mixture of AMS-LaTeX and the macros of our predecessor, TCI. Future versions of SW will evolve toward more of MacKichan Software, Inc.'s own macros.

The .ini File

The main initialization file for Scientific Word is sciword.ini, for Scientific WorkPlace it is swp-pro.ini, and for Scientific WorkPlace Student Edition it is swp-se.ini. These files are in the corresponding directory sw25, swp25, or swp25se. They contain the defaults for directories, the assignment of symbols to the cache bar, details of the filters and drivers, automatic substitution sequences, and many more settings.

Section Headings

We don't encourage the use of the \section* form of the sectioning commands. You should control which sections are numbered using the appropriate depth of numbering command. This command can be placed in the Doc Info LaTeX section of the document or (more appropriately) in a LaTeX style file. For example, to ensure that no section headings are numbered, use the command \setcounter{secnumdepth}{0}.

Since publishers usually want the actual section heads to appear in the table of contents, the optional parameter form is not directly supported. However, it you enter an optional parameter, it appears in brackets at the start of the section head.

If your document contains a section* command, it appears on the Scientific Word screen as if it were a normal section. Leave it untouched if you want to retain the command. Otherwise, delete it and apply the section tag.

SW and LaTeX

If you save your document before you print or preview, the dvi file is preserved under the name of the document.

If the document was not saved beforehand, a temporary .tex file is created, and the dvi file is generated from the temporary file. The .dvi file is later discarded.

Converting Documents from T3

T3 documents are converted to SW using the T3TOTEX conversion utility available with T3. These utilities are also installed in \sw20\convert if you choose a full install or choose the utilities with a custom install.

T3 is based on a simple 1/2 space column model. This model allows the placement of any character in any 1/2 space position. For example, many T3 users place a character normally used for subscripts in the superscript position, a 1/2 space above the main line. This small character was designed to sit on the main line, and is positioned in the lower half. The equivalent superscript character that sits on the main line but is positioned in the upper half should be used. Nevertheless, converting this incorrectly placed subscript to TeX using T3TOTEX results in $x^{_2}$ which does not look good in TeX and must be changed to a simple subscript in SW.

An error in the T3TOTEX program sometimes results in double subscripts or double superscripts. You will need to edit the ASCII TeX file directly to fix these occurrences. An example of a double superscript (which is not accepted by TeX) is $x^1^2$.

User-Defined Tagged Runs

The Style Editor allows you to create your own tagged runs (text tags).

User-Defined \newfield

For letters, memos, faxes, and press releases, a command was added to handle the logical elements. It takes the form

\newfield{field}{alias}

It is added in the document preamble or can be specified in the .cst file. In SW, field appears on the Item tag popup, and alias appears on the lead-in object.

If you use \newfield environments in a document outside of SW, make sure there is a blank space between the begin and end statements.

Using Plain TeX

SW includes a plain TeX format file in the directory \swp25\tex\truefmt. You can use this format with IniTeX32 with the following steps:

  1. Start the TrueTeX formatter using the icon.

  2. TrueTeX automatically starts with the Open TeX File dialog. Click Cancel or press Escape to exit from this dialog.

  3. Select Preload from the menu bar.

  4. Click Search in the Select Preloaded Format File dialog.

  5. Select plain.fmt and click Open.

  6. Select File, Open TeX Source File from the menu bar.

  7. Select your plain TeX document and click OK to begin.

Using testfont.tex to Display a Font

The file testfont.tex in the \swp25\extras directory is a plain TeX file that can be used to preview and print a table showing all of the characters in one of the TeX fonts supplied with SW. To preview the font dcr10, for example,

  1. Follow the instructions in the previous section on Using Plain TeX to open \swp25\extras\testfont.tex.

  2. At the prompt "Name of the font to test = " type dcr10 and then press Enter.

  3. At the next prompt, type \table\bye and press Enter.

  4. The formatter processes the file and exits.

  5. Instead of typing \table\bye, you can type \help and press Enter to obtain a complete list of the commands you can type at this point.

  6. Use the TrueTeX Previewer directly to open \swp25\extras\testfont.dvi.

  7. Choose File Print to obtain a printout of the table.

The Characters

SW 1.0 was designed by Roger Hunter with help from Fred Richman, Guy Rivers, Kathleen Albers of TCI and Bill Jones of Lotus Development Corporation. Bill's input was provided during the design of the Ami Pro equation editor.

Version 2.0 was designed by Roger Hunter with help from an expanding cast of characters, including Elbert Walker and the beta testers.

Writing and editorial assistance for the manual and on-line Help system was provided by Susan Bagby.

The SWP "manual" Doing Mathematics with Scientific WorkPlace was written by Darel Hardy and Carol Walker.

Programmers were and are Ron Ausbrooks, Andy Canham, Chris Gorman, Lars Hansen, Roger Hunter, Larry Hughes, Jack Medd, George Pearson, Nathan Rakoff, Fred Richman, Jon Stenerson, and John Thomas. The program is written in C++.

Testers were Jennifer Higbie, Ian Hughes, John MacKendrick, Brian Palmer, and Cheryl Sutter.

Support were John MacKendrick, Paul Osario, Kathy Watt, Ömer Açikel, Christopher Casey.

Font Metric File Formats

Windows supplies the width of each character in a font, and also provides some general information about the font. SW, like TeX, requires much more. The additional information is supplied in SW font metric files.

There are two different formats of Font Metric files; one is the editable

(ASCII) form and the other is the compressed (binary) form. A brief description of both

forms of the font metric files follows.

ASCII Form

The ASCII form of the font metrics file is designed to be human editable. We attempted to keep the file 'readable' so that it can be modified and updated as needed. The units default to twips (20 twips per point) but can be changed using the UNITS keyword in the metrics file. Recognized units are points and twips.

A valid line in a Font Metrics file is of the form

UNITS points \ twips

[key_name] = [value];

or of the form

[char_set] [char_offset] = [height] [depth] [italic_correction] {width};

where the square brackets denote required statements and the braces denote optional statements. The UNITS statement may be followed by either the points keyword or the twips keyword. A semicolon (;) is used as both a delimiter and a comment character. Any text after a semicolon is ignored.

A key_name can be any of the following:

FontFace (font name - e.g. Tms Rmn)
FontSize (font size in points)
Num1 (numerator shift up in display)
Num2 (numerator shift up in non-display & non-\ atop)
Num3 (numerator shift up in non-display & \ atop)
Denom1 (denominator shift down in display)
Denom2 (denominator shift down in non-display)
Sup1 (superscript shift up in uncramped display)
Sup2 (superscript shift up in uncramped non-display)
Sup3 (superscript shift up in cramped display and non-display)
Sub1 (subscript shift down if superscript is absent)
Sub2 (subscript shift down if superscript is present)
SupDrop (superscript baseline below top of large box)
SubDrop (subscript baseline below bottom of large box)
AxisHeight (height of fraction lines above baseline)
RuleThickness (thickness of fraction bars)
BigOpSpacing1 (minimum clearance above a displayed op)
BigOpSpacing2 (minimum clearance below a displayed op)
BigOpSpacing3 (minimum baselineskip above a displayed op)
BigOpSpacing4 (minimum baselineskip below a displayed op)
BigOpSpacing5 (padding above and below displayed limits)

Some example lines follow:

;
; font parameters
;
Sup1 = 5;
Sup2 = 6;
Sub1 = 3;
BigOpSpacing1 = 3;
BigOpSpacing2 = 2;
BigOpSpacing3 = 7;
BigOpSpacing4 = 6;
BigOpSpacing5 = 3;
;
; end font parameters
;
;
; character metrics
;
0 65 = 16 0 0; "A" //anything after the semicolon is ignored
0 66 = 16 0 5; "B"
0 67 = 16 0 5; "C"
0 97 = 11 0 3; "a"
0 98 = 16 0 3; "b"
0 99 = 11 0 3; "c"
0 100 = 16 0 5; "d"
1 0 = 12 0 0 6; PRIME
1 32 = 11 0 2; alpha

Compressed Form

The goal of compressing the above data is to create a file which

  1. Can be read from disk very quickly and

  2. Contains the data in predefined structures which allow fast access to the metrics of each character.

The units for all metrics in the compressed form are twips.

The compressed form of the font metrics file has an array (MetricsArray) of metrics records of the form {height,depth,italcorr,width}. The size of the array depends on the number of unique combinations of the four attributes extracted from the ASCII form of the file. There should be a relatively small number of metrics records for ordinary fonts.

There is also an array of nbytes of offsets into the MetricsArray where Math: n is greater than or equal to number of characters in the system. Since there is only one byte allocated for the offset into MetricsArray, there is a maximum of 256 entries in the MetricsArray.

The complete format of the file is as follows:

ID 2 Version
nLength 2 length
Name nLength name
Size 2 font
Font 42 21
Character 512 offset
nEntries 2 number
MetricsArray ... 2

The FRAME Macro

The FRAME macro is used for graphics and plots in SW. The macro implements the concept of a frame, a rectangular region in the document that contains a picture, plot, or other items. This macro is defined in tcilatex.tex, in the \swp25\tex\macros\tci directory. Here is an example of the macro, as it appears in the readme.tex document:


Sample macro

The macro has 8 parameters (the limit in TeX is 9). The parameters are:

  1. Placement flags. These determine the frame type (figure or table), whether the frame is in-line, displayed, or floating, and if floating, the LaTeX floating placement flags (here, top, bottom, page of floats). The FRAME macro processes these flags and calls other macros based on the flag values.

  2. Width of the frame in the document.

  3. Height of the frame in the document.

  4. Vertical offset of the frame from the baseline, if it is in-line.

  5. The caption.

  6. A marker (in LaTeX terms, a label).

  7. The name that appears on the gray button when the frame is iconified.

  8. The TeX \special that contains information about the actual graphic file that will be used in the print or preview process. The \TEXTsymbol{\backslash}special uses key-value pairs. The meaning of most of the key-value pairs is apparent from the names. The file-properties field values have the following meanings:

    X - file exists

    N - file is "named" (i.e., not with one of our generated names)

    P - file is "permanent" (when this is set, graphics file shouldn't be deleted)

    T - file is "temporary" (you should probably never see this in a .tex file, though you may possibly in a clipboard paste) E - file is "external" (i.e., was imported as opposed to being generated, as plots or graphics pastes)

    U - file is "unalterable" (this is always set for an imported graphic in the current system; may be more useful in the future)

    M - file is "modified" (you should not see this in a file)

    D - file is "deleted"

Swap File

We recommend that you have at least 20 MB of RAM in a permanent Windows swap file.

To examine the current virtual memory setting for your Windows 95 installation

  1. From the Start menu, choose Settings and then choose Control Panel.

  2. Choose System and then choose the Performance tab.

  3. Choose the Virtual Memory button in the lower-right corner and examine the virtual memory settings.

  4. If the minimum setting is less than 20 MB, check Let me specify my own virtual memory settings.

  5. Change the minimum setting to 20 MB and set a maximum setting greater than 20 MB.

  6. Choose OK.

  7. When the system asks if you want to confirm the virtual memory setting, choose Yes.

  8. Confirm your settings, then choose Close.

    The system will reboot.

To examine the current virtual memory setting for your Windows NT installation

  1. From the Windows Program Manager, choose the Main program group and then choose Control Panel.

  2. Choose System.

  3. Choose Virtual Memory and examine the virtual memory settings.

  4. If the minimum setting is less than 20 MB, specify a minimum initial size of 20 MB and a maximum setting greater than 20 MB.

  5. Choose OK to close the dialog box.

  6. Choose OK to close the Control Panel.

    The system will reboot.

To examine the current virtual memory setting for your Windows 3.1 installation

  1. From the Windows Program Manager, choose the Main program group and then choose Control Panel.

  2. Choose Enhanced.

  3. Choose Virtual Memory and examine the swap file settings.

  4. If the minimum setting is less than 20,000 KB, choose Change.

    1. In the New Swapfile Settings area, enter the drive where Windows 3.1 is installed.

    2. Set the Type Permanent.

    3. Set New Size to 20,000 KB

      Make sure the maximum setting is greater than 21,000 KB.

  5. Choose OK.

    The system will reboot.

Added 01/01/96

This document was created with Scientific WorkPlace.