XMetaL Tips and Tricks
Su-Laine Yeo February 5, 2010 at 12:52 am
Mapping Bold, Italic, and Underline toolbar buttons to attributesFebruary 5, 2010 at 12:52 amParticipants 1Replies 0Last Activity 12 years, 8 months ago
You can configure XMetaL to map the B, I, and U (Bold, Italic, and Underline) toolbar buttons to particular elements, by editing the .CTM file for your customization. For example, the following code in the .CTM file says that is the element type for bold, for italic, and for underline:
In some schemas, formatting is expressed as attributes rather than as elements. For example, bold may be expressed as
, italic as , and underline as .
If your schema does this, you can still use the B, I, and U toolbar buttons to insert the appropriate markup, however it cannot be done through the .CTM file, and it requires scripting.
XMetaL Author 6.0 has an example of such a script for DocBook documents. To see it, click Help > Samples > Anatomy and Physiology (Docbook) and use the B, I, and U toolbar buttons there. The code behind it is in the docbookxi.js file and the docbookxi.mcr file in C:Program FilesXMetaL 6.0AuthorRulesDocBook5.0xi. You are free to copy this code for any other customization in XMetaL.
- You must be logged in to reply to this topic.