Right-to-left text Reverser Shoebox Version 4 and later (July 1998) For files exported from Shoebox in Rich Text Format. Use Rtl Reverser if your database contains text in a right-to-left script and you want to print it using a non-Middle-East (e.g. English) edition of Microsoft Windows and Word. Please note that this approach isn't for editing right-to-left text in Microsoft Word. You edit the text in Shoebox and use Word as a "printing engine". First get right-to-left text showing correctly on the screen in Shoebox. For each language encoding corresponding to a right-to-left script (writing system), choose Advanced Options in the Language Encoding Properties dialog box, then check the "right to left" box and select a Rendering DLL along with an .SDF table. Also, for every marker being exported, make sure it has a Field Name, not just an asterisk (*). See the list of markers under Database, Properties to verify this. Once you've got all that working to your satisfaction, continue with the rest of these instructions. A. HOW TO SET IT UP Here are the files in this test package: rtlrev.txt - this file of instructions rtlrev.exe - Rtl Reverser for Word 6 rtlrev32.exe - Rtl Reverser for Word 95 and 97 rtlrev.dot - macros for Microsoft Word 6 and 95 rtlrev97,dot - macros for Microsoft Word 97 The following instructions suppose that you have at least one .DOT document template for each kind of database you export from Shoebox. For example, you may be using the mdf_e.dot template provided with Shoebox for your dictionaries. You'll need to modify each template to enable it to use the Rtl Reverser. For each of your templates, open it in Microsoft Word and follow the steps below. (These steps were written for Word 6; the details may differ for Word 95 and 97.) Note: Be sure to open the .DOT document template file; don't make a new .DOC document file. 1. Copy macros from the rtlrev.dot template. * Choose Tools, Macro [Word 6 and 95] Choose Tools, Macro, Macros [Word 97] * Choose Organizer * Choose the Macros tab [Word 6 and 95] Choose the Macro Project Items tab [Word 97] The following steps assume that your document template is on the left side of the dialog box and NORMAL.DOT is on the right. * Choose Close File under NORMAL.DOT * Choose Open File * Select the rtlrev.dot template [Word 6 and 95] Select the rtlrev97.dot template [Word 97] * Choose OK [Word 6 and 95] Choose Open [Word 97] * Select the following three macros in rtlrev.dot's list on the right side: ReverseRightToLeftText Rtlrev Rtlrev32 * Choose Copy * Choose Close * Choose File, Save 2a. Call the right-to-left macro-- do this step if the template is for the Multi-Dictionary Formatter (MDF): * Choose Tools, Macro * Select FinishExportingFromShoebox (Use a single click, NOT a double click) * Choose Edit * Find the line near the top: StartOfDocument * Insert a line after it: ReverseRightToLeftText.MAIN * Choose File, Close * Choose Yes (you want to keep the changes) * Choose File, Save 2b. Add a custom menu item to your document template-- do this step if the template is not for MDF: Instructions for Word 6 and 95: * Choose Tools, Customize * Choose the Menus tab * Select your .DOT file in the Save Changes In dropdown list box (if it isn't already) * Select from the list of Categories: Macros * Select Macros: ReverseRightToLeftText * Select Change What Menu: &Tools * Select Position on Menu: &Options... * Modify the contents of the Name on Menu box: &Finish exporting from Shoebox * Choose "Add After" * Choose Close * Choose File, Save Instructions for Word 97: * Choose Tools, Customize * Choose the Commands tab * Select Categories: Macros * Notice the item in the Commands list: TemplateProject.ReverseRightToLeftText * With the mouse drag the item over Microsoft Word's Tools menu, then down to the bottom of the menu * Let the item drop * Right click on the item * Change the Name to: &Finish exporting from Shoebox * Type Esc * Choose Close * Choose File, Save Check that the item has been added to your Tools menu. When you attach this template to an exported document, you can use the menu item to run the macro that reverses right-to-left text. Note: The ampersand in &Finish indicates that Alt+T, F is the keyboard accelerator for the menu item. 3a. Identify for Rtl Reverser which text in your documents is right-to-left by modifying the attributes of the character and paragraph styles in the template. * Choose Format, Styles * Select "Styles in Use" in the drop-down list box labelled "List" Go down the Styles list and find the ones that mark right-to-left text. You'll use Language: (no proofing) to indicate right-to-left styles: * Select the style from the list Note: Use a single click, NOT a double click. * Choose Modify * Choose Format, Language * Select (no proofing) in the list labelled "Mark Selected Text As" * Choose OK, OK Note: If you've defined style formatting using based-on relationships, then you need only do the preceding steps for the right-to-left base styles. For example, here are the styles to modify in the mdf_e.dot and mdf_n.dot templates for the Multi-Dictionary Formatter: Vernacular language: National language: Homonym number Headword (n) Letter (v) Letter (n) Lexeme national Subentry Part of speech (n) vernacular * Choose Close * Choose File, Save 3b. For right-to-left scripts in which numbers are written left-to-right, you may want to define a character style for numbers. Do the opposite of step 3a for it; that is, choose an explicit language (it doesn't matter which one) to indicate that it isn't right-to-left. 4. If you're using Windows 3.1, copy rtlrev.exe to your Windows folder; if you're using Windows 95 or NT, copy rtlrev32.exe instead. Note: Windows 95 and NT users, be sure to get rtlrev32.exe into the Windows folder, not a shortcut. The macro doesn't work if it's only a shortcut. 5. In Shoebox, set up a custom export process to convert your database to a document in Rich Text Format (RTF). Note: Follow these steps with an appropriate file loaded. Export processes are part of the database type of a file. * Choose File, Export * Choose the process closest to your needs: either RTF or Multi-Dictionary Formatter (MDF) * Choose Copy * Specify a name appropriate for this export process * Specify the template you made above to attach in Microsoft Word * Examine the other options and see if anything else should be modified. * Choose OK Note: At this point, you may set up other export processes if you wish. B. HOW TO USE IT (ONCE IT'S SET UP) 1. In Shoebox, use your custom export process to convert your database to a document in Rich Text Format (RTF). * Choose File, Export * Choose the appropriate custom process * Check "Automatically open document..." (near the bottom of the dialog box) * Choose OK 2. Open the exported document in Microsoft Word. Note: If you checked the "Automatically open document..." box in Shoebox, it will cause Word to open the document for you. Steps 3a and 3b are optional. 3a. If you will use a printer other than the current default printer, choose it now: * Choose File, Print * Select the printer you want to use * Close the Print dialog box for now (you will print in step 3d below) 3b. If you need to change the formatting for any styles, choose Format, Style, then select the style and choose Modify. Note: If you intend the formatting change to apply to future exported documents too, be sure to check the "Add to Template" box before you choose OK. If you don't, your change will be forgotten when you export again and replace this document file. 3c. Choose Tools, Finish exporting from Shoebox Microsoft Word runs a macro that makes some changes to your document and saves the file; hides itself and runs the Rtl Reverser program; then reopens your document, ready to be printed. 3d. Choose File, Print Known limitations: The implementation of text reversing in this version of Rtl Reverser and the Rtl macros is intended to format right-to-left text marked by character styles embedded in left-to-right paragraphs, e.g. glosses and example sentences in lexical entries. If your entire text is one language and your markers are primarily for paragraph styles, you can choose Edit, Select All and choose the appropriate character style. Although you can indicate that paragraph styles are right-to-left, their formatting will be rudimentary and in double-column sections it won't be correct. If you do want to experiment with right-to-left paragraphs, be sure to Modify the appropriate styles: choose Format, Paragraph and select Alignment: Right. Please send reports of problems with this test package and suggestions for making the software more useful and easier to use to Internet address: mark_pedrotti@sil.org