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 and/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 to format text has a major heading and the para. style to format the text as a paragraph.

The second kind of style is the "Nestable Style". Nestable Styles 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 portion of text they apply to can be all inside one paragraph or even cross from one paragraph to another. And if two Character/Nestable styles are applied, they can even overlap, as in this example, "This text <italic>is italic, and <bold>this is both bold and italic, and </italic>this part is only bold.</bold>"

The type of 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 turned off again.

The short cut 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</h2.> (Those familiar with HTML in web pages will recognize the similarity.)

A Code is enclosed in Square Brackets, for example [sk1] 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 names an mws file to assist with this conversion process.

More Ways to Apply a Style

Remember that there are two kinds of styles. 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 will be positioned at 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 you can 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, you need to highlight the text to which the style will be applied. (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 you wish to apply. Place your cursor at the point 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 navigate 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.

If you now examine your document, you should 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 certain default or basic formatting choices - and can be used for many other document characteristics as well. Click here for more information on the Initial Style.