Document 342 Adding new text tagsVersion: 3.5, 3.51, & 4.x - Scientific WorkPlace & Scientific Word Tagged runs are text tags that are applied to selections of text. Examples of tagged runs are bold and emphasized. Two components are needed to add tagged runs, a screen component that determines appearance in the program's edit window and the typeset component that determines the appearance of the typeset document. The screen appearance is controlled by the screen style or .cst file. New tagged runs can be added to the .cst file when using Version 4.0, but the .cst file must be edited with a text editor when using earlier versions. The typeset appearance is determined by appropriate LaTeX macros usually added to the document preamble or made available via a package file. Two examples illustrate how to add new tagged runs. These procedures were tested with Versions 3.5 and 4.x. Example 1. Adding a BoldItalics text tagScreen displayThe screen display is determined by the .cst file. To find out what .cst file is used by your document, choose File/Style. The name of the .cst file is located at the bottom of the dialog.
Typeset display using the SW filter
Typeset display using the Portable LaTeX filter
Note You can nest certain text tags, so the above effect can also be achieved by highlighting a word or words of text plus the spaces around the word(s), selecting the Bold tag, then highlighting only the word(s) and selecting the Italics tag. Example 2. Adding a bold, 11-point, typewriter text tagScreen displayThe screen display is determined by the .cst file. From the File menu, choose Style and look at the bottom of the dialog to determine the .cst file used by your document.
Typeset display using the SW filterLaTeX uses two methods to select attributes, a switch method and a macro method. The example above uses the switch method where the LaTeX source looks similar to {\switchTagged text.}. Unfortunately, the macro definition for \QTR in tcilatex.tex used only the switch method. This example uses the macro method, so tcilatex.tex must be modified. The modification given below will then work with both the switch and macro methods. This modification is already included with Version 4.1, so the following steps are needed only when using Version 3.x or 4.0.
Typeset display using the Portable LaTeX filter
Additional notesIf you share your document with other SWP or SW users, they will have to make similar changes to tcilatex.tex (if you use the macro method for defining the tagged run) and their local cst files. If you save your .cst file in the same directory as your document (from the Tag menu, choose Appearance, make changes, and then choose Save As) and then use the SW Document Manager to wrap your document, the cst file will be included with the document. If you run the Document Manager directly (in Version 3.x, from the File menu, choose Document Manager; in Version 4.x, from the Tools menu, choose Document Manager), you can also include your version of tcilatex.tex when wrapping your document. If you are using the Portable LaTeX filter, notice that Example 1 and Example 2 use different forms of expanding the \QTR macro. In Example 1, the SW input filter recognizes the expansion. In Example 2, the SW input filter doesn't recognize the expansion. Therefore, in order to see appropriately tagged text instead of a TeX field, you must include "tcimacro" in the addition to latex2.dat and save the extra comments with the document. Added 12/12/01; revised 07/03/02 This document was created with Scientific WorkPlace. |