Using .mws files with DBTWin

By J. R. Westmoreland

This document describes the basic instructions you will need to use the .mws files as part of the DBTWin program.

The .mws file is used to control the substitution, or mapping, of MS-Word styles to DBTWin styles.  This translation is controlled, and modified by, the instructions contained in the .mws file.

The .mws file consists of two parts: Comments, which can be used to describe the files use and other documentation.  And Mapping Elements, which tell DBTWin how to do the importing from MS-Word styles to the corresponding styles in DBT.

The Comment Lines are lines that begin with a number sign "#".  The rest of the line is ignored.  These lines can contain anything you wish.  It is a good idea to use the comments to describe the function of the file and other items that might be necessary for some one else to know if they need to modify the file later.

The Mapping Elements are used to specify the name of the MS-Word style, its type, and the name of the DBT style to which this MS-Word should be mapped.  It can also contain additional instructions that control how the DBT style is handled and other attributes.

The rest of this document will describe the format and parameters of the mapping elements. It will also talk about the limitations of the .mws file.

The general format of the mapping element is:

<type> "<MSWord-style-name>"

{

  <parameter> = <value>

  …

}

We will now discuss each of the parts of the mapping element.

<type>

The type of the mapping element. This item has one of the following values: User which indicates that the MS-Word style is a user defined style.  These are all styles that are not part of those defined by default in MS-Word. Please see the list of Built-in styles at the end of this document. Built-In are the default styles as defined by Microsoft as part of Word. Also, Built-In styles are those that will have their names change based on your locale for Word. In general, it is a good idea to try User first and if that fails then try Built-In.

<MSWord-style-name>

This is the name of the style defined in Word.  This name should match the word style name in spelling as well as case.  This item, as well as all other items in this file, is case sensitive.

The opening and closing braces "{" and "}" are used to group the parameter and value pairs together for the MS-Word style name described above.

Now we will discuss each of the name/value pair items that can be placed in side the body of the mapping definition. The body is the information that is enclosed in the braces.

MappedName = “<DBTStyleName>” | none

The value of this parameter is the DBT style name.  If this name has a dot "." At its end, like the "para." Style, you must drop the "." From the name. E.g., "para." Would become "para".  You can also use the value "none" to indicate that there is not a style mapping for this MS-Word style.  Note: the DBT style name must be surrounded with double quotes.

MappedNameInNote = "DBTStyleName"

This keyword is used only for Footnote Reference and Endnote Reference styles.  In these cases, the MappedName keyword specifies the name of the DBT style used where the reference appears in the body of the document, and the MappedNameInNote keyword specifies the name of the DBT style used where the reference appears within the footnote or endnote.

Ignore = Always | IfBlank | IfOrnamental

This parameter is used to leave out a paragraph from the import.  It can take the following values: Always which can be used to eliminate a paragraph from the document being imported such as print-only items like header and footer. IfBlank which is used to eliminate blank paragraphs. IfOrnamental used to eliminate paragraphs whose contents are just lines of characters like dashes "-", or asterisks "*", etc.

AggregateForward = Always | Never | IfSameName | IfSameCategory

AggregateBackward = Always | Never | IfSameName | IfSameCategory

These keywords are used to check the next and previous paragraphs and determine their treatment relative to the current paragraph style mapping.  It can have the following values: IfSameName which will aggregate the paragraphs into a single block of the specified style. Always which indicates that the paragraph should always be aggregated in to the current style. Never that indicates that the paragraph should never be aggregated to the current style.  This means that the paragraph will always be imported into a DBT linear paragraph style independent of the style being used before or after it. IfSameCategory which is only applicable if you have a "Category=Index" or "Category=TOC" item in the map element body.

Level = <LevelNumber>

This keyword is the DBT style level that should be applied to the mapped style.  The mapped style is the style specified in the MappedName parameter. The value of this parameter is a number that indicates the level.

Note that Level is most often useful when a series of paragraphs is aggregated. The combination of these three properties, Level, AggregateForware and AggregateBackward is intended to bridge the gap between the way the designers of Word conceived of styles and the way Duxbury did.

Category = None | TOC | Index

This parameter is used to specify the category of the mapping. The Category parameter can have one of three values at this time. They are: TOC - indicating that this table of contents, Index - indicating that this is an index, or None - indicating that there is no category.

IgnoreEmphases = Never | InDef

This parameter is used to tell DBT how to handle emphasis indicators. The two possible values to this parameter are: Never - emphasis used in the style will be shown in braille - and InDef - DBT will ignore emphasis that is part of the style definition, but show emphasis that has been added to characters within the style.

