8 Graphical presentation of documents

The graphical appearance of documents is generated by the editor itself. The user only describes the logical structure (see section 4) of documents and enters text (see section 3): page layout and typography are processed by the editor.

A presentation schema is associated with each type of document. This schema indicates how the different elements composing documents of this type are presented and how attributes influence this presentation. Presentation schemas are written in a language called P (see The Languages of Thot) which allows the creation of new presentation schemas (see section 24.2).

Style sheetscan be used to extend presentation schemas in a more specific way. A style sheet allows to redefine or extend the presentation of the documents. The editor allows the use and the editing of style sheets.

8.1 Presentation elements

Presentation schemas allow the user to include in the appearance of documents certain elements called presentation elements which are not part of the logical structure of the document but which make the structure clearer. This is the case for the text string ``Abstract'' which precedes the logical element of type Abstract and for the numbers of chapters, sections, etc.

Numbers are automatically updated by the editor when the document structure is modified. Thus, if a new section is created after this section, the following section numbers will be automatically changed.

Presentation elements are not part of the logical structure nor of the document contents. They are created by the system. The user cannot select or modify their contents directly.

Presentation elements represent the logical element with which they are associated. By clicking on them with the left mouse button, you select these elements and also the logical element they represent.

8.2 Changing presentation schema

Several presentation schemas can be associated with the same structure schema (thus, with a document type). A default presentation schema is specified in the .conf file (see section 23.2.4). This presentation schema will be associated with a newly created document.

The user can modify the presentation schema at any time by using the ``Present document'' command from the ``Present'' menu. This command displays the menu of different structure schemas used by the document, the first schema being the one which defines the document type while others are schemas of the types of the other document objects (Paragraph, Table, Math, etc.). By choosing one of these structure schemas, you get another menu which lists the presentation schemas that can be applied to this structure schema; the grey entry indicates the current presentation schema. Once a choice has been made, the editor redisplays the document using the new presentation schema.

This operation can be repeated for other structure schemas and can be performed at any time.

As an example, you can choose a presentation schema with no pages for this document. Note that when the window width is modified, the text is formatted so as to cover the window on its total width. If you go back to a schema with pages (``Present'' command), you can notice that the document format is not influenced by the change made on the window width: both presentation schemas use the window width in a different way.

8.3 Specific presentation

The layout automatically generated from presentation schemas is called generic presentation (see section 8.2). It can be modified for a given element of the document. This element has then a specific presentation. The specific presentation allows you to change the aspect of text or graphical elements (see section 18.1.2), the color or the formatting of the elements of a document; this is done through the ``Present element'' submenu of the ``Present'' menu. It also permits the geometric position and dimensions of elements to be modified.

8.3.1 Changing the aspect of the text

To modify the aspect of characters in a part of a document, first select the required part (see section 3.2 and 4.1). The selection can be reduced to a single character or enlarged to several logical elements. Then choose the ``Characters'' entry from the ``Present element'' submenu: the ``Characters'' form is displayed.

The ``Characters'' form shows the typographic features allocated to the characters of the first selected element.

This form allows you to change one or more typographic features of the characters included in the selected part: font, style, body size, underlining, underline weight.

Changes made on the aspect of the text apply to a single view (see section 9): the one in which the selection was made.

The ``Characters'' form associates typographic features with selected elements themselves and not directly with the character strings being contained (unless the selection concerns character strings). Due to the presentation schema, text leaves of the logical structure inherit the typographic features carried by their ascendants. However, certain presentation schemas do not specify inheritance.

By way of example, you can select this paragraph and associate it with the Courier font, then select the section 8.3.1 and associate it with the Helvetica font: the whole text of the section inherits the Helvetica font, except the text of this paragraph which remains in Courier (see section 8.3.6 to restore the original font to this section).

8.3.2 Changing the aspect of graphical elements

To modify the aspect of basic graphical elements of a drawing, such as the one presented in Figure 4, first select the required part, then display the ``Graphics'' form by using the ``Graphics'' entry from the ``Present element'' sub-menu.

[Here is a Drawing]

Figure 4 - Aspect of graphical elements

The ``Graphics'' form allows the line style, line weight and the fill pattern of closed elements to be modified.

When assigned in this way, the graphical aspect is applied as typographic features of characters only to the view containing the current selection. It is directly applied to selected elements and transmitted by inheritance (if it is specified by the presentation schema) to basic graphical elements.

Further details on graphic editing are given in section 18.

8.3.3 Changing color

In order to modify the color of a part of a document, he ``Colors'' entry from the ``Present element'' sub-menu must be selected. The color palette is opened, allowing you to color the selected part: click on a box with the left mouse button to assign the color of this box to the selected element; the background color is applied by using the right or the middle mouse button.

By default, graphical elements have no fill pattern but they can be given a background color: to do this, specify the fill pattern of the element (see section 8.3.2). The right and middle mouse buttons assign a uniform fill pattern to graphical elements so that such elements are filled with the selected color.

Specific colors are applied to a single view (containing the current selection) in the same way as the typographic features of characters or the aspect of graphical elements. They are directly allocated to the selected elements and transmitted by inheritance (if it is specified by the presentation schema) to basic elements (texts, graphics, images).

8.3.4 Changing format

To modify the formatting of paragraphs and other such elements, use the ``Format'' form which is displayed by selecting the ``Format'' entry from the ``Presentat element'' sub-menu.

