APPLICATION NOTE #166A USING XYWRITE III PLUS FILES WITH THE PC VERSION OF PAGEMAKER 3.0 PageMaker, a product of Aldus Corporation, is a desktop publishing package that allows you to electronically lay out the pages of your publication. Most of the text and graphics used by PageMaker are prepared using other applications and then imported by PageMaker. XYQUEST has developed import and export filters that allow XyWrite III Plus files to be read into and out of PageMaker. This application note describes how to install and use the filters on an IBM PC or compatible; it also includes some tips on using XyWrite III Plus so that the conversions are most successful. PROGRAM DESCRIPTION Each application program has its own command language. Everytime you "place" a file into a PageMaker publication, PageMaker runs the file through the appropriate import filter. The filter converts the application's commands to a format that PageMaker can understand. Similarly, an export filter takes the PageMaker format and changes it to the format used by the application. To ensure that your XyWrite III Plus files are fully compatible with PageMaker 3.0, XYQUEST has developed its own filters. When you "place" a file with the extension .XY3, PageMaker sends a copy of the file through the import filter, which converts XyWrite embedded commands to PageMaker commands. If the filter encounters a XyWrite command that is not supported by PageMaker (e.g., Column Tables), it omits that command. (Your original file remains intact, because PageMaker imports a copy of it.) The export filter creates a copy of the PageMaker file and changes the text and commands (graphics are not exported) to XyWrite format. When the filter encounters a PageMaker command that does not have a XyWrite equivalent, it interprets the information and stores the data in an IV (Invisible) command in the XyWrite file. The PC versions of the XyWrite filters are available on request through XYQUEST's Technical Support Department. INSTALLING THE FILTERS This installation procedure assumes you have already installed PageMaker 3.0 and XyWrite III Plus on your PC, and that XyWrite III Plus is loaded. Now complete the following steps to install the XyWrite III Plus filters. (See Note #1.) 1. Copy the filter files from the XYQUEST-supplied disk to the PageMaker directory on your hard disk. For example: Type: F5copy a:xy3imprt.flt,c:\pm Type: F5copy a:xy3exprt.flt,c:\pm Type: F5copy a:*.tbl,c:\pm 2. Call the file WIN.INI from the Windows or PM directory of your hard disk. For example: Type: F5call c:\windows\win.ini 3. Move the cursor to the import filters section. Type: F5se /[pmfilters/ (If the search is unsuccessful, refer to the PageMaker Reference Manual for information on adding a filters section to the WIN.INI file.) 4. Search for the term ",XY3" which identifies the XyWrite filter. Type: F5se /,xy3/ Result: If the search is successful, it means a XyWrite filter is already installed, and you need to modify the entry for it. If the search is not successful, you need to add an entry that identifies the XyWrite filter. 5. Add the following line to identify the XyWrite import filter, or change the existing XyWrite entry to read: XyWrite III(+)=XY3IMPRT,XY3 (Notice the use of the comma rather than a period in filter name.) 6. Move the cursor to the beginning of the export filters section. Press: Ctrl Home Type: F5se /[pmexports/ (If the search is unsuccessful, refer to the PageMaker Reference Manual for information on adding a filters section to the WIN.INI file.) 7. Add the following line to identify the XyWrite export filter. XyWrite III(+) export=XY3EXPRT,XY3 8. Store WIN.INI. Type: F5store Note #1 Filter Limit. PageMaker allows you to install up to 10 import filters and 20 export filters. If you already have the maximum number installed, you need to delete one before completing this procedure. (If you have an older version of the XyWrite import filter, be sure to delete it.) QUICK CHECKLIST Below is a list of things you must keep in mind when preparing a XyWrite file for importing to PageMaker. For more information on an item, refer to the appropriate section under "Converting Files." * File Naming. Rename the XyWrite file using the extension .XY3. * Embedded Commands vs. Default Commands. If you have any formatting commands set up as defaults, you must embed them in your document if you want PageMaker to honor them. * Styles. If you use styles, the filter will ignore any embedded commands that are outside the style definition, except for mode commands. * Display Modes. In XyWrite, set text in reverse (MD RV) that you want converted to italic, and set text in bold reverse (MD BR) that you want converted to bold italic. * Margin Settings. Remove the LM and RM commands from the very beginning of the XyWrite document, but keep any subsequent LM and RM commands used for creating indents. (If PageMaker finds an LM or RM command in the first line of the XyWrite file, it adds that value to its margins for all pages.) * Vertical Spacing. If you want PageMaker to ignore the XyWrite spacing between lines, turn Automatic Leading on (AL ON) in XyWrite. * Hyphenation. If the text of your document is in a foreign language, specify a hyphenation language code. Also, if you want PageMaker to use the Hyphenation Exception Dictionary you created in XyWrite, you can convert it for use by Pagemaker. * Footnotes. If your document has a second set of footnotes, add a marker to the start of each footnote in that set. * Character Substitution. If your file uses special characters not normally found on the keyboard, you may need to modify the character substitution file used by the import filter. CONVERTING FILES If you use the import filter when placing a XyWrite file into PageMaker, the filter converts every XyWrite formatting command for which there is a PageMaker equivalent. This includes modes, indents, tabs, styles, footnotes, etc. PageMaker ignores commands for top margin (TP), bottom margin (BT), offset (OF), headers (RH), footers (RF), set page number (SP), snaking columns (SN), and column tables (CT). The export filter converts PageMaker commands to their XyWrite equivalent; if there is no XyWrite equivalent, the filter stores the data in an IV (Invisible) command in the XyWrite file. The IV command, which can be seen in expanded mode only, contains the label $PM$ followed by a string of numbers. The numbers represent PageMaker values; if you re-import the file through the PageMaker import filter, that filter will restore the information to PageMaker format. If you plan to import your file into PageMaker, be careful not to edit or delete the IV commands (see Note #2). The following paragraphs explain exactly how the import conversions are handled for specific commands. Unless otherwise noted, the export filter reverses the action described for the import filter. Note #2 Editing Exported Files. If want to edit a file that you have exported from PageMaker, and plan to re-import the file, we recommend that you make your edits in expanded display mode. Because the IV commands are invisible in normal display mode, you could accidentally define and delete a block of text that contains one. Note #3 Deactivating "Export Tags." When you export a file, the "Export Tags" option is automatically selected by PageMaker. Before exporting the file, click "Export Tags" to deselect it. Otherwise, you will get tags with the symbols less than (<) and greater than (>) in your file. File Naming In order for PageMaker to read the file being imported as a XyWrite file, it must see the extension .XY3. Be sure to use this naming convention when you name your XyWrite files. When you export a file, PageMaker automatically adds the extension .XY3 to the filename you specify. Embedded Commands vs Default Commands XyWrite allows you to establish the format by inserting embedded commands in your document or by using defaults. The XyWrite import filter converts only embedded commands, not default commands. For example, let's say your STARTUP.INT file contains the command DEFAULT TS=3,6,9, but your document does not contain a TS command; your imported document will not establish tabs because PageMaker will never see the default tab setting in STARTUP.INT. That means you must explicitly define the XyWrite formatting commands in the documents you want PageMaker to import. In this example, you would embed the command TS 3,6,9 into the file. Display Modes The import and export filters convert the 13 standard XyWrite display modes to (or from) the associated PageMaker display mode. The following table defines the PageMaker mode associated with each XyWrite mode. XyWrite Mode PageMaker Mode Normal (MD NM) Normal Bold (MD BO) Bold Underline (MD UL) Underline Reverse (MD RV) Italic Bold Underline (MD BU) Bold Underline Bold Reverse (MD BR) Bold Italic Superscript (MD SU) Superscript Subscript (MD SD) Subscript Footnote Number (MD FN) Superscript Flashing (MD FL) Normal Flashing Underline (MD FU) Underline Flashing Reverse (MD FR) Italic Underline Standout (MD SO) Italic Alignment Commands The XyWrite alignment commands FL (Flush Left), FR (Flush Right), and FC (Flush Center) convert to PageMaker's align left, align right, and align center settings. Similarly, XyWrite's JU (Justify On) command turns on PageMaker's justified setting, and the NJ (No Justify) command turns PageMaker's justification off. Margin Settings The values in XyWrite's margin commands (LM and RM) are added to the values of PageMaker's inside and outside margins. For example, if your XyWrite file contains the command LM 10 (see Note #4), and the PageMaker guide for the left margin is set at 1, your publication will actually have a 2-inch left margin. You should therefore set the margins in one application or the other, but not both. We generally recommend that you remove the left and right margin commands from the beginning of the XyWrite document before placing it in PageMaker, and set the margins in PageMaker. This allows you to specify a gutter in PageMaker (for the binding edge), and easily change the margins. If you choose to use XyWrite's commands to set your margins, you need to pass the settings to PageMaker at the beginning of the file. PageMaker uses these settings to establish the publication's margin guides. If your document contains different margin settings, be sure the first RM command defines the largest value that applies to the document. Once you establish the maximum value, you can reset the right margin as necessary for indents. Because PageMaker designs a page using indents rather than margin settings, the export filter uses IP (Indent Paragraph) commands rather than the LM (Left Margin) command. For example, the export filter converts a one-inch left margin to IP 10,10 rather than LM 10. To calculate the right margin, the export filter uses a default value of RM 78, and subtracts from it the value of the right indents established by PageMaker. For example, if in PageMaker there is a right indent of 1 inch, the export filter converts the right margin to RM 68. XyWrite's top and bottom margin commands (TP and BT) are ignored by PageMaker. Note #4 Measurement Units. PageMaker and XyWrite both use inches as the default unit of horizontal measure. XyWrite, however, uses 10ths of inches, while PageMaker does not. To specify a one-inch margin in XyWrite, you specify LM 10, not 1. Indents XyWrite's IP (Indent Paragraph) command establishes two values (in 10ths of an inch--see Note #4); the first value defines the indent for the first line of each paragraph, while the second value defines the indent for the rest of the paragraph. The values in the IP command are added to the left margin. For example, if your left margin is one inch and your XyWrite file contains the command IP 10,10, all text that follows the command is indented two inches from the left. Footnotes The import filter passes footnote text that is embedded in an FN (Footnote) command to PageMaker. PageMaker, in turn, automatically numbers the footnotes and dumps the footnote text at the end of the publication as endnotes. If you have a second set of footnotes (marked by an FN2 command), PageMaker uses the first word in the footnote as the footnote marker. You might, for example, type an asterisk (followed by a space) as the first "word" in each footnote of set 2. PageMaker would then output the asterisk as the footnote marker. The export filter does not send footnotes from PageMaker to XyWrite as embedded FN commands. Instead, the export filter places a superscript number at the point of each footnote reference, and places the footnote text at the end of the document. If you then add or delete a footnote, existing footnotes will not be automatically renumbered. Hyphenation XyWrite's HY ON and HY OFF commands are passed to PageMaker to turn hyphenation on and off. In addition, you can include a value n (n is a number from 100 to 125) with the HY command to select the foreign language algorithm you want PageMaker to use for the hyphenation. The following list defines the currently available language/country codes. 100 US 101 France 102 Britain 103 Germany 104 Italy 105 Netherlands 106 Belgium/Lux 107 Sweden 108 Spain 109 Denmark 110 Portugal 111 French Canada 112 Norway 113 Israel 114 Japan 115 Australia 116 Arabia 117 Finland 118 French Switzerland 119 German Switzerland 120 Greece 121 Iceland 122 Malta 123 Cyprus 124 Turkey 125 Yugoslavia For example, to select PageMaker's French hyphenation, embed the following command in your XyWrite file: F5hy 101 Result: A triangle appears in your XyWrite file, and standard XyWrite hyphenation is turned on. When PageMaker imports the file, however, it applies its French hyphenation algorithm to the text in your document. Tab Settings Both XyWrite and PageMaker measure tab settings in tenths of an inch, and both support left, right, center, and decimal tabs. The only difference is that PageMaker's tabs are relative to the left margin, while XyWrite's tabs, by default, are relative to the left edge of the paper. You might want to change XyWrite's default setting so that your XyWrite document more closely resembles the PageMaker publication. You do this by embedding the RT (Relative Tabs) command in the document you plan to import. Type: F5rt 1 Vertical Spacing XyWrite gives you a variety of options for defining and changing vertical spacing. The fundamental choice involves whether or not you turn on automatic leading. If you do turn on automatic leading (AL ON), PageMaker assumes total control of interline spacing. You can still use the first value in the LL (Line Leading) command to adjust interparagraph spacing, but PageMaker will ignore any attempt to change the interline spacing through XyWrite. If you do not turn on automatic leading, or turn it off at some point in your document (AL OFF), XyWrite formatting commands establish the interline spacing. You can use the LS (Line Spacing) command and the LL (Line Leading) command to control the space between lines of text and between paragraphs. Because PageMaker defaults to automatic leading, the export filter always sends the command AL ON. Styles You can use XyWrite's style commands to identify the name of the PageMaker style sheet you want to invoke. When you use styles, PageMaker ignores all embedded commands outside of the style definition, except for embedded mode commands. To use this feature: 1. In PageMaker, create the style sheets you plan to use. 2. In XyWrite, use the SS command to create style definitions with the same names as those you created in PageMaker. These can be dummy commands (see Note #5), or they can include any of the XyWrite formatting commands. 3. Invoke the style by typing a Use Style command in the XyWrite document. For example: Type: F5us 2COLUMN When you export a document from PageMaker back to XyWrite, you may notice that it contains SS commands even though you weren't using styles. That's because PageMaker uses default styles when you don't explicitly name one, and the default styles are exported as SS commands. Note #5 Dummy Style Command. If you are not interested in having the display of your document in XyWrite resemble final PageMaker output as closely as possible, you can create a dummy style--one that establishes a style name, but does not contain any formatting commands. Note #6 Style Command Sets. If you pass style names to PageMaker with XyWrite's US (Use Style) command, you must have a SS (Save Style) command of the same name in your document. Otherwise, XyWrite flags the US commands as formatting errors. The SS command does not need to include formatting commands, as explained in Note #5. Note #7 Style Names. PageMaker allows you to use two words when naming style sheets. If you want to use this naming convention in XyWrite, use the underscore character ( _ ) as the word separator. Smart Quotes The import filter automatically converts the quotation mark character " to open (") and close (") quotation marks. The export filter reverses the conversion. Redlining Modes Redlining is a XyWrite feature that lets you keep track of changes that you make to a document. XyWrite does this by marking additions and deletions with special insert and delete character modes. The XyWrite insert and delete modes are: Insert Delete Modes Modes Description MD IN MD DN Normal MD IB MD DB Bold MD IU MD DU Underline MD IR MD DR Reverse MD IL MD DL Bold Underline MD IV MD DV Bold Reverse MD IS MD DS Superscript MD ID MD DD Subscript Notice that the insert and delete modes correspond to the standard text display modes. When the import filter encounters text that is in one of the insert modes, it displays the text in the appropriate PageMaker mode (e.g., normal, bold, etc.); when the filer encounters text that is in one of the delete modes, it erases that text. (See Note #8.) For example, if the XyWrite mode is MD IN (insert normal), the filter converts all text in that mode to PageMaker's normal display; if the XyWrite mode is MD DN (delete normal), the filter deletes all text in that mode. Note #8 File Integrity. The import filter does not alter your original XyWrite files; instead, it makes a copy of your XyWrite file and modifies the copy by converting commands and erasing text that has been redlined for deletion. Character Substitution XyWrite uses the IBM extended ASCII character set, while PageMaker uses the Windows ANSI character set (see Note #9). The import filter automatically converts ASCII characters 128-255 to a PageMaker equivalent, and the export filter converts them back. To make these conversions, the import filter checks the \PM directory for a character substitution file called CHRIMPC.TBL, while the export filter checks for a character substitution file called CHREXPC.TBL. CHRIMPC.TBL and CHREXPC.TBL are XyWrite text files that change the ASCII character displayed by XyWrite into an ANSI character for PageMaker, or vice versa. They do this by associating an ASCII value with its corresponding ANSI value. The tables are set up so that, whenever possible, the same characters are displayed by both application programs. In some cases, there are no equivalents, which means you have to type the ASCII character that is being used to represent the ANSI character. For example, if you want to send an en space to PageMaker, you must enter an ASCII 26 (ÿ1A) in your XyWrite text file. (To enter this character, press AltShift26.) If you call one of the character substitution files to the screen in XyWrite, you will see that each entry is described in detail. Because XyWrite cannot display all the ANSI characters, don't be confused by the entries in the left column, which may show a blank space or an unrelated character. Refer to the descriptions to see what character will actually be displayed in PageMaker. Because these character substitution files are straight ASCII files, you can alter the automatic conversions made by the filters, or change the display of other ASCII characters if you want. Note #9 Non-ANSI Screen Fonts. If you are using non-ANSI screen fonts (e.g., Bitstream fonts), the PageMaker display may vary. You can edit the appropriate character substitution files so the correct characters are displayed. USING XYWRITE TO CALCULATE PUBLICATION LENGTH You can use XyWrite to get a close approximation of what your line endings and page breaks will be when PageMaker formats your publication. This is useful if you have to write copy to fit in a certain area or number of pages. To calculate your publication length, perform the following steps in XyWrite: 1. Load the appropriate XyWrite printer file (see Notes #10 and #11). For example, if you are using a PostScript printer as your output device from PageMaker: Type: F5load 3postpls.prn 2. Call your document to the screen. 3. Turn on the P-L (Page-Line) counter. (See Note #12.) Press: Shift F9 4. In your document, embed the formatting commands that you plan to use in PageMaker. This includes margin settings, indents, line spacing, hyphenation, etc. (If you prefer, you can define styles with the SS command, and invoke the styles with the US command.) 5. Insert EL (Extra Lead) commands for each graphic you plan to insert in your publication. For example, if you want a 3-inch hole (18 lines) for a photograph: Type: F5el 18 Result: The P-L (Page-Line) indicator reflects the specified depth. Note #10 Character Widths. If you are concerned about reviewing line endings in XyWrite, and you are using ASCII characters to represent ANSI characters, you should modify your printer file's width table to include widths for these characters. For example, if you are using ÿ1A to represent an en space, you should enter the width of an en space in your printer file. Refer to Chapter 6 of the XyWrite III Plus Reference Guide for information on how to modify width tables. Note #11 PT (Print Type) Tables. Be sure your printer file contains the PT (Print Type) tables for the fonts and point sizes you plan to use in PageMaker. Although this information is not passed to PageMaker, it is important if you want to calculate line endings and number of pages for viewing in XyWrite. For information on creating a PT table, refer to Chapter 6 of the XyWrite III Plus Reference Guide or to Application Note #162. Note #12 Vertical Measurement. XyWrite measures vertically in pages and lines. By default, XyWrite uses six lines per inch. To convert the value in the P-L counter to inches, divide the number of lines by 6. For example, if the P-L counter displays a value of 1-30, it means that the cursor is on page 1, five inches from the top of the page (30/6 = 5). Note #13 Hyphenation Exception Dictionary. XyWrite's hyphenation exception dictionary is a straight ASCII text file. With a few modifications, you can load it into PageMaker so that both products use the same hyphenation exception dictionary. To do this: 1. Call DICTION from your XyWrite directory. 2. Remove all asterisks from the file. Type: F5ci /*// 3. Delete the first line of the file (the one that contains ;HY;). 4. Store the file as PMUSUSER.TXT in the PageMaker directory. For example: Type: F5st \pm\pmususer.txt Result: PageMaker automatically loads this file into memory. Note #14 Measuring in Picas and Points. If you are using a PostScript printer and would prefer to measure in picas and points rather than inches, refer to Application Note #146. Note #15 Machine Types. If you export a file and then want to import it, you must use the same machine type (i.e., Macintosh or PC) for both conversions.