DisableInToc = True | False

This can have one of two values True or False.  False is the default. When set to True, this causes a style to be ignored when it occurs in a Word table of contents. E.g., not mapped to a DBT style. Word makes hyperlinks out of table of content entries.  This parameter can be used to avoid putting table of content entries into computer braille.

IgnoreCentering = True | False

This parameter can be set to True or False.  False is the default.  Normally, DBT looks upon centering of a paragraph (or line) in a Word file as significant. Users generally want centered lines in the print document to be centered in braille. However, when this flag is set to True, the text that is set in that style will not be centered in DBT even if the user centers it in the Word document unless it is part of the DBT style.

IgnoreSuperscript = True | False

This parameter can be set to True of False.  False is the default.  This is typically set for character styles.  When set to true, DBT will omit [ps] and [pe] codes to indicate that the text is superscript, if the superscripting is part of the style definition.

IgnoreContents = Always | IfBlank | IfOrnamental

This parameter is similar to the Ignore parameter. It takes the same values as the Ignore parameter. The difference being that while Ignore will lose the start and end tags this parameter will lose the contents rather than the tags.

Now that we have finished the discussion of the format and parameters, with their values, of the .mws file let's talk about some good practices when you decide to modify these files.

The prime rule is: "Make sure you backup the file you want to modify. If you don't you WILL be sorry."

Remember that there are limitations to what you can do with the .mws file even though it is a very powerful tool.

List of Built-In Styles

  Normal

  Heading 1

  Heading 2

  Heading 3

  Heading 4

  Heading 5

  Heading 6

  Heading 7

  Heading 8

  Heading 9

  Index 1

  Index 2

  Index 3

  Index 4

  Index 5

  Index 6

  Index 7

  Index 8

  Index 9

  TOC 1

  TOC 2

  TOC 3

  TOC 4

  TOC 5

  TOC 6

  TOC 7

  TOC 8

  TOC 9

  Normal Indent

  Footnote Text

  Annotation Text

  Header

  Footer

  Index Heading

  Caption

  Table of Figures

  Envelope Address

  Envelope Return

  Footnote Reference

  Annotation Reference

  Line Number

  Page Number

  Endnote Reference

  Endnote Text

  Table of Authorities

  Macro Text

  TOA Heading

  List

  List Bullet

  List Number

  List 2

  List 3

  List 4

  List 5

  List Bullet 2

  List Bullet 3

  List Bullet 4

  List Bullet 5

  List Number 2

  List Number 3

  List Number 4

  List Number 5

  Title

  Closing

  Signature

  Default Paragraph Font

  Body Text

  Body Text Indent

  List Continue

  List Continue 2

  List Continue 3

  List Continue 4

  List Continue 5

  Message Header

  Subtitle

  Salutation

  Date

  Body Text First Indent

  Body Text First Indent 2

  Note Heading

  Body Text 2

  Body Text 3

  Body Text Indent 2

  Body Text Indent 3

  Block Text

  Hyperlink

  Followed Hyperlink

  Strong

  Emphasis

  Document Map

  Plain Text

  E-mail Signature

  Normal (Web)

  HTML Acronym

  HTML Address

  HTML Site

  HTML Code

  HTML Definition

  HTML Keyboard

  HTML Preformatted

  HTML Sample

  HTML Typewriter

  HTML Variable

  Table Normal

  No List

  1 / a / i

  1 / 1.1 / 1.1.1

  Article / Section

  Table Simple 1

  Table Simple 2

  Table Simple 3

  Table Classic 1

  Table Classic 2

  Table Classic 3

  Table Classic 4

  Table Colorful 1

  Table Colorful 2

  Table Colorful 3

  Table Columns 1

  Table Columns 2

  Table Columns 3

  Table Columns 4

  Table Columns 5

  Table Grid 1

  Table Grid 2

  Table Grid 3

  Table Grid 4

  Table Grid 5

  Table Grid 6

  Table Grid 7

  Table Grid 8

  Table List 1

  Table List 2

  Table List 3

  Table List 4

  Table List 5

  Table List 6

  Table List 7

  Table List 8

  Table 3D effects 1

  Table 3D effects 2

  Table 3D effects 3

  Table Contemporary

  Table Elegant

  Table Professional

  Table Subtle 1

  Table Subtle 2

  Table Web 1

  Table Web 2

  Table Web 3

  Table Grid

  Table Theme