This form allows the user to change one or more formatting parameters assigned to the selected elements: alignment mode, value and position of the first line indent, justification, line spacing and hyphenation.

The specific formatting is applied to one view only (the view containing the current selection) in the same way as the typographic features of characters and the aspect or color of graphical elements. It is directly applied to the selected elements and transmitted by inheritance (if it is specified by the presentation schema) to elements of their descents.

8.3.5 Changing element position or dimension

Use the mouse to change the position and the dimension of various elements. These changes are independent of the current selection. By simultaneously pressing the Control key and the left mouse button, you can move the selected element with the mouse. The element in question appears in a frame and the cursor shows the directions in which the element can move. The movements of the mouse move the frame and when you release the button, the element takes the position indicated by the frame. As for selection, the mouse position determines the element to be moved.

Dimensional changes are performed in the same way, but by using the middle mouse button.

Positional and dimensional changes can apply to all element types; they are not restricted to graphical elements (see section 18). For example, you can move and resize this paragraph.

The possibilities for changing the position and the size of elements are defined by the presentation schema. This is why all operations are not possible for all elements: you cannot directly change the height of a paragraph but you can change its width.

8.3.6 Returning to standard presentation

You can always remove the specific presentation applied to a part of the document or to the whole document if you want to get a homogeneous graphical form as defined by the presentation schema.

For the features characters, graphics, colors, format, open the presentation form of the feature (8.3.1 to 8.3.5) and check the ``default'' item of each menu. If the element's geometry has been modified, you can restore it by activing the ``Defaule geometry'' entry of ``Present Element'' menu.

This command displays a form which allows you to choose one or more sets of presentation features (characters, graphics, colors, format, geometry) to which you want to apply the presentation defined in the presentation schema. These sets of features correspond to those described in sections 8.3.1 to 8.3.5 .

8.4 Style sheets

The style sheets define new presentation rules in addition to those of presentation schemas. With the editor you can associate existing style sheets to a document and edit them. The style sheets management is implemented in Thot as a prototype, as a consequence it is not implemented as a complete feature is not error safe.

8.4.1 Style sheets syntax

The style sheets are expressed in the CSS (Cascading Style Sheets) language. A simple rule in CSS is composed by a selector, an attribute and a value.

The selector selects the application range of the presentation attribute value. As an example, the rule Paragraph { color:red } sets the red color to all paragraphs in the whole document.

It is possible to apply several attributes to a same element type:

Paragraph { color:red; font-size:small }

It is also possible to group several selectors and apply the same rule:

List, Exemple { color:red; font-size:small }

The style rules are grouped into categories depending on the attributes and the types they affect. Those categories [0] are:

8.4.2 Use of style sheets

The ``Style Sheets'' entry of the ``Present'' menu displays the style sheets associated to the document in decreasing priority order. The form allows you to associate a new style sheet to the document (Add a sheet), to remove the selected style sheet (Remove sheet) and to change the priority order of the used style sheets.

References to style sheets are stored with the document file. When a document referencing style sheets is opened the style sheets are read and applied automatically.

8.4.3 Edition of style sheets

The editor provides two way of editing style sheets

The ``Style'' entry of the ``Present'' menu displays a form allwing the editing of style sheet rules. This form contains two selectors: The first ``Style sheet'' allows the choice of the sheet to be edited, the other ``Style Rule'' allows to select the desired rule of the chosen style sheet. The text zone under the last selector lets you edit the rule. The button row on th right part of the form lets you define the rules using the standar specific presentation forms (``Characters'', ``Colors'', ``Graphics'', ``Format'').

The ``Style sheet'' form can also be used to duplicate or discard a existing rule.

The ``style by example'' entru of the ``Present'' menu is used to define a style rule by generalisation of the specific presentation of an element. The form displays the style rule corresponding to the specific presentation rule of the element and proposes a chioce between several selector, depending on the context of the selected element. This feature is not implemented in this version of the editor.

8.5 Pagination

Presentation schemas can define pages or not. During the writing phase of the document, it is not useful to split the document into pages, but this operation is necessary for printing.

Page format is specified in presentation schemas: height, width, margins, numbering, contents of footers and headers and so on. Presentation schemas also allow you to express constraints on the position of page breaks in order to avoid separating a section title from the beginning of the following paragraph or cutting a paragraph just after the first or last line (widow and orphan).

8.5.1 Automatic pagination

Pagination is performed by the editor upon the user's request and not continuously, like other presentation features.

When you use a presentation schema which specifies pages, the two leading items of the ``Pages'' menu cut the document into pages for one or for all views:

A large document takes some time to be paginated. You can follow the pagination process in the message area of the Thot window: the view name and the number of the processed page are displayed during operation.

8.5.2 Manual pagination

Automatic pagination commands insert ``page break'' elements within the document. These elements are saved with the document. They can be treated as any other element [4]; it is possible to remove or to insert any element anywhere in the document, thus modifying the result produced by the automatic pagination commands.

To remove a page break, just select the corresponding element (see section 4.1) by clicking on the rule marking the edge of a page and remove it (see section 4.4) with the Delete key for example.

To insert a page break, select one element or a character string, then invoke the ``Insert a page break'' command from the ``Pages'' menu. This command displays a menu which allows you to choose the position of the page break to be created: either before or after the selected part. Page breaks inserted in this way are kept when the document is repaginated with the automatic pagination commands. They can be removed, like any other page break.


[Section 9] [Table of contents]