9. Phrase level elements
The TEI toolbar has several buttons which may be used to quickly convert text to phrase level elements (hi
, emph
, abbr
, name
, etc) and the other way round. These toolbar buttons are similar to those found in most word processors and as such, behave like “toggle switches”. The "B" toggle is switched on when the caret is found inside some bold text; it is off otherwise.
A word processor has about 6 different basic text styles. TEI has dozens of different phrase level elements, so it would be impractical for the toolbar to contain dozens of toggles. Instead, the TEI toolbar has just 3 toggles (hi
with attribute rend="italic"
, hi
with attribute rend="bold"
, name
) and 3 menus (“italic styles”, “bold styles”, “other styles”) containing entries for many more phrase level elements.
Notice how the menu button changes to when an entry found in this menu is selected (that is, a toggle is switched on).
There are two ways to use these toggles.
- Click a toggle (e.g. “other styles” menu, date toggle). This creates an empty phrase level element at caret position (e.g. an empty
date
element). Start typing and when you are done, click this toggle again[1] to end the phrase level element and return to plain text. - OR make a text selection (possibly containing a mix of text and phrase level elements) then click a toggle to wrap this text selection into a phrase level element.
When there is no text selection and no node selection, all these toggles act on the word containing the caret. This feature is handy because it corresponds to the most common use case. However this differs from the principle of implicit element selection used everywhere else in XMLmind XML Editor.
Converting a phrase level element to plain text
If you select a phrase level element, using either the text selection or the node selection (e.g. click the phrase level element name in the node path bar), and click the corresponding toggle (which is switched on), the selection will be converted to plain text.
When there is no text selection and no node selection and a toggle is switched on, clicking this toggle converts the word containing the caret to plain text.
A handy alternative is to make a text or node selection and then click the " Plain text" toolbar button.
Going further
- Notice that the “italic styles”, “bold styles”, “other styles” menus all end with a "Customize" entry. This entry, which displays a dialog box, lets you add or remove phrase level elements to/from the menu. More information in "Dialog box allowing to edit “text style” menu items".