DBT Styles
What is a DBT Style?
A DBT Style is a named collection of DBT codes (commands) that is designed to achieve a specific purpose with respect to the formatting or translation of a section of text. Each DBT template contains a number of predefined styles, and new styles can be created at will.
Styles are a great convenience when preparing your documents, allowing a whole set of DBT codes to be applied to a document, or selected part of a document, all at the same time.
Applying a Style
There are actually several ways to apply a style. As a simple example, to apply a style to a section of text, you can highlight the text, press F8, and select a style from the list of styles in the template. For example, in any of the Basic templates, you can select the style italic to have DBT italicize the text. You can select the math style to have DBT translate and format it as a mathematical expression, or select brlinline to have DBT treat it as a sequence of pre-translated braille entered in the midst of text.
Again, the names of the styles available depend on the template selected.
Remind Me, What is a DBT Code?
A DBT Code is a command which tells DBT to take a specific action, usually at or just after the point at which the code is inserted in the text. A code can be a simple command such as telling DBT to go to a new line or to skip a line. Or it can be quite complex, such as setting all the controls for where and how page numbering is to appear in the document. There are over 200 codes in DBT.
There are Two Kinds of Style
Where a style may be entered and how the DBT editor responds when it is applied both depend on which kind of style it is.
The first kind of style is the "Linear Style". Linear Styles can only be used one at a time. Often these are called "Paragraph Styles" because these styles get applied to an entire paragraph (where a "paragraph" is technically defined as the text that lies between the prior line-ending code and the next line-ending code). Examples of Linear Styles (again from the Basic templates) are the h1. style, which formats the text as a major heading, and the para. style, which formats the text as a paragraph.
The second kind of style is the "Nestable Style", which can be used many ways. A Nestable Style can appear inside a Linear Style on a portion of text inside the paragraph, and one Nestable Style can even appear inside another. Nestable Styles are also called "Character Styles". The passage of text to which they apply can be inside one paragraph or even cross from one paragraph to another. If two Character/Nestable styles are applied, they can even overlap, as in this example, This text is italic, and this is both bold and italic, and this part is only bold.
The type of a style is indicated in its name. If the name of a style ends with a period (a full stop), it is a Linear (Paragraph) style, and that is how the DBT editor will treat it. Style names which do not end with a period indicate Nestable (Character) styles.
Formatted View v. Coded View
When you are editing text in DBT you may not see styles (or codes) because they are hidden, and instead you see the formatted effects that the styles (and codes) produce. This is DBT working in its "formatted view." To see styles and codes, you need to switch to the "coded view."
To do so, open the View menu and select Codes. When viewing codes is turned on, you see a tick (check mark) against the Codes menu item. This is what is called a "toggle" operation, so if you select Codes again when it is ticked, coded view is again turned off.
The shortcut for this is to hold down the Alt key and press the F3 key to turn on coded view. Again, this is a "toggle" command, so pressing Alt + F3 again turns coded view off.
When you have coded view on, you see additional text appear, enclosed in special punctuation. Each style is enclosed between angle brackets (less than and greater than signs). Whenever a style is used, you see both a Beginning Style and an Ending Style. For example, <h1.>My Heading</h1.> (Those familiar with HTML in web pages will recognize the similarity.)
In coded view, a code is enclosed in square brackets, for example [sk1], a code which tells DBT to skip one line.
Styles in a File Imported from Word
"Why are there so many styles already there after I open a Word file?"
When DBT opens a Microsoft Word file, DBT converts many of the formats from Word into equivalent DBT styles. Each DBT template references an mws file to assist with this conversion process.
More Ways to Apply a Style
Remember that there are two kinds of styles, and they must be applied slightly differently.
A "Paragraph Style" applies to an entire paragraph. You can simply place the cursor anywhere inside the paragraph to apply a style to it. To do this, open the Layout Menu, choose Apply Style, and navigate through the list of styles to your desired style, for example, "h1.", (the equivalent to "Heading 1" in MS Word). To apply it, press Enter.
The shortcut for this action is to press the F8 key which immediately brings up the list of styles. As the list of styles is in alphabetical order, you can press the letter h, and the selection jumps to the beginning of the "h" portion of the list. To select "h1.", you can keep typing the name of the style until it is highlighted, or you can move to it with the Up and Down arrows, or click on it with the mouse. When you reach the required style, press Enter to apply it.
A "Character Style" applies to a span of text. Suppose you want to apply the "bold" style to a phrase. Before you can apply the style to the phrase, you need to highlight it. (See highlighting text for the several ways to do a highlight.)
Having highlighted the text, open the Layout Menu, choose Apply Style, navigate through the list to find your style ("bold"), and press Enter. The shortcut, again, is to press the F8 key, which immediately brings up the list of styles. Navigate to your style, and press Enter to apply it.
Can I Apply a Character Style without Using Highlight?
There is an additional way to enter styles, assuming you know the name of the style. Place your cursor in the document where you wish the style to begin.
Hold down the Ctrl Key and press F9. A dialog box pops up, into which you can type the style name, for example bold. Then press Enter.
Now move the cursor to the point in your document where you wish the style to end. Press Ctrl+F9 again, and in the dialog box type / (forward slash) followed by the name of the style you typed at the beginning, for example /bold.
You should now see the Beginning and Ending Style on your selected text. For some styles this requires switching to "coded view".
What is the Initial Style?
The initial style is used at the beginning of a document to set its fundamental formatting choices, but an initial style can be extended to define special formatting behaviors as might be needed for a particular set of documents. These definitions might cover, for example, the handling of reference page numbers or soft hyphens, or the inclusion of fold lines for documents that have to be mailed.
Nearly all templates include an initial style, although in some templates the initial style might be hidden and so not normally appear in dialogs such as Apply Style or Modify Style. Choosing the option to Show All Styles will make it visible.