Annotation of Amaya/doc/languages.html, revision 1.34

1.32      cvs         1: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                      2:     "http://www.w3.org/TR/html4/loose.dtd">
1.18      cvs         3: <html>
                      4: <head>
1.30      cvs         5:   <title>The Languages of Thot</title>
                      6:   <meta http-equiv="Content-Type" content="text/html">
1.18      cvs         7: </head>
1.30      cvs         8: 
1.18      cvs         9: <body>
                     10: 
1.19      cvs        11: <div class="frontmatter" align="center">
1.18      cvs        12: <h1>The Languages of Thot</h1>
                     13: 
                     14: <h3>Vincent Quint</h3>
                     15: 
                     16: <h4>Translated from French by Ethan Munson</h4>
                     17: 
1.34    ! cvs        18: <h4>Version of December 28, 2000</h4>
1.30      cvs        19: 
                     20: <p>© 1996-2000 INRIA</p>
1.18      cvs        21: <hr>
                     22: </div>
                     23: 
                     24: <div class="tableofcontents">
                     25: <h2><a href="languages.toc.html">Contents</a></h2>
                     26: <ul>
1.30      cvs        27:   <li><big><a href="#sect2">The document model of Thot</a></big>
                     28:     <ul>
                     29:       <li><strong><a href="#sectb21">The logical structure of
                     30:         documents</a></strong></li>
                     31:       <li><strong><a href="#sectb22">Generic and specific
                     32:         structures</a></strong></li>
                     33:       <li><strong><a href="#sectb23">Logical structure and physical
                     34:         structure</a></strong></li>
                     35:       <li><strong><a href="#sectb24">Document structures and object
                     36:         structures</a></strong></li>
                     37:     </ul>
                     38:   </li>
                     39:   <li><big><a href="#sect3">The S language</a></big>
                     40:     <ul>
                     41:       <li><strong><a href="#sectb31">Document meta-structure</a></strong>
                     42:         <ul>
                     43:           <li><a href="#sectc311">The basic types</a></li>
                     44:           <li><a href="#sectc312">Constructed elements</a></li>
                     45:           <li><a href="#sectc313">Logical structure constructors</a>
                     46:             <ul>
                     47:               <li><small><a href="#sectd3131">Aggregate and
                     48:               List</a></small></li>
                     49:               <li><small><a href="#sectd3132">Choice, Schema, and
                     50:                 Unit</a></small></li>
                     51:               <li><small><a href="#sectd3133">Reference and
                     52:                 Inclusion</a></small></li>
                     53:               <li><small><a href="#sectd3134">Mark pairs</a></small></li>
                     54:               <li><small><a href="#sectd3135">Restrictions and
                     55:                 Extensions</a></small></li>
                     56:               <li><small><a href="#sectd3136">Summary</a></small></li>
                     57:             </ul>
                     58:           </li>
                     59:           <li><a href="#sectc314">Associated Elements</a></li>
                     60:           <li><a href="#sectc315">Attributes</a></li>
                     61:           <li><a href="#sectc316">Discussion of the model</a></li>
                     62:         </ul>
                     63:       </li>
                     64:       <li><strong><a href="#sectb32">The definition language for generic
                     65:         structures</a></strong>
                     66:         <ul>
                     67:           <li><a href="#sectc321">Writing Conventions</a></li>
                     68:           <li><a href="#sectc322">Extension schemas</a></li>
                     69:           <li><a href="#sectc323">The general organization of structure
                     70:             schemas</a></li>
                     71:           <li><a href="#sectc324">The default presentation</a></li>
                     72:           <li><a href="#sectc325">Global Attributes</a></li>
                     73:           <li><a href="#sectc327">Structured elements</a></li>
                     74:           <li><a href="#sectc328">Structure definitions</a>
                     75:             <ul>
                     76:               <li><small><a href="#sectd3281">List</a></small></li>
                     77:               <li><small><a href="#sectd3282">Aggregate</a></small></li>
                     78:               <li><small><a href="#sectd3283">Choice</a></small></li>
                     79:               <li><small><a href="#sectd3284">Reference</a></small></li>
                     80:               <li><small><a href="#sectd3285">Mark pairs</a></small></li>
                     81:             </ul>
                     82:           </li>
                     83:           <li><a href="#sectc329">Imports</a></li>
                     84:           <li><a href="#sectc3210">Extension rules</a></li>
                     85:           <li><a href="#sectc3211">Associated elements</a></li>
                     86:           <li><a href="#sectc3212">Units</a></li>
                     87:           <li><a href="#sectc3213">Skeleton elements</a></li>
                     88:           <li><a href="#sectc3214">Exceptions</a></li>
                     89:         </ul>
                     90:       </li>
                     91:       <li><strong><a href="#sectb33">Some examples</a></strong>
                     92:         <ul>
                     93:           <li><a href="#sectc331">A class of documents: articles</a></li>
                     94:           <li><a href="#sectc332">A class of objects: mathematical
                     95:             formulas</a></li>
                     96:         </ul>
                     97:       </li>
                     98:     </ul>
                     99:   </li>
                    100:   <li><big><a href="#sect4">The P language</a></big>
                    101:     <ul>
                    102:       <li><strong><a href="#sectb41">Document presentation</a></strong>
                    103:         <ul>
                    104:           <li><a href="#sectc411">Two levels of presentation</a></li>
                    105:           <li><a href="#sectc412">Boxes</a></li>
                    106:           <li><a href="#sectc413">Views and visibility</a></li>
                    107:           <li><a href="#sectc414">Pages</a></li>
                    108:           <li><a href="#sectc415">Numbering</a></li>
1.34    ! cvs       109:           <li><a href="#sectc416">Presentation properties</a></li>
1.30      cvs       110:         </ul>
                    111:       </li>
                    112:       <li><strong><a href="#sectb42">Presentation description
                    113:         language</a></strong>
                    114:         <ul>
                    115:           <li><a href="#sectc421">The organization of a presentation
                    116:             schema</a></li>
                    117:           <li><a href="#sectc422">Views</a></li>
                    118:           <li><a href="#sectc423">Print Views</a></li>
                    119:           <li><a href="#sectc424">Counters</a></li>
                    120:           <li><a href="#sectc425">Presentation constants</a></li>
                    121:           <li><a href="#sectc426">Variables</a></li>
                    122:           <li><a href="#sectc427">Default presentation rules</a></li>
                    123:           <li><a href="#sectc428">Presentation and page layout boxes</a></li>
                    124:           <li><a href="#sectc429">Presentation of structured elements</a></li>
                    125:           <li><a href="#sectc4210">Logical attribute presentation</a></li>
                    126:           <li><a href="#sectc4212">Value transmission rules</a></li>
                    127:           <li><a href="#sectc4213">Presentation rules</a></li>
                    128:           <li><a href="#sectc4214">Conditions applying to presentation
                    129:             rules</a>
                    130:             <ul>
                    131:               <li><small><a href="#sectd42141">Conditions based on the logical
                    132:                 position of the element</a></small></li>
                    133:               <li><small><a href="#sectd42142">Conditions on
                    134:                 references</a></small></li>
                    135:               <li><small><a href="#sectd42143">Conditions on logical
                    136:                 attributes</a></small></li>
                    137:               <li><small><a href="#sectd42144">Conditions on page
                    138:                 breaks</a></small></li>
                    139:               <li><small><a href="#sectd42145">Conditions on the element's
                    140:                 content</a></small></li>
                    141:               <li><small><a href="#sectd42146">Conditions on
                    142:                 counters</a></small></li>
                    143:             </ul>
                    144:           </li>
                    145:           <li><a href="#sectc4215">A presentation rule</a></li>
                    146:           <li><a href="#sectc4216">Box axes</a></li>
                    147:           <li><a href="#sectc4217">Distance units</a></li>
                    148:           <li><a href="#sectc4218">Relative positions</a></li>
                    149:           <li><a href="#sectc4219">Box extents</a>
                    150:             <ul>
                    151:               <li><small><a href="#sectd42191">Fixed extents</a></small></li>
                    152:               <li><small><a href="#sectd42192">Relative
                    153:               extents</a></small></li>
                    154:               <li><small><a href="#sectd42193">Elastic
                    155:               extents</a></small></li>
                    156:             </ul>
                    157:           </li>
                    158:           <li><a href="#sectc4220">Overflow</a></li>
                    159:           <li><a href="#sectc4221">Inheritance</a></li>
                    160:           <li><a href="#sectc4222">Line breaking</a>
                    161:             <ul>
                    162:               <li><small><a href="#sectd42221">Line spacing</a></small></li>
                    163:               <li><small><a href="#sectd42222">First line
                    164:                 indentation</a></small></li>
                    165:               <li><small><a href="#sectd42223">Alignment</a></small></li>
                    166:               <li><small><a href="#sectd42224">Justification</a></small></li>
                    167:               <li><small><a href="#sectd42225">Hyphenation</a></small></li>
                    168:               <li><small><a href="#sectd42226">Avoiding line
                    169:                 breaking</a></small></li>
                    170:             </ul>
                    171:           </li>
                    172:           <li><a href="#sectc4223">Page breaking and line breaking
                    173:             conditions</a></li>
                    174:           <li><a href="#sectc4224">Visibility</a></li>
1.34    ! cvs       175:           <li><a href="#sectc4225">Character style properties</a>
1.30      cvs       176:             <ul>
                    177:               <li><small><a href="#sectd42251">Character size</a></small></li>
                    178:               <li><small><a href="#sectd42252">Font and character
                    179:                 style</a></small></li>
                    180:               <li><small><a href="#sectd42253">Underlining</a></small></li>
                    181:             </ul>
                    182:           </li>
                    183:           <li><a href="#sectc4226">Stacking order</a></li>
                    184:           <li><a href="#sectc4227">Line style</a></li>
                    185:           <li><a href="#sectc4228">Line thickness</a></li>
                    186:           <li><a href="#sectc4229">Fill pattern</a></li>
                    187:           <li><a href="#sectc4230">Colors</a></li>
                    188:           <li><a href="#sectc4230a">Background color and border</a></li>
                    189:           <li><a href="#sectc4230b">Background pictures</a></li>
                    190:           <li><a href="#sectc4231">Presentation box content</a></li>
                    191:           <li><a href="#sectc4232">Presentation box creation</a></li>
                    192:           <li><a href="#sectc4233">Page layout</a></li>
                    193:           <li><a href="#sectc4234">Box copies</a></li>
                    194:         </ul>
                    195:       </li>
                    196:     </ul>
                    197:   </li>
                    198:   <li><big><a href="#sect5">The T language</a></big>
                    199:     <ul>
                    200:       <li><strong><a href="#sectb51">Document translation</a></strong>
                    201:         <ul>
                    202:           <li><a href="#sectc511">Translation principles</a></li>
                    203:           <li><a href="#sectc512">Translation procedure</a></li>
                    204:         </ul>
                    205:       </li>
                    206:       <li><strong><a href="#sectb52">Translation definition
                    207:         language</a></strong>
                    208:         <ul>
                    209:           <li><a href="#sectc521">Organization of a translation
                    210:           schema</a></li>
                    211:           <li><a href="#sectc522">Line length</a></li>
                    212:           <li><a href="#sectc523">Buffers</a></li>
                    213:           <li><a href="#sectc524">Counters</a></li>
                    214:           <li><a href="#sectc525">Constants</a></li>
                    215:           <li><a href="#sectc526">Variables</a></li>
                    216:           <li><a href="#sectc527">Translating structure elements</a></li>
                    217:           <li><a href="#sectc528">Conditional rules</a>
                    218:             <ul>
                    219:               <li><small><a href="#sectd5281">Conditions based on the logical
                    220:                 position of the element</a></small></li>
                    221:               <li><small><a href="#sectd5282">Conditions on
                    222:                 references</a></small></li>
                    223:               <li><small><a href="#sectd5284">Conditions on the
                    224:                 alphabets</a></small></li>
                    225:               <li><small><a href="#sectd5285">Conditions on page
                    226:                 breaks</a></small></li>
                    227:               <li><small><a href="#sectd5286">Conditions on the element's
                    228:                 content</a></small></li>
                    229:               <li><small><a href="#sectd5288">Conditions on the presence of
                    230:                 specific presentation rules</a></small></li>
                    231:               <li><small><a href="#sectd5289">Conditions on the presence of
                    232:                 logical attributes</a></small></li>
                    233:               <li><small><a href="#sectd52810">Conditions on logical
                    234:                 attributes</a></small></li>
                    235:               <li><small><a href="#sectd52811">Conditions on specific
                    236:                 presentation rules</a></small></li>
                    237:             </ul>
                    238:           </li>
                    239:           <li><a href="#sectc529">Translation rules</a></li>
                    240:           <li><a href="#sectc5210">The <tt>Create</tt> rule</a></li>
                    241:           <li><a href="#sectc5211">The <tt>Write</tt> rule</a></li>
                    242:           <li><a href="#sectc5212">The <tt>Read</tt> rule</a></li>
                    243:           <li><a href="#sectc5213">The <tt>Include</tt> rule</a></li>
                    244:           <li><a href="#sectc5214">The <tt>Get</tt> rule</a></li>
                    245:           <li><a href="#sectc5215">The <tt>Copy</tt> rule</a></li>
                    246:           <li><a href="#sectc5216">The <tt>Use</tt> rule</a></li>
                    247:           <li><a href="#sectc5217">The <tt>Remove</tt> rule</a></li>
1.31      cvs       248:           <li><a href="#sectc5217a">The <code>Ignore</code> rule</a></li>
1.30      cvs       249:           <li><a href="#sectc5218">The <tt>NoTranslation</tt> rule</a></li>
                    250:           <li><a href="#sectc5219">The <tt>NoLineBreak</tt> rule</a></li>
                    251:           <li><a href="#sectc5220">The <tt>ChangeMainFile</tt> rule</a></li>
                    252:           <li><a href="#sectc5220a">The <tt>RemoveFile</tt> rule</a></li>
                    253:           <li><a href="#sectc5221">The <tt>Set</tt> and <tt>Add</tt>
                    254:           rules</a></li>
                    255:           <li><a href="#sectc5221a">The <tt>Indent</tt> rule</a></li>
                    256:           <li><a href="#sectc5222">Rule application order</a></li>
                    257:           <li><a href="#sectc5223">Translation of logical attributes</a></li>
                    258:           <li><a href="#sectc5224">Translation of specific
                    259:           presentations</a></li>
                    260:           <li><a href="#sectc5225">Recoding of characters, symbols and
                    261:             graphics</a></li>
                    262:         </ul>
                    263:       </li>
                    264:     </ul>
                    265:   </li>
                    266:   <li><big><a href="#sect6">Language grammars</a></big>
                    267:     <ul>
                    268:       <li><strong><a href="#sectb61">The M meta-language</a></strong></li>
                    269:       <li><strong><a href="#sectb62">The S language</a></strong></li>
                    270:       <li><strong><a href="#sectb63">The P language</a></strong></li>
                    271:       <li><strong><a href="#sectb64">The T language</a></strong></li>
                    272:     </ul>
                    273:   </li>
                    274:   <li><big><a href="#sect7">Character coding</a></big>
                    275:     <ul>
                    276:       <li><strong><a href="#sectb71">Characters</a></strong></li>
                    277:       <li><strong><a href="#sectb72">Symbols</a></strong></li>
                    278:       <li><strong><a href="#sectb73">Graphical elements</a></strong></li>
                    279:     </ul>
                    280:   </li>
1.18      cvs       281: </ul>
                    282: <hr>
                    283: </div>
1.1       cvs       284: 
1.18      cvs       285: <div class="chapter">
1.30      cvs       286: <h1><a name="sect2">The document model of Thot</a></h1>
1.1       cvs       287: 
1.30      cvs       288: <p>All of the services which Thot provides to the user are based on the
                    289: system's internal document representation.  This representation is itself
                    290: derived from the document model which underlies Thot.  The model is presented
                    291: here, prior to the description of the languages which permit the generic
                    292: specification of documents.</p>
1.1       cvs       293: 
1.18      cvs       294: <div class="section">
1.30      cvs       295: <h2><a name="sectb21">The logical structure of documents</a></h2>
1.1       cvs       296: 
1.30      cvs       297: <p>The document model of Thot is primarily designed to allow the user to
                    298: operate on those entities which s/he has in mind when s/he works on a
                    299: document. The model makes no assumptions about the nature of these entities.
                    300: It is essentially these logical entities, such as paragraphs, sections,
                    301: chapters, notes, titles, and cross-references which give a document its
                    302: logical structure.</p>
                    303: 
                    304: <p>Because of this model, the author can divide the document into chapters,
1.1       cvs       305: giving each one a title.  The content of these chapters can be further divided
1.2       cvs       306: into sections, subsections, etc.  The text is organized into successive
                    307: paragraphs, according to the content. In the writing phase, the lines, pages,
                    308: margins, spacing, fonts, and character styles are not very important. In fact,
                    309: if the system requires documents to be written in these terms, it gets in the
                    310: way. So, Thot's model is primarily based on the logical aspect of documents.
1.18      cvs       311: The creation of a model of this type essentially requires the definition :</p>
                    312: <ul>
1.30      cvs       313:   <li>of the entities which can appear in the documents,</li>
                    314:   <li>and the relations between these entities.</li>
1.18      cvs       315: </ul>
1.30      cvs       316: 
                    317: <p>The choice of entities to include in the model can be subtle.  Some
                    318: documents require chapters, while others only need various levels of sections.
                    319: Certain documents contain appendices, others don't.  In different documents
                    320: the same logical entity may go by different names (e.g. ``Conclusion'' and
1.1       cvs       321: ``Summary'').  Certain entities which are absolutely necessary in some
                    322: documents, such as clauses in a contract or the address of the recipient in a
1.18      cvs       323: letter, are useless in most other cases.</p>
1.30      cvs       324: 
                    325: <p>The differences between documents result from more than just the entities
                    326: that appear in them, but also from the relationships between these entities
                    327: and the ways that they are linked.  In certain documents, notes are spread
                    328: throughout the document, for example at the bottom of the page containing the
1.1       cvs       329: cross-reference to them, while in other documents they are collected at the
                    330: end of each chapter or even at the end of the work.  As another example, the
                    331: introduction of some documents can contain many sections, while in other
                    332: documents, the introduction is restricted to be a short sequence of
1.18      cvs       333: paragraphs.</p>
1.30      cvs       334: 
                    335: <p>All of this makes it unlikely that a single model can describe any document
                    336: at a relatively high level.  It is obviously tempting to make up a list of
                    337: widely used entities, such as chapters, sections, paragraphs, and titles, and
                    338: then map all other entities onto the available choices.  In this way, an
1.1       cvs       339: introduction can be supported as a chapter and a contract clause supported as
                    340: a paragraph or section. However, in trying to widen the range of usage of
                    341: certain entities, their meaning can be lost and the power of the model
                    342: reduced.  In addition, while this widening partially solves the problem of
                    343: choosing entities, it does not solve the problem of their organization: when a
                    344: chapter must be composed of sections, how does one indicate that an
                    345: introduction has none when it is merely another chapter?  One solution is to
                    346: include introductions in the list of supported entities. But then, how does
                    347: one distinguish those introductions which are allowed to have sections from
                    348: those which are not.  Perhaps this could be done by defining two types of
                    349: introduction. Clearly, this approach risks an infinite expansion of the list
1.18      cvs       350: of widely used entities.</p>
                    351: </div>
1.1       cvs       352: 
1.18      cvs       353: <div class="section">
1.30      cvs       354: <h2><a name="sectb22">Generic and specific structures</a></h2>
1.1       cvs       355: 
1.30      cvs       356: <p>Thus, it is apparently impossible to construct an exhaustive inventory of
                    357: all those entities which are necessary and sufficient to precisely describe
                    358: any document. It also seems impossible to specify all possible arrangements of
1.18      cvs       359: these entities in a document.  This is why Thot uses a <em>meta-model</em>
                    360: instead, which permits the description of numerous <em>models</em>, each one
                    361: describing a <em>class</em> of documents.</p>
1.30      cvs       362: 
                    363: <p>A <em>class</em> is a set of documents having very similar structure. Thus,
1.1       cvs       364: the collection of research reports published by a laboratory constitutes a
                    365: class; the set of commercial proposals by the sales department of a company
                    366: constitutes another class; the set of articles published by a journal
                    367: constitutes a third class.  Clearly, it is not possible to enumerate every
                    368: possible document class.  It is also clear that new document classes must be
1.18      cvs       369: created to satisfy new needs and applications.</p>
1.30      cvs       370: 
                    371: <p>To give a more rigorous definition of classes, we must introduce the ideas
                    372: of <em>generic structure</em> and <em>specific structure</em>.  Each document
                    373: has a <em>specific structure</em> which organizes the various parts which
                    374: comprise it.  We illustrate this with the help of a simple example comparing
                    375: two reports, A and B (<a href="#specstruct">see Figure</a>). The report A
                    376: contains an introduction followed by three chapters and a conclusion.  The
                    377: first chapter contains two sections, the second, three sections.  That is the
1.18      cvs       378: <em>specific</em> structure of document A. Similarly, the structure of
1.1       cvs       379: document B is: an introduction, two chapters, a conclusion; Chapter 1 has
                    380: three sections while Chapter 2 has four.  The specific structures of these two
1.18      cvs       381: documents are thus different.</p>
1.1       cvs       382: 
1.18      cvs       383: <div class="figure">
                    384: <hr>
                    385: <pre>        Report A                 Report B
1.1       cvs       386:              Introduction              Introduction
                    387:              Chapter 1                 Chapter 1
                    388:                   Section 1.1               Section 1.1
                    389:                   Section 1.2               Section 1.2
                    390:              Chapter 2                      Section 1.3
                    391:                   Section 2.1          Chapter 2
                    392:                   Section 2.2               Section 2.1
                    393:                   Section 2.3               Section 2.2
                    394:              Chapter 3                      Section 2.3
                    395:              Conclusion                     Section 2.4
1.18      cvs       396:                                        Conclusion</pre>
1.30      cvs       397: 
                    398: <p align="center"><em><a name="specstruct">Two specific
                    399: structures</a></em></p>
1.18      cvs       400: <hr>
1.30      cvs       401: </div>
                    402: 
                    403: <p>The <em>generic structure</em> defines the ways in which specific
                    404: structures can be constructed.  It specifies how to generate specific
                    405: structures.  The reports A and B, though different, are constructed in
                    406: accordance with the same generic structure, which specifies that a report
                    407: contains an introduction followed by a variable number of chapters and a
                    408: conclusion, with each chapter containing a variable number of sections.</p>
                    409: 
                    410: <p>There is a one-to-one correspondence between a class and a generic
                    411: structure: all the documents of a class are constructed in accordance with the
                    412: same generic structure.  Hence the definition of the class: a class is a set
                    413: of documents whose specific structure is constructed in accordance with the
                    414: same generic structure.  A class is characterized by its generic
                    415: structure.</p>
1.19      cvs       416: 
1.30      cvs       417: <p>Thus, a generic structure can be considered to be a model at the level
                    418: which interests us, but only for one class of documents.  When the definition
                    419: is limited to a single class of documents, it is possible to define a model
                    420: which does a good job of representing the documents of the class, including
                    421: the necessary entities and unencumbered by useless entities.  The description
                    422: of the organization of the documents in the class can then be sufficiently
1.18      cvs       423: precise.</p>
                    424: </div>
1.1       cvs       425: 
1.18      cvs       426: <div class="section">
1.30      cvs       427: <h2><a name="sectb23">Logical structure and physical structure</a></h2>
1.1       cvs       428: 
1.30      cvs       429: <p>Generic structures only describe the <em>logical</em> organization of
1.18      cvs       430: documents, not their <em>physical</em> presentation on a screen or on sheets
1.1       cvs       431: of paper.  However, for a document to be displayed or printed, its graphic
1.18      cvs       432: presentation must be taken into account.</p>
1.30      cvs       433: 
                    434: <p>An examination of current printed documents shows that the details of
1.1       cvs       435: presentation essentially serve to bring out their logical structure. Outside
                    436: of some particular domains, notably advertising, the presentation is rarely
                    437: independent of the logical organization of the text.  Moreover, the art of
                    438: typography consists of enhancing the organization of the text being set,
                    439: without catching the eye of the reader with overly pronounced effects.  Thus,
                    440: italic and boldface type are used to emphasize words or expressions which have
                    441: greater significance than the rest of the text: keywords, new ideas,
                    442: citations, book titles, etc.  Other effects highlight the organization of the
                    443: text: vertical space, margin changes, page breaks, centering, eventually
                    444: combined with the changes in the shapes or weight of the characters. These
                    445: effects serve to indicate the transitions between paragraphs, sections, or
                    446: chapters: an object's level in the logical structure of the document is shown
1.18      cvs       447: by the markedness of the effects.</p>
1.30      cvs       448: 
                    449: <p>Since the model permits the description of all of the logical structure of
                    450: the document, the presentation can be derived from the model without being
1.1       cvs       451: submerged in the document itself.  It suffices to use the logical structure of
                    452: the document to make the desired changes in its presentation: changes in type
1.18      cvs       453: size, type style, spacing, margin, centering, etc.</p>
1.30      cvs       454: 
                    455: <p>Just as one cannot define a unique generic logical structure for all
                    456: document classes, one cannot define universal presentation rules which can be
                    457: applied to all document classes.  For certain types of documents the chapter
                    458: titles will be centered on the page and printed in large, bold type.  For
                    459: other documents, the same chapter titles will be printed in small, italic type
                    460: and aligned on the left margin.</p>
                    461: 
                    462: <p>Therefore, it is necessary to base the presentation specifications for
1.1       cvs       463: documents on their class.  Such a specification can be very fine-grained,
                    464: because the presentation is expressed in terms of the entities defined in the
                    465: generic logical structure of the class.  Thus, it is possible to specify a
                    466: different presentation for the chapter titles and the section titles, and
                    467: similarly to specify titles for the sections according to their level in the
                    468: section hierarchy.  The set of rules which specify the presentation of all the
1.18      cvs       469: elements defined in a generic logical structure is called a <em>generic
                    470: presentation</em>.</p>
1.30      cvs       471: 
                    472: <p>There are several advantages derived from having a presentation linked to
                    473: the generic structure and described by a generic presentation. Homogeneity is
                    474: the first.  Since every document in a class corresponds to the same generic
1.1       cvs       475: logical structure, a homogenous presentation for different documents of the
                    476: same class can be assured by applying the same generic presentation to all
                    477: documents of the class.  Homogeneity of presentation can also be found among
1.2       cvs       478: the entities of a single document: every section heading will be presented  in
1.1       cvs       479: the same way, the first line of every paragraph of the same type will have the
1.18      cvs       480: same indentation, etc.</p>
1.30      cvs       481: 
                    482: <p>Another advantage of this approach to presentation is that it facilitates
1.1       cvs       483: changes to the graphical aspect of documents.  A change to the generic
                    484: presentation rules attached to each type of entity will alter the presentation
                    485: of the entire document, and will do so homogenously.  In this case, the
                    486: internal homogeneity of the class is no longer assured, but the way to control
                    487: it is simple.  It suffices to adopt a single generic presentation for the
1.18      cvs       488: entire class.</p>
1.30      cvs       489: 
                    490: <p>If the presentation of the class does not have to be homogenous, then the
1.1       cvs       491: appearance of the document can be adapted to the way it will be used or to the
                    492: device used to render it.  This quality is sufficient to allow the existence
1.18      cvs       493: of <a name="mulpres">many generic presentations</a> for the same document
1.1       cvs       494: class. By applying one or the other of these presentations to it, the document
                    495: can be seen under different graphical aspects.  It must be emphasized that
                    496: this type of modification of the presentation is not a change to the document
                    497: itself (in its specific logical structure or its content), but only in its
1.18      cvs       498: appearance at the time of editing or printing.</p>
                    499: </div>
1.1       cvs       500: 
1.18      cvs       501: <div class="section">
1.30      cvs       502: <h2><a name="sectb24">Document structures and object structures</a></h2>
1.1       cvs       503: 
1.30      cvs       504: <p>So far, we have only discussed the global structure of documents and have
                    505: not considered the contents found in that structure.  We could limit ourselves
                    506: to purely textual contents by assuming that a title or a paragraph contains a
1.1       cvs       507: simple linear text.  But this model would be too restrictive.  In fact,
                    508: certain documents contain not only text, but also contain tables,  diagrams,
                    509: photographs, mathematical formulas, and program fragments.  The model must
1.18      cvs       510: permit the representation of such <em>objects</em>.</p>
1.30      cvs       511: 
                    512: <p>Just as with the whole of the document, the model takes into account the
1.1       cvs       513: logical structure of objects of this type.  Some are clearly structured,
                    514: others are less so.  Logical structure can be recognized in mathematical
                    515: formulas, in tables, and in certain types of diagrams.  On the other hand, it
                    516: is difficult to define the structure of a photograph or of some drawings.  But
                    517: in any case, it does not seem possible to define one unique structure which
                    518: can represent every one of these types of objects.  The approach taken in the
                    519: definition of meta-structure and document classes also applies to objects.
                    520: Object classes can be defined which put together objects of similar type,
1.18      cvs       521: constructed from the same generic logical structure.</p>
1.30      cvs       522: 
                    523: <p>Thus, a mathematical class can be defined and have a generic logical
                    524: structure associated with it.  But even if a single generic structure can
                    525: represent a sufficient variety of mathematical formulas, for other objects
                    526: with less rigorous structure, multiple classes must be defined.  As for
                    527: documents, using multiple classes assures that the model can describe the full
                    528: range of objects to be presented.  It also permits the system to support
                    529: objects which were not initially anticipated.  Moreover, this comment applies
                    530: equally to mathematics: different classes of formulas can be described
                    531: depending on the domain of mathematics being described.</p>
                    532: 
                    533: <p>Since objects have the same level of logical representation as documents,
                    534: they gain the same advantages.  In particular, it is possible to define the
1.1       cvs       535: presentation separately from the objects themselves and attach it to the
                    536: class.  Thus, as for documents, objects of the same type have a uniform
                    537: presentation and the presentation of every object in a given class can be
                    538: changed simply by changing the generic presentation of the class.  Another
                    539: advantage of using this document model is that the system does not bother the
                    540: user with the details of presentation, but rather allows the user to
1.18      cvs       541: concentrate on the logical aspect of the document and the objects.</p>
1.30      cvs       542: 
                    543: <p>It is clear that the documents in a class do not necessarily use the same
1.1       cvs       544: classes of objects: one technical report will contain tables while another
                    545: report will have no tables but will use mathematical formulas. The usable
1.2       cvs       546: object classes are not always mentioned in a limiting way in the generic
                    547: logical structure of documents.  Rather, they can be chosen freely from a
1.18      cvs       548: large set, independent of the document class.</p>
1.30      cvs       549: 
                    550: <p>Thus, the object classes will be made commonplace and usable in every
1.1       cvs       551: document. The notion of ``object'' can be enlarged to include not only
                    552: non-textual elements, but also certain types of textual elements which can
                    553: appear in practically every document, whatever their class.  Among these
1.2       cvs       554: textual elements, one can mention enumerations, descriptions, examples,
1.18      cvs       555: quotations, even paragraphs.</p>
1.30      cvs       556: 
                    557: <p>Thus, the document model is not a single, general model describing every
                    558: type of document in one place.  Rather, it is a meta-model which can be used
                    559: to describe many different models each of which represents either a class of
1.1       cvs       560: similar documents or a class of similar objects which every document can
1.18      cvs       561: include.</p>
                    562: </div>
                    563: <hr>
                    564: </div>
1.1       cvs       565: 
1.18      cvs       566: <div class="chapter">
                    567: <h1><a name="sect3">The S language</a></h1>
1.1       cvs       568: 
1.18      cvs       569: <div class="section">
1.30      cvs       570: <h2><a name="sectb31">Document meta-structure</a></h2>
1.1       cvs       571: 
1.30      cvs       572: <p>Since the concept of meta-structure is well suited to the task of
                    573: describing documents at a high level of abstraction, this meta-structure must
                    574: be precisely defined.  Toward that end this section first presents the basic
1.1       cvs       575: elements from which documents and structured objects are composed and then
                    576: specifies the ways in which these basic elements are assembled into structures
1.18      cvs       577: representing complete documents and objects.</p>
1.1       cvs       578: 
1.18      cvs       579: <div class="subsection">
1.30      cvs       580: <h3><a name="sectc311">The basic types</a></h3>
1.1       cvs       581: 
1.30      cvs       582: <p>At the lowest level of a document's structure, the first atom considered is
1.1       cvs       583: the character.  However, since characters are seldom isolated, usually
                    584: appearing as part of a linear sequence, and in order to reduce the complexity
1.18      cvs       585: of the document structure, <em>character strings</em> are used as atoms and
1.1       cvs       586: consecutive characters belonging to the same structural element are grouped in
1.18      cvs       587: the same character string.</p>
1.30      cvs       588: 
                    589: <p>If the structure of a document is not refined to go down to  the level of
1.1       cvs       590: words or phrases, the contents of a simple paragraph can be considered to be a
                    591: single character string.  On the other hand, the title of a chapter, the title
                    592: of the first section of that chapter, and the text of the first paragraph of
                    593: that section constitute three different character strings, because they belong
1.18      cvs       594: to distinct structural elements.</p>
1.30      cvs       595: 
                    596: <p>If, instead, a very fine-grained representation for the structure of a
1.1       cvs       597: document is sought, character strings could be defined to contain only a
                    598: single word, or even just a single character.  This is the case, for example,
                    599: in programs,  for which one wants to retain a structure very close to the
1.2       cvs       600: syntax of the programming language.  In this case, an assignment statement
1.1       cvs       601: initializing a simple variable to zero would be composed of two structural
                    602: elements, the identifier of the variable (a short character string) and the
1.18      cvs       603: assigned value (a string of a single character, `0').</p>
1.30      cvs       604: 
                    605: <p>The character string is not the only atom necessary for representing those
1.1       cvs       606: documents that interest us.  It suffices for purely textual documents, but as
                    607: soon as the non-textual objects which we have considered arise, there must be
                    608: other atoms; the number of objects which are to be represented determines the
1.18      cvs       609: number of types of atoms that are necessary.</p>
1.30      cvs       610: 
                    611: <p>Primitive <em>graphical elements</em> are used for tables and figures of
1.1       cvs       612: different types.  These elements are simple geometric shapes like horizontal
                    613: or vertical lines, which are sufficient for tables, or even oblique lines,
1.2       cvs       614: arrows, rectangles, circles, polygons, and curves for use in figures. From
                    615: these elements and character strings, graphical objects and tables can be
1.18      cvs       616: constructed.</p>
1.30      cvs       617: 
                    618: <p>Photographs, though having very little structure, must still appear in
1.18      cvs       619: documents.  They are supported by <em>picture</em> elements, which are
                    620: represented as matrices of pixels.</p>
1.30      cvs       621: 
                    622: <p>Finally, mathematical notations require certain elements which are
1.18      cvs       623: simultaneously characters and graphical elements, the <em>symbols</em>. By way
1.2       cvs       624: of example, radicals, integration signs, or even large parentheses are
1.1       cvs       625: examples of this type of atom.  The size of each of these symbols is
                    626: determined by its environment, that is to say, by the expression to which it
1.18      cvs       627: is attached.</p>
1.30      cvs       628: 
                    629: <p>To summarize, the primitive elements which are used in the construction of
1.18      cvs       630: documents and structured objects are:</p>
                    631: <ul>
1.30      cvs       632:   <li>character strings,</li>
                    633:   <li>graphical elements,</li>
                    634:   <li>pictures,</li>
                    635:   <li>and mathematical symbols.</li>
1.18      cvs       636: </ul>
                    637: </div>
1.1       cvs       638: 
1.18      cvs       639: <div class="subsection">
1.30      cvs       640: <h3><a name="sectc312">Constructed elements</a></h3>
                    641: 
                    642: <p>A document is evidently formed from primitive elements.  But the model of
                    643: Thot also proposes higher level elements.  Thus, in a document composed of
                    644: several chapters, each chapter is an element, and in the chapters each section
                    645: is also an element, and so on.  A document is thus an organized set of
                    646: elements.</p>
1.1       cvs       647: 
1.30      cvs       648: <p>In a document there are different sorts of elements.  Each element has a
1.18      cvs       649: <em>type</em> which indicates the role of the element within the document as a
1.1       cvs       650: whole.  Thus, we have, for example, the chapter and section types.  The
                    651: document is made up of typed elements: elements of the type chapter and
                    652: elements of the type section, among others, but also character string elements
                    653: and graphical elements: the primitive elements are typed elements just as
                    654: well.  At the other extreme, the document itself is also considered to be a
1.18      cvs       655: typed element.</p>
1.30      cvs       656: 
                    657: <p>The important difference between the primitive elements and the other
                    658: elements of the document is that the primitive elements are atoms (they cannot
                    659: be decomposed), whereas the others, called <em>constructed elements</em>, are
1.1       cvs       660: composed of other elements, which can either be primitive elements or
                    661: constructed elements.  A constructed element of type chapter (or more simply,
                    662: ``a chapter'') is composed of sections, which are also constructed elements. A
                    663: paragraph, a constructed element, can be made up of character strings, which
1.18      cvs       664: are primitive elements, and of equations, which are constructed elements.</p>
1.30      cvs       665: 
                    666: <p>A document is also a constructed element.  This is an important point. In
1.1       cvs       667: particular, it allows a document to be treated as part of another document,
                    668: and conversely, permits a part of a document to be treated as a complete
                    669: document.  Thus, an article presented in a journal is treated by its author as
                    670: a document in itself, while the editor of the journal considers it to be part
                    671: of an issue.  A table or a figure appearing in a document can be extracted and
                    672: treated as a complete document, for example to prepare transparencies for a
1.18      cvs       673: conference.</p>
1.30      cvs       674: 
                    675: <p>These thoughts about types and constructed elements apply just as well to
1.1       cvs       676: objects as they do to documents.  A table is a constructed element made up of
                    677: other constructed elements, rows and columns.  A row is formed of cells, which
                    678: are also constructed elements which contain primitive elements (character
1.18      cvs       679: strings) and/or constructed elements like equations.</p>
                    680: </div>
1.1       cvs       681: 
1.18      cvs       682: <div class="subsection">
1.30      cvs       683: <h3><a name="sectc313">Logical structure constructors</a></h3>
1.1       cvs       684: 
1.30      cvs       685: <p>Having defined the primitive elements and the constructed elements, it is
                    686: now time to define the types of organization which allow the building of
1.18      cvs       687: structures.  For this, we rely on the notion of the <em>constructor</em>.  A
1.1       cvs       688: constructor defines a way of assembling certain elements in a structure.  It
                    689: resides at the level of the meta-structure: it does not describe the existing
                    690: relations in a given structure, but rather defines  how elements are assembled
1.18      cvs       691: to build a structure that conforms to a model.</p>
1.30      cvs       692: 
                    693: <p>In defining the overall organization of documents, the first two
                    694: constructors considered are the aggregate and the list.</p>
1.1       cvs       695: 
1.18      cvs       696: <div class="subsubsection">
1.30      cvs       697: <h4><a name="sectd3131">Aggregate and List</a></h4>
1.1       cvs       698: 
1.30      cvs       699: <p>The <em>aggregate</em> constructor is used to define constructed element
                    700: types which are collections of a given number of other elements. These
                    701: collections may or may not be ordered.  The elements may be either constructed
                    702: or primitive and are specified by their type.  A report (that is, a
                    703: constructed element of the report type) has an aggregate structure.  It is
                    704: formed from a title, an author's name, an introduction, a body, and a
                    705: conclusion, making it a collection of five element types.  This type of
                    706: constructor is found in practically every document, and generally at several
                    707: levels in a document.</p>
                    708: 
                    709: <p>The <em>list</em> constructor is used to define constructed elements which
                    710: are ordered sequences of elements (constructed or primitive) having the same
                    711: type. The minimum and maximum numbers of elements for the sequence can be
                    712: specified in the list constructor or the number of elements can be left
                    713: unconstrained. The body of a report is a list of chapters and is typically
                    714: required to contain a minimum of two chapters (is a chapter useful if it is
                    715: the only one in the report?) The chapter itself can contain a list of
                    716: sections, each section containing a list of paragraphs.  In the same way as
                    717: the aggregate, the list is a very frequently used constructor in every type of
                    718: document. However, these two constructors are not sufficient to describe every
                    719: document structure; thus other constructors supplement them.</p>
1.18      cvs       720: </div>
1.1       cvs       721: 
1.18      cvs       722: <div class="subsubsection">
1.30      cvs       723: <h4><a name="sectd3132">Choice, Schema, and Unit</a></h4>
1.1       cvs       724: 
1.30      cvs       725: <p>The <em>choice</em> constructor is used to define the structure of an
                    726: element type for which one alternative is chosen from several possibilities.
                    727: Thus, a paragraph can be either a simple text paragraph, or an enumeration, or
                    728: a citation.</p>
                    729: 
                    730: <p>The choice constructor indicates the complete list of possible options,
                    731: which can be too restrictive in certain cases, the paragraph being one such
                    732: case. Two constructors, <em>unit</em> and <em>schema</em>, address this
1.1       cvs       733: inconvenience.  They allow more freedom in the choice of an element type.  If
                    734: a paragraph is defined by a schema constructor, it is possible to put in the
                    735: place of a paragraph a table, an equation, a drawing or any other object
                    736: defined by another generic logical structure.  It is also possible to define a
                    737: paragraph as a sequence of units, which could be character strings, symbols,
1.2       cvs       738: or pictures.  The choice constructor alone defines a generic logical structure
1.1       cvs       739: that is relatively constrained; in contrast, using units and schemas, a very
1.18      cvs       740: open structure can be defined.</p>
1.30      cvs       741: 
                    742: <p>The <em>schema</em> constructor represents an object defined by a generic
1.18      cvs       743: logical structure chosen freely from among those available.</p>
1.30      cvs       744: 
                    745: <p>The <em>unit</em> constructor represents an element whose type can be
                    746: either a primitive type or an element type defined as a unit in the generic
                    747: logical structure of the document, or in another generic logical structure
                    748: used in the document.  Such an element may be used in document objects
                    749: constructed according to other generic structures.</p>
                    750: 
                    751: <p>Thus, for example, if a cross-reference to a footnote is defined in the
1.1       cvs       752: generic logical structure ``Article'' as a unit, a table (an object defined by
                    753: another generic structure) can contain cross-references to footnotes, when
                    754: they appear in an article.  In another type of document, a table defined by
                    755: the same generic structure can contain other types of elements, depending on
                    756: the type of document into which the table is inserted.  All that is needed is
                    757: to declare, in the generic structure for tables, that the contents of cells
                    758: are units.  In this way, the generic structure of objects is divided up
                    759: between different types of documents which are able to adapt themselves to the
1.18      cvs       760: environment into which they are inserted.</p>
                    761: </div>
1.1       cvs       762: 
1.18      cvs       763: <div class="subsubsection">
1.30      cvs       764: <h4><a name="sectd3133">Reference and Inclusion</a></h4>
1.1       cvs       765: 
1.30      cvs       766: <p>The <em>reference</em> is used to define document elements that are
1.18      cvs       767: cross-references to other elements, such as a section, a chapter, a
                    768: bibliographic citation, or a figure.  The reference is bi-directional.  It can
                    769: be used to access both the element being cross-referenced and each of the
                    770: elements which make use of the cross-reference.</p>
1.30      cvs       771: 
                    772: <p>References can be either <em>internal</em> or <em>external</em>.  That is,
1.1       cvs       773: they can designate elements which appear in the same document or in another
1.18      cvs       774: document.</p>
1.30      cvs       775: 
                    776: <p>The <em><a name="inclusion">inclusion</a></em> constructor is a special
                    777: type of reference.  Like the reference, it is an internal or external
                    778: bidirectional link, but it is not a cross-reference.  This link represents the
                    779: ``live'' inclusion of the designated element; it accesses the most recent
                    780: version of that element and not a ``dead'' copy, fixed in the state in which
                    781: it was found at the moment the copy was made.  As soon as an element is
                    782: modified, all of its inclusions are automatically brought up to date.  It must
                    783: be noted that, in addition to inclusion, Thot permits the creation of ``dead''
                    784: copies.</p>
                    785: 
                    786: <p>There are three types of inclusions: inclusions with full expansion,
1.1       cvs       787: inclusions with partial expansion, and inclusions without expansion. During
                    788: editing, inclusions without expansion are represented on the screen by the
                    789: name of the included document, in a special color, while inclusions with
                    790: expansion (full or partial) are represented by a copy (full or partial) of the
                    791: included element (also in a special color). The on-screen representation of a
1.18      cvs       792: partial inclusion is a <a href="#sectc3213">``skeleton''</a> image of the
                    793: included document.</p>
1.30      cvs       794: 
                    795: <p>Inclusion with complete expansion can be used to include parts of the same
1.1       cvs       796: document or of other documents.  Thus, it can be either an internal or an
                    797: external link.  It can be used to include certain bibliographic entries of a
                    798: scientific article in another article, or to copy part of a mathematical
                    799: formula into another formula of the same document, thus assuring that both
1.18      cvs       800: copies will remain synchronized.</p>
1.30      cvs       801: 
                    802: <p>Inclusion without expansion or with partial expansion is used to include
1.1       cvs       803: complete documents.  It is always an external link.  It is used primarily to
                    804: divide very large documents into sub-documents that are easier to manipulate,
                    805: especially when there are many authors.  So, a book can include some chapters,
                    806: where each chapter is a different document which can be edited separately.
                    807: When viewing the book on the screen, it might be desirable to see only the
                    808: titles of the chapters and sections.  This can be achieved using inclusion
1.18      cvs       809: with partial expansion.</p>
1.30      cvs       810: 
                    811: <p>During printing, inclusions without expansion or with partial expansion can
                    812: be represented either as they were shown on the screen or by a complete (and
1.18      cvs       813: up-to-date) copy of the included element or document.</p>
1.30      cvs       814: 
                    815: <p>The inclusion constructor, whatever its type, respects the generic
                    816: structure: only those elements authorized by the generic structure can be
                    817: included at a given position in a document.</p>
1.18      cvs       818: </div>
1.1       cvs       819: 
1.18      cvs       820: <div class="subsubsection">
1.30      cvs       821: <h4><a name="sectd3134">Mark pairs</a></h4>
1.1       cvs       822: 
1.30      cvs       823: <p>It is often useful to delimit certain parts of a document independently
                    824: from the logical structure.  For example, one might wish to attach some
                    825: information (in the form of an <a href="#sectc315">attribute</a>) or a
                    826: particular treatment to a group of words or a set of consecutive paragraphs.
                    827: <em>Mark pairs</em> are used to do this.</p>
                    828: 
                    829: <p>Mark pairs are elements which are always paired and are terminals in the
1.1       cvs       830: logical structure of the document.  Their position in the structure of the
                    831: document is defined in the generic structure.  It is important to note that
1.18      cvs       832: when the terminals of a mark pair are <em>extensions</em> (see the next
                    833: section), they can be used quite freely.</p>
                    834: </div>
1.1       cvs       835: 
1.18      cvs       836: <div class="subsubsection">
1.30      cvs       837: <h4><a name="sectd3135">Restrictions and Extensions</a></h4>
1.1       cvs       838: 
1.30      cvs       839: <p>The primitive types and the constructors presented so far permit the
1.1       cvs       840: definition of the logical structure of documents and objects in a rigorous
                    841: way.  But this definition can be very cumbersome in certain cases, notably
                    842: when trying to constrain or extend the authorized element types in a
1.18      cvs       843: particular context.  <em>Restrictions</em> and <em>extensions</em> are used to
                    844: cope with these cases.</p>
1.30      cvs       845: 
                    846: <p>A restriction associates with a particular element type <em>A</em>, a list
                    847: of those element types which elements of type <em>A</em> may not contain, even
                    848: if the definition of type <em>A</em> and those of its components authorize
                    849: them otherwise.  This simplifies the writing of generic logical structures and
1.1       cvs       850: allows limitations to be placed, when necessary, on the choices offered by the
1.18      cvs       851: schema and unit constructors.</p>
1.30      cvs       852: 
                    853: <p>Extensions are the inverse of restrictions.  They identify a list of
                    854: element types whose presence <em>is</em> permitted, even if its definition and
                    855: those of its components do not authorize them otherwise.</p>
1.18      cvs       856: </div>
                    857: 
                    858: <div class="subsubsection">
1.30      cvs       859: <h4><a name="sectd3136">Summary</a></h4>
1.18      cvs       860: 
1.30      cvs       861: <p>Thus, four constructors are used to construct a document:</p>
1.18      cvs       862: <ul>
1.30      cvs       863:   <li>the aggregate constructor (ordered or not),</li>
                    864:   <li>the list constructor,</li>
                    865:   <li>the choice constructor and its extensions, the unit and schema
                    866:     constructors,</li>
                    867:   <li>the reference constructor and its variant, the inclusion.</li>
                    868: </ul>
                    869: 
                    870: <p>These constructors are also sufficient for objects.  Thus, these
                    871: constructors provide a homogenous meta-model which can describe both the
                    872: organization of the document as a whole and that of the various types of
                    873: objects which it contains.  After presenting the description language for
                    874: generic structures, we will present several examples which illustrate the
                    875: appropriateness of the model.</p>
                    876: 
                    877: <p>The first three constructors (aggregate, list and choice) lead to tree-like
1.1       cvs       878: structures for documents and objects, the objects being simply the subtrees of
                    879: the tree of a document (or even of other objects' subtrees).  The reference
                    880: constructor introduces other, non-hierarchical, relations which augment those
                    881: of the tree: when a paragraph makes reference to a chapter or a section, that
                    882: relation leaves the purely tree-like structure.  Moreover,  external reference
                    883: and inclusion constructors permit the establishment of links between different
1.18      cvs       884: documents, thus creating a hypertext structure.</p>
                    885: </div>
                    886: </div>
1.1       cvs       887: 
1.18      cvs       888: <div class="subsection">
1.30      cvs       889: <h3><a name="sectc314">Associated Elements</a></h3>
1.1       cvs       890: 
1.30      cvs       891: <p>Thanks to the list, aggregate and choice constructors, the organization of
                    892: the document is specified rigorously, using constructed and primitive
                    893: elements. But a document is made up of more than just its elements; it clearly
                    894: also contains links between them.  There exist elements whose position in the
1.1       cvs       895: document's structure is not determinable.  This is notably the case for
                    896: figures and notes.  A figure can be designated at many points in the same
                    897: document and its place in the physical document can vary over the life of the
                    898: document without any effect on the meaning or clarity of the document.  At one
                    899: time, it can be placed at the end of the document along with all other
                    900: figures.  At another time, it can appear at the top of the page which follows
                    901: the first mention of the figure.  The figures can be dispersed throughout the
                    902: document or can be grouped together.  The situation is similar for notes,
                    903: which can be printed at the bottom of the page on which they are mentioned or
                    904: assembled together at the end of the chapter or even the end of the work.  Of
                    905: course, this brings up questions of the physical position of elements in
                    906: documents that are broken into pages, but this reflects the structural
                    907: instability of these elements.  They cannot be treated the same way as
                    908: elements like paragraphs or sections, whose position in the structure is
1.18      cvs       909: directly linked to the semantics of the document.</p>
1.30      cvs       910: 
                    911: <p>Those elements whose position in the structure of the document is not
                    912: fixed, even though they are definitely part of the document, are called
1.18      cvs       913: <em>associated elements</em>.  Associated elements are themselves structures,
1.1       cvs       914: which is to say that their content can be organized logically by the
1.18      cvs       915: constructors from primitive and constructed elements.</p>
1.30      cvs       916: 
                    917: <p>It can happen that the associated elements are totally disconnected from
                    918: the structure of the document, as in a commentary or appraisal of the entire
                    919: work. But more often, the associated elements are linked to the content of the
1.1       cvs       920: document by references.  This is generally the case for notes and figures,
1.18      cvs       921: among others.</p>
1.30      cvs       922: 
                    923: <p>Thus, associated elements introduce a new use for the reference
                    924: constructor. It not only serves to create links between elements of the
                    925: principal structure of the document, but also serves to link the associated
                    926: elements to the primary structure.</p>
1.18      cvs       927: </div>
1.1       cvs       928: 
1.18      cvs       929: <div class="subsection">
1.30      cvs       930: <h3><a name="sectc315">Attributes</a></h3>
1.1       cvs       931: 
1.30      cvs       932: <p>There remain logical aspects of documents that are not entirely described
                    933: by the structure.  Certain types of semantic information, which are not stated
1.1       cvs       934: explicitly in the text, must also be taken into account.  In particular, such
                    935: information is shown by typographic effects which do not correspond to a
                    936: change between structural elements.  In fact, certain titles are set in bold
                    937: or italic or are printed in a different typeface from the rest of the text in
                    938: order to mark them as structurally distinct.  But these same effects
                    939: frequently appear in the middle of continuous text (e.g. in the interior of a
                    940: paragraph).  In this case, there is no change between structural elements; the
                    941: effect serves to highlight a word, expression, or phrase.  The notion of an
1.18      cvs       942: <em>attribute</em> is used to express this type of information.</p>
1.30      cvs       943: 
                    944: <p>An attribute is a piece of information attached to a structural element
                    945: which augments the type of the element and clarifies its function in the
                    946: document. Keywords, foreign language words, and titles of other works can all
                    947: be represented by character strings with attached attributes.  Attributes may
1.1       cvs       948: also be attached to constructed elements.  Thus, an attribute indicating the
                    949: language can be attached to a single word or to a large part of a
1.18      cvs       950: document.</p>
1.30      cvs       951: 
                    952: <p>In fact, an attribute can be any piece of information which is linked to a
1.1       cvs       953: part of a document and which can be used by agents which work on the document.
                    954: For example, the language in which the document is written determines the set
                    955: of characters used by an editor or formatter.  It also determines the
                    956: algorithm or hyphenation dictionary to be used.  The attribute ``keyword''
                    957: facilitates the work of an information retrieval system.  The attribute
                    958: ``index word'' allows a formatter to automatically construct an index at the
1.18      cvs       959: end of the document.</p>
1.30      cvs       960: 
                    961: <p>As with the types of constructed elements, the attributes and the values
                    962: they can take are defined separately in each generic logical structure, not in
                    963: the meta-model, according to the needs of the document class or the nature of
                    964: the object.</p>
                    965: 
                    966: <p>Many types of attributes are offered: numeric, textual, references, and
1.18      cvs       967: enumerations:</p>
                    968: <ul>
1.30      cvs       969:   <li><em>Numeric attributes</em> can take integer values (negative, positive,
                    970:     or null).</li>
                    971:   <li><em>Textual attributes</em> have as their values character strings.</li>
                    972:   <li><em>Reference attributes</em> designate an element of the logical
                    973:     structure.</li>
                    974:   <li><em>Enumeration attributes</em> can take one value from a limited list
                    975:     of possible values, each value being a name.</li>
1.18      cvs       976: </ul>
1.30      cvs       977: 
                    978: <p>In a generic structure, there is a distinction between <em>global
1.18      cvs       979: attributes</em> and <em>local attributes</em>.  A global attribute can be
1.1       cvs       980: applied to every element type defined in the generic structure where it is
                    981: specified.  In contrast, a local attribute can only be applied to certain
                    982: types of elements, even only a single type.  The ``language'' attribute
                    983: presented above is an example of a global attribute.  An example of a local
                    984: attribute is the rank of an author (principal author of the document or
                    985: secondary author): this attribute can only be applied sensibly to an element
1.18      cvs       986: of the ``author'' type.</p>
1.30      cvs       987: 
                    988: <p>Attributes can be assigned to the elements which make up the document in
                    989: many different ways.  The author can freely and dynamically place them on any
                    990: part of the document in order to attach supplementary information of his/her
1.18      cvs       991: choice. However, attributes may only be assigned in accordance with the rules
                    992: of the generic structure; in particular, local attributes can only be assigned
                    993: to those element types for which they are defined.</p>
1.30      cvs       994: 
                    995: <p>In the generic structure, certain local attributes can be made mandatory
                    996: for certain element types.  In this case, Thot automatically associates the
1.2       cvs       997: attribute with the elements of this type and it requires the user to provide a
1.18      cvs       998: value for this attribute.</p>
1.30      cvs       999: 
                   1000: <p>Attributes can also be automatically assigned, with a given value, by every
1.1       cvs      1001: application processing the document in order to systematically add a piece of
                   1002: information to certain predefined elements of the document.  By way of
                   1003: example, in a report containing a French abstract and an English abstract,
                   1004: each of the two abstracts is defined as a sequence of paragraphs.  The first
                   1005: abstract has a value of ``French'' for the ``language'' attribute while the
1.18      cvs      1006: second abstract's ``language'' attribute has a value of ``English''.</p>
1.30      cvs      1007: 
                   1008: <p>In the case of mark pairs, attributes are logically associated with the
                   1009: pair as a whole, but are actually attached to the first mark.</p>
1.18      cvs      1010: </div>
1.1       cvs      1011: 
1.18      cvs      1012: <div class="subsection">
1.30      cvs      1013: <h3><a name="sectc316">Discussion of the model</a></h3>
1.1       cvs      1014: 
1.30      cvs      1015: <p>The notions of attribute, constructor, structured element, and associated
1.1       cvs      1016: element are used in the definition of generic logical structures of documents
                   1017: and objects.  The problem is to assemble them to form generic structures.  In
                   1018: fact, many types of elements and attributes can be found in a variety of
                   1019: generic structures.  Rather than redefine them for each structure in which
                   1020: they appear, it is best to share them between structures. The object classes
                   1021: already fill this sharing function.  If a mathematical class is defined, its
                   1022: formulas can be used in many different document classes, without redefining
                   1023: the structure of each class.  This problem arises not only for the objects
                   1024: considered here; it also arises for the commonplace textual elements found in
                   1025: many document classes.  This is the reason why the notion of object is so
                   1026: broad and why paragraphs and enumerations are also considered to be objects.
                   1027: These object classes not only permit the sharing of the structures of
1.18      cvs      1028: elements, but also of the attributes defined in the generic structures.</p>
1.30      cvs      1029: 
                   1030: <p>Structure, such as that presented here, can appear very rigid, and it is
1.1       cvs      1031: possible to imagine that a document editing system based on this model could
                   1032: prove very constraining to the user.  This is, in fact, a common criticism of
                   1033: syntax-directed editors.  This defect can be avoided with Thot, primarily for
1.18      cvs      1034: three reasons:</p>
                   1035: <ul>
1.30      cvs      1036:   <li>the generic structures are not fixed in the model itself,</li>
                   1037:   <li>the model takes the dynamics of documents into account,</li>
                   1038:   <li>the constructors offer great flexibility.</li>
1.18      cvs      1039: </ul>
1.30      cvs      1040: 
                   1041: <p>When the generic structure of a document is not predefined, but rather is
1.1       cvs      1042: constructed specifically for each document class, it can be carefully adapted
                   1043: to the current needs.  In cases where the generic structure is inadequate for
                   1044: a particular document of the class, it is always possible either to create a
                   1045: new class with a generic structure well suited to the new case or to extend
                   1046: the generic structure of the existing class to take into account the specifics
                   1047: of the document which poses the problem.  These two solutions can also be
1.18      cvs      1048: applied to objects whose structures prove to be poorly designed.</p>
1.30      cvs      1049: 
                   1050: <p>The model is sufficiently flexible to take into account all the phases of
                   1051: the life of the document.  When a generic structure specifies that a report
                   1052: must contain a title, an abstract, an introduction, at least two chapters, and
                   1053: a conclusion, this means only that a report, <em>upon completion</em>, will
                   1054: have to contain all of these elements.  When the author begins writing, none
                   1055: of these elements is present.  Thot uses this model.  Therefore, it tolerates
1.2       cvs      1056: documents which do not conform strictly to the generic structure of their
                   1057: class;  it also considers the generic logical structure to be a way of helping
1.18      cvs      1058: the user in the construction of a complex document.</p>
1.30      cvs      1059: 
                   1060: <p>In contrast, other applications may reject a document which does not
                   1061: conform strictly to its generic structure.  This is, for example, what is done
                   1062: by compilers which refuse to generate code for a program which is not
1.1       cvs      1063: syntactically correct.  This might also occur when using a document
1.18      cvs      1064: application for a report which does not have an abstract or title.</p>
1.30      cvs      1065: 
                   1066: <p>The constructors of the document model bring a great flexibility to the
1.1       cvs      1067: generic structures.  A choice constructor (and even more, a unit or schema
                   1068: constructor)  can represent several, very different elements. The list
                   1069: constructor permits the addition of more elements of the same type.  Used
                   1070: together, these two constructors permit any series of elements of different
                   1071: types.  Of course, this flexibility can be reduced wherever necessary since a
                   1072: generic structure can limit the choices or the number of elements in a
1.18      cvs      1073: list.</p>
1.30      cvs      1074: 
                   1075: <p>Another difficulty linked to the use of structure in the document model
1.1       cvs      1076: resides in the choice of the level of the structure.  The structure of a
                   1077: discussion could be extracted from the text itself via linguistic analysis.
                   1078: Some studies are exploring this approach, but the model of Thot excludes this
                   1079: type of structure.  It only takes into account the logical structure provided
1.18      cvs      1080: explicitly by the author.</p>
1.30      cvs      1081: 
                   1082: <p>However, the level of structure of the model is not imposed.  Each generic
1.1       cvs      1083: structure defines its own level of structure, adapted to the document class or
                   1084: object and to the ways in which it will be processed.  If it will only be
                   1085: edited and printed, a  relatively simple structure suffices.  If more
                   1086: specialized processing will be applied to it, the structure must represent the
                   1087: element types on which this processing must act.  By way of example, a simple
                   1088: structure is sufficient for printing formulas, but a more complex structure is
                   1089: required to perform symbolic or numeric calculations on the mathematical
1.18      cvs      1090: expressions.  The document model of Thot allows both types of structure.</p>
                   1091: </div>
                   1092: </div>
1.1       cvs      1093: 
1.18      cvs      1094: <div class="section">
1.30      cvs      1095: <h2><a name="sectb32">The definition language for generic structures</a></h2>
1.1       cvs      1096: 
1.30      cvs      1097: <p>Generic structures, which form the basis of the document model of Thot, are
1.1       cvs      1098: specified using a special language.  This definition language, called S, is
1.18      cvs      1099: described in this section.</p>
1.30      cvs      1100: 
                   1101: <p>Each generic structure, which defines a class of documents or objects, is
1.2       cvs      1102: specified by a file, written in the S language, which is called a
1.18      cvs      1103: <em>structure schema</em>.  Structure schemas are compiled into tables, called
                   1104: structure tables, which are used by Thot and which determine its behavior.</p>
1.1       cvs      1105: 
1.18      cvs      1106: <div class="subsection">
1.30      cvs      1107: <h3><a name="sectc321">Writing Conventions</a></h3>
1.1       cvs      1108: 
1.30      cvs      1109: <p>The grammar of S, like those of the languages P and T presented later, is
1.1       cvs      1110: described using the meta-language M, derived from the Backus-Naur Form
1.18      cvs      1111: (BNF).</p>
1.30      cvs      1112: 
                   1113: <p>In this meta-language each rule of the grammar is composed of a grammar
                   1114: symbol followed by an equals sign (`=') and the right part of the rule.  The
                   1115: equals sign plays the same role as the traditional `::=' of BNF: it indicates
                   1116: that the right part defines the symbol of the left part.  In the right
                   1117: part,</p>
1.18      cvs      1118: <dl>
1.30      cvs      1119:   <dt>concatenation</dt>
                   1120:     <dd>is shown by the juxtaposition of symbols;</dd>
                   1121:   <dt>character strings</dt>
                   1122:     <dd>between apostrophes ' represent terminal symbols, that is, keywords in
                   1123:       the language defined.  Keywords are written here in upper-case letters,
1.31      cvs      1124:       but can be written in any combination of upper and lower-case letters.
1.30      cvs      1125:       For example, the keyword <tt>DEFPRES</tt> of S can also be written as
                   1126:       <tt>defpres</tt> or <tt>DefPres</tt>.</dd>
                   1127:   <dt>material between brackets</dt>
                   1128:     <dd>(`[' and `]') is optional;</dd>
                   1129:   <dt>material between angle brackets</dt>
                   1130:     <dd>(`&lt;' and `&gt;') can be repeated many times or omitted;</dd>
                   1131:   <dt>the slash</dt>
                   1132:     <dd>(`/') indicates an alternative, a choice between the options separated
                   1133:       by the slash character;</dd>
                   1134:   <dt>the period</dt>
                   1135:     <dd>marks the end of a rule;</dd>
                   1136:   <dt>text between braces</dt>
                   1137:     <dd>(`{' and `}') is simply a comment.</dd>
1.18      cvs      1138: </dl>
1.30      cvs      1139: 
                   1140: <p>The M meta-language also uses the concepts of identifiers, strings, and
1.18      cvs      1141: integers:</p>
                   1142: <dl>
1.30      cvs      1143:   <dt><tt>NAME</tt></dt>
                   1144:     <dd>represents an identifier, a sequence of letters (upper or lower-case),
                   1145:       digits, and underline characters (`_'), beginning with a letter.  Also
                   1146:       considered a letter is the sequence of characters `<tt>\nnn</tt>' where
                   1147:       the letter <tt>n</tt> represents the ISO Latin-1 code of the letter in
                   1148:       octal.  It is thus possible to use accented letters in identifiers.  The
                   1149:       maximum length of identifiers is fixed by the compiler.  It is normally
                   1150:       31 characters.
                   1151:       <p>Unlike keywords, upper and lower-case letters are distinct in
                   1152:       identifiers. Thus, <tt>Title</tt>, <tt>TITLE</tt>, and <tt>title</tt>
                   1153:       are considered different identifiers.</p>
                   1154:     </dd>
                   1155:   <dt><tt>STRING</tt></dt>
                   1156:     <dd>represents a string.  This is a string of characters delimited by
1.31      cvs      1157:       apostrophes. If an apostrophe must appear in a string, it is doubled. As
                   1158:       with identifiers, strings can contain characters represented by their
1.30      cvs      1159:       octal code (after a backslash).  As with apostrophes, if a backslash
                   1160:       must appear in a string, it is doubled.</dd>
                   1161:   <dt><tt>NUMBER</tt></dt>
                   1162:     <dd>represents a positive integer or zero (without a sign), or said
                   1163:       another way, a sequence of decimal digits.</dd>
1.18      cvs      1164: </dl>
1.30      cvs      1165: 
                   1166: <p>The M language can be used to define itself as follows:</p>
1.18      cvs      1167: <pre>{ Any text between braces is a comment. }
1.30      cvs      1168: Grammar      = Rule &lt; Rule &gt; 'END' .
                   1169:                { The &lt; and &gt; signs indicate zero }
1.1       cvs      1170:                { or more repetitions. }
                   1171:                { END marks the end of the grammar. }
                   1172: Rule         = Ident '=' RightPart '.' .
                   1173:                { The period indicates the end of a rule }
                   1174: RightPart    = RtTerminal / RtIntermed .
                   1175:                { The slash indicates a choice }
                   1176: RtTerminal   ='NAME' / 'STRING' / 'NUMBER' .
                   1177:                { Right part of a terminal rule }
1.30      cvs      1178: RtIntermed   = Possibility &lt; '/' Possibility &gt; .
1.1       cvs      1179:                { Right part of an intermediate rule }
1.30      cvs      1180: Possibility  = ElemOpt &lt; ElemOpt &gt; .
                   1181: ElemOpt      = Element / '[' Element &lt; Element &gt; ']' /
                   1182:               '&lt;' Element &lt; Element &gt; '&gt;'  .
1.1       cvs      1183:                { Brackets delimit optional parts }
                   1184: Element      = Ident / KeyWord .
                   1185: Ident        = NAME .
                   1186:                { Identifier, sequence of characters }
                   1187: KeyWord      = STRING .
                   1188:                { Character string delimited by apostrophes }
1.18      cvs      1189: END</pre>
                   1190: </div>
1.1       cvs      1191: 
1.18      cvs      1192: <div class="subsection">
1.30      cvs      1193: <h3><a name="sectc322">Extension schemas</a></h3>
1.1       cvs      1194: 
1.30      cvs      1195: <p>A structure schema defines the generic logical structure of a class of
1.1       cvs      1196: documents or objects, independent of the operations which can be performed on
                   1197: the documents.  However, certain applications may require particular
                   1198: information to be represented by the structure for the documents that they
                   1199: operate on.  Thus a document version manager will need to indicate in the
                   1200: document the parts which belong to one version or another.  An indexing system
                   1201: will add highly-structured index tables as well as the links between these
1.18      cvs      1202: tables and the rest of the document.</p>
1.30      cvs      1203: 
                   1204: <p>Thus, many applications need to extend the generic structure of the
                   1205: documents on which they operate to introduce new attributes, associated
                   1206: elements or element types.  These additions are specific to each application
                   1207: and must be able to be applied to any generic structure: users will want to
                   1208: manage versions or construct indices for many types of documents.  Extension
                   1209: schemas fulfill this role: they define attributes, elements, associated
                   1210: elements, units, etc., but they can only be used jointly with a structure
                   1211: schema that they complete. Otherwise, structure schemas can always be used
                   1212: without these extensions when the corresponding applications are not
                   1213: available.</p>
1.18      cvs      1214: </div>
1.1       cvs      1215: 
1.18      cvs      1216: <div class="subsection">
1.30      cvs      1217: <h3><a name="sectc323">The general organization of structure schemas</a></h3>
1.1       cvs      1218: 
1.30      cvs      1219: <p>Every structure schema begins with the keyword <tt>STRUCTURE</tt> and ends
1.18      cvs      1220: with the keyword <tt>END</tt>.  The keyword <tt>STRUCTURE</tt> is followed by
                   1221: the keyword <tt>EXTENSION</tt> in the case where the schema defines an
1.1       cvs      1222: extension, then by the name of the generic structure which the schema defines
                   1223: (the name of the document or object class).  The name of the structure is
1.18      cvs      1224: followed by a semicolon.</p>
1.30      cvs      1225: 
                   1226: <p>In the case of a complete schema (that is, a schema which is not an
1.1       cvs      1227: extension), the definition of the name of the structure is followed by the
                   1228: declarations of the default presentation schema, the global attributes, the
1.34    ! cvs      1229: structure rules, the associated elements, the units, the skeleton elements and
        !          1230: the exceptions.  Only the definition of the structure rules is required.  Each
        !          1231: series of declarations begins with a keyword: <tt>DEFPRES</tt>, <tt>ATTR</tt>,
        !          1232: <tt>STRUCT</tt>, <tt>ASSOC</tt>, <tt>UNITS</tt>, <tt>EXPORT</tt>,
        !          1233: <tt>EXCEPT</tt>.</p>
        !          1234: 
        !          1235: <p>In the case of an extension schema, there are no skeleton elements and the
        !          1236: <tt>STRUCT</tt> section is optional, while that section is required in a
        !          1237: schema that is not an extension.  On the other hand, extension schemas can
        !          1238: contain an <tt>EXTENS</tt> section, which must not appear in a schema which is
        !          1239: not an extension; this section defines the complements to attach to the rules
        !          1240: found in the schema to which the extension will be added. The sections
        !          1241: <tt>ATTR</tt>, <tt>STRUCT</tt>, <tt>ASSOC</tt>, and <tt>UNITS</tt> define new
        !          1242: attributes, new elements, new associated elements, and new units which add
        !          1243: their definitions to the principal schema.</p>
1.18      cvs      1244: <pre>     StructSchema ='STRUCTURE' ElemID ';'
1.1       cvs      1245:                    'DEFPRES' PresID ';'
                   1246:                  [ 'ATTR' AttrSeq ]
                   1247:                    'STRUCT' RulesSeq
                   1248:                  [ 'ASSOC' RulesSeq ]
                   1249:                  [ 'UNITS' RulesSeq ]
                   1250:                  [ 'EXPORT' SkeletonSeq ]
                   1251:                  [ 'EXCEPT' ExceptSeq ]
                   1252:                    'END' .
1.18      cvs      1253:      ElemID       = NAME .</pre>
1.30      cvs      1254: 
                   1255: <p>or</p>
1.18      cvs      1256: <pre>     ExtensSchema ='STRUCTURE' 'EXTENSION' ElemID ';'
1.1       cvs      1257:                    'DEFPRES' PresID ';'
                   1258:                  [ 'ATTR' AttrSeq ]
                   1259:                  [ 'STRUCT' RulesSeq ]
                   1260:                  [ 'EXTENS' ExtensRuleSeq ]
                   1261:                  [ 'ASSOC' RulesSeq ]
                   1262:                  [ 'UNITS' RulesSeq ]
                   1263:                  [ 'EXCEPT' ExceptSeq ]
                   1264:                    'END' .
1.18      cvs      1265:      ElemID       = NAME .</pre>
                   1266: </div>
1.1       cvs      1267: 
1.18      cvs      1268: <div class="subsection">
1.30      cvs      1269: <h3><a name="sectc324">The default presentation</a></h3>
1.1       cvs      1270: 
1.30      cvs      1271: <p>It was shown <a href="#mulpres">above</a> that many different presentations
1.1       cvs      1272: are possible for documents and objects of the same class.  The structure
1.18      cvs      1273: schema defines a preferred presentation for the class, called the <em>default
                   1274: presentation</em>.  Like generic structures, presentations are described by
                   1275: programs, called <em>presentation schemas</em>, which are written in a
                   1276: specific language, P, presented <a href="#sectb42">later</a> in this document.
                   1277: The name appearing after the keyword <tt>DEFPRES</tt> is the name of the
1.2       cvs      1278: default presentation schema.  When a new document is created, Thot will use
                   1279: this presentation schema by default, but the user remains free to choose
1.18      cvs      1280: another if s/he wishes.</p>
                   1281: <pre>     PresID = NAME .</pre>
                   1282: </div>
1.1       cvs      1283: 
1.18      cvs      1284: <div class="subsection">
1.30      cvs      1285: <h3><a name="sectc325">Global Attributes</a></h3>
1.1       cvs      1286: 
1.30      cvs      1287: <p>If the generic structure includes global attributes of its own, they are
1.18      cvs      1288: declared after the keyword <tt>ATTR</tt>.  Each global attribute is defined by
1.1       cvs      1289: its name, followed by an equals sign and the definition of its type.  The
1.18      cvs      1290: declaration of a global attribute is terminated by a semi-colon.</p>
1.30      cvs      1291: 
                   1292: <p>For attributes of the numeric, textual, or reference types, the type is
1.18      cvs      1293: indicated by a keyword, <tt>INTEGER</tt>, <tt>TEXT</tt>, or <tt>REFERENCE</tt>
                   1294: respectively.</p>
1.30      cvs      1295: 
                   1296: <p>In the case of a reference attribute, the keyword <tt>REFERENCE</tt> is
1.1       cvs      1297: followed by the type of the referenced element in parentheses.  It can refer
1.18      cvs      1298: to any type at all, specified by using the keyword <tt>ANY</tt>, or to a
1.1       cvs      1299: specific type.  In the latter case, the element type designated by the
1.18      cvs      1300: reference can be defined either in the <a href="#sectc327"><tt>STRUCT</tt>
                   1301: section</a> of the same structure schema or in the <tt>STRUCT</tt> section of
1.1       cvs      1302: another structure schema.  When the type is defined in another schema, the
                   1303: element type is followed by the name of the structure schema (within
                   1304: parentheses) in which it is defined.  The name of the designated element type
1.18      cvs      1305: can be preceded by the keyword <tt>First</tt> or <tt>Second</tt>, but only in
                   1306: the case where the type is defined as <a href="#sectd3285">a pair</a>.  These
1.1       cvs      1307: keywords indicate whether the attribute must designate the first mark of the
                   1308: pair or the second.  If the reference refers to a pair and neither of these
1.18      cvs      1309: two keywords is present, then the first mark is used.</p>
1.30      cvs      1310: 
                   1311: <p>In the case of an enumeration attribute, the equals sign is followed by the
1.1       cvs      1312: list of names representing the possible values of the attribute, the names
                   1313: being separated from each other by commas.  An enumeration attribute has at
                   1314: least one possible value; the maximum number of values is defined by the
1.18      cvs      1315: compiler for the S language.</p>
1.30      cvs      1316: <pre>     AttrSeq   = Attribute &lt; Attribute &gt; .
1.1       cvs      1317:      Attribute = AttrID '=' AttrType  ';' .
                   1318:      AttrType  = 'INTEGER' / 'TEXT' /
                   1319:                  'REFERENCE' '(' RefType ')' /
                   1320:                  ValueSeq .
                   1321:      RefType   = 'ANY' / [ FirstSec ] ElemID [ ExtStruct ] .
                   1322:      FirstSec  = 'First' / 'Second' .
                   1323:      ExtStruct = '(' ElemID ')' .
1.30      cvs      1324:      ValueSeq  = AttrVal &lt; ',' AttrVal &gt; .
1.1       cvs      1325:      AttrID    = NAME .
1.18      cvs      1326:      AttrVal   = NAME .</pre>
1.30      cvs      1327: 
                   1328: <p>There is a predefined global text attribute, the <em>language</em>, which
                   1329: is automatically added to every Thot structure schema.  This attribute allows
1.2       cvs      1330: Thot to perform certain actions, such as hyphenation and spell-checking, which
                   1331: cannot be performed without knowing the language in which each part of the
                   1332: document is written.  This attribute can be used just like any explicitly
1.18      cvs      1333: declared attribute: the system acts as if every structure schema contains</p>
                   1334: <pre>ATTR
                   1335:    Language = TEXT;</pre>
1.30      cvs      1336: 
1.18      cvs      1337: <blockquote class="example">
1.30      cvs      1338:   <p><strong>Example:</strong></p>
                   1339: 
                   1340:   <p>The following specification defines the global enumeration attribute
                   1341:   WordType.</p>
                   1342:   <pre>ATTR
1.18      cvs      1343:    WordType = Definition, IndexWord, DocumentTitle;</pre>
                   1344: </blockquote>
                   1345: </div>
1.1       cvs      1346: 
1.18      cvs      1347: <div class="subsection">
1.30      cvs      1348: <h3><a name="sectc327">Structured elements</a></h3>
1.1       cvs      1349: 
1.30      cvs      1350: <p>The rules for defining structured elements are required, except in an
1.1       cvs      1351: extension schema: they constitute the core of a structure schema, since they
                   1352: define the structure of the different types of elements that occur in a
1.18      cvs      1353: document or object of the class defined by the schema.</p>
1.30      cvs      1354: 
                   1355: <p>The first structure rule after the keyword <tt>STRUCT</tt> must define the
1.1       cvs      1356: structure of the class whose name appears in the first instruction
1.18      cvs      1357: (<tt>STRUCTURE</tt>) of the schema.  This is the root rule of the schema,
                   1358: defining the root of the document tree or object tree.</p>
1.30      cvs      1359: 
                   1360: <p>The remaining rules may be placed in any order, since the language permits
                   1361: the definition of element types before or after their use, or even in the same
1.1       cvs      1362: instruction in which they are used.  This last case allows the definition of
1.18      cvs      1363: recursive structures.</p>
1.30      cvs      1364: 
                   1365: <p>Each rule is composed of a name (the name of the element type whose
                   1366: structure is being defined) followed by an equals sign and a structure
                   1367: definition.</p>
                   1368: 
                   1369: <p>If any local attributes are associated with the element type defined by the
1.2       cvs      1370: rule, they appear between parentheses after the type name and before the
1.18      cvs      1371: equals sign.  The parentheses contain, first, the keyword <tt>ATTR</tt>, then
1.2       cvs      1372: the list of local attributes, separated by commas.  Each local attribute is
                   1373: composed of the name of the attribute followed by an equals sign and the
1.18      cvs      1374: definition of the attribute's type, just as in the definition of <a
                   1375: href="#sectc325">global attributes</a>.  The name of the attribute can be
1.2       cvs      1376: preceded by an exclamation point to indicate that the attribute must always be
                   1377: present for this element type.  The same attribute, identified by its name,
                   1378: can be defined  as a local attribute for multiple element types.  In this
                   1379: case, the equals sign and definition of the attribute type need only appear in
                   1380: the first occurrence of the attribute.  It should be noted that global
1.18      cvs      1381: attributes cannot also be defined as local attributes.</p>
1.30      cvs      1382: 
                   1383: <p>If any <a href="#sectd3135">extensions</a> are defined for this element
                   1384: type, a plus sign follows the structure definition and the names of the
                   1385: extension element types appear between parentheses after the plus.  If there
                   1386: are multiple extensions, they are separated by commas.  These types can either
                   1387: be defined in the same schema, defined in other schemas, or they may be base
1.18      cvs      1388: types identified by the keywords <tt>TEXT</tt>, <tt>GRAPHICS</tt>,
                   1389: <tt>SYMBOL</tt>, or <tt>PICTURE</tt>.</p>
1.30      cvs      1390: 
                   1391: <p><a href="#sectd3135">Restrictions</a> are indicated in the same manner as
1.18      cvs      1392: extensions, but they are introduced by a minus sign and they come after the
                   1393: extensions, or if there are no extensions, after the structure definition.</p>
1.30      cvs      1394: 
                   1395: <p>If the values of attributes must be attached systematically to this element
1.18      cvs      1396: type, they are introduced by the keyword <tt>WITH</tt> and declared in the
1.1       cvs      1397: form of a list of fixed-value attributes.  When such definitions of fixed
1.18      cvs      1398: attribute values appear, they are always the last part of the rule.</p>
1.30      cvs      1399: 
                   1400: <p>The rule is terminated by a semicolon.</p>
                   1401: <pre>  RuleSeq       = Rule &lt; Rule &gt; .
1.1       cvs      1402:   Rule          = ElemID [ LocAttrSeq ] '=' DefWithAttr ';'.
1.30      cvs      1403:   LocAttrSeq    = '(' 'ATTR' LocAttr &lt; ';' LocAttr &gt; ')' .
1.1       cvs      1404:   LocAttr       = [ '!' ] AttrID [ '=' AttrType ] .
                   1405:   DefWithAttr   = Definition
                   1406:                   [ '+' '(' ExtensionSeq ')' ]
                   1407:                   [ '-' '(' RestrictSeq ')' ]
                   1408:                   [ 'WITH' FixedAttrSeq ] .
1.30      cvs      1409:   ExtensionSeq  = ExtensionElem &lt; ',' ExtensionElem &gt; .
1.1       cvs      1410:   ExtensionElem = ElemID / 'TEXT' / 'GRAPHICS' /
                   1411:                   'SYMBOL' / 'PICTURE' .
1.30      cvs      1412:   RestrictSeq   = RestrictElem &lt; ',' RestrictElem &gt; .
1.1       cvs      1413:   RestrictElem  = ElemID / 'TEXT' / 'GRAPHICS' /
1.18      cvs      1414:                   'SYMBOL' / 'PICTURE' .</pre>
1.30      cvs      1415: 
                   1416: <p>The list of fixed-value attributes is composed of a sequence of
1.1       cvs      1417: attribute-value pairs separated by commas.  Each pair contains the name of the
                   1418: attribute and the fixed value for this element type, the two being separated
                   1419: by an equals sign.  If the sign is preceded by a question mark the given value
                   1420: is only an initial value that may be modified later rather than a value fixed
                   1421: for all time.  Reference attributes are an exception to this norm.  They
                   1422: cannot be assigned a fixed value, but when the name of such an attribute
                   1423: appears this indicates that this element type must have a valid value for the
1.2       cvs      1424: attribute.  For the other attribute types, the fixed value is indicated by a
1.1       cvs      1425: signed integer (numeric attributes), a character string between apostrophes
1.18      cvs      1426: (textual attributes) or the name of a value (enumeration attributes).</p>
1.30      cvs      1427: 
                   1428: <p>Fixed-value attributes can either be <a href="#sectc325">global</a> or
                   1429: local to the element type for which they are fixed, but they must be declared
                   1430: before they are used.</p>
                   1431: <pre>    FixedAttrSeq    = FixedAttr &lt; ',' FixedAttr &gt; .
1.1       cvs      1432:     FixedAttr       = AttrID [ FixedOrModifVal ] .
                   1433:     FixedOrModifVal = [ '?' ] '=' FixedValue .
                   1434:     FixedValue      = [ '-' ] NumValue / TextVal / AttrVal .
                   1435:     NumValue        = NUMBER .
1.18      cvs      1436:     TextVal         = STRING .</pre>
                   1437: </div>
1.1       cvs      1438: 
1.18      cvs      1439: <div class="subsection">
1.30      cvs      1440: <h3><a name="sectc328">Structure definitions</a></h3>
1.1       cvs      1441: 
1.30      cvs      1442: <p>The structure of an element type can be a simple base type or a constructed
1.18      cvs      1443: type.</p>
1.30      cvs      1444: 
                   1445: <p>For constructed types, it is frequently the case that similar structures
1.1       cvs      1446: appear in many places in a document.  For example the contents of the
                   1447: abstract, of the introduction, and of a section can have the same structure,
                   1448: that of a sequence of paragraphs.  In this case, a single, common structure
                   1449: can be defined (the paragraph sequence in this example), and the schema is
                   1450: written to indicate that each element type possesses this structure, as
1.18      cvs      1451: follows:</p>
                   1452: <pre>     Abstract           = Paragraph_sequence;
1.1       cvs      1453:      Introduction       = Paragraph_sequence;
1.18      cvs      1454:      Section_contents   = Paragraph_sequence;</pre>
1.30      cvs      1455: 
                   1456: <p>The equals sign means ``has the same structure as''.</p>
                   1457: 
                   1458: <p>If the element type defined is a simple base type, this is indicated by one
                   1459: of the keywords <tt>TEXT</tt>, <tt>GRAPHICS</tt>, <tt>SYMBOL</tt>, or
1.18      cvs      1460: <tt>PICTURE</tt>.  If some local attributes must be associated with a base
1.1       cvs      1461: type, the keyword of the base type is followed by the declaration of the local
1.18      cvs      1462: attributes using the syntax <a href="#sectc327">presented above.</a></p>
1.30      cvs      1463: 
                   1464: <p>In the case of an open choice, the type is indicated by the keyword
1.18      cvs      1465: <tt>UNIT</tt> for units or the keyword <tt>NATURE</tt> for objects having a
                   1466: structure defined by any other schema.</p>
1.30      cvs      1467: 
                   1468: <p>A unit represents one of the two following categories:</p>
1.18      cvs      1469: <ul>
1.30      cvs      1470:   <li>a base type: text, graphical element, symbol, picture,</li>
                   1471:   <li>an element whose type is chosen from among the types defined as units in
                   1472:     the <tt>UNITS</tt> section of the document's structure schema.  It can
                   1473:     also be chosen from among the types defined as <a
                   1474:     href="#sectd3132">units</a> in the <a href="#sectc3212"><tt>UNITS</tt>
                   1475:     section</a> of the structure schemas that defines the ancestors of the
                   1476:     element to which the rule is applied.</li>
1.18      cvs      1477: </ul>
1.30      cvs      1478: 
                   1479: <p>Before the creation of an element defined as a unit, Thot asks the user to
1.18      cvs      1480: choose between the categories of elements.</p>
1.30      cvs      1481: 
                   1482: <p>Thus, the contents of a paragraph can be specified as a sequence of units,
1.1       cvs      1483: which will permit the inclusion in the paragraphs of character strings,
                   1484: symbols, and various elements, such as cross-references, if these are defined
1.18      cvs      1485: as units.</p>
1.30      cvs      1486: 
                   1487: <p>A schema object (keyword <tt>NATURE</tt>) represents an object defined by a
1.1       cvs      1488: structure schema freely chosen from among the available schemas; in the case
                   1489: the element type is defined by the first rule (the root rule) of the chosen
1.18      cvs      1490: schema.</p>
1.30      cvs      1491: 
                   1492: <p>If the element type defined is a constructed type, the list, aggregate,
1.1       cvs      1493: choice, and reference constructors are used.  In this case the definition
                   1494: begins with a keyword identifying the constructor.  This keyword is followed
1.18      cvs      1495: by a syntax specific to each constructor.</p>
1.30      cvs      1496: 
                   1497: <p>The local attribute definitions appear after the name of the element type
1.18      cvs      1498: being defined, if this element type has <a href="#sectc327">local
                   1499: attributes</a>.</p>
                   1500: <pre>   Definition = BaseType [ LocAttrSeq ] / Constr / Element .
1.1       cvs      1501:    BaseType   = 'TEXT' / 'GRAPHICS' / 'SYMBOL' / 'PICTURE' /
                   1502:                 'UNIT' / 'NATURE' .
                   1503:    Element    = ElemID [ ExtOrDef ] .
                   1504:    ExtOrDef   = 'EXTERN' / 'INCLUDED' / 
                   1505:                 [ LocAttrSeq ] '=' Definition .
                   1506:    Constr     = 'LIST' [ '[' min '..' max ']' ] 'OF'
                   1507:                        '(' DefWithAttr ')' /
                   1508:                 'BEGIN' DefOptSeq 'END' /
                   1509:                 'AGGREGATE' DefOptSeq 'END' /
                   1510:                 'CASE' 'OF' DefSeq 'END' /
                   1511:                 'REFERENCE' '(' RefType ')' /
1.18      cvs      1512:                 'PAIR' .</pre>
1.1       cvs      1513: 
1.18      cvs      1514: <div class="subsubsection">
1.30      cvs      1515: <h4><a name="sectd3281">List</a></h4>
1.1       cvs      1516: 
1.30      cvs      1517: <p>The list constructor permits the definition of an element type composed of
                   1518: a list of elements, all of the same type.  A list definition begins with the
1.18      cvs      1519: <tt>LIST</tt> keyword followed by an optional range, the keyword <tt>OF</tt>,
1.1       cvs      1520: and the definition, between parentheses, of the element type which must
                   1521: compose the list.  The optional range is composed of the minimum and maximum
                   1522: number of elements for the list separated by two periods and enclosed by
                   1523: brackets.  If the range is not present, the number of list elements is
                   1524: unconstrained.  When only one of the two bounds of the range is unconstrained,
                   1525: it is represented by a star ('*') character.  Even when both bounds are
1.18      cvs      1526: unconstrained, they can be specified by <tt>[*..*]</tt>, but it is simpler not
                   1527: to specify any bound.</p>
                   1528: <pre>               'LIST' [ '[' min '..' max ']' ]
1.1       cvs      1529:                'OF' '(' DefWithAttr ')'
                   1530:      min     = Integer / '*' .
                   1531:      max     = Integer / '*' .
1.18      cvs      1532:      Integer = NUMBER .</pre>
1.30      cvs      1533: 
                   1534: <p>Before the document is edited, Thot creates the minimum number of elements
                   1535: for the list.  If no minimum was given, it creates a single element. If a
                   1536: maximum number of elements is given and that number is attained, the editor
                   1537: refuses to create new elements for the list.</p>
                   1538: 
                   1539: <blockquote class="example">
                   1540:   <p><strong>Example:</strong></p>
                   1541: 
                   1542:   <p>The following two instructions define the body of a document as a
                   1543:   sequence of at least two chapters and the contents of a section as a
                   1544:   sequence of paragraphs.  A single paragraph can be the entire contents of a
                   1545:   section.</p>
                   1546:   <pre>Body             = LIST [2..*] OF (Chapter);
1.18      cvs      1547: Section_contents = LIST OF (Paragraph);</pre>
                   1548: </blockquote>
                   1549: </div>
1.1       cvs      1550: 
1.18      cvs      1551: <div class="subsubsection">
1.30      cvs      1552: <h4><a name="sectd3282">Aggregate</a></h4>
1.1       cvs      1553: 
1.30      cvs      1554: <p>The aggregate constructor is used to define an element type as a collection
                   1555: of sub-elements, each having a fixed type.  The collection may be ordered or
1.1       cvs      1556: unordered.  The elements composing the collection are called
1.18      cvs      1557: <em>components</em>.  In the definition of an aggregate, a keyword indicates
                   1558: whether or not the aggregate is ordered: <tt>BEGIN</tt> for an ordered
                   1559: aggregate, <tt>AGGREGATE</tt> for an unordered aggregate. This keyword is
1.1       cvs      1560: followed by the list of component type definitions which is terminated by the
1.18      cvs      1561: <tt>END</tt> keyword.  The component type definitions are separated by
                   1562: commas.</p>
1.30      cvs      1563: 
                   1564: <p>Before creating an aggregate, the Thot editor creates all the aggregate's
1.1       cvs      1565: components in the order they appear in the structure schema, even for
                   1566: unordered aggregates.  However, unlike ordered aggregates, the components of
                   1567: an unordered aggregate may be rearranged using operations of the Thot editor.
                   1568: The exceptions to the rule are any components whose name was preceded by a
                   1569: question mark character ('?').  These components, which are optional, can be
                   1570: created by explicit request, possibly at the time the aggregate is created,
1.18      cvs      1571: but they are not created automatically <em>prior</em> to the creation of the
                   1572: aggregate.</p>
                   1573: <pre>                 'BEGIN' DefOptSeq 'END'
1.30      cvs      1574:      DefOptSeq = DefOpt ';' &lt; DefOpt ';' &gt; .
1.18      cvs      1575:      DefOpt    = [ '?' ] DefWithAttr .</pre>
1.30      cvs      1576: 
1.18      cvs      1577: <blockquote class="example">
1.30      cvs      1578:   <p><strong>Example:</strong></p>
                   1579: 
                   1580:   <p>In a bilingual document, each paragraph has an English version and a
                   1581:   French version.  In certain cases, the translator wants to add a marginal
                   1582:   note, but this note is present in very few paragraphs.  Thus, it must not be
                   1583:   created systematically for every paragraph.  A bilingual paragraph of this
                   1584:   type is declared:</p>
                   1585:   <pre>Bilingual_paragraph = BEGIN
1.1       cvs      1586:                       French_paragraph  = TEXT;
                   1587:                       English_paragraph = TEXT;
                   1588:                       ? Note            = TEXT;
1.18      cvs      1589:                       END;</pre>
                   1590: </blockquote>
                   1591: </div>
1.1       cvs      1592: 
1.18      cvs      1593: <div class="subsubsection">
1.30      cvs      1594: <h4><a name="sectd3283">Choice</a></h4>
1.1       cvs      1595: 
1.30      cvs      1596: <p>The choice constructor permits the definition of an element type which is
1.18      cvs      1597: chosen from among a set of possible types.  The keywords <tt>CASE</tt> and
                   1598: <tt>OF</tt> are followed by a list of definitions of possible types, which are
                   1599: separated by semicolons and terminated by the <tt>END</tt> keyword.</p>
                   1600: <pre>               'CASE' 'OF' DefSeq 'END'
1.30      cvs      1601:      DefSeq = DefWithAttr ';' &lt; DefWithAttr ';' &gt; .</pre>
                   1602: 
                   1603: <p>Before the creation of an element defined as a choice, the Thot editor
1.1       cvs      1604: presents the list of possible types for the element to the user.  The user has
1.18      cvs      1605: only to select the element type that s/he wants to create from this list.</p>
1.30      cvs      1606: 
                   1607: <p>The order of the type declarations is important.  It determines the order
                   1608: of the list presented to the user before the creation of the element.  Also,
                   1609: when a Choice element is being created automatically, the first type in the
                   1610: list is used.  In fact, using the Thot editor, when an empty Choice element is
1.1       cvs      1611: selected, it is possible to select this element and to enter its text from
                   1612: keyboard. In this case, the editor uses the first element type which can
1.18      cvs      1613: contain an atom of the character string type.</p>
1.30      cvs      1614: 
                   1615: <p>The two special cases of the choice constructor, the <a
1.18      cvs      1616: href="#sectc328"><em>schema</em></a> and the <a
                   1617: href="#sectc3212"><em>unit</em></a> are discussed elsewhere.</p>
1.30      cvs      1618: 
1.18      cvs      1619: <blockquote class="example">
1.30      cvs      1620:   <p><strong>Example:</strong></p>
                   1621: 
                   1622:   <p>It is common in documents to treat a variety of objects as if they were
                   1623:   ordinary paragraphs.  Thus, a ``Paragraph'' might actually be composed of a
                   1624:   block of text (an ordinary paragraph), or a mathematical formula whose
                   1625:   structure is defined by another structure schema named Math, or a table,
                   1626:   also defined by another structure schema.  Here is a definition of such a
                   1627:   paragraph:</p>
                   1628:   <pre>Paragraph = CASE OF
1.1       cvs      1629:               Simple_text = TEXT;
                   1630:               Formula     = Math;
                   1631:               Table_para  = Table;
1.18      cvs      1632:               END;</pre>
                   1633: </blockquote>
                   1634: </div>
1.1       cvs      1635: 
1.18      cvs      1636: <div class="subsubsection">
1.30      cvs      1637: <h4><a name="sectd3284">Reference</a></h4>
1.1       cvs      1638: 
1.30      cvs      1639: <p>Like all elements in Thot, references are typed.  An element type defined
                   1640: as a reference is a cross-reference to an element of some other given type.
                   1641: The keyword <tt>REFERENCE</tt> is followed by the name of a type enclosed in
1.1       cvs      1642: parentheses.  When the type which is being cross-referenced is defined in
                   1643: another structure schema, the type name is itself followed by the name of the
1.18      cvs      1644: external structure schema in which it is defined.</p>
1.30      cvs      1645: 
                   1646: <p>When the designated element type is a <a href="#sectd3285">mark pair</a>,
                   1647: it can be preceded by a <tt>FIRST</tt> or <tt>SECOND</tt> keyword.  These
1.18      cvs      1648: keywords indicate whether the reference points to the first or second mark of
                   1649: the pair. If the reference points to a pair and neither of these two keywords
                   1650: is present, the reference is considered to point to the first mark of the
                   1651: pair.</p>
1.30      cvs      1652: 
                   1653: <p>There is an exception to the principle of typed references:  it is possible
                   1654: to define a reference which designates an element of any type, which can
                   1655: either be in the same document or another document. In this case, it suffices
                   1656: to put the keyword <tt>ANY</tt> in the parentheses which indicate the
                   1657: referenced element type.</p>
1.18      cvs      1658: <pre>             'REFERENCE' '(' RefType ')'
                   1659:    RefType = 'ANY' / [ FirstSec ] ElemID [ ExtStruct ] .</pre>
1.30      cvs      1660: 
                   1661: <p>When defining an inclusion, the <tt>REFERENCE</tt> keyword is not used.
1.1       cvs      1662: Inclusions with complete expansion are not declared as such in the structure
                   1663: schemas, since any element defined in a structure schema can be replaced by an
                   1664: element of the same type.  Instead, inclusions without expansion or with
                   1665: partial expansion must be declared explicitly whenever they will include a
                   1666: complete object ( and not a part of an object).  In this case, the object type
                   1667: to be included (that is, the name of its structure schema) is followed by a
1.18      cvs      1668: keyword: <tt>EXTERN</tt> for inclusion without expansion and <tt>INCLUDED</tt>
                   1669: for partial expansion.</p>
1.30      cvs      1670: 
                   1671: <p>Before creating a cross-reference or an inclusion, the Thot editor asks the
1.1       cvs      1672: user to choose, from the document images displayed, the referenced or included
1.18      cvs      1673: element.</p>
1.30      cvs      1674: 
1.18      cvs      1675: <blockquote class="example">
1.30      cvs      1676:   <p><strong>Example:</strong></p>
                   1677: 
                   1678:   <p>If the types Note and Section are defined in the Article structure
                   1679:   schema, it is possible to define, in the same structure schema, a reference
                   1680:   to a note and a reference to a section in this manner:</p>
                   1681:   <pre>Ref_note    = REFERENCE (Note);
1.18      cvs      1682: Ref_section = REFERENCE (Section);</pre>
1.30      cvs      1683: 
                   1684:   <p>It is also possible to define the generic structure of a collection of
                   1685:   articles, which include (with partial expansion) objects of the Article
                   1686:   class and which possess an introduction which may include cross-references
                   1687:   to sections of the included articles.  In the Collection structure schema,
                   1688:   the definitions are:</p>
                   1689:   <pre>Collection = BEGIN
1.6       cvs      1690:              Collection_title = TEXT;
                   1691:              Introduction = LIST OF (Elem = CASE OF
1.1       cvs      1692:                                            TEXT;
                   1693:                                            Ref_sect;
                   1694:                                            END);
1.6       cvs      1695:              Body = LIST OF (Article INCLUDED);
                   1696:              END;
1.18      cvs      1697: Ref_sect   = REFERENCE (Section (Article));</pre>
1.30      cvs      1698: 
                   1699:   <p>Here we define a Folder document class which has a title and includes
                   1700:   documents of different types, particularly Folders:</p>
                   1701:   <pre>Folder   = BEGIN
1.6       cvs      1702:            Folder_title    = TEXT;
                   1703:            Folder_contents = LIST OF (Document);
                   1704:            END;
1.1       cvs      1705: 
                   1706: Document = CASE OF
                   1707:               Article EXTERN;
                   1708:               Collection EXTERN;
                   1709:               Folder EXTERN;
1.18      cvs      1710:               END;</pre>
1.30      cvs      1711: 
                   1712:   <p>Under this definition, Folder represents either an aggregate which
                   1713:   contains a folder title and the list of included documents or an included
                   1714:   folder.  To resolve this ambiguity, in the P language, the placement of a
                   1715:   star character in front of the type name (here, Folder) indicates an
                   1716:   included document.</p>
1.18      cvs      1717: </blockquote>
                   1718: </div>
1.1       cvs      1719: 
1.18      cvs      1720: <div class="subsubsection">
1.30      cvs      1721: <h4><a name="sectd3285">Mark pairs</a></h4>
1.1       cvs      1722: 
1.30      cvs      1723: <p>Like other elements, mark pairs are typed.  The two marks of the pair have
                   1724: the same type, but there exist two predefined subtypes which apply to all mark
1.18      cvs      1725: pairs: the first mark of the pair (called <tt>First</tt> in the P and T
                   1726: languages) and the second mark (called <tt>Second</tt>).</p>
1.30      cvs      1727: 
                   1728: <p>In the S language, a mark pair is noted simply by the <tt>PAIR</tt>
1.18      cvs      1729: keyword.</p>
1.30      cvs      1730: 
                   1731: <p>In the Thot editor, marks are always moved or destroyed together.  The two
1.1       cvs      1732: marks of a pair have the same identifier, unique within the document, which
1.18      cvs      1733: permits intertwining mark pairs without risk of ambiguity.</p>
                   1734: </div>
                   1735: </div>
1.1       cvs      1736: 
1.18      cvs      1737: <div class="subsection">
1.30      cvs      1738: <h3><a name="sectc329">Imports</a></h3>
1.1       cvs      1739: 
1.30      cvs      1740: <p>Because of schema constructors, it is possible, before editing a document,
                   1741: to use classes defined by other structure schemas whenever they are needed. It
                   1742: is also possible to assign specific document classes to certain element types.
                   1743: In this case, these classes are simply designated by their name.  In fact, if
                   1744: a type name is not defined in the structure schema, it is assumed that it
1.18      cvs      1745: specifies a structure defined by another structure schema.</p>
1.30      cvs      1746: 
1.18      cvs      1747: <blockquote class="example">
1.30      cvs      1748:   <p><strong>Example:</strong></p>
                   1749: 
                   1750:   <p>If the types Math and Table don't appear in the left part of a structure
                   1751:   rule in the schema, the following two rules indicate that a formula has the
                   1752:   structure of an object defined by the structure schema Math and that a table
                   1753:   element has the structure of an object defined by the Table schema.</p>
                   1754:   <pre>Formula    = Math;
1.18      cvs      1755: Table_elem = Table;</pre>
                   1756: </blockquote>
                   1757: </div>
                   1758: 
                   1759: <div class="subsection">
1.30      cvs      1760: <h3><a name="sectc3210">Extension rules</a></h3>
1.18      cvs      1761: 
1.30      cvs      1762: <p>The <tt>EXTENS</tt> section, which can only appear in an extension schema,
1.1       cvs      1763: defines complements to the rules in the primary schema (i.e. the structure
                   1764: schema to which the extension schema will be applied). More precisely, this
                   1765: section permits the addition to an existing type of local attributes,
1.18      cvs      1766: extensions, restrictions and fixed-value attributes.</p>
1.30      cvs      1767: 
                   1768: <p>These additions can be applied to the root rule of the primary schema,
1.18      cvs      1769: designated by the keyword <tt>Root</tt>, or to any other explicitly named
                   1770: rule.</p>
1.30      cvs      1771: 
                   1772: <p>Extension rules are separated from each other by a semicolon and each
1.18      cvs      1773: extension rule has the same syntax as a <a href="#sectc327">structure
                   1774: rule</a>, but the part which defines the constructor is absent.</p>
1.30      cvs      1775: <pre>     ExtenRuleSeq = ExtensRule ';' &lt; ExtensRule ';' &gt; .
1.6       cvs      1776:      ExtensRule   = RootOrElem [ LocAttrSeq ]
                   1777:                     [ '+' '(' ExtensionSeq ')' ]
                   1778:                     [ '-' '(' RestrictSeq ')' ]
                   1779:                     [ 'WITH' FixedAttrSeq ] .
1.18      cvs      1780:      RootOrElem   = 'Root' / ElemID .</pre>
                   1781: </div>
1.1       cvs      1782: 
1.18      cvs      1783: <div class="subsection">
1.30      cvs      1784: <h3><a name="sectc3211">Associated elements</a></h3>
1.1       cvs      1785: 
1.30      cvs      1786: <p>If associated elements are necessary, they must be declared in a specific
1.18      cvs      1787: section of the structure schema, introduced by the keyword <tt>ASSOC</tt>.
1.1       cvs      1788: Each associated element type is specified like any other structured element.
                   1789: However, these types must not appear in any other element types of the schema,
1.18      cvs      1790: except in <tt>REFERENCE</tt> rules.</p>
                   1791: </div>
1.1       cvs      1792: 
1.18      cvs      1793: <div class="subsection">
1.30      cvs      1794: <h3><a name="sectc3212">Units</a></h3>
                   1795: 
                   1796: <p>The <tt>UNITS</tt> section of the structure schema contains the
                   1797: declarations of the element types which can be used in the external objects
                   1798: making up parts of the document or in objects of the class defined by the
                   1799: schema.  As with associated elements, these element types are defined just
                   1800: like other structured element types. They can be used in the other element
                   1801: types of the schema, but they can also be used in any other rule of the
                   1802: schema.</p>
                   1803: 
                   1804: <blockquote class="example">
                   1805:   <p><strong>Example:</strong></p>
1.1       cvs      1806: 
1.30      cvs      1807:   <p>If references to notes are declared as units:</p>
                   1808:   <pre>UNITS
1.18      cvs      1809:    Ref_note = REFERENCE (Note);</pre>
1.30      cvs      1810: 
                   1811:   <p>then it is possible to use references to notes in a cell of a table, even
                   1812:   when <tt>Table</tt> is an external structure schema.  The <tt>Table</tt>
                   1813:   schema must declare a cell to be a sequence of units, which can then be base
                   1814:   element types (text, for example) or references to notes in the
                   1815:   document.</p>
                   1816:   <pre>Cell = LIST OF (UNITS);</pre>
1.18      cvs      1817: </blockquote>
                   1818: </div>
1.1       cvs      1819: 
1.18      cvs      1820: <div class="subsection">
1.30      cvs      1821: <h3><a name="sectc3213">Skeleton elements</a></h3>
1.1       cvs      1822: 
1.30      cvs      1823: <p>When editing a document which contains or must contain external references
                   1824: to several other documents, it may be necessary to load a large number of
1.1       cvs      1825: documents, simply to see the parts designated by the external references of
                   1826: the document while editing, or to access the source of included elements.  In
                   1827: this case, the external documents are not modified and it is only necessary to
                   1828: see the elements of these documents which could be referenced.  Because of
                   1829: this, the editor will suggest that the documents be loaded in ``skeleton''
                   1830: form.  This form contains only the elements of the document explicitly
1.18      cvs      1831: mentioned in the <tt>EXPORT</tt> section of their structure schema and, for
1.1       cvs      1832: these elements, only the part of the contents specified in that section. This
                   1833: form has the advantage of being very compact, thus requiring very few
                   1834: resources from the editor.  This is also the skeleton form which constitutes
1.18      cvs      1835: the expanded form of <a href="#inclusion">inclusions</a> with partial
                   1836: expansion.</p>
1.30      cvs      1837: 
                   1838: <p>Skeleton elements must be declared explicitly in the <tt>EXPORT</tt>
                   1839: section of the structure schema that defines them.  This section begins with
                   1840: the keyword <tt>EXPORT</tt> followed by a comma-separated list of the element
1.1       cvs      1841: types which must appear in the skeleton form and ending with a semicolon.
1.18      cvs      1842: These types must have been previously declared in the schema.</p>
1.30      cvs      1843: 
                   1844: <p>For each skeleton element type, the part of the contents which is loaded by
1.1       cvs      1845: the editor, and therefore displayable, can be specified by putting the keyword
1.18      cvs      1846: <tt>WITH</tt> and the name of the contained element type to be loaded after
1.1       cvs      1847: the name of the skeleton element type.  In this case only that named element,
                   1848: among all the elements contained in the exportable element type, will be
1.18      cvs      1849: loaded.  If the <tt>WITH</tt> is absent, the entire contents of the skeleton
1.1       cvs      1850: element will be loaded by the editor.  If instead, it is better that the
                   1851: skeleton form not load the contents of a particular element type, the keyword
1.18      cvs      1852: <tt>WITH</tt> must be followed by the word <tt>Nothing</tt>.</p>
                   1853: <pre>                [ 'EXPORT' SkeletonSeq ]
1.1       cvs      1854: 
1.30      cvs      1855:      SkeletonSeq = SkelElem &lt; ',' SkelElem &gt; ';' .
1.1       cvs      1856:      SkelElem    = ElemID [ 'WITH' Contents ] .
1.18      cvs      1857:      Contents    = 'Nothing' / ElemID [ ExtStruct ] .</pre>
1.30      cvs      1858: 
1.18      cvs      1859: <blockquote class="example">
1.30      cvs      1860:   <p><strong>Example:</strong></p>
                   1861: 
                   1862:   <p>Suppose that, in documents of the article class, the element types
                   1863:   Article_title, Figure, Section, Paragraph, and Biblio should appear in the
                   1864:   skeleton form in order to make it easier to create external references to
                   1865:   them from other documents.  When loading an article in its skeleton form,
                   1866:   all of these element types will be loaded except for paragraphs, but only
                   1867:   the article title will be loaded in its entirety.  For figures, the caption
                   1868:   will be loaded, while for sections, the title will be loaded, and for
1.31      cvs      1869:   bibliographic entries, only the title that they contain will be loaded. Note
                   1870:   that bibliographic elements are defined in another structure schema, RefBib.
1.32      cvs      1871:   To produce this result, the following declarations should be placed in the
1.31      cvs      1872:   Article structure schema:</p>
1.30      cvs      1873:   <pre>EXPORT
1.1       cvs      1874:    Article_title,
1.5       cvs      1875:    Figure With Caption,
1.1       cvs      1876:    Section With Section_title,
                   1877:    Paragraph With Nothing,
1.18      cvs      1878:    Biblio With Biblio_title(RefBib);</pre>
                   1879: </blockquote>
                   1880: </div>
1.1       cvs      1881: 
1.18      cvs      1882: <div class="subsection">
1.30      cvs      1883: <h3><a name="sectc3214">Exceptions</a></h3>
1.1       cvs      1884: 
1.30      cvs      1885: <p>The behavior of the Thot editor and the actions that it performs are
1.1       cvs      1886: determined by the structure schemas.  These actions are applied to all
                   1887: document and object types in accordance with their generic structure.  For
                   1888: certain object types, such as tables and graphics, these actions are not
                   1889: sufficient or are poorly adapted and some special actions must be added to or
                   1890: substituted for certain standard actions.  These special actions are called
1.18      cvs      1891: <em>exceptions</em>.</p>
1.30      cvs      1892: 
                   1893: <p>Exceptions only inhibit or modify certain standard actions, but they can be
1.18      cvs      1894: used freely in every structure schema.</p>
1.30      cvs      1895: 
                   1896: <p>Each structure schema can contain a section defining exceptions.  It begins
1.18      cvs      1897: with the keyword <tt>EXCEPT</tt> and is composed of a sequence of exception
1.1       cvs      1898: declarations, separated by semicolons.  Each declaration of an exception
                   1899: begins with the name of an element type or attribute followed by a colon. This
                   1900: indicates the element type or attribute to which the following exceptions
1.18      cvs      1901: apply.  When the given element type name is a <a href="#sectd3285">mark
                   1902: pair</a>, and only in this case, the type name can be preceded by the keyword
                   1903: <tt>First</tt> or <tt>Second</tt>, to indicate if the exceptions which follow
1.1       cvs      1904: are associated with the first mark of the pair or the second.  In the absence
1.18      cvs      1905: of this keyword, the first mark is used.</p>
1.30      cvs      1906: 
                   1907: <p>When placed in an <a href="#sectc322">extension schema</a>, the keyword
1.18      cvs      1908: <tt>EXTERN</tt> indicates that the type name which follows is found in the
1.1       cvs      1909: principal schema (the schema being extended by the extension schema).  The
1.18      cvs      1910: exceptions are indicated by a name.  They are separated by semicolons.</p>
                   1911: <pre>                  [ 'EXCEPT' ExceptSeq ]
1.1       cvs      1912: 
1.30      cvs      1913:      ExceptSeq     = Except ';' &lt; Except ';' &gt; .
1.1       cvs      1914:      Except        = [ 'EXTERN' ] [ FirstSec ] ExcTypeOrAttr
                   1915:                      ':' ExcValSeq .
                   1916:      ExcTypeOrAttr = ElemID / AttrID .
1.30      cvs      1917:      ExcValSeq     = ExcValue &lt; ',' ExcValue &gt; .
1.19      cvs      1918:      ExcValue      ='NoCut' / 'NoCreate' / 'NoHMove' / 
                   1919:                     'NoVMove' / 'NoHResize' / 'NoVResize' /
                   1920:                     'NoMove' / 'NoResize' / 'MoveResize' /
                   1921:                     'NewWidth' / 'NewHeight' / 'NewHPos' /
                   1922:                     'NewVPos' / 'Invisible' /
1.28      cvs      1923:                     'NoSelect' / 'NoSpellCheck' /
1.1       cvs      1924:                     'Hidden' / 'ActiveRef' /
                   1925:                     'ImportLine' / 'ImportParagraph' /
                   1926:                     'NoPaginate' / 'ParagraphBreak' /
1.19      cvs      1927:                     'PageBreak' / 'PageBreakAllowed' / 'PageBreakPlace' /
                   1928:                     'PageBreakRepetition' / 'PageBreakRepBefore' /
1.9       cvs      1929:                     'HighlightChildren' / 'ExtendedSelection' /
1.29      cvs      1930:                     'ReturnCreateNL' / 'ReturnCreateWithin' /
                   1931:                     'IsDraw' / 'IsTable' /
1.19      cvs      1932:                     'IsRow' / 'IsColHead' / 'IsCell' /
                   1933:                     'NewPercentWidth' / 'ColRef' / 'ColSpan' /
                   1934:                     'RowSpan' / 'SaveDocument' / 'Shadow' .</pre>
1.30      cvs      1935: 
                   1936: <p>The following are the available exceptions:</p>
1.18      cvs      1937: <dl>
1.30      cvs      1938:   <dt><tt>NoCut</tt></dt>
                   1939:     <dd>This exception can only be applied to element types.  Elements of a
                   1940:       type to which this exception is applied cannot be deleted by the
                   1941:     editor.</dd>
                   1942:   <dt><tt>NoCreate</tt></dt>
                   1943:     <dd>This exception can only be applied to element types.  Elements of a
                   1944:       type to which this exception is applied cannot be created by ordinary
                   1945:       commands for creating new elements.  These elements are usually created
                   1946:       by special actions associated with other exceptions.</dd>
                   1947:   <dt><tt>NoHMove</tt></dt>
                   1948:     <dd>This exception can only be applied to element types.  Elements of a
                   1949:       type to which this exception is applied cannot be moved horizontally
                   1950:       with the mouse. Their children elements cannot be moved either.</dd>
                   1951:   <dt><tt>NoVMove</tt></dt>
                   1952:     <dd>This exception can only be applied to element types.  Elements of a
                   1953:       type to which this exception is applied cannot be moved vertically with
                   1954:       the mouse. Their children elements cannot be moved either.</dd>
                   1955:   <dt><tt>NoMove</tt></dt>
                   1956:     <dd>This exception can only be applied to element types.  Elements of a
                   1957:       type to which this exception is applied cannot be moved in any direction
                   1958:       with the mouse.  Their children elements cannot be moved either.</dd>
                   1959:   <dt><tt>NoHResize</tt></dt>
                   1960:     <dd>This exception can only be applied to element types.  Elements of a
                   1961:       type to which this exception is applied cannot be resized horizontally
                   1962:       with the mouse. Their children elements cannot be resized either.</dd>
                   1963:   <dt><tt>NoVResize</tt></dt>
                   1964:     <dd>This exception can only be applied to element types.  Elements of a
                   1965:       type to which this exception is applied cannot be resized vertically
                   1966:       with the mouse. Their children elements cannot be resized either.</dd>
                   1967:   <dt><tt>NoResize</tt></dt>
                   1968:     <dd>This exception can only be applied to element types.  Elements of a
                   1969:       type to which this exception is applied cannot be resized in any
                   1970:       direction with the mouse.  Their children elements cannot be resized
                   1971:       either.</dd>
                   1972:   <dt><tt>MoveResize</tt></dt>
                   1973:     <dd>This exception can only be applied to element types.  Elements of a
                   1974:       type to which this exception is applied can be moved and resized in any
                   1975:       direction with the mouse, even if one of their ancestor element has an
                   1976:       exception that prevents moving or resizing.  Their children elements can
                   1977:       also be resized or moved.</dd>
                   1978:   <dt><tt>NewWidth</tt></dt>
                   1979:     <dd>This exception can only be applied to numeric attributes.  If the
                   1980:       width of an element which has this attribute is modified with the mouse,
                   1981:       the value of the new width will be assigned to the attribute.</dd>
                   1982:   <dt><tt>NewHeight</tt></dt>
                   1983:     <dd>This exception can only be applied to numeric attributes.  If the
                   1984:       height of an element which has this attribute is modified with the
                   1985:       mouse, the value of the new height will be assigned to the
                   1986:     attribute.</dd>
                   1987:   <dt><tt>NewHPos</tt></dt>
                   1988:     <dd>This exception can only be applied to numeric attributes.  If the
                   1989:       horizontal position of an element which has this attribute is modified
                   1990:       with the mouse, the value of the new horizontal position will be
                   1991:       assigned to the attribute.</dd>
                   1992:   <dt><tt>NewVPos</tt></dt>
                   1993:     <dd>This exception can only be applied to numeric attributes.  If the
                   1994:       vertical position of an element which has this attribute is modified
                   1995:       with the mouse, the value of the new vertical position will be assigned
                   1996:       to the attribute.</dd>
                   1997:   <dt><tt>Invisible</tt></dt>
                   1998:     <dd>This exception can only be applied to attributes, but can be applied
                   1999:       to all attribute types.  It indicates that the attribute must not be
                   2000:       seen by the user and that its value must not be changed directly.  This
                   2001:       exception is usually used when another exception manipulates the value
                   2002:       of an attribute.</dd>
                   2003:   <dt><tt>NoSelect</tt></dt>
                   2004:     <dd>This exception can only be applied to element types.  Elements of a
                   2005:       type to which this exception is applied cannot  be selected directly
                   2006:       with the mouse, but they can be selected by other methods provided by
                   2007:       the editor.</dd>
                   2008:   <dt>NoSpellCheck</dt>
                   2009:     <dd>This exception can only be applied to element types.  Elements of a
                   2010:       type to which this exception is applied are not taken into account by
                   2011:       the spell checker.</dd>
                   2012:   <dt><tt>Hidden</tt></dt>
                   2013:     <dd>This exception can only be applied to element types.  It indicates
                   2014:       that elements of this type, although present in the document's
                   2015:       structure, must not be shown to the user of the editor.  In particular,
                   2016:       the creation menus must not propose this type and the selection message
                   2017:       must not pick it.</dd>
                   2018:   <dt><tt>ActiveRef</tt></dt>
                   2019:     <dd>This exception can only be applied to attributes of the reference
                   2020:       type.  It indicates that when the user of the editor makes a double
                   2021:       click on an element which possesses a reference attribute having this
                   2022:       exception, the element designated by the reference attribute will be
                   2023:       selected.</dd>
                   2024:   <dt><tt>ImportLine</tt></dt>
                   2025:     <dd>This exception can only be applied to element types.  It indicates
                   2026:       that elements of this type should receive the content of imported text
                   2027:       files.  An element is created for each line of the imported file.  A
                   2028:       structure schema cannot contain several exceptions <tt>ImportLine</tt>
                   2029:       and, if it contains one, it should not contain any exception
                   2030:       <tt>ImportParagraph</tt>.</dd>
                   2031:   <dt><tt>ImportParagraph</tt></dt>
                   2032:     <dd>This exception can only be applied to element types.  It indicates
                   2033:       that elements of this type should receive the content of imported text
1.31      cvs      2034:       files.  An element is created for each paragraph of the imported file. A
                   2035:       paragraph is a sequence of lines without any empty line.  A structure
1.30      cvs      2036:       schema cannot contain several exceptions <tt>ImportParagraph</tt> and,
                   2037:       if it contains one, it should not contain any exception
                   2038:       <tt>ImportLine</tt>.</dd>
                   2039:   <dt><tt>NoPaginate</tt></dt>
                   2040:     <dd>This exception can only be applied to the root element, i.e. the name
                   2041:       that appear after the keyword <tt>STRUCTURE</tt> at the beginning of the
                   2042:       structure schema.  It indicates that the editor should not allow the
                   2043:       user to paginate documents of that type.</dd>
                   2044:   <dt><tt>ParagraphBreak</tt></dt>
                   2045:     <dd>This exception can only be applied to element types.  When the caret
                   2046:       is within an element of a type to which this exception is applied, it is
                   2047:       that element that will be split when the user hits the Return key.</dd>
                   2048:   <dt><tt>ReturnCreateNL</tt></dt>
                   2049:     <dd>This exception can only be applied to element types.  When the caret
                   2050:       is within an element of a type to which this exception is applied, the
                   2051:       Return key simply inserts a New line character (code \212) at the
                   2052:       current position. The Return key does not create a new element; it does
                   2053:       not split the current element either.</dd>
                   2054:   <dt><tt>ReturnCreateWithin</tt></dt>
                   2055:     <dd>This exception can only be applied to element types.  When the caret
                   2056:       is within an element of a type to which this exception is applied, the
                   2057:       Return key will create a new element within that element, not a sibling
                   2058:       after that element.</dd>
                   2059:   <dt><tt>HighlightChildren</tt></dt>
                   2060:     <dd>This exception can only be applied to element types.  Elements of a
                   2061:       type to which this exception is applied are not highlighted themselves
1.32      cvs      2062:       when they are selected in the main view, but all their children are
                   2063:       highlighted instead. If children have this exception too, the process is
                   2064:       applied recursively. Only the main view defined in the presentation
                   2065:       schema is concerned. Tee exception is ignored for other views.</dd>
1.30      cvs      2066:   <dt><tt>ExtendedSelection</tt></dt>
                   2067:     <dd>This exception can only be applied to element types.  The selection
                   2068:       extension command (middle button of the mouse) only add the clicked
                   2069:       element (if it has that exception) to the current selection, without
                   2070:       selecting other elements between the current selection and the clicked
                   2071:       element.</dd>
                   2072:   <dt>IsDraw, IsTable, IsColHead, IsRow, IsCell</dt>
                   2073:     <dd>These exceptions can only be applied to element types.  Elements of a
                   2074:       type to which these exceptions are applied are identified as Draws,
                   2075:       Tables, Colheads, Rows or Cells and specific processing are applied to
                   2076:       them.</dd>
                   2077:   <dt>ColRef</dt>
                   2078:     <dd>This exception can only be applied to attributes of the reference
                   2079:       type. It indicates that this attribute refers to the column head (see
                   2080:       exception IsColHead) which the element belongs to.</dd>
                   2081:   <dt>ColSpan, RowSpan</dt>
1.31      cvs      2082:     <dd>These exceptions can only be applied to numeric attributes of cells.
1.30      cvs      2083:       They indicate that attribute values give how many columns or rows the
                   2084:       element spans.</dd>
                   2085:   <dt>Shadow</dt>
                   2086:     <dd>This exception can only be applied to element types.  Text of elements
                   2087:       of a type to which this exception is applied are displayed and printed
                   2088:       as a set of stars ('*').</dd>
1.18      cvs      2089: </dl>
1.30      cvs      2090: 
1.18      cvs      2091: <blockquote class="example">
1.30      cvs      2092:   <p><strong>Example:</strong></p>
                   2093: 
                   2094:   <p>Consider a structure schema for object-style graphics which defines the
                   2095:   Graphic_object element type with the associated Height and Weight numeric
                   2096:   attributes.  Suppose that we want documents of this class to have the
                   2097:   following qualities:</p>
                   2098:   <ul>
                   2099:     <li>Whenever the width or height of an object is changed using the mouse,
                   2100:       the new values are stored in the object's Width and Height
                   2101:     attributes.</li>
                   2102:     <li>The user should not be able to change the values of the Width and
                   2103:       Height attributes via the Attributes menu of the Thot editor.</li>
                   2104:   </ul>
                   2105: 
                   2106:   <p>The following exceptions will produce this effect.</p>
                   2107:   <pre>STRUCT
1.1       cvs      2108: ...
1.5       cvs      2109:    Graphics_object (ATTR Height = Integer; Width = Integer)
1.1       cvs      2110:        = GRAPHICS with Height ?= 10, Width ?= 10;
                   2111: ...
                   2112: EXCEPT
                   2113:    Height: NewHeight, Invisible;
1.18      cvs      2114:    Width: NewWidth, Invisible;</pre>
                   2115: </blockquote>
                   2116: </div>
                   2117: </div>
1.1       cvs      2118: 
1.18      cvs      2119: <div class="section">
1.30      cvs      2120: <h2><a name="sectb33">Some examples</a></h2>
1.1       cvs      2121: 
1.30      cvs      2122: <p>In order to illustrate the principles of the document model and the syntax
                   2123: of the S language, this section presents two examples of structure schemas.
                   2124: One defines a class of documents, the other defines a class of objects.</p>
1.1       cvs      2125: 
1.18      cvs      2126: <div class="subsection">
1.30      cvs      2127: <h3><a name="sectc331">A class of documents: articles</a></h3>
1.1       cvs      2128: 
1.30      cvs      2129: <p>This example shows a possible structure for articles published in a
                   2130: journal. Text between braces is comments.</p>
1.18      cvs      2131: <pre>STRUCTURE Article;  { This schema defines the Article class }
1.1       cvs      2132: DEFPRES ArticleP;   { The default presentation schema is
                   2133:                       ArticleP }
                   2134: ATTR                { Global attribute definitions }
                   2135:    WordType = Definition, IndexWord, DocumentTitle;
                   2136:    { A single global attribute is defined, with three values }
                   2137: STRUCT              { Definition of the generic structure }
                   2138:    Article = BEGIN  { The Article class has an aggregate
                   2139:                       structure }
                   2140:              Title = BEGIN   { The title is an aggregate }
                   2141:                      French_title = 
                   2142:                          Text WITH Language='Fran\347ais';
                   2143:                      English_title =
                   2144:                          Text WITH Language='English';
                   2145:                      END;
                   2146:              Authors = 
                   2147:                LIST OF (Author
                   2148:                  (ATTR Author_type=principal,secondary)
                   2149:                  { The Author type has a local attribute }
                   2150:                  = BEGIN
                   2151:                    Author_name = Text;
                   2152:                    Info = Paragraphs ;
                   2153:                    { Paragraphs is defined later }
                   2154:                    Address    = Text;
                   2155:                    END
                   2156:                  );
                   2157:              Keywords = Text;
                   2158:              { The journal's editor introduces the article
                   2159:                with a short introduction, in French and
                   2160:                in English }
                   2161:              Introduction = 
                   2162:                  BEGIN
                   2163:                  French_intr  = Paragraphs WITH
                   2164:                                 Language='Fran\347ais';
                   2165:                  English_intr = Paragraphs WITH
                   2166:                                 Language='English';
                   2167:                  END;
                   2168:              Body = Sections; { Sections are defined later }
                   2169:                    { Appendixes are only created on demand }
                   2170:            ? Appendices = 
                   2171:                  LIST OF (Appendix =
                   2172:                           BEGIN
                   2173:                           Appendix_Title    = Text;
                   2174:                           Appendix_Contents = Paragraphs;
                   2175:                           END
                   2176:                          );
                   2177:              END;      { End of the Article aggregate }
                   2178: 
                   2179:     Sections = LIST [2..*] OF (
                   2180:                  Section = { At least 2 sections }
                   2181:                  BEGIN
                   2182:                  Section_title   = Text;
                   2183:                  Section_contents =
                   2184:                    BEGIN
                   2185:                    Paragraphs;
                   2186:                    Sections; { Sections at a lower level }
                   2187:                    END;
                   2188:                  END
                   2189:                  );
                   2190: 
                   2191:     Paragraphs = LIST OF (Paragraph = CASE OF
                   2192:                                Enumeration = 
                   2193:                                    LIST [2..*] OF
                   2194:                                        (Item = Paragraphs);
                   2195:                                Isolated_formula = Formula;
                   2196:                                LIST OF (UNIT);
                   2197:                                END
                   2198:                           );
                   2199: 
                   2200: ASSOC         { Associated elements definitions }
                   2201: 
                   2202:    Figure = BEGIN
1.5       cvs      2203:             Figure_caption  = Text;
1.1       cvs      2204:             Illustration   = NATURE;
                   2205:             END;
                   2206: 
                   2207:    Biblio_citation = CASE OF
                   2208:                         Ref_Article =
                   2209:                            BEGIN
                   2210:                            Authors_Bib   = Text;
                   2211:                            Article_Title = Text;
                   2212:                            Journal       = Text;
                   2213:                            Page_Numbers  = Text;
                   2214:                            Date          = Text;
                   2215:                            END;
                   2216:                         Ref_Livre =
                   2217:                            BEGIN
                   2218:                            Authors_Bib; { Defined above }
                   2219:                            Book_Title   = Text;
                   2220:                            Editor       = Text;
                   2221:                            Date;        { Defined above }
                   2222:                            END;
                   2223:                        END;
                   2224: 
                   2225:    Note =  Paragraphs - (Ref_note);
                   2226: 
                   2227: UNITS      { Elements which can be used in objects }
                   2228: 
                   2229:    Ref_note    = REFERENCE (Note);
                   2230:    Ref_biblio  = REFERENCE (Biblio_citation);
                   2231:    Ref_figure  = REFERENCE (Figure);
                   2232:    Ref_formula = REFERENCE (Isolated_formula);
                   2233: 
                   2234: EXPORT     { Skeleton elements }
                   2235: 
                   2236:    Title,
1.5       cvs      2237:    Figure with Figure_caption,
1.1       cvs      2238:    Section With Section_title;
                   2239: 
1.18      cvs      2240: END           { End of the structure schema }</pre>
1.30      cvs      2241: 
                   2242: <p>This schema is very complete since it defines both paragraphs and
1.1       cvs      2243: bibliographic citations.  These element types could just as well be defined in
1.18      cvs      2244: other structure schemas, as is the case with the <tt>Formula</tt> class.  All
1.1       cvs      2245: sorts of other elements can be inserted into an article, since a paragraph can
                   2246: contain any type of unit.  Similarly, figures can be any class of document or
1.18      cvs      2247: object that the user chooses.</p>
1.30      cvs      2248: 
                   2249: <p>Generally, an article doesn't contain appendices, but it is possible to add
1.1       cvs      2250: them on explicit request:  this is the effect of the question mark before the
1.18      cvs      2251: word Appendices.</p>
1.30      cvs      2252: 
                   2253: <p>The Figure, Biblio_citation and Note elements are associated elements.
                   2254: Thus, they are only used in <tt>REFERENCE</tt> statements.</p>
                   2255: 
                   2256: <p>Various types of cross-references can be put in paragraphs.  They can also
                   2257: be placed the objects which are part of the article, since the
                   2258: cross-references are defined as units (<tt>UNITS</tt>).</p>
                   2259: 
                   2260: <p>There is a single restriction to prevent the creation of Ref_note elements
1.18      cvs      2261: within notes.</p>
1.30      cvs      2262: 
                   2263: <p>It is worth noting that the S language permits the definition of recursive
1.1       cvs      2264: structures like sections: a section can contain other sections (which are thus
                   2265: at the next lower level of the document tree).  Paragraphs are also recursive
                   2266: elements, since a paragraph can contain an enumeration in which each element
1.18      cvs      2267: (<tt>Item</tt>) is composed of paragraphs.</p>
                   2268: </div>
1.1       cvs      2269: 
1.18      cvs      2270: <div class="subsection">
1.30      cvs      2271: <h3><a name="sectc332">A class of objects: mathematical formulas</a></h3>
1.1       cvs      2272: 
1.30      cvs      2273: <p>The example below defines the <tt>Formula</tt> class which is used in
                   2274: Article documents.  This class represents mathematical formulas  with a rather
                   2275: simple structure, but sufficient to produce a correct rendition on the screen
                   2276: or printer.  To support more elaborate operations (formal or numeric
1.1       cvs      2277: calculations), a finer structure should be defined. This class doesn't use any
1.18      cvs      2278: other class and doesn't define any associated elements or units.</p>
                   2279: <pre>STRUCTURE Formula;
1.1       cvs      2280: DEFPRES FormulaP;
                   2281: 
                   2282: ATTR
                   2283:    String_type = Function_name, Variable_name;
                   2284: 
                   2285: STRUCT
                   2286:    Formula      = Expression;
                   2287:    Expression   = LIST OF (Construction);
                   2288:    Construction = CASE OF
                   2289:                   TEXT;         { Simple character string }
                   2290:                   Index    = Expression;
                   2291:                   Exponent = Expression;
                   2292:                   Fraction =
                   2293:                         BEGIN
1.6       cvs      2294:                         Numerator   = Expression;
1.1       cvs      2295:                         Denominator = Expression;
                   2296:                         END;
                   2297:                   Root = 
                   2298:                         BEGIN
                   2299:                       ? Order = TEXT;
                   2300:                         Root_Contents = Expression;
                   2301:                         END;
                   2302:                   Integral =
                   2303:                         BEGIN
                   2304:                         Integration_Symbol = SYMBOL;
                   2305:                         Lower_Bound        = Expression;
                   2306:                         Upper_Bound        = Expression;
                   2307:                         END;
                   2308:                   Triple =
                   2309:                         BEGIN
                   2310:                         Princ_Expression = Expression;
                   2311:                         Lower_Expression = Expression;
                   2312:                         Upper_Expression = Expression;
                   2313:                         END;
                   2314:                   Column = LIST [2..*] OF 
                   2315:                               (Element = Expression);
                   2316:                   Parentheses_Block =
                   2317:                         BEGIN
                   2318:                         Opening  = SYMBOL;
                   2319:                         Contents = Expression;
                   2320:                         Closing  = SYMBOL;
                   2321:                         END;
                   2322:                   END;       { End of Choice Constructor }
1.18      cvs      2323: END                          { End of Structure Schema }</pre>
1.30      cvs      2324: 
                   2325: <p>This schema defines a single global attribute which allows functions and
1.1       cvs      2326: variables to be distinguished.  In the presentation schema, this attribute can
                   2327: be used to choose between roman (for functions) and italic characters (for
1.18      cvs      2328: variables).</p>
1.30      cvs      2329: 
                   2330: <p>A formula's structure is that of a mathematical expression, which is itself
                   2331: a sequence of mathematical constructions.  A mathematical construction can be
1.1       cvs      2332: either a simple character string, an index, an exponent, a fraction, a root,
                   2333: etc.  Each of these mathematical constructions has a sensible structure which
                   2334: generally includes one or more expressions, thus making the formula class's
1.18      cvs      2335: structure definition recursive.</p>
1.30      cvs      2336: 
                   2337: <p>In most cases, the roots which appear in the formulas are square roots and
1.1       cvs      2338: their order (2) is not specified.  This is why the Order component is marked
                   2339: optional by a question mark.  When explicitly requested, it is possible to add
1.18      cvs      2340: an order to a root, for example for cube roots (order = 3).</p>
1.30      cvs      2341: 
                   2342: <p>An integral is formed by an integration symbol, chosen by the user (simple
1.1       cvs      2343: integral, double, curvilinear, etc.), and two bounds.  A more fine-grained
                   2344: schema would add components for the integrand and the integration variable.
                   2345: Similarly, the Block_Parentheses construction leaves the choice of opening and
                   2346: closing symbols to the user.  They can be brackets, braces, parentheses,
1.18      cvs      2347: etc.</p>
                   2348: </div>
                   2349: </div>
                   2350: <hr>
                   2351: </div>
1.1       cvs      2352: 
1.18      cvs      2353: <div class="chapter">
                   2354: <h1><a name="sect4">The P Language</a></h1>
1.1       cvs      2355: 
1.18      cvs      2356: <div class="section">
1.30      cvs      2357: <h2><a name="sectb41">Document presentation</a></h2>
1.1       cvs      2358: 
1.30      cvs      2359: <p>Because of the model adopted for Thot, the presentation of documents is
1.1       cvs      2360: clearly separated from their structure and content.  After having presented
                   2361: the logical structure of documents, we now detail the principles implemented
1.18      cvs      2362: for their presentation.  The concept of <em>presentation</em> encompasses what
1.5       cvs      2363: is often called the page layout, the composition, or the document style.  It
1.18      cvs      2364: is the set of operations which display the document on the screen or print it
                   2365: on paper.  Like logical structure, document presentation is defined
                   2366: generically with the help of a language, called P.</p>
1.1       cvs      2367: 
1.18      cvs      2368: <div class="subsection">
1.30      cvs      2369: <h3><a name="sectc411">Two levels of presentation</a></h3>
1.1       cvs      2370: 
1.30      cvs      2371: <p>The link between structure and presentation is clear: the logical
                   2372: organization of a document is used to carry out its presentation, since the
                   2373: purpose of the presentation is to make evident the organization of the
                   2374: document.  But the presentation is equally dependent on the device used to
                   2375: render the document. Certain presentation effects, notably changes of font or
                   2376: character set, cannot be performed on all printers or on all screens.  This is
                   2377: why Thot uses a two-level approach, where the presentation is first described
                   2378: in abstract terms, without taking into account each particular device, and
                   2379: then the presentation is realized within the constraints of a given
                   2380: device.</p>
                   2381: 
                   2382: <p>Thus, presentation is only described as a function of the structure of the
1.1       cvs      2383: documents and the image that would be produced on an idealized device.  For
                   2384: this reason, presentation descriptions do not refer to any device
1.18      cvs      2385: characteristics: they describe <em>abstract presentations</em> which can be
                   2386: concretized on different devices.</p>
1.30      cvs      2387: 
                   2388: <p>A presentation description also defines a <em>generic presentation</em>,
                   2389: since it describes the appearance of a class of documents or objects. This
                   2390: generic presentation must also be applied to document and object instances,
                   2391: each conforming to its generic logical structure, but with all the allowances
                   2392: that were called to mind above: missing elements, constructed elements with
                   2393: other logical structures, etc.</p>
                   2394: 
                   2395: <p>In order to preserve the homogeneity between documents and objects,
1.1       cvs      2396: presentation is described with a single set of tools which support the layout
                   2397: of a large document as well as the composition of objects like a graphical
                   2398: figure or mathematical formula.  This unity of presentation description tools
                   2399: contrasts with the traditional approach, which focuses more on documents than
                   2400: objects and thus is based on the usual typographic conventions, such as the
                   2401: placement of margins, indentations, vertical spaces, line lengths,
1.18      cvs      2402: justification, font changes, etc.</p>
                   2403: </div>
1.1       cvs      2404: 
1.18      cvs      2405: <div class="subsection">
1.30      cvs      2406: <h3><a name="sectc412">Boxes</a></h3>
1.1       cvs      2407: 
1.30      cvs      2408: <p>To assure the homogeneity of tools, all presentation in Thot, for documents
                   2409: as well as for the objects which they contain, is based on the notion of the
1.18      cvs      2410: <em>box</em>, such as was implemented in T<sub><big>E</big></sub>X.</p>
1.30      cvs      2411: 
                   2412: <p>Corresponding to each element of the document is a box,  which is the
1.1       cvs      2413: rectangle enclosing the element on the display device (screen or sheet of
1.18      cvs      2414: paper);  the outline of this rectangle is not visible, except when a <a
                   2415: href="#sectc4230a"><tt>ShowBox</tt> rule</a> applies to the element. The sides
                   2416: of the box are parallel to the sides of the screen or the sheet of paper.  By
                   2417: way of example, a box is associated with a character string, a line of text, a
                   2418: page, a paragraph, a title, a mathematical formula, or a table cell.</p>
1.30      cvs      2419: 
                   2420: <p>Whatever element it corresponds to, each box possesses four sides and four
1.18      cvs      2421: axes, which we designate as follows (<a href="#boxes">see figure</a>):</p>
                   2422: <dl>
1.30      cvs      2423:   <dt><tt>Top</tt></dt>
                   2424:     <dd>the upper side,</dd>
                   2425:   <dt><tt>Bottom</tt></dt>
                   2426:     <dd>the lower side,</dd>
                   2427:   <dt><tt>Left</tt></dt>
                   2428:     <dd>the left side,</dd>
                   2429:   <dt><tt>Right</tt></dt>
                   2430:     <dd>the right side,</dd>
                   2431:   <dt><tt>VMiddle</tt></dt>
                   2432:     <dd>the vertical axis passing through the center of the box,</dd>
                   2433:   <dt><tt>HMiddle</tt></dt>
                   2434:     <dd>the horizontal axis passing through the center of the box,</dd>
                   2435:   <dt><tt>VRef</tt></dt>
                   2436:     <dd>the vertical reference axis,</dd>
                   2437:   <dt><tt>HRef</tt></dt>
                   2438:     <dd>the horizontal reference axis.</dd>
1.18      cvs      2439: </dl>
                   2440: 
                   2441: <div class="figure">
                   2442: <hr>
                   2443: <pre>        Left   VRef  VMiddle        Right
1.1       cvs      2444:                  :      :
                   2445:     Top   -----------------------------
                   2446:           |      :      :             |
                   2447:           |      :      :             |
                   2448:           |      :      :             |
                   2449:           |      :      :             |
                   2450:           |      :      :             |
                   2451: HMiddle ..|...........................|..
                   2452:           |      :      :             |
                   2453:           |      :      :             |
                   2454:    HRef ..|...........................|..
                   2455:           |      :      :             |
                   2456:           |      :      :             |
                   2457:   Bottom  -----------------------------
1.18      cvs      2458:                  :      :</pre>
1.30      cvs      2459: 
                   2460: <p align="center"><em><a name="boxes">The sides and axes of
                   2461: boxes</a><em></em></em></p>
1.18      cvs      2462: <hr>
1.30      cvs      2463: </div>
1.19      cvs      2464: 
1.30      cvs      2465: <p>The principal role of boxes is to set the extent and position of the images
                   2466: of the different elements of a document with respect to each other on the
1.1       cvs      2467: reproduction device.  This is done by defining relations between the boxes of
                   2468: different elements which give relative extents and positions to these
1.18      cvs      2469: boxes.</p>
1.30      cvs      2470: 
                   2471: <p>There are three types of boxes:</p>
1.18      cvs      2472: <ul>
1.30      cvs      2473:   <li>boxes corresponding to structural elements of the document,</li>
                   2474:   <li>presentation boxes,</li>
                   2475:   <li>page layout boxes.</li>
1.18      cvs      2476: </ul>
1.30      cvs      2477: 
                   2478: <p><strong>Boxes corresponding to structural elements of the document</strong>
1.1       cvs      2479: are those which linked to each of the elements (base or structured) of the
                   2480: logical structure of the document.  Such a box contains all the contents of
1.18      cvs      2481: the element to which it corresponds (there is an exception: see <a
                   2482: href="#sectc4220">rules <tt>VertOverflow</tt> and <tt>HorizOverflow</tt></a>).
                   2483: These boxes form a tree-like structure, identical to that of the structural
                   2484: elements to which they correspond.  This tree expresses the inclusion
                   2485: relationships between the boxes: a box includes all the boxes of its subtree.
                   2486: On the other hand, there are no predefined rules for the relative positions of
                   2487: the included boxes.  If they are at the same level, they can overlap, be
                   2488: contiguous, or be disjoint. The rules expressed in the generic presentation
                   2489: specify their relative positions.</p>
1.30      cvs      2490: 
                   2491: <p><strong>Presentation boxes</strong> represent elements which are not found
                   2492: in the logical structure of the document but which are added to meet the needs
                   2493: of presentation.  These boxes are linked to the elements of the logical
                   2494: structure that are best suited to bringing them out. For example, they are
                   2495: used to add the character string ``Summary:'' before the summary in the
                   2496: presentation of a report or to represent the fraction bar in a formula, or
                   2497: also to make the title of a field in a form appear.  These elements have no
                   2498: role in the logical structure of the document: the presence of a Summary
                   2499: element in the document does not require the creation of another structural
                   2500: object to hold the word ``Summary''. Similarly, if a Fraction element contains
                   2501: both a Numerator element and a Denominator element, the fraction bar has no
                   2502: purpose structurally.  On the other hand, these elements of the presentation
                   2503: are important for the reader of the reproduced document or for the user of an
1.1       cvs      2504: editor.  This is why they must appear in the document's image.  It is the
                   2505: generic presentation which specifies the presentation boxes to add by
                   2506: indicating their content (a base element for which the value is specified) and
                   2507: the position that they must take in the tree of boxes.  During editing, these
1.18      cvs      2508: boxes cannot be modified by the user.</p>
1.30      cvs      2509: 
                   2510: <p><strong>Page layout boxes</strong> are boxes created implicitly by the page
1.1       cvs      2511: layout rules.  These rules indicate how the contents of a structured element
                   2512: must be broken into lines and pages.  In contrast to presentation boxes, these
                   2513: line and page boxes do not depend on the logical structure of the document,
1.18      cvs      2514: but rather on the physical constraints of the output devices: character size,
                   2515: height and width of the window on the screen or of the sheet of paper.</p>
                   2516: </div>
1.1       cvs      2517: 
1.18      cvs      2518: <div class="subsection">
1.30      cvs      2519: <h3><a name="sectc413">Views and visibility</a></h3>
1.1       cvs      2520: 
1.30      cvs      2521: <p>One of the operations that one might wish to perform on a document is to
                   2522: view it is different ways.  For this reason, it is possible to define several
1.18      cvs      2523: <em>views</em> for the same document, or better yet, for all documents of the
1.1       cvs      2524: same class.  A view is not a different presentation of the document, but
                   2525: rather a filter which only allows the display of certain parts of the
                   2526: document.  For example, it might be desirable to see only the titles of
                   2527: chapters and sections in order to be able to move rapidly through the
                   2528: document.  Such a view could be called a ``table of contents''.  It might also
                   2529: be desirable to see only the mathematical formulas of a document in order to
                   2530: avoid being distracted by the non-mathematical aspects of the document.  A
1.18      cvs      2531: ``mathematics'' view could provide this service.</p>
1.30      cvs      2532: 
                   2533: <p>Views, like presentation, are based on the generic logical structure. Each
1.1       cvs      2534: document class, and each generic presentation, can be provided with views
                   2535: which are particularly useful for that class or presentation.  For each view,
1.18      cvs      2536: the <em>visibility</em> of elements is defined, indicated whether or not the
1.1       cvs      2537: elements must be presented to the user.  The visibility is calculated  as a
                   2538: function of the type of the elements or their hierarchical position in the
                   2539: structure of the document.  Thus, for a table of contents, all the ``Chapter
                   2540: Title'' and ``Section Title'' elements are made visible.  However, the
                   2541: hierarchical level could be used to make the section titles invisible below a
                   2542: certain threshold level.  By varying this threshold, the granularity of the
                   2543: view can be varied.  In the ``mathematics'' view, only Formula elements would
1.18      cvs      2544: be made visible, no matter what their hierarchical level.</p>
1.30      cvs      2545: 
                   2546: <p>Because views are especially useful for producing a synthetic image of the
1.1       cvs      2547: document, it is necessary to adapt the presentation of the elements to the
                   2548: view in which they appear.  For example, it is inappropriate to have a page
                   2549: break before every chapter title in the table of contents.  Thus, generic
                   2550: presentations take into account the possible views and permit each element
1.18      cvs      2551: type's presentation to vary according the view in which its image appears.</p>
1.30      cvs      2552: 
                   2553: <p><a name="views">Views</a> are also used, when editing documents, to display
1.1       cvs      2554: the associated elements.  So, in addition to the primary view of the document,
                   2555: there can be a ``notes'' view and a ``figures'' view which contain,
                   2556: respectively, the associated elements of the Note and Figure types. In this
                   2557: way, it is possible to see simultaneously the text which refers to these
                   2558: elements and the elements themselves, even if they will be separated when
1.18      cvs      2559: printed.</p>
                   2560: </div>
1.1       cvs      2561: 
1.18      cvs      2562: <div class="subsection">
1.30      cvs      2563: <h3><a name="sectc414">Pages</a></h3>
1.1       cvs      2564: 
1.30      cvs      2565: <p>Presentation schemas can be defined which display the document as a long
1.1       cvs      2566: scroll, without page breaks.  This type of schema is particularly well-suited
                   2567: to the initial phase of work on a document, where jumps from page to page
                   2568: would hinder composing and reading the document on a screen.  In this case,
                   2569: the associated elements (such as notes), which are normally displayed in the
                   2570: page footer, are presented in a separate window.  But, once the document is
                   2571: written, it may be desirable to display the document on the screen in the same
                   2572: manner in which it will be printed.  So, the presentation schema must define
1.18      cvs      2573: pages.</p>
1.30      cvs      2574: 
                   2575: <p>The P language permits the specification of the dimensions of pages as well
                   2576: as their composition.  It is possible to generate running titles, page
                   2577: numbers, zones at the bottom of the page for notes, etc.  The editor follows
                   2578: this model and inserts page break marks in the document which are used during
                   2579: printing, insuring that the pages on paper are the same as on the screen.</p>
                   2580: 
                   2581: <p>Once a document has been edited with a presentation schema defining pages,
                   2582: it contains page marks.  But it is always possible to edit the document using
                   2583: a schema without pages.  In this case, the page marks are simply ignored by
                   2584: the editor.  They are considered again as soon as a schema with pages is used.
1.18      cvs      2585: Thus, the user is free to choose between schemas with and without pages.</p>
1.30      cvs      2586: 
                   2587: <p>Thot treats the page break, rather than the page itself, as a box. This
                   2588: page break box contains all the elements of one page's footer, a rule marking
                   2589: the edge of this page, and all the elements of the next page's header.  The
1.1       cvs      2590: elements of the header and footer can be running titles, page number,
                   2591: associated elements (notes, for example), etc. All these elements, as well as
                   2592: their content and graphical appearance, are defined by the generic
1.18      cvs      2593: presentation.</p>
                   2594: </div>
1.1       cvs      2595: 
1.18      cvs      2596: <div class="subsection">
1.30      cvs      2597: <h3><a name="sectc415">Numbering</a></h3>
1.1       cvs      2598: 
1.30      cvs      2599: <p>Many elements are numbered in documents: pages, chapters, sections,
                   2600: formulas, theorems, notes, figures, bibliographic references, exercises,
                   2601: examples, lemmas, etc.  Because Thot has a notion of logical structure, all of
                   2602: these numbers (with the exception of pages) are redundant with information
                   2603: implicit in the logical structure of the document.  Such numbers are simply a
                   2604: way to make the structure of the document more visible.  So, they are part of
                   2605: the document's presentation and are calculated by the editor from the logical
1.1       cvs      2606: structure.  The structure does not contain numbers as such; it only defines
                   2607: relative structural positions between elements, which serve as ordering
1.18      cvs      2608: relations on these elements.</p>
1.30      cvs      2609: 
                   2610: <p>If the structure schema defines the body of a document as a sequence of at
1.18      cvs      2611: least two chapters:</p>
                   2612: <pre>Body = LIST [2..*] OF Chapter;</pre>
1.30      cvs      2613: 
                   2614: <p>the sequence defined by the list constructor is ordered and each chapter
                   2615: can be assigned a number based on its rank in the Body list.  Therefore, all
1.18      cvs      2616: elements contained in lists a the structure of a document can be numbered, but
                   2617: they are not the only ones.  The tree structure induced by the aggregate,
                   2618: list, and choice constructors (excluding references) defines a total order on
                   2619: the elements of the document's primary structure.  So, it is possible to
                   2620: define a numbering which uses this order, filtering elements according to
                   2621: their type so that only certain element types are taken into account in the
                   2622: numbering.  In this way, it possible to number all the theorems and lemmas of
                   2623: a chapter in the same sequence of numbers, even when they are not part of the
                   2624: same list constructor and appear at different levels of the document's tree.
                   2625: By changing the filter, they can be numbered separately: one sequence of
                   2626: numbers for theorems, another for the lemmas.</p>
1.30      cvs      2627: 
                   2628: <p>Associated elements pose a special problem, since they are not part of the
1.1       cvs      2629: document's primary structure, but are attached only by references, which
                   2630: violate the total order of the document.  Then, these associated elements are
                   2631: frequently numbered, precisely because the number is an effective way to
                   2632: visualize the reference.  In order to resolve this problem, Thot implicitly
                   2633: defines a list constructor for each type of associated element, gathering
                   2634: together (and ordering) these elements.  Thus, the associated elements can be
1.18      cvs      2635: numbered by type.</p>
1.30      cvs      2636: 
                   2637: <p>Since they are calculated from the document's logical structure and only
                   2638: for the needs of the presentation, numbers are presentation elements,
                   2639: described by presentation boxes, just like the fraction bar or the word
                   2640: ``Summary''. Nevertheless, numbers differ from these other boxes because their
                   2641: content varies from instance to instance, even though they are of the same
                   2642: type, whereas all fraction bars are horizontal lines and the same word
                   2643: ``Summary'' appears at the head of every document's summary.</p>
1.18      cvs      2644: </div>
1.1       cvs      2645: 
1.18      cvs      2646: <div class="subsection">
1.34    ! cvs      2647: <h3><a name="sectc416">Presentation properties</a></h3>
1.1       cvs      2648: 
1.34    ! cvs      2649: <p>The principal properties which determine document presentation are the
1.18      cvs      2650: <em>positions</em> and <em>dimensions</em> of boxes, the <em>font</em>, the
                   2651: <em>style</em>, the <em>size</em>, the <em>underlining</em> and the
1.34    ! cvs      2652: <em>color</em> of their content.  From these properties, and some others of
        !          2653: less importance, it is possible to represent the usual typographic properties
        !          2654: for the textual parts of the document.  These same properties can be used to
1.1       cvs      2655: describe the geometry of the non-textual elements, even though they are
1.18      cvs      2656: two-dimensional elements unlike the text, which is linear.</p>
1.30      cvs      2657: 
                   2658: <p>As we have already  seen, the positions of the boxes always respect the
                   2659: rule of enclosure: a box in the tree encloses all the boxes of the next lower
1.34    ! cvs      2660: level which are attached to it.  The positional properties permit the
1.30      cvs      2661: specification of the position of each box in relation to the enclosing box or
                   2662: to its sibling boxes (boxes directly attached to the same enclosing box in the
                   2663: tree of boxes).</p>
                   2664: 
1.34    ! cvs      2665: <p>The presentation properties also provide control over the dimensions of the
1.1       cvs      2666: boxes.  The dimensions of a box can depend either on its content or on its
                   2667: context (its sibling boxes and the enclosing box). Each dimension (height or
1.18      cvs      2668: width) can be defined independently of the other.</p>
1.30      cvs      2669: 
1.34    ! cvs      2670: <p>Because of the position and dimension properties, it is possible to do the
1.1       cvs      2671: same things that are normally done in typography by changing margins, line
                   2672: lengths, and vertical or horizontal skips.  This approach can also align or
1.18      cvs      2673: center elements and groups of elements.</p>
1.30      cvs      2674: 
1.34    ! cvs      2675: <p>In contrast to the position and dimension properties, the font, style,
1.30      cvs      2676: size, underlining, and color do not concern the box itself (the rectangle
1.34    ! cvs      2677: delimiting the element), but its content.  These properties indicate the
1.30      cvs      2678: typographic attributes which must be applied to the text contained in the box,
                   2679: and by extension, to all base elements.</p>
                   2680: 
1.34    ! cvs      2681: <p>For text, the font property is used to change the family of characters
1.1       cvs      2682: (Times, Helvetica, Courier, etc.); the style is used to obtain italic or
                   2683: roman, bold or light characters;  the size determines the point size of the
                   2684: characters; underlining defines the type and thickness of the lines drawn
1.18      cvs      2685: above, below, or through the characters.</p>
1.30      cvs      2686: 
1.34    ! cvs      2687: <p>For graphics, the line style property can be either solid, dotted, or
        !          2688: dashed; the line thickness property controls the width of the lines; the fill
        !          2689: pattern property determines how closed geometric figures must be filled.</p>
1.30      cvs      2690: 
1.34    ! cvs      2691: <p>While some of the properties which determine the appearance of a box's
1.1       cvs      2692: contents make sense only for one content type (text or graphic), other
1.34    ! cvs      2693: properties apply to all content types: these are the color properties. These
1.18      cvs      2694: indicate the color of lines and the background color.</p>
                   2695: </div>
                   2696: </div>
1.1       cvs      2697: 
1.18      cvs      2698: <div class="section">
1.30      cvs      2699: <h2><a name="sectb42">Presentation description language</a></h2>
                   2700: 
1.34    ! cvs      2701: <p>A generic presentation defines the values of presentation properties (or
1.30      cvs      2702: the way to calculate those values) for a generic structure, or more precisely,
                   2703: for all the element types and all the global and local attributes defined in
1.34    ! cvs      2704: that generic structure.  This definition of the presentation properties is
1.30      cvs      2705: made with the P language.  A program written in this language, that is a
                   2706: generic presentation expressed in P, is call a <em>presentation schema</em>.
                   2707: This section describes the syntax and semantics of the language, using the
                   2708: same <a href="#sectc321">meta-language</a> as was used for the definition of
                   2709: the S language.</p>
1.1       cvs      2710: 
1.30      cvs      2711: <p>Recall that it is possible to write many different presentation schemas for
1.1       cvs      2712: the same class of documents or objects.  This allows users to choose for a
                   2713: document the graphical appearance  which best suits their type of work or
1.18      cvs      2714: their personal taste.</p>
1.1       cvs      2715: 
1.18      cvs      2716: <div class="subsection">
1.30      cvs      2717: <h3><a name="sectc421">The organization of a presentation schema</a></h3>
1.1       cvs      2718: 
1.30      cvs      2719: <p>A presentation schema begins with the word <tt>PRESENTATION</tt> and ends
                   2720: with the word <tt>END</tt>.  The word <tt>PRESENTATION</tt> is followed by the
                   2721: name of the generic structure to which the presentation will be applied.  This
                   2722: name must be the same as that which follows the keyword <tt>STRUCTURE</tt> in
                   2723: the structure schema associated with the presentation schema.</p>
                   2724: 
                   2725: <p>After this declaration of the name of the structure, the following sections
1.18      cvs      2726: appear (in order):</p>
                   2727: <ul>
1.30      cvs      2728:   <li>Declarations of
                   2729:     <ul>
                   2730:       <li>all views,</li>
                   2731:       <li>printed views,</li>
                   2732:       <li>counters,</li>
                   2733:       <li>presentation constants,</li>
                   2734:       <li>variables,</li>
                   2735:     </ul>
                   2736:   </li>
                   2737:   <li>default presentation rules,</li>
                   2738:   <li>presentation box and page layout box definitions,</li>
                   2739:   <li>presentation rules for structured elements,</li>
                   2740:   <li>presentation rules for attributes,</li>
                   2741:   <li>rules for transmitting values to attributes of included documents.</li>
1.18      cvs      2742: </ul>
1.30      cvs      2743: 
                   2744: <p>Each of these sections is introduced by a keyword which is followed by a
1.18      cvs      2745: sequence of declarations.  Every section is optional.</p>
                   2746: <pre>     SchemaPres ='PRESENTATION' ElemID ';'
1.1       cvs      2747:                [ 'VIEWS' ViewSeq ]
                   2748:                [ 'PRINT' PrintViewSeq ]
                   2749:                [ 'COUNTERS' CounterSeq ]
                   2750:                [ 'CONST' ConstSeq ]
                   2751:                [ 'VAR' VarSeq ]
                   2752:                [ 'DEFAULT' ViewRuleSeq ]
                   2753:                [ 'BOXES' BoxSeq ]
                   2754:                [ 'RULES' PresentSeq ]
                   2755:                [ 'ATTRIBUTES' PresAttrSeq ]
                   2756:                [ 'TRANSMIT' TransmitSeq ]
                   2757:                  'END' .
1.18      cvs      2758:      ElemID     = NAME .</pre>
                   2759: </div>
1.1       cvs      2760: 
1.18      cvs      2761: <div class="subsection">
1.30      cvs      2762: <h3><a name="sectc422">Views</a></h3>
1.1       cvs      2763: 
1.30      cvs      2764: <p>Each of the possible views must be declared in the presentation schema.  As
1.18      cvs      2765: has <a href="#views">already been described</a>, the presentation rules for an
1.1       cvs      2766: element type can vary according to the view in which the element appears.  The
                   2767: name of the view is used to designate the view to which the presentation rules
1.18      cvs      2768: apply (see the <a href="#inkeyword"><tt>IN</tt> instruction</a>).  The
1.1       cvs      2769: definition of the view's contents are dispersed throughout the presentation
                   2770: rules attached to the different element types and attributes.  The
1.18      cvs      2771: <tt>VIEWS</tt> section is simply a sequence of view names separated by commas
                   2772: and terminated by a semi-colon.</p>
1.30      cvs      2773: 
                   2774: <p>One of the view names (and only one) can be followed by the keyword
1.18      cvs      2775: <tt>EXPORT</tt>.  This keyword identifies the view which presents the members
                   2776: of the document class in <a href="#sectc3213">skeleton form</a>.  The
                   2777: graphical appearance  and the content of this view is defined just as with
                   2778: other views, but it is useless to specify presentation rules concerning this
                   2779: view for the elements which are not loaded in the skeleton form.</p>
1.30      cvs      2780: 
                   2781: <p>It is not necessary to declare any views; in this case there is a single
1.1       cvs      2782: unnamed view.  If many views are declared, the first view listed is considered
                   2783: the principal view.  The principal view is the one to which all rules that are
1.18      cvs      2784: not preceded by an indication of a view will apply (see the <a
                   2785: href="#inkeyword">instruction <tt>IN</tt></a>).</p>
1.30      cvs      2786: 
                   2787: <p>The principal view is the the one which the editor presents on the screen
                   2788: when the user asks to create or edit a document.  Thus, it makes sense to put
                   2789: the most frequently used view at the head of the list.  But if the structure
1.18      cvs      2790: schema contains <a href="#sectc3213">skeleton elements</a> and is loaded in
                   2791: its skeleton form, the view whose name is followed by the keyword
                   2792: <tt>EXPORT</tt> will be opened and no other views can be opened.</p>
                   2793: <pre>                      'VIEWS' ViewSeq
1.1       cvs      2794:      ViewSeq         = ViewDeclaration
1.30      cvs      2795:                        &lt; ',' ViewDeclaration &gt; ';' .
1.1       cvs      2796:      ViewDeclaration = ViewID [ 'EXPORT' ] .
1.18      cvs      2797:      ViewID          = NAME .</pre>
1.30      cvs      2798: 
1.18      cvs      2799: <blockquote class="example">
1.30      cvs      2800:   <p><strong>Example:</strong></p>
                   2801: 
                   2802:   <p>When editing a report, it might be useful have views of the table of
                   2803:   contents and of the mathematical formulas, in addition to the principal view
                   2804:   which shows the document in its entirety.  To achieve this, a presentation
                   2805:   schema for the Report class would have the following <tt>VIEWS</tt>
                   2806:   section:</p>
                   2807:   <pre>VIEWS
1.18      cvs      2808:      Full_text, Table_of_contents, Formulas;</pre>
1.30      cvs      2809: 
                   2810:   <p>The contents of these views are specified in the presentation rules of
                   2811:   the schema.</p>
1.18      cvs      2812: </blockquote>
                   2813: </div>
1.1       cvs      2814: 
1.18      cvs      2815: <div class="subsection">
1.30      cvs      2816: <h3><a name="sectc423">Print Views</a></h3>
1.1       cvs      2817: 
1.30      cvs      2818: <p>When editing a document, each view is presented in a different window.  In
1.18      cvs      2819: addition to the views specified by the <tt>VIEWS</tt> instruction, the user
1.1       cvs      2820: can display the associated elements with one window for each type of
1.18      cvs      2821: associated element.</p>
1.30      cvs      2822: 
                   2823: <p>When printing a document, it is possible to print any number of views,
                   2824: chosen from among all the views which the editor can display (views in the
                   2825: strict sense or associated elements).  Print views, as well as the order in
                   2826: which they must be printed, are indicated by the <tt>PRINT</tt> instruction.
                   2827: It appears after the <tt>VIEWS</tt> instruction and is formed of the keyword
1.18      cvs      2828: <tt>PRINT</tt> followed by the ordered list of print view names.  The print
1.1       cvs      2829: view names are separated by commas and followed by a semi-colon.  A print view
1.18      cvs      2830: name is either a view name declared in the <tt>VIEWS</tt> instruction or the
1.1       cvs      2831: name of an associated element type (with an ``s'' added to the end).  The
1.18      cvs      2832: associated element must have been declared in the <tt>ASSOC</tt> section of
                   2833: the structure schema.</p>
                   2834: <pre>                    'PRINT' PrintViewSeq
1.30      cvs      2835:      PrintViewSeq = PrintView &lt; ',' PrintView &gt; ';' .
1.18      cvs      2836:      PrintView    = ViewID / ElemID .</pre>
1.30      cvs      2837: 
                   2838: <p>If the <tt>PRINT</tt> instruction is absent, the printing program will
                   2839: print only the principal view (the first view specified by the <tt>VIEWS</tt>
1.18      cvs      2840: instruction or the single, unnamed view when there is no <tt>VIEWS</tt>
                   2841: instruction).</p>
1.30      cvs      2842: 
1.18      cvs      2843: <blockquote class="example">
1.30      cvs      2844:   <p><strong>Example:</strong></p>
                   2845: 
                   2846:   <p>Consider a Report presentation using the view declarations from the
                   2847:   preceding example.  Suppose we want to print the full text and table of
                   2848:   contents views, but not the Formulas view, which is only useful when
                   2849:   editing.  In addition, suppose that we also want to print the bibliographic
                   2850:   citations, which are associated elements (of type <tt>Citation</tt>).  A
                   2851:   sensible printing order would be to print the full text then the
                   2852:   bibliography and finally the table of contents.  To obtain this result when
                   2853:   printing, the presentation schema would say:</p>
                   2854:   <pre>PRINT
1.18      cvs      2855:      Full_text, Citations, Table_of_contents;</pre>
                   2856: </blockquote>
                   2857: </div>
                   2858: 
                   2859: <div class="subsection">
1.30      cvs      2860: <h3><a name="sectc424">Counters</a></h3>
1.18      cvs      2861: 
1.30      cvs      2862: <p>A presentation has a <em>counter</em> for each type of number in the
1.1       cvs      2863: presentation.  All counters, and therefore all types of numbers, used in the
1.18      cvs      2864: schema must be declared after the <tt>COUNTERS</tt> keyword.</p>
1.30      cvs      2865: 
                   2866: <p>Each counter declaration is composed of a name identifying the counter
1.1       cvs      2867: followed by a colon and the counting function to be applied to the counter.
1.18      cvs      2868: The counter declaration ends with a semi-colon.</p>
1.30      cvs      2869: 
                   2870: <p>The counting function indicates how the counter values will be calculated.
1.16      cvs      2871: Three types of counting functions are available.  The first type is used to
                   2872: count the elements of a list or aggregate: it assigns to the counter the rank
1.18      cvs      2873: of the element in the list or aggregate.  More precisely, the function</p>
                   2874: <pre>RANK OF ElemID [ LevelAsc ] [ INIT AttrID ]
                   2875:         [ 'REINIT' AttrID ]</pre>
1.30      cvs      2876: 
                   2877: <p>indicates that when an element creates, by a creation rule (see the <a
1.18      cvs      2878: href="#sectc4232"><tt>Create</tt> instructions</a>), a presentation box
1.5       cvs      2879: containing  the counter value, this value is the rank of the creating element,
1.18      cvs      2880: if it is of type <tt>ElemID</tt>, otherwise the rank of the first element of
                   2881: type <tt>ElemID</tt> which encloses the creating element in the logical
                   2882: structure of the document.</p>
1.30      cvs      2883: 
                   2884: <p>The type name can be preceded by a star in the special case where the
1.18      cvs      2885: structure schema defines an element of whose <tt>ElemID</tt> is the same as
                   2886: that of an <a href="#sectd3284">inclusion</a> without expansion or with
                   2887: partial expansion.  To resolve this ambiguity, the <tt>ElemID</tt> alone
                   2888: refers to the type defined in the structure schema while the <tt>ElemID</tt>
                   2889: preceded by a star refers to the included type.</p>
1.30      cvs      2890: 
                   2891: <p>The type name <tt>ElemID</tt> can be followed by an integer.  That number
1.1       cvs      2892: represents the relative level, among the ancestors of the creating element, of
1.18      cvs      2893: the element whose rank is asked.  If that relative level <i>n</i> is unsigned,
                   2894: the <i>n</i><sup>th</sup> element of type <tt>ElemID</tt> encountered when
1.1       cvs      2895: travelling the logical structure from the root to the creating element is
1.16      cvs      2896: taken into account.  If the relative level is negative, the logical structure
                   2897: is travelled in the other direction, from the creating element to the
1.18      cvs      2898: root.</p>
1.30      cvs      2899: 
                   2900: <p>The function can end with the keyword <tt>INIT</tt> followed by the name of
                   2901: a numeric attribute (and only a numeric attribute).  Then, the rank of the
                   2902: first element of the list or aggregate is considered to be the value of this
1.1       cvs      2903: attribute, rather than the default value of 1, and the rank of the other
                   2904: elements is shifted accordingly.  The attribute which determines the initial
1.18      cvs      2905: value is searched on the element itself and on its ancestors.</p>
1.30      cvs      2906: 
                   2907: <p>The function can end with the keyword <tt>REINIT</tt> followed by the name
                   2908: of a numeric attribute (and only a numeric attribute).  Then, if an element to
                   2909: be counted has this attribute, the counter value for this element is the
1.1       cvs      2910: attribute value and the following elements are numbered starting from this
1.18      cvs      2911: value.</p>
1.30      cvs      2912: 
                   2913: <p>When the <tt>RANK</tt> function is written</p>
1.18      cvs      2914: <pre>RANK OF Page [ ViewID ] [ INIT AttrID ]</pre>
1.30      cvs      2915: 
                   2916: <p>(<tt>Page</tt>is a keyword of the P language), the counter takes as its
                   2917: value the number of the page on which the element which creates the
                   2918: presentation box containing the number appears.  This is done as if the pages
                   2919: of the document form a list for each view.  The counter only takes into
                   2920: account the pages of the relevant view, that is the view displaying the
                   2921: presentation box whose contents take the value of the number.  However, if the
                   2922: keyword <tt>Page</tt> is followed by the name of a view (between parentheses),
                   2923: it is the pages of that view that are taken into account.  As in the preceding
                   2924: form, the <tt>RANK</tt> function applied to pages can end with the
                   2925: <tt>INIT</tt> keyword followed by the name of a numeric attribute which sets
                   2926: the value of the first page's number.  This attribute must be a local
                   2927: attribute of the document itself, and not of one of its components.</p>
                   2928: 
                   2929: <p>The second counting function is used to count the occurrences of a certain
1.18      cvs      2930: element type in a specified context.  The instruction</p>
                   2931: <pre>SET n ON Type1 ADD m ON Type2 [ INIT AttrID ]</pre>
1.30      cvs      2932: 
                   2933: <p>says that when the document is traversed from beginning to end (in the
                   2934: order induced by the logical structure), the counter is assigned the value
1.18      cvs      2935: <tt>n</tt> each time an element of type <tt>Type1</tt> is encountered, no
                   2936: matter what the current value of the counter, and the value <tt>m</tt> is
                   2937: added to the current value of the counter each time an element of type
                   2938: <tt>Type2</tt> is encountered.</p>
1.30      cvs      2939: 
                   2940: <p>As with the <tt>RANK</tt> function, the type names can be preceded by a
                   2941: star to resolve the ambiguity of included elements.</p>
                   2942: 
                   2943: <p>If the function ends with the keyword <tt>INIT</tt> followed by the name of
                   2944: an attribute and if the document possesses this attribute, the value of this
1.18      cvs      2945: attribute is used in place of <tt>n</tt>.  The attribute must be numeric.  It
                   2946: is searched on the element itself and on its ancestors.</p>
1.30      cvs      2947: 
                   2948: <p>This function can also be used with the <tt>Page</tt> keyword in the place
                   2949: of <tt>Type1</tt> or <tt>Type2</tt>.  In the first case, the counter is
1.18      cvs      2950: reinitialized on each page with the value <tt>n</tt>, while in the second
                   2951: case, it is incremented by <tt>m</tt> on each page.  As with the preceding
                   2952: counting function, the word <tt>Page</tt> can be followed by a name between
1.1       cvs      2953: parentheses.  In this case, the name specifies a view whose pages are taken
1.18      cvs      2954: into account.</p>
1.30      cvs      2955: 
                   2956: <p>The definition of a counter can contain several <tt>SET</tt> functions and
1.18      cvs      2957: several <tt>ADD</tt> functions, each with a different value.  The total number
                   2958: of counting functions must not be greater than 6.</p>
1.30      cvs      2959: 
                   2960: <p>The third counting function is used to count the elements of a certain type
1.16      cvs      2961: encountered when travelling from the creating element to the root of the
                   2962: logical structure.  The creating element is included if it is of that type.
1.18      cvs      2963: That function is written</p>
                   2964: <pre>RLEVEL OF Type</pre>
1.30      cvs      2965: 
                   2966: <p>where <tt>Type</tt> represents the type of the elements to be counted.</p>
                   2967: 
                   2968: <p>The formal definition of counter declarations is:</p>
1.18      cvs      2969: <pre>                    'COUNTERS' CounterSeq
1.30      cvs      2970:      CounterSeq   = Counter &lt; Counter &gt; .
1.1       cvs      2971:      Counter      = CounterID ':' CounterFunc ';' .
                   2972:      CounterID    = NAME .
                   2973:      CounterFunc  = 'RANK' 'OF' TypeOrPage [ SLevelAsc ]
1.16      cvs      2974:                     [ 'INIT' AttrID ] [ 'REINIT' AttrID ] /
1.30      cvs      2975:                     SetFunction &lt; SetFunction &gt;
                   2976:                     AddFunction &lt; AddFunction &gt;
1.16      cvs      2977:                     [ 'INIT' AttrID ] /
                   2978:                     'RLEVEL' 'OF' ElemID .
1.1       cvs      2979:      SLevelAsc    = [ '-' ] LevelAsc .
                   2980:      LevelAsc     =  NUMBER .
                   2981:      SetFunction  = 'SET' CounterValue 'ON' TypeOrPage .
                   2982:      AddFunction  = 'ADD' CounterValue 'ON' TypeOrPage .
                   2983:      TypeOrPage   = 'Page' [ '(' ViewID ')' ] / 
1.16      cvs      2984:                     [ '*' ] ElemID .
1.18      cvs      2985:      CounterValue = NUMBER .</pre>
1.30      cvs      2986: 
1.18      cvs      2987: <blockquote class="example">
1.30      cvs      2988:   <p><strong>Example:</strong></p>
                   2989: 
                   2990:   <p>If the body of a chapter is defined as a sequence of sections in the
                   2991:   structure schema:</p>
                   2992:   <pre>Chapter_body = LIST OF (Section = 
1.1       cvs      2993:                             BEGIN
                   2994:                             Section_Title = Text;
                   2995:                             Section_Body  = Paragraphs;
                   2996:                             END
1.18      cvs      2997:                          );</pre>
1.30      cvs      2998: 
                   2999:   <p>the section counter is declared:</p>
                   3000:   <pre>SectionCtr : RANK OF Section;</pre>
                   3001: 
                   3002:   <p>and the display of the section number before the section title is
                   3003:   obtained by a <a href="#sectc4232"><tt>CreateBefore</tt> rule</a> attached
                   3004:   the <tt>Section_Title</tt> type, which creates a presentation box whose
                   3005:   content is the value of the <tt>SectionCtr</tt> counter (see the <a
                   3006:   href="#sectc4231"><tt>Content</tt> instruction</a>).</p>
                   3007: 
                   3008:   <p>In order to number the formulas separately within each chapter, the
                   3009:   formula counter is declared:</p>
                   3010:   <pre>FormulaCtr : SET 0 ON Chapter ADD 1 ON Formula;</pre>
                   3011: 
                   3012:   <p>and the display of the formula number in the right margin, alongside each
                   3013:   formula, is obtained by a <tt>CreateAfter</tt> instruction attached to the
                   3014:   <tt>Formula</tt> type, which creates a presentation box whose content is the
                   3015:   value of the <tt>FormulaCtr</tt> counter.</p>
                   3016: 
                   3017:   <p>To number the page chapter by chapter, with the first page of each
                   3018:   chapter having the number 1, the counter definition would be</p>
                   3019:   <pre>ChapterPageCtr : SET 0 ON Chapter ADD 1 ON Page;</pre>
                   3020: 
                   3021:   <p>If there is also a chapter counter</p>
                   3022:   <pre>ChapterCtr : RANK OF Chapter;</pre>
                   3023: 
                   3024:   <p>the <a href="#sectc4231">content</a> of a presentation box created at the
                   3025:   top of each page could be defined as:</p>
                   3026:   <pre>Content : (VALUE(ChapterCtr, URoman) TEXT '-'
1.18      cvs      3027:            VALUE(ChapterPageCtr, Arabic));</pre>
1.30      cvs      3028: 
                   3029:   <p>Thus, the presentation box contains the number of the chapter in
                   3030:   upper-case roman numerals followed by a hyphen and the number of the page
                   3031:   within the chapter in arabic numerals.</p>
1.18      cvs      3032: </blockquote>
1.30      cvs      3033: 
1.18      cvs      3034: <blockquote class="example">
1.30      cvs      3035:   <p><strong>Example:</strong></p>
                   3036: 
                   3037:   <p>To count tables and figures together in a document of the chapter type, a
                   3038:   counter could be defined using:</p>
                   3039:   <pre>CommonCtr : SET 0 ON Chapter ADD 1 ON Table
1.18      cvs      3040:             ADD 1 ON Figure;</pre>
                   3041: </blockquote>
                   3042: </div>
1.1       cvs      3043: 
1.18      cvs      3044: <div class="subsection">
1.30      cvs      3045: <h3><a name="sectc425">Presentation constants</a></h3>
1.1       cvs      3046: 
1.30      cvs      3047: <p>Presentation constants are used in the definition of the content of
1.18      cvs      3048: presentation boxes.  This content is used in <a href="#sectc426">variable
                   3049: definitions</a> and in the <a href="#sectc4231"><tt>Content</tt> rule</a>. The
1.1       cvs      3050: only presentation constants which can be used are character strings,
1.2       cvs      3051: mathematical symbols, graphical elements, and pictures, that is to say, base
1.18      cvs      3052: elements.</p>
1.30      cvs      3053: 
                   3054: <p>Constants can be defined directly in the variables or presentation boxes
1.18      cvs      3055: (<tt>Content</tt> rule) which use them.  But it is only necessary them to
1.1       cvs      3056: declare once, in the constant declaration section, even though they are used
                   3057: in many variables or boxes.  Thus, each declared constant has a name, which
                   3058: allows it to be designated whenever it is used, a type (one of the four base
                   3059: types) and a value (a character string or a single character for mathematical
1.18      cvs      3060: symbols and graphical elements).</p>
1.30      cvs      3061: 
                   3062: <p>The constant declarations appear after the keyword <tt>CONST</tt>.  Each
1.1       cvs      3063: declaration is composed of the name of the constant, an equals sign, a keyword
1.18      cvs      3064: representing its type (<tt>Text</tt>, <tt>Symbol</tt>, <tt>Graphics</tt> or
                   3065: <tt>Picture</tt>) and the string representing its value. A semi-colon
                   3066: terminates each declaration.</p>
1.30      cvs      3067: 
                   3068: <p>In the case of a character string, the keyword <tt>Text</tt> can be
                   3069: followed by the name of an alphabet (for example, <tt>Greek</tt> or
                   3070: <tt>Latin</tt>) in which the constant's text should be expressed.  If the
                   3071: alphabet name is absent, the Latin alphabet is used.  When the alphabet name
                   3072: is present, only the first letter of the alphabet name is interpreted.  Thus,
                   3073: the words <tt>Greek</tt> and <tt>Grec</tt> designate the same alphabet.  In
                   3074: current versions of Thot, only the Greek and Latin alphabets are
                   3075: available.</p>
1.18      cvs      3076: <pre>                 'CONST' ConstSeq
1.30      cvs      3077:      ConstSeq   = Const &lt; Const &gt; .
1.1       cvs      3078:      Const      = ConstID '=' ConstType ConstValue ';' .
                   3079:      ConstID    = NAME .
                   3080:      ConstType  ='Text' [ Alphabet ] / 'Symbol' /
                   3081:                  'Graphics' / 'Picture' .
                   3082:      ConstValue = STRING .
1.18      cvs      3083:      Alphabet   = NAME .</pre>
1.30      cvs      3084: 
                   3085: <p>For character strings in the Latin alphabet (ISO Latin-1 character set),
1.1       cvs      3086: characters having codes higher than 127 (decimal) are represented by their
1.18      cvs      3087: code in octal.</p>
1.30      cvs      3088: 
                   3089: <p>In the case of a symbol or graphical element, the value only contains a
                   3090: single character, between apostrophes, which indicates the form of the element
                   3091: which must be drawn in the box whose content is the constant.  The symbol or
1.1       cvs      3092: graphical element takes the dimensions of the box, which are determined by the
1.18      cvs      3093: <tt>Height</tt> and <tt>Width</tt> rules. See <a href="#sectb72">table of
                   3094: codes</a> for the symbols and graphical elements.</p>
1.30      cvs      3095: 
1.18      cvs      3096: <blockquote class="example">
1.30      cvs      3097:   <p><strong>Example:</strong></p>
                   3098: 
                   3099:   <p>The constants ``Summary:'' and fraction bar, which were described
                   3100:   earlier, are declared:</p>
                   3101:   <pre>CONST
1.1       cvs      3102:      SummaryConst = Text 'Summary:';
1.18      cvs      3103:      Bar          = Graphics 'h';</pre>
                   3104: </blockquote>
                   3105: </div>
1.1       cvs      3106: 
1.18      cvs      3107: <div class="subsection">
1.30      cvs      3108: <h3><a name="sectc426">Variables</a></h3>
1.1       cvs      3109: 
1.30      cvs      3110: <p>Variables permit the definition of computed content for presentation boxes.
                   3111: A variable is associated with a presentation box by a <tt>Content</tt> rule;
                   3112: but before being used in a <tt>Content</tt> rule, a variable can be defined in
                   3113: the <tt>VAR</tt> section.  It is also possible to define a variable at the
                   3114: time of its use in a <tt>Content</tt> rule, as can be done with a
                   3115: constant.</p>
                   3116: 
                   3117: <p>A variable has a name and a value which is a character string resulting
                   3118: from the concatenation of the values of a sequence of functions.  Each
                   3119: variable declaration is composed of the variable name followed by a colon and
                   3120: the sequence of functions which produces its value, separated by spaces.  Each
1.18      cvs      3121: declaration is terminated by a semi-colon.</p>
                   3122: <pre>                  'VAR' VarSeq
1.30      cvs      3123:      VarSeq      = Variable &lt; Variable &gt; .
1.1       cvs      3124:      Variable    = VarID ':' FunctionSeq ';' .
                   3125:      VarID       = NAME .
1.30      cvs      3126:      FunctionSeq = Function &lt; Function &gt; .</pre>
                   3127: 
                   3128: <p>Several functions are available.  The first two return, in the form of a
1.18      cvs      3129: character string, the current date.  <tt>DATE</tt> returns the date in
                   3130: English, while <tt>FDATE</tt> returns the date in french.</p>
1.30      cvs      3131: 
                   3132: <p>Two other functions, <tt>DocName</tt> and <tt>DirName</tt>, return the
1.18      cvs      3133: document name and the directory where the document is stored.</p>
1.30      cvs      3134: 
                   3135: <p>Function <tt>ElemName</tt> returns the type of the element which created
                   3136: the presentation box whose contents are the variable.</p>
                   3137: 
                   3138: <p>Another function simply returns the value of a presentation constant. For
                   3139: any constant declared in the <tt>CONST</tt> section, it is sufficient to give
                   3140: the name of the constant.  Otherwise, the type and value of the constant must
                   3141: be given, using the same form as in a <a href="#sectc425">constant
1.18      cvs      3142: declaration</a>. If the constant is not of type text, (types <tt>Symbol</tt>,
                   3143: <tt>Graphics</tt> or <tt>Picture</tt>), it must be alone in the variable
                   3144: definition; only constants of type <tt>Text</tt> can be mixed with other
                   3145: functions.</p>
1.30      cvs      3146: 
                   3147: <p>It is also possible to obtain the value of an attribute, simply by
                   3148: mentioning the attribute's name.  The value of this function is the value of
                   3149: the attribute for the element which created the presentation box whose
                   3150: contents are the variable.  If the creating element does not have the
                   3151: indicated attribute, the value is an empty string.  In the case of a numeric
                   3152: attribute, the attribute is translated into a decimal number in arabic
                   3153: numerals.  If another form is desired, the <tt>VALUE</tt> function must be
                   3154: used.</p>
                   3155: 
                   3156: <p>The last available function returns, as a character string, the value of a
1.1       cvs      3157: counter, an attribute or a page number. This value can be presented in
1.18      cvs      3158: different styles.  The keyword <tt>VALUE</tt> is followed (between
1.1       cvs      3159: parentheses) by the name of the counter, the name of the attribute, or the
1.18      cvs      3160: keyword <tt>PageNumber</tt> and the desired style, the two parameters being
1.1       cvs      3161: separated by a comma.  The style is a keyword which indicates whether the
1.18      cvs      3162: value should be presented in arabic numerals (<tt>Arabic</tt>), lower-case
                   3163: roman numerals (<tt>LRoman</tt>), or upper-case roman numerals
                   3164: (<tt>URoman</tt>), or by an upper-case letter (<tt>Uppercase</tt>) or
                   3165: lower-case letter (<tt>Lowercase</tt>).</p>
1.30      cvs      3166: 
                   3167: <p>For a page counter, the keyword <tt>PageNumber</tt> can be followed,
                   3168: between parentheses, by the name of the view from which to obtain the page
                   3169: number.  By default, the first view declared in the <tt>VIEWS</tt> section is
                   3170: used.  The value obtained is the number of the page on which is found the
                   3171: element that is using the variable in a <tt>Content</tt> rule.</p>
                   3172: 
                   3173: <p>For an ordinary counter, the name of the counter can be preceded by the
1.18      cvs      3174: keyword <tt>MaxRangeVal</tt> or <tt>MinRangeVal</tt>.  These keywords mean
1.1       cvs      3175: that the value returned by the function is the maximum (minimum resp.) value
                   3176: taken by the counter in the whole document, not the value for the element
1.18      cvs      3177: concerned by the function.</p>
                   3178: <pre>     Function     = 'DATE' / 'FDATE' /
1.1       cvs      3179:                     'DocName' / 'DirName' /
                   3180:                     'ElemName' / 'AttributeName' /
                   3181:                      ConstID / ConstType ConstValue /
                   3182:                      AttrID /
                   3183:                     'VALUE' '(' PageAttrCtr ','
                   3184:                                 CounterStyle ')' .
1.6       cvs      3185:      PageAttrCtr  = 'PageNumber' [ '(' ViewID ')' ] /
1.1       cvs      3186:                      [ MinMax ] CounterID / AttrID .
                   3187:      CounterStyle = 'Arabic' / 'LRoman' / 'URoman' /
                   3188:                     'Uppercase' / 'Lowercase' .
1.18      cvs      3189:      MinMax       = 'MaxRangeVal' / 'MinRangeVal' .</pre>
1.30      cvs      3190: 
1.18      cvs      3191: <blockquote class="example">
1.30      cvs      3192:   <p><strong>Example:</strong></p>
                   3193: 
                   3194:   <p>To make today's date appear at the top of the first page of a report, a
                   3195:   <a href="#sectc4232"><tt>CREATE</tt> rule</a> associated with the
                   3196:   Report_Title element type generates a presentation box whose content
                   3197:   (specified by the <tt>Content</tt> rule of that presentation box) is the
                   3198:   variable:</p>
                   3199:   <pre>VAR
1.18      cvs      3200:      Todays_date : TEXT 'Version of ' DATE;</pre>
1.30      cvs      3201: 
                   3202:   <p>To produce, before each section title, the chapter number (in upper-case
                   3203:   roman numerals) followed by the section number (in arabic numerals), two
                   3204:   counters must be defined:</p>
                   3205:   <pre>COUNTERS
1.1       cvs      3206:      ChapterCtr : RANK OF Chapter;
1.18      cvs      3207:      SectionCtr : RANK OF Section;</pre>
1.30      cvs      3208: 
                   3209:   <p>and the Section_Title element must create a presentation box whose
                   3210:   content is the variable</p>
                   3211:   <pre>VAR
1.1       cvs      3212:      SectionNum : VALUE (ChapterCtr, URoman) TEXT '-'
1.18      cvs      3213:                   VALUE (SectionCtr, Arabic);</pre>
1.30      cvs      3214: 
                   3215:   <p>In order to make the page number on which each section begins appear in
                   3216:   the table of contents view next to the section title, each Section_Title
                   3217:   element must create a presentation box, visible only in the table of
                   3218:   contents view, whose content is the variable:</p>
                   3219:   <pre>VAR
1.1       cvs      3220:      TitlePageNume :
1.18      cvs      3221:            VALUE (PageNumber(Full_text), Arabic);</pre>
                   3222: </blockquote>
                   3223: </div>
1.1       cvs      3224: 
1.18      cvs      3225: <div class="subsection">
1.30      cvs      3226: <h3><a name="sectc427">Default presentation rules</a></h3>
1.1       cvs      3227: 
1.30      cvs      3228: <p>In order to avoid having to specify, for each element type defined in the
1.1       cvs      3229: structure schema, values for every one of the numerous presentation
1.34    ! cvs      3230: properties, the presentation schema allows the definition of a set of default
1.1       cvs      3231: presentation rules.  These rules apply to all the boxes of the elements
                   3232: defined in the structure schema and to the presentation boxes and page layout
                   3233: boxes defined in the presentation schema.  Only rules which differ from these
1.18      cvs      3234: default need to be specified in other sections of the presentation schema.</p>
1.30      cvs      3235: 
                   3236: <p>For the primary view, the default rules can define every presentation
1.34    ! cvs      3237: property, but not the <a href="#presfunct">presentation functions</a> or the
1.18      cvs      3238: <a href="#sectc4223">linebreaking conditions</a> (the <tt>NoBreak1</tt>,
                   3239: <tt>NoBreak2</tt>, and <tt>Gather</tt> rules).</p>
1.30      cvs      3240: 
                   3241: <p>In a presentation schema, the default presentation rules section is
                   3242: optional; in this case, the <tt>DEFAULT</tt> keyword is also absent and the
                   3243: following rules are considered to be the default rules:</p>
1.26      cvs      3244: <pre>   Visibility:        Enclosing =;
                   3245:    VertRef:           * . Left;
                   3246:    HorizRef:          Enclosed . HRef;
                   3247:    Height:            Enclosed . Height;
                   3248:    Width:             Enclosed . Width;
                   3249:    VertPos:           Top = Previous . Bottom;
                   3250:    HorizPos:          Left = Enclosing . Left;
                   3251:    MarginTop:         0;
                   3252:    MarginRight:       0;
                   3253:    MarginBottom:      0;
                   3254:    MarginLeft:        0;
                   3255:    PaddingTop:        0;
                   3256:    PaddingRight:      0;
                   3257:    PaddingBottom:     0;
                   3258:    PaddingLeft:       0;
                   3259:    BorderTopWidth:    0;
                   3260:    BorderRightWidth:  0;
                   3261:    BorderBottomWidth: 0;
                   3262:    BorderLeftWidth:   0;
                   3263:    BorderTopColor:    Foreground;
                   3264:    BorderRightColor:  Foreground;
                   3265:    BorderBottomColor: Foreground;
                   3266:    BorderLeftColor:   Foreground;
                   3267:    BorderTopStyle:    None;
                   3268:    BorderRightStyle:  None;
                   3269:    BorderBottomStyle: None;
                   3270:    BorderLeftStyle:   None;
                   3271:    VertOverflow:      No;
                   3272:    HorizOverflow:     No;
                   3273:    Size:              Enclosing =;
                   3274:    Style:             Enclosing =;
                   3275:    Weight:            Enclosing =;
                   3276:    Font:              Enclosing =;
                   3277:    Underline:         Enclosing =;
                   3278:    Thickness:         Enclosing =;
                   3279:    Indent:            Enclosing =;
                   3280:    LineSpacing:       Enclosing =;
                   3281:    Adjust:            Enclosing =;
                   3282:    Justify:           Enclosing =;
                   3283:    Hyphenate:         Enclosing =;
                   3284:    PageBreak:         Yes;
                   3285:    LineBreak:         Yes;
                   3286:    InLine:            Yes;
                   3287:    Depth:             0;
                   3288:    LineStyle:         Enclosing =;
                   3289:    LineWeight:        Enclosing =;
                   3290:    FillPattern:       Enclosing =;
                   3291:    Background:        Enclosing =;
                   3292:    Foreground:        Enclosing =;</pre>
1.30      cvs      3293: 
                   3294: <p>If other values are desired for the default rules, they must be defined
1.1       cvs      3295: explicitly in the default rules section.  In fact, it is only necessary to
                   3296: define those default rules which differ from the ones above, since the rules
1.18      cvs      3297: above will be used whenever a rule is not explicitly named.</p>
1.30      cvs      3298: 
                   3299: <p>Default rules for views other than the primary  view can also be specified.
1.1       cvs      3300: Otherwise, the default rules for the primary views are applied to the other
1.18      cvs      3301: views.</p>
1.30      cvs      3302: 
                   3303: <p>Default rules are expressed in the same way as <a
                   3304: href="#sectc4215">explicit rules for document elements</a>.</p>
1.18      cvs      3305: </div>
1.1       cvs      3306: 
1.18      cvs      3307: <div class="subsection">
1.30      cvs      3308: <h3><a name="sectc428">Presentation and page layout boxes</a></h3>
1.1       cvs      3309: 
1.30      cvs      3310: <p>The presentation process uses elements which are not part of the logical
1.1       cvs      3311: structure of the document, such as pages (which are the page layout boxes) or
                   3312: alternatively, rules, numbers, or words introducing certain parts of the
                   3313: document, such as ``Summary'', ``Appendices'', ``Bibliography'', etc. (which
1.18      cvs      3314: are presentation boxes).</p>
1.30      cvs      3315: 
                   3316: <p>After the word <tt>BOXES</tt>, each presentation or page layout box is
                   3317: defined by its name and a sequence of presentation rules which indicate how
                   3318: they must be displayed.  These rules are the same as those which define the
                   3319: boxes associated with element of the logical structure of the document, with a
1.18      cvs      3320: single exception, the <a href="#sectc4231"><tt>Content</tt> rule</a> which is
1.1       cvs      3321: used only to specify the content of presentation boxes.  The content of boxes
                   3322: associated with elements of the document structure is defined in each document
                   3323: or object and thus is not specified in the presentation schema, which applies
1.18      cvs      3324: to all documents or objects of a class.</p>
1.30      cvs      3325: 
                   3326: <p>Among the rules which define a presentation box, certain ones can refer to
1.1       cvs      3327: another presentation box (for example, in their positional rules).  If the
                   3328: designated box is defined after the box which designates it, a
1.18      cvs      3329: <tt>FORWARD</tt> instruction followed by the name of the designated box must
                   3330: appear before the designation.</p>
                   3331: <pre>             'BOXES' BoxSeq
1.30      cvs      3332:      BoxSeq = Box &lt; Box &gt; .
1.1       cvs      3333:      Box    ='FORWARD' BoxID ';' /
                   3334:               BoxID ':' ViewRuleSeq .
1.18      cvs      3335:      BoxID  = NAME .</pre>
                   3336: </div>
1.1       cvs      3337: 
1.18      cvs      3338: <div class="subsection">
1.30      cvs      3339: <h3><a name="sectc429">Presentation of structured elements</a></h3>
1.1       cvs      3340: 
1.30      cvs      3341: <p>After the words <tt>RULES</tt>, the presentation schema gives the
                   3342: presentation rules that apply to the elements whose types are defined in the
                   3343: structure schema.  Only those rules which differ from the <a
1.18      cvs      3344: href="#sectc427">default</a> must be specified in the <tt>RULES</tt>
                   3345: section.</p>
1.30      cvs      3346: 
                   3347: <p>The rule definitions for each element type are composed of the name of the
1.1       cvs      3348: element type (as specified in the structure schema) followed by a colon and
1.18      cvs      3349: the set of rules specific to that type.</p>
1.30      cvs      3350: 
                   3351: <p>The type name can be preceded by a star in the special case where the
1.18      cvs      3352: structure schema defines an <a href="#sectd3284">inclusion</a> without
1.1       cvs      3353: expansion (or with partial expansion) of a type with the same name as an
1.18      cvs      3354: element of defined in the structure schema.</p>
1.30      cvs      3355: 
                   3356: <p>In the case where the element is a <a href="#sectd3285">mark pair</a>, but
1.18      cvs      3357: only in this case, the type name can be preceded by the keywords
                   3358: <tt>First</tt> or <tt>Second</tt>.  These keywords indicate whether the rules
                   3359: that follow apply to the first or second mark of the pair.</p>
                   3360: <pre>                 'RULES' PresentSeq
1.30      cvs      3361:      PresentSeq = Present &lt; Present &gt; .
1.6       cvs      3362:      Present    = [ '*' ] [ FirstSec ] ElemID ':'
                   3363:                   ViewRuleSeq .
1.18      cvs      3364:      FirstSec   = 'First' / 'Second' .</pre>
1.30      cvs      3365: 
                   3366: <p>A presentation schema can define presentation rules for base elements,
                   3367: which are defined implicitly in the structure schemas.  In the English version
                   3368: of the presentation schema compiler, the base type names are the same as in
                   3369: the S language, but they are terminated by the <tt>_UNIT</tt> suffix:
1.18      cvs      3370: <tt>TEXT_UNIT</tt>, <tt>PICTURE_UNIT</tt>, <tt>SYMBOL_UNIT</tt>,
                   3371: <tt>GRAPHICS_UNIT</tt>.  The base type names are written in upper-case
                   3372: letters.</p>
                   3373: </div>
                   3374: 
                   3375: <div class="subsection">
1.30      cvs      3376: <h3><a name="sectc4210">Logical attribute presentation</a></h3>
1.18      cvs      3377: 
1.30      cvs      3378: <p>After the keyword <tt>ATTRIBUTES</tt>, all attributes which are to have
                   3379: some effect on the presentation of the element to which they are attached must
                   3380: be mentioned, along with the corresponding presentation rules.  This is true
                   3381: for both global attributes (which can be attached to all element types) and
                   3382: local attributes (which can only be attached to certain element types).</p>
                   3383: 
                   3384: <p>Also mentioned in this section are attributes which imply an effect on
1.1       cvs      3385: elements in the subtree of the element to which they are attached. The
                   3386: presentation of these descendants  can be modified as a function of the value
                   3387: of the attribute which they inherit, just as if it was attached to them
1.18      cvs      3388: directly.</p>
1.30      cvs      3389: 
                   3390: <p>The specification for each attribute includes the attribute's name,
                   3391: followed by an optional value specification and, after a colon, a set of
                   3392: rules.  The set of rules must contain at least one rule.</p>
                   3393: 
                   3394: <p>When there is no value specification, the rules are applied to all elements
1.1       cvs      3395: which carry the attribute, no matter what their value.  When the rules must
                   3396: only apply when the attribute has certain values, these values must be
1.18      cvs      3397: specified.  Thus, the same attribute can appear in the <tt>ATTRIBUTES</tt>
1.1       cvs      3398: section several times, with each appearance having a different value
                   3399: specification.  However, reference attributes never have a value specification
1.18      cvs      3400: and, as a result, can only appear once in the <tt>ATTRIBUTES</tt> section.</p>
1.30      cvs      3401: 
                   3402: <p>To specify that the presentation rules apply to some of the descendants of
                   3403: the element having the attribute, the name of the affected element type is
                   3404: given, between parentheses, after the attribute name.  This way, the
                   3405: presentation rules for the attribute will be applied to the element having the
                   3406: attribute, if it is of the given type, and to all of its descendants of the
                   3407: given type. In the case where this type is a <a href="#sectd3285">mark
                   3408: pair</a>, but only in this case, the type name can be preceded by the keywords
                   3409: <tt>First</tt> or <tt>Second</tt>.  These keywords indicate whether the rules
                   3410: that follow apply to the first or second mark of the pair. If the rule must
                   3411: apply to several different element types, the specification must be repeated
                   3412: for each element type.</p>
                   3413: 
                   3414: <p>The specification of values for which the presentation rules will be
                   3415: applied varies according to the type of the attribute:</p>
1.18      cvs      3416: <dl>
1.30      cvs      3417:   <dt>numeric attribute</dt>
                   3418:     <dd>If the rules are to apply for one value of the attribute, then the
                   3419:       attribute name is followed by an equals sign and this value.  If the
                   3420:       rules are to apply for all values less than (or greater than) a
                   3421:       threshold value, non-inclusive, the attribute name followed by a '&lt;'
                   3422:       sign (or a '&gt;' sign, respectively) and the threshold value.  If the
                   3423:       rules must apply to a range of values, the attribute name is followed by
                   3424:       the word '<tt>IN</tt>' and the two bounds of the range, enclosed in
                   3425:       brackets and separated by two periods ('<tt>..</tt>').  In the case of
                   3426:       ranges, the values of the bounds are included in the range.
                   3427:       <p>The threshold value in the comparisons can be the value of an
                   3428:       attribute attached to an ancestor element.  In this case, the attribute
                   3429:       name is given instead of a constant value.</p>
                   3430:       <p>It is also possible to write rules which apply only when a comparison
                   3431:       between two different attributes of the element's ancestors is true. In
                   3432:       this case, the first attribute name is followed by a comparison keyword
                   3433:       and the name of the second attribute.  The comparison keywords are
                   3434:       <tt>EQUAL</tt> (simple equality), <tt>LESS</tt> (non-inclusive less
                   3435:       than), and <tt>GREATER</tt> (non-inclusive greater than).</p>
                   3436:     </dd>
                   3437:   <dt>text attribute</dt>
                   3438:     <dd>If the rules are to apply for one value of the attribute, then the
                   3439:       attribute name is followed by an equals sign and this value.</dd>
                   3440:   <dt>reference attribute</dt>
                   3441:     <dd>There is never a value specification; the rules apply no matter what
                   3442:       element is designated by the attribute.</dd>
                   3443:   <dt>enumerated attribute</dt>
                   3444:     <dd>If the rules are to apply for one value of the attribute, then the
                   3445:       attribute name is followed by an equals sign and this value.</dd>
1.18      cvs      3446: </dl>
1.30      cvs      3447: 
                   3448: <p>The order in which the rules associated with a numeric attribute are
                   3449: defined is important.  When multiple sets of rules can be applied, the first
                   3450: set declared is the one used.</p>
                   3451: 
                   3452: <p>Rules for attributes have priority over both default rules and rules
1.1       cvs      3453: associated with element types.  The attribute rules apply to the element to
                   3454: which the attribute is attached.  It is the rules which apply to the
                   3455: surrounding elements (and especially to the descendants) which determine the
                   3456: effect of the attribute rules on the environment ( and especially on the
1.18      cvs      3457: terminal elements of the structure).</p>
                   3458: <pre>                    'ATTRIBUTES' PresAttrSeq
1.30      cvs      3459:      PresAttrSeq  = PresAttr &lt; PresAttr &gt; .
1.1       cvs      3460:      PresAttr     = AttrID [ '(' [ FirstSec ] ElemID ')' ]
                   3461:                     [ AttrRelation ] ':' ViewRuleSeq .
                   3462:      AttrID       = NAME .
                   3463:      AttrRelation ='=' AttrVal /
1.30      cvs      3464:                     '&gt;' [ '-' ] MinValue /
1.1       cvs      3465:                     '&lt;' [ '-' ] MaxValue /
                   3466:                     'IN' '[' [ '-' ] LowerBound '..'
                   3467:                     [ '-' ] UpperBound ']' /
                   3468:                     'GREATER' AttrID /
                   3469:                     'EQUAL' AttrID /
                   3470:                     'LESS' AttrID .
                   3471:      AttrVal      = [ '-' ] EqualNum / EqualText /
                   3472:                     AttrValue .
                   3473:      MinValue     = NUMBER .
                   3474:      MaxValue     = NUMBER .
                   3475:      LowerBound   = NUMBER .
                   3476:      UpperBound   = NUMBER.
                   3477:      EqualNum     = NUMBER .
                   3478:      EqualText    = STRING .
1.18      cvs      3479:      AttrValue    = NAME .</pre>
1.30      cvs      3480: 
                   3481: <p>In presentation rules associated with a numeric attribute (and only in such
1.1       cvs      3482: rules), the attribute name can be used in place of a numeric value.  In this
                   3483: case, the value of the attribute is used in the application of the rule. Thus,
                   3484: the attribute can represent a relation between the size of two boxes, the
                   3485: height and width of a box, the height of an area where page breaks are
                   3486: prohibited, the distance between two boxes, the position of the reference axis
                   3487: of a box, the interline spacing,  the indentation of the first line, the
1.18      cvs      3488: visibility, the depth (z-order), or the character set.</p>
1.30      cvs      3489: 
                   3490: <p>The presentation rules associated with reference attributes, it is possible
                   3491: to use the element designated by the attribute as a reference box in a
                   3492: positional or extent rule.  This element is represented in the <a
1.18      cvs      3493: href="#sectc4218">position</a> or <a href="#sectc4219">extent</a> rule by the
                   3494: keyword <tt>Referred</tt>.</p>
1.30      cvs      3495: 
1.18      cvs      3496: <blockquote class="example">
1.30      cvs      3497:   <p><strong>Example:</strong></p>
                   3498: 
                   3499:   <p>In all structure schemas, there is a global Language attribute defined as
                   3500:   follows:</p>
                   3501:   <pre>ATTR
1.18      cvs      3502:      Language = TEXT;</pre>
1.30      cvs      3503: 
                   3504:   <p>The following rules would make French text be displayed in roman
                   3505:   characters and English text be displayed in italics:</p>
                   3506:   <pre>ATTRIBUTES
1.1       cvs      3507:      Language = 'French' :
1.6       cvs      3508:                 Style : Roman;
1.1       cvs      3509:      Language = 'English' :
1.18      cvs      3510:                 Style : Italics;</pre>
1.30      cvs      3511: 
                   3512:   <p>Using these rules, when the user puts the Language attribute with the
                   3513:   value 'English' on the summary of a document, every character string
                   3514:   (terminal elements) contained in the summary are displayed in italics.  See
                   3515:   the <a href="#sectd42252"><tt>Style</tt> rule</a>.</p>
1.18      cvs      3516: </blockquote>
1.30      cvs      3517: 
1.18      cvs      3518: <blockquote class="example">
1.30      cvs      3519:   <p><strong>Example:</strong></p>
                   3520: 
                   3521:   <p>A numeric attribute representing the importance of the part of the
                   3522:   document to which it is attached can be defined:</p>
                   3523:   <pre>ATTR
1.18      cvs      3524:      Importance = INTEGER;</pre>
1.30      cvs      3525: 
                   3526:   <p>In the presentation schema, the importance of an element is reflected in
                   3527:   the choice of character size, using the following rules.</p>
                   3528:   <pre>ATTRIBUTES
1.1       cvs      3529:      Importance &lt; 2 :
                   3530:               Size : 1;
                   3531:      Importance IN [2..4] :
                   3532:               Size : Importance;
                   3533:      Importance = 10 :
                   3534:               Size : 5;
1.30      cvs      3535:      Importance &gt; 4 :
1.18      cvs      3536:               Size : 4;</pre>
1.30      cvs      3537: 
                   3538:   <p>Thus, the character size corresponds to the value of the Importance
                   3539:   attribute; its value is</p>
                   3540:   <ul>
                   3541:     <li>the value of the Importance attribute when the value is between 2 and
                   3542:       4 (inclusive),</li>
                   3543:     <li>1, when the value of the Importance attribute is less than 2,</li>
                   3544:     <li>4, when the value of the Importance attribute is greater than 4,</li>
                   3545:     <li>5, when the value of the Importance attribute is 10.</li>
                   3546:   </ul>
                   3547: 
                   3548:   <p>The last case (value 5) must be defined before the case which handles all
                   3549:   Importance values greater than 4, because the two rules are not disjoint and
                   3550:   the first one defined will have priority.  Otherwise, when the Importance
                   3551:   attribute has value 10, the font size will be 4.</p>
1.18      cvs      3552: </blockquote>
1.30      cvs      3553: 
1.18      cvs      3554: <blockquote class="example">
1.30      cvs      3555:   <p><strong>Example:</strong></p>
                   3556: 
                   3557:   <p>Suppose the structure defines a list element which can have an attribute
                   3558:   defining the type of list (numbered or not):</p>
                   3559:   <pre>STRUCT
1.1       cvs      3560:     list (ATTR list_type = enumeration, dash)
1.18      cvs      3561:          = LIST OF (list_item = TEXT);</pre>
1.30      cvs      3562: 
                   3563:   <p>Then, the presentation schema could use the attribute placed on the list
                   3564:   element to put either a dash or a number before the each element of the
                   3565:   list:</p>
                   3566:   <pre>ATTRIBUTES
1.1       cvs      3567:    list_type (list_item) = enumeration :
                   3568:         CreateBefore (NumberBox);
                   3569:    list_type (list_item) = dash :
1.18      cvs      3570:         CreateBefore (DashBox);</pre>
                   3571: </blockquote>
1.30      cvs      3572: 
1.18      cvs      3573: <blockquote class="example">
1.30      cvs      3574:   <p><strong>Example:</strong></p>
                   3575: 
                   3576:   <p>Suppose that two attributes are defined in the structure schema.  The
                   3577:   first is a numeric global attribute called ``version''.  The other is a
                   3578:   local attribute defined on the root of the document called
                   3579:   ``Document_version'':</p>
                   3580:   <pre>STRUCTURE Document
1.1       cvs      3581: ATTR
                   3582:     version = INTEGER;
                   3583: STRUCT
                   3584:     Document (ATTR Document_version = INTEGER) =
                   3585:         BEGIN
                   3586:         SomeElement ;
                   3587:         ...
                   3588:         SomeOtherElement ;
                   3589:         END ;
1.18      cvs      3590: ...</pre>
1.30      cvs      3591: 
                   3592:   <p>These attributes can be used in the presentation schema to place change
                   3593:   bars in the margin next to elements whose version attribute has a value
                   3594:   equal to the Document_version attribute of the root and to place a star in
                   3595:   margin of elements whose version attribute is less than the value of the
                   3596:   root's Document_version attribute:</p>
                   3597:   <pre>ATTRIBUTES
1.1       cvs      3598:     version EQUAL Document_version :
                   3599:         CreateBefore (ChangeBarBox) ;
                   3600:     version LESS Document_version :
1.18      cvs      3601:         CreateBefore (StarBox) ;</pre>
                   3602: </blockquote>
                   3603: </div>
1.1       cvs      3604: 
1.18      cvs      3605: <div class="subsection">
1.30      cvs      3606: <h3><a name="sectc4212">Value transmission rules</a></h3>
1.1       cvs      3607: 
1.30      cvs      3608: <p>The last section of a presentation schema, which is optional, serves to
1.1       cvs      3609: defines the way in which a document transmits certain values to its
1.18      cvs      3610: sub-documents.  A sub-document is an document <a
                   3611: href="#inclusion">included</a> without expansion or with partial expansion.
1.1       cvs      3612: The primary document can transmit to its sub-documents the values of certain
                   3613: counters or the textual content of certain of its elements, as a function of
1.18      cvs      3614: their type.</p>
1.30      cvs      3615: 
                   3616: <p>The sub-documents receive these values in attributes which must be defined
                   3617: in their structure schema as local attributes of the root element.  The types
                   3618: of these attributes must correspond to the type of the value which they
                   3619: receive: numeric attributes for receiving the value of a counter, textual
                   3620: attributes for receiving the content of an element.</p>
                   3621: 
                   3622: <p>In the structure schema of the primary document, there appears at the end,
1.18      cvs      3623: after the <tt>TRANSMIT</tt> keyword, a sequence of transmission rules.  Each
1.1       cvs      3624: rule begins with the name of the counter to transmit or of the element type
                   3625: whose textual content will be transmitted.  This name is followed by the
1.18      cvs      3626: keyword <tt>To</tt> and the name of the attribute of the sub-document to which
1.1       cvs      3627: the value is transmitted.  The sub-document class is indicated between
                   3628: parentheses after the name of the attribute.  The transmission rule ends with
1.18      cvs      3629: a semicolon.</p>
1.30      cvs      3630: <pre>     TransmitSeq   =  Transmit &lt; Transmit &gt; .
1.1       cvs      3631:      Transmit      =  TypeOrCounter 'To' ExternAttr
                   3632:                       '(' ElemID ')' ';' .
                   3633:      TypeOrCounter =  CounterID / ElemID .
1.18      cvs      3634:      ExternAttr    =  NAME .</pre>
1.30      cvs      3635: 
1.18      cvs      3636: <blockquote class="example">
1.30      cvs      3637:   <p><strong>Example:</strong></p>
                   3638: 
                   3639:   <p>Consider a Book document class which includes instances of the Chapter
                   3640:   document class.  These classes might have the following schemas:</p>
                   3641:   <pre>STRUCTURE Book
1.1       cvs      3642: STRUCT
                   3643:    Book = BEGIN
                   3644:           Title = Text;
                   3645:           Body  = LIST OF (Chapter INCLUDED);
                   3646:           END;
                   3647:    ...
                   3648: 
                   3649: STRUCTURE Chapter
                   3650: STRUCT
                   3651:    Chapter (ATTR FirstPageNum = Integer;
                   3652:                  ChapterNum = Integer;
                   3653:                  CurrentTitle   = Text) =
1.6       cvs      3654:           BEGIN
                   3655:           ChapterTitle = Text;
                   3656:           ...
                   3657:           END;
1.18      cvs      3658:    ...</pre>
1.30      cvs      3659: 
                   3660:   <p>Then the presentation schema for books could define chapter and page
                   3661:   counters. The following transmission rules in the book presentation schema
                   3662:   would transmit values for the three attributes defined at the root of each
                   3663:   chapter sub-document.</p>
                   3664:   <pre>PRESENTATION Book;
1.1       cvs      3665: VIEWS
                   3666:    Full_text;
                   3667: COUNTERS
                   3668:    ChapterCtr: Rank of Chapter;
                   3669:    PageCtr: Rank of Page(Full_text);
                   3670: ...
                   3671: TRANSMIT
                   3672:    PageCtr TO FirstPageNum(Chapter);
                   3673:    ChapterCtr TO ChapterNum(Chapter);
                   3674:    Title TO CurrentTitle(Chapter);
1.18      cvs      3675: END</pre>
1.30      cvs      3676: 
                   3677:   <p>Thus, each chapter included in a book can number its pages as a function
                   3678:   of the number of pages preceding it in the book, can make the chapter's
                   3679:   number appear before the number of each of its sections, or can place the
                   3680:   title of the book at the top of each page.</p>
1.18      cvs      3681: </blockquote>
                   3682: </div>
1.1       cvs      3683: 
1.18      cvs      3684: <div class="subsection">
1.30      cvs      3685: <h3><a name="sectc4213">Presentation rules</a></h3>
1.1       cvs      3686: 
1.30      cvs      3687: <p>Whether defining the appearance of a presentation or page layout box, an
1.1       cvs      3688: element type, or an attribute value, the set of presentation rules that apply
1.18      cvs      3689: is always defined in the same way.</p>
1.30      cvs      3690: 
                   3691: <p>Normally, a set of presentation rules is placed between the keywords
1.18      cvs      3692: <tt>BEGIN</tt> and <tt>END</tt>, the keyword <tt>END</tt> being followed by a
1.1       cvs      3693: semicolon.  The first section of this block defines the rules that apply to
1.18      cvs      3694: the primary view, if the <a href="#sectc427">default rules</a> are not
1.1       cvs      3695: completely suitable.  Next comes the rules which apply to specific other
                   3696: views, with a rule sequence for each view for which the default rules are not
                   3697: satisfactory.  If the default rules are suitable for the non-primary views,
                   3698: there will not be any specific rules for these views.  If there is only one
1.18      cvs      3699: rule which applies to all views then the keywords <tt>BEGIN</tt> and
                   3700: <tt>END</tt> need not appear.</p>
1.30      cvs      3701: 
                   3702: <p>For each view, it is only necessary to specify those rules which differ
                   3703: from the default rules for the view, so that for certain views (or even all
                   3704: views), there may be no specific rules.</p>
                   3705: 
                   3706: <p>The specific rules for a non-primary view are introduced by the <a
1.18      cvs      3707: name="inkeyword"><tt>IN</tt> keyword</a>, followed by the view name.  The
                   3708: rules for that view follow, delimited by the keywords <tt>BEGIN</tt> and
                   3709: <tt>END</tt>, or without these two keywords when there is only one rule.</p>
1.30      cvs      3710: 
                   3711: <p><strong>Note:</strong> the view name which follows the <tt>IN</tt> keyword
1.1       cvs      3712: must not be the name of the primary view, since the rules for that view are
1.18      cvs      3713: found before the rules for the other views.</p>
1.30      cvs      3714: 
                   3715: <p>Within each block concerning a view, other blocks can appear, delimited by
                   3716: the same keywords <tt>BEGIN</tt> and <tt>END</tt>.  Each of these blocks
                   3717: gathers the presentation rules that apply, for a given view, only when a given
1.1       cvs      3718: condition is satisfied.  Each block is preceded by a condition introduced by
1.18      cvs      3719: the <tt>IF</tt> keyword.  If such a conditional block contains only one rule,
                   3720: the keywords <tt>BEGIN</tt> and <tt>END</tt> can be omitted.</p>
1.30      cvs      3721: 
                   3722: <p>Although the syntax allows any presentation rule to appear in a conditional
1.18      cvs      3723: block, only <a href="#sectc4232">creation rules</a> are allowed after any
                   3724: condition; other rules are allowed only after conditions <tt>Within</tt> and
1.1       cvs      3725: ElemID.  In addition, the following rules cannot be conditional:
1.18      cvs      3726: <tt>PageBreak, LineBreak, Inline, Gather</tt>.</p>
1.30      cvs      3727: 
                   3728: <p>For a given view, the rules that apply without any condition must appear
1.1       cvs      3729: before the first conditional block.  If some rules apply only when none of the
                   3730: specified condition holds, they are grouped in a block preceded by the keyword
1.18      cvs      3731: <tt>Otherwise</tt>, and that block must appear after the last conditionnal
                   3732: block concerning the same view.</p>
1.30      cvs      3733: <pre>     ViewRuleSeq  = 'BEGIN' &lt; RulesAndCond &gt; &lt; ViewRules &gt;
1.1       cvs      3734:                     'END' ';' /
                   3735:                     ViewRules / CondRules / Rule .
                   3736:      RulesAndCond = CondRules / Rule .
                   3737:      ViewRules    = 'IN' ViewID CondRuleSeq .
1.30      cvs      3738:      CondRuleSeq  = 'BEGIN' &lt; RulesAndCond &gt; 'END' ';' /
1.1       cvs      3739:                     CondRules / Rule .
1.30      cvs      3740:      CondRules    = CondRule &lt; CondRule &gt;
1.1       cvs      3741:                     [ 'Otherwise' RuleSeq ] .
                   3742:      CondRule     = 'IF' ConditionSeq RuleSeq .
1.30      cvs      3743:      RulesSeq     = 'BEGIN' Rule &lt; Rule &gt; 'END' ';' /
1.18      cvs      3744:                     Rule .</pre>
1.30      cvs      3745: 
1.18      cvs      3746: <blockquote class="example">
1.30      cvs      3747:   <p><strong>Example:</strong></p>
                   3748: 
                   3749:   <p>The following rules for a report's title make the title visible in the
                   3750:   primary view and invisible in the table of contents and in the formula views
                   3751:   (see the <a href="#sectc4224"><tt>Visibility</tt> rule</a>).</p>
                   3752:   <pre>Title : BEGIN
1.1       cvs      3753:         Visibility : 1;
                   3754:         ...    {Other rules for the primary view}
                   3755:         IN Table_of_contents
                   3756:            Visibility : 0;
                   3757:         IN Formulas
                   3758:            Visibility : 0;
1.18      cvs      3759:         END;</pre>
                   3760: </blockquote>
                   3761: </div>
1.1       cvs      3762: 
1.18      cvs      3763: <div class="subsection">
1.30      cvs      3764: <h3><a name="sectc4214">Conditions applying to presentation rules</a></h3>
1.1       cvs      3765: 
1.30      cvs      3766: <p>Many conditions can be applied to presentation rules.  Conditions allow
1.1       cvs      3767: certain presentation rules to apply only in certain cases.  These conditions
                   3768: can be based on the structural position of the element.  They can be based on
                   3769: whether the element has references, and what type of references, whether the
1.33      cvs      3770: element has attributes, whether the element is empty or not, whether the
                   3771: element is the root of its document or not. They can also be based on the
                   3772: value of a counter.</p>
1.30      cvs      3773: 
                   3774: <p>It is possible to specify several conditions which must all be true for the
1.18      cvs      3775: rules to apply.</p>
1.30      cvs      3776: 
                   3777: <p>A set of conditions is specified by the <tt>IF</tt> keyword.  This keyword
                   3778: is followed by the sequence of conditions, separated by the <tt>AND</tt>
                   3779: keyword. Each condition is specified by a keyword which defines the condition
                   3780: type. In some cases, the keyword is followed by other data, which specify the
                   3781: condition more precisely.</p>
                   3782: 
                   3783: <p>An elementary condition can be negative; it is then preceded by the
1.18      cvs      3784: <tt>NOT</tt> keyword.</p>
1.30      cvs      3785: 
                   3786: <p>When the presentation rule(s) controlled by the condition apply to a
                   3787: reference element or a reference attribute, an elementary condition can also
                   3788: apply to element referred by this reference.  The <tt>Target</tt> keyword is
                   3789: used for that purpose.  It must appear before the keyword defining the
                   3790: condition type.</p>
1.18      cvs      3791: <pre>     CondRule      ='IF' ConditionSeq RuleSeq .
1.30      cvs      3792:      ConditionSeq  = Condition &lt; 'AND' Condition &gt; .
1.1       cvs      3793:      Condition     = [ 'NOT' ] [ 'Target' ] ConditionElem .
                   3794:      ConditionElem ='First' / 'Last' /
                   3795:                      [ 'Immediately' ] 'Within' [ NumParent ]
                   3796:                                        ElemID [ ExtStruct ] /
                   3797:                      ElemID /
                   3798:                     'Referred' / 'FirstRef' / 'LastRef' /
                   3799:                     'ExternalRef' / 'InternalRef' / 'CopyRef' /
                   3800:                     'AnyAttributes' / 'FirstAttr' / 'LastAttr' /
                   3801:                     'UserPage' / 'StartPage' / 'ComputedPage' /
1.33      cvs      3802:                     'Empty' / 'Root' /
1.1       cvs      3803:                     '(' [ MinMax ] CounterName CounterCond ')' /
                   3804:                      CondPage '(' CounterID ')' .
                   3805:      NumParent     = [ GreaterLess ] NParent .
1.30      cvs      3806:      GreaterLess   ='&gt;' / '&lt;' .
1.1       cvs      3807:      NParent       = NUMBER.
1.6       cvs      3808:      ExtStruct     ='(' ElemID ')' .
1.30      cvs      3809:      CounterCond   ='&lt;' MaxCtrVal / '&gt;' MinCtrVal /
1.1       cvs      3810:                     '=' EqCtrVal / 
                   3811:                     'IN' '[' ['-'] MinCtrBound '.' '.'
                   3812:                      ['-'] MaxCtrBound ']' .
                   3813:      PageCond      ='Even' / 'Odd' / 'One' .
                   3814:      MaxCtrVal     = NUMBER .
                   3815:      MinCtrVal     = NUMBER .
                   3816:      EqCtrVal      = NUMBER .
                   3817:      MaxCtrBound   = NUMBER .
1.18      cvs      3818:      MinCtrBound   = NUMBER .</pre>
1.1       cvs      3819: 
1.18      cvs      3820: <div class="subsubsection">
                   3821: <h4><a name="sectd42141">Conditions based on the logical position of the
                   3822: element</a></h4>
1.30      cvs      3823: 
                   3824: <p>The condition can be on the position of the element in the document's
                   3825: logical structure tree.  It is possible to test whether the element is the
                   3826: first (<tt>First</tt>) or last (<tt>Last</tt>) among its siblings or if it is
                   3827: not the first (<tt>NOT First</tt>) or not the last (<tt>NOT Last</tt>). These
1.18      cvs      3828: conditions can be associated only with <a href="#sectc4232">creation
                   3829: rules</a>.</p>
1.30      cvs      3830: 
1.33      cvs      3831: <p>It is possible to test if the element is the root of its document (keyword
                   3832: <code>Root</code>).</p>
                   3833: 
1.30      cvs      3834: <p>It is also possible to test if the element is contained in an element of a
1.18      cvs      3835: given type (<tt>Within</tt>) or if it is not (<tt>NOT Within</tt>). The type
                   3836: is indicated after the keyword <tt>Within</tt>. If that element type is
1.1       cvs      3837: defined in a structure schema which is not the one which corresponds to the
                   3838: presentation schema, the type name of this element must be followed, between
1.18      cvs      3839: parentheses, by the name of the structure schema which defines it.</p>
1.30      cvs      3840: 
                   3841: <p>If the keyword <tt>Within</tt> is preceded by <tt>Immediately</tt>, the
1.18      cvs      3842: condition is satisfied only if the <em>parent</em> element has the type
                   3843: indicated. If the word <tt>Immediately</tt> is missing, the condition is
                   3844: satisfied if any <em>ancestor</em> has the type indicated.</p>
1.30      cvs      3845: 
                   3846: <p>An integer <i>n</i> can appear between the keyword <tt>Within</tt> and the
1.1       cvs      3847: type.  It specifies the number of ancestors of the indicated type that must be
                   3848: present for the condition to be satisfied.  If the keyword
1.18      cvs      3849: <tt>Immediately</tt> is also present, the <i>n</i> immediate ancestors of the
                   3850: element must have the indicated type.  The integer <i>n</i> must be positive
1.30      cvs      3851: or zero.  It can be preceded by <tt>&lt;</tt> or <tt>&gt;</tt> to indicate a
1.1       cvs      3852: maximum or minimum number of ancestors.  If these symbols are missing, the
1.18      cvs      3853: condition is satisfied only if it exists exactly <i>n</i> ancestors.  When
1.30      cvs      3854: this number is missing, it is equivalent to &gt; 0.</p>
                   3855: 
                   3856: <p>If the condition applies to presentation rules associated with an
                   3857: attribute, in the <tt>ATTRIBUTES</tt> section of the presentation schema, the
                   3858: condition can be simply an element name. Presentation rules are then executed
                   3859: only if the attribute is attached to an element of that type. The keyword
                   3860: <tt>NOT</tt> before the element name indicates that the presentation rules
                   3861: must be executed only if the element is not of the type indicated.</p>
1.18      cvs      3862: </div>
1.1       cvs      3863: 
1.18      cvs      3864: <div class="subsubsection">
1.30      cvs      3865: <h4><a name="sectd42142">Conditions on references</a></h4>
                   3866: 
                   3867: <p>References may be taken into account in conditions, which can be based on
                   3868: the fact that the element, or one of its ancestors, is designated by a at
                   3869: least one reference (<tt>Referred</tt>) or by none (<tt>NOT
                   3870: Referred</tt>).</p>
                   3871: 
                   3872: <p>If the element or attribute to which the condition is attached is a
                   3873: reference, the condition can be based on the fact that it acts as the first
                   3874: reference to the designated element (<tt>FirstRef</tt>), or as the last
                   3875: (<tt>LastRef</tt>), or as a reference to an element located in another
                   3876: document (<tt>ExternalRef</tt>) or in the same document
                   3877: (<tt>InternalRef</tt>).</p>
1.1       cvs      3878: 
1.30      cvs      3879: <p>The condition can also be based on the fact that the element is an <a
1.18      cvs      3880: href="#inclusion">inclusion</a>.  This is noted (<tt>CopyRef</tt>).</p>
1.30      cvs      3881: 
                   3882: <p>Like all conditions, conditions on references can be inverted by the
1.18      cvs      3883: <tt>NOT</tt> keyword. These conditions can be associated only with <a
                   3884: href="#sectc4232">creation rules</a>.</p>
                   3885: </div>
1.1       cvs      3886: 
1.18      cvs      3887: <div class="subsubsection">
1.30      cvs      3888: <h4><a name="sectd42143">Conditions on logical attributes</a></h4>
                   3889: 
                   3890: <p>The condition can be based on the presence or absence of attributes
                   3891: associated with the element, no matter what the attributes or their values.
                   3892: The <tt>AnyAttributes</tt> keyword expresses this condition.</p>
1.1       cvs      3893: 
1.30      cvs      3894: <p>If the condition appears in the presentation rules of an attribute, the
1.18      cvs      3895: <tt>FirstAttr</tt> and <tt>LastAttr</tt> keywords can be used to indicate that
1.1       cvs      3896: the rules must only be applied if this attribute is the first attribute for
                   3897: the element or if it is the last (respectively).  These conditions can also be
1.18      cvs      3898: inverted by the <tt>NOT</tt> keyword. These conditions can be associated only
                   3899: with <a href="#sectc4232">creation rules</a>.</p>
1.30      cvs      3900: 
                   3901: <p>It is also possible to apply certain presentation rules only when the
                   3902: element being processed or one of its ancestors has a certain attribute,
                   3903: perhaps with a certain value.  This can be done in the <a
1.18      cvs      3904: href="#sectc4210"><tt>ATTRIBUTES</tt> section</a>.</p>
                   3905: </div>
1.1       cvs      3906: 
1.18      cvs      3907: <div class="subsubsection">
1.30      cvs      3908: <h4><a name="sectd42144">Conditions on page breaks</a></h4>
1.1       cvs      3909: 
1.30      cvs      3910: <p>The page break base type (and only this type) can use the following
1.18      cvs      3911: conditions: <tt>ComputedPage</tt>, <tt>StartPage</tt>, and <tt>UserPage</tt>.
                   3912: The <tt>ComputedPage</tt> condition indicates that the presentation rule(s)
1.1       cvs      3913: should apply if the page break was created automatically by Thot;  the
1.18      cvs      3914: <tt>StartPage</tt> condition is true if the page break is generated before the
                   3915: element by the <tt>Page</tt> rule; and the <tt>UserPage</tt> condition applies
                   3916: if the page break was inserted by the user.</p>
1.30      cvs      3917: 
                   3918: <p>These conditions can be associated only with <a href="#sectc4232">creation
1.18      cvs      3919: rules</a>.</p>
                   3920: </div>
1.1       cvs      3921: 
1.18      cvs      3922: <div class="subsubsection">
1.30      cvs      3923: <h4><a name="sectd42145">Conditions on the element's content</a></h4>
1.1       cvs      3924: 
1.30      cvs      3925: <p>The condition can be based on whether or not the element is empty.  An
                   3926: element which has no children or whose leaves are all empty is considered to
                   3927: be empty itself.  This condition is expressed by the <tt>Empty</tt> keyword,
                   3928: optionally preceded by the <tt>NOT</tt> keyword. This condition can be
                   3929: associated only with <a href="#sectc4232">creation rules</a>.</p>
1.18      cvs      3930: </div>
1.1       cvs      3931: 
1.18      cvs      3932: <div class="subsubsection">
1.30      cvs      3933: <h4><a name="sectd42146">Conditions on counters</a></h4>
1.1       cvs      3934: 
1.30      cvs      3935: <p>Presentation rules can apply when the counter's value is one, is even or
                   3936: odd, is equal, greater than or less than a given value or falls in a range of
1.1       cvs      3937: values.  This is particularly useful for creating header and footer boxes.
1.18      cvs      3938: These conditions can be associated only with <a href="#sectc4232">creation
                   3939: rules</a>.</p>
1.30      cvs      3940: 
                   3941: <p>To compare the value of a counter to a given value, a comparison is given
1.1       cvs      3942: between parentheses. The comparison is composed of the counter name followed
                   3943: by an equals, greater than, or less than sign and the value to which the
                   3944: counter will be compared.  A test for whether or not a counter's value falls
                   3945: in a range also appears within parentheses.  In this case, the counter name is
1.18      cvs      3946: followed by the <tt>IN</tt> keyword and the range definition within brackets.
                   3947: The <tt>Even</tt>, <tt>Odd</tt> and <tt>One</tt> are used to test a counter's
                   3948: value and are followed by the counter name between parentheses.</p>
1.30      cvs      3949: 
                   3950: <p>The list of possible conditions on counters is:</p>
1.18      cvs      3951: <dl>
1.30      cvs      3952:   <dt><tt>Even (Counter)</tt></dt>
                   3953:     <dd>the box is created only if the counter has an even value.</dd>
                   3954:   <dt><tt>Odd (Counter)</tt></dt>
                   3955:     <dd>the box is created only if the counter has an odd value.</dd>
                   3956:   <dt><tt>One (Counter)</tt></dt>
                   3957:     <dd>the box is created only the counter's value is 1.</dd>
                   3958:   <dt><tt>NOT One (Counter)</tt></dt>
                   3959:     <dd>the box is created, unless the counter's value is 1.</dd>
                   3960:   <dt><tt>(Counter &lt; Value)</tt></dt>
                   3961:     <dd>the box is created only if the counter's value is less than
                   3962:     Value.</dd>
                   3963:   <dt><tt>(Counter &gt; Value)</tt></dt>
                   3964:     <dd>the box is created only if the counter's value is greater than
                   3965:     Value.</dd>
                   3966:   <dt><tt>(Counter = Value)</tt></dt>
                   3967:     <dd>the box is created only if the counter's value is equal to Value.</dd>
                   3968:   <dt><tt>NOT (Counter = Value)</tt></dt>
                   3969:     <dd>the is created only if the counter's value is different than
                   3970:     Value.</dd>
                   3971:   <dt><tt>(Counter IN [MinValue..MaxValue])</tt></dt>
                   3972:     <dd>the box is created only if the counter's value falls in the range
                   3973:       bounded by MinValue and MaxValue (inclusive).</dd>
                   3974:   <dt><tt>NOT (Counter IN [MinValue..MaxValue])</tt></dt>
                   3975:     <dd>the box is created only if the value of the counter does not fall in
                   3976:       the range bounded by MinValue and MaxValue (inclusive).</dd>
1.18      cvs      3977: </dl>
1.30      cvs      3978: 
                   3979: <p><strong>Note:</strong> the <tt>NOT Even</tt> and <tt>NOT Odd</tt>
                   3980: conditions are syntactically correct but can be expressed more simply by
                   3981: <tt>Odd</tt> and <tt>Even</tt>, respectively.</p>
1.18      cvs      3982: </div>
                   3983: </div>
1.1       cvs      3984: 
1.18      cvs      3985: <div class="subsection">
1.30      cvs      3986: <h3><a name="sectc4215">A presentation rule</a></h3>
1.1       cvs      3987: 
1.34    ! cvs      3988: <p>A presentation rule defines either a presentation property or presentation
        !          3989: function.  The properties are:</p>
1.18      cvs      3990: <ul>
1.30      cvs      3991:   <li>the position of the vertical and horizontal reference axes of the
                   3992:   box,</li>
                   3993:   <li>the position of the box in relation to other boxes,</li>
                   3994:   <li>the height or width of the box, with overflow exceptions,</li>
                   3995:   <li>the margins, padding and borders of the box,</li>
                   3996:   <li>the characteristics of the lines contained in the box: linespacing,
                   3997:     indentation of the first line, justification, hyphenation,</li>
                   3998:   <li>the conditions for breaking the box across pages,</li>
                   3999:   <li>the characteristics of the characters contained in the box: size, font,
                   4000:     style, underlining,</li>
                   4001:   <li>the depth of the box among overlapping boxes (often called stacking
                   4002:     order),</li>
                   4003:   <li>the characteristics of graphic elements contained in the box: style and
                   4004:     thickness of lines, fill pattern for closed objects,</li>
                   4005:   <li>the colors in text, graphics, pictures, and symbols contained in the box
                   4006:     are displayed or printed,</li>
                   4007:   <li>for presentation boxes only, the contents of the box.</li>
                   4008: </ul>
                   4009: 
                   4010: <p>The <a name="presfunct">presentation functions</a> are:</p>
                   4011: <ul>
                   4012:   <li>the creation of a presentation box</li>
                   4013:   <li>the line-breaking or page-breaking style,</li>
                   4014:   <li>the copying of another box,</li>
                   4015:   <li>the display of the box background and border,</li>
                   4016:   <li>the display of a background picture and its aspect.</li>
                   4017: </ul>
                   4018: 
1.34    ! cvs      4019: <p>For each box and each view, every presentation property is defined once and
        !          4020: only once, either explicitly or by the <a href="#sectc427">default rules</a>.
        !          4021: In contrast, presentation functions are not obligatory and can appear many
        !          4022: times for the same element.  for example an element can create many
        !          4023: presentation boxes.  Another element may not use any presentation
1.18      cvs      4024: functions.</p>
1.30      cvs      4025: 
1.34    ! cvs      4026: <p>Each rule defining a presentation property begins with a keyword followed
        !          4027: by a colon.  The keyword indicates the property which is the subject of the
1.18      cvs      4028: rule. After the keyword and the colon, the remainder of the rule varies.  All
                   4029: rules are terminated by a semicolon.</p>
1.34    ! cvs      4030: <pre>     Rule      = Property ';' / PresFunc ';' .
        !          4031:      Property  ='VertRef' ':'       PositionHoriz /
1.6       cvs      4032:                 'HorizRef' ':'      PositionVert /
                   4033:                 'VertPos' ':'       VPos /
                   4034:                 'HorizPos' ':'      HPos /
                   4035:                 'Height' ':'        Dimension /
                   4036:                 'Width' ':'         Dimension /
                   4037:                 'VertOverflow' ':'  Boolean /
1.1       cvs      4038:                 'HorizOverflow' ':' Boolean /
1.26      cvs      4039:                 'MarginTop' ':'     MarginWidth /
                   4040:                 'MarginRight' ':'   MarginWidth /
                   4041:                 'MarginBottom' ':'  MarginWidth /
                   4042:                 'MarginLeft' ':'    MarginWidth /
                   4043:                 'PaddingTop' ':'    PaddingWidth /
                   4044:                 'PaddingRight' ':'  PaddingWidth /
                   4045:                 'PaddingBottom' ':' PaddingWidth /
                   4046:                 'PaddingLeft' ':'   PaddingWidth /
                   4047:                 'BorderTopWidth' ':' BorderWidth /
                   4048:                 'BorderRightWidth' ':' BorderWidth /
                   4049:                 'BorderBottomWidth' ':' BorderWidth /
                   4050:                 'BorderLeftWidth' ':' BorderWidth /
                   4051:                 'BorderTopColor' ':' BorderColor /
                   4052:                 'BorderRightColor' ':' BorderColor /
                   4053:                 'BorderBottomColor' ':' BorderColor /
                   4054:                 'BorderLeftColor' ':' BorderColor /
                   4055:                 'BorderTopStyle' ':' BorderStyle /
                   4056:                 'BorderRightStyle' ':' BorderStyle /
                   4057:                 'BorderBottomStyle' ':' BorderStyle /
                   4058:                 'BorderLeftStyle' ':' BorderStyle .
1.6       cvs      4059:                 'LineSpacing' ':'   DistanceInherit /
                   4060:                 'Indent' ':'        DistanceInherit /
                   4061:                 'Adjust' ':'        AdjustInherit /
                   4062:                 'Justify' ':'       BoolInherit /
                   4063:                 'Hyphenate' ':'     BoolInherit /
                   4064:                 'PageBreak' ':'     Boolean /
                   4065:                 'LineBreak' ':'     Boolean /
                   4066:                 'InLine' ':'        Boolean /
                   4067:                 'NoBreak1' ':'      AbsDist /
                   4068:                 'NoBreak2' ':'      AbsDist /
                   4069:                 'Gather' ':'        Boolean /
                   4070:                 'Visibility' ':'    NumberInherit /
                   4071:                 'Size'  ':'         SizeInherit /
                   4072:                 'Font' ':'          NameInherit /
                   4073:                 'Style' ':'         StyleInherit /
1.23      cvs      4074:                 'Weight' ':'        WeightInherit /
1.6       cvs      4075:                 'Underline' ':'     UnderLineInherit /
                   4076:                 'Thickness' ':'     ThicknessInherit /
                   4077:                 'Depth' ':'         NumberInherit /
                   4078:                 'LineStyle' ':'     LineStyleInherit /
                   4079:                 'LineWeight' ':'    DistanceInherit /
                   4080:                 'FillPattern' ':'   NameInherit /
                   4081:                 'Background' ':'    NameInherit /
1.13      cvs      4082:                 'Foreground' ':'    NameInherit /
1.6       cvs      4083:                 'Content' ':'       VarConst .
1.1       cvs      4084:      PresFunc = Creation '(' BoxID ')' /
                   4085:                 'Line' /
                   4086:                 'NoLine' /
                   4087:                 'Page' '(' BoxID ')' /
1.13      cvs      4088:                 'Copy' '(' BoxTypeToCopy ')' /
                   4089:                 'ShowBox' /
1.18      cvs      4090:                 'BackgroundPicture' ':' FileName /
                   4091:                 'PictureMode' ':'   PictMode /</pre>
                   4092: </div>
                   4093: 
                   4094: <div class="subsection">
1.30      cvs      4095: <h3><a name="sectc4216">Box axes</a></h3>
1.18      cvs      4096: 
1.30      cvs      4097: <p>The position of the middle axes <tt>VMiddle</tt> and <tt>HMiddle</tt> in
1.1       cvs      4098: relation to their box is always calculated automatically as a function of the
                   4099: height and width of the box and is not specified by the presentation rules. In
                   4100: the presentation schema, these middle axes are used only to position their box
                   4101: with respect to another by specifying the distance between the middle axis and
1.18      cvs      4102: an axis or a side of another box (see the <a href="#sectc4218">relative
                   4103: position</a>).</p>
1.30      cvs      4104: 
                   4105: <p>The reference axes of a box are also used to position their box in relation
                   4106: to another, but in contrast to the middle axes, the presentation schema must
                   4107: make their position explicit, either in relation to a side or the middle axis
                   4108: of the box itself, or in relation to an axis of an enclosed box.</p>
                   4109: 
                   4110: <p>Only boxes of base elements have predefined reference axes.  For character
1.1       cvs      4111: string boxes, the horizontal reference axis is the baseline of the characters
                   4112: (the line which passes immediately under the upper-case letters, ignoring the
                   4113: letter Q) and the vertical reference axis is at the left edge of the first
1.18      cvs      4114: character of the string.</p>
1.30      cvs      4115: 
                   4116: <p>The positions of a box's reference axes are defined by the <tt>VertRef</tt>
1.18      cvs      4117: and <tt>HorizRef</tt> rules which specify the <a href="#distance">distance</a>
1.1       cvs      4118: between the reference axis and an axis or parallel side of the same box or of
1.18      cvs      4119: an enclosed box.</p>
                   4120: <pre>               'VertRef'  ':' PositionHoriz
                   4121:                'HorizRef' ':' PositionVert</pre>
1.30      cvs      4122: 
1.18      cvs      4123: <blockquote class="example">
1.30      cvs      4124:   <p><strong>Example:</strong></p>
                   4125: 
                   4126:   <p>If, in the structure schema for mathematical formulas, the fraction
                   4127:   element is defined by</p>
                   4128:   <pre>Fraction = BEGIN
1.1       cvs      4129:            Numerator   = Expression;
                   4130:            Denominator = Expression;
1.18      cvs      4131:            END;</pre>
1.30      cvs      4132: 
                   4133:   <p>then the horizontal reference axis of the fraction can be positioned on
                   4134:   top of the denominator by the rule:</p>
                   4135:   <pre>Fraction :
1.1       cvs      4136:      BEGIN
                   4137:      HorizRef : Enclosed Denominator . Top;
                   4138:      ...
1.18      cvs      4139:      END;</pre>
1.30      cvs      4140: 
                   4141:   <p>To put the horizontal reference axis of a column at its middle:</p>
                   4142:   <pre>Column :
1.1       cvs      4143:      BEGIN
                   4144:      HorizRef : * . HMiddle;
                   4145:      ...
1.18      cvs      4146:      END;</pre>
                   4147: </blockquote>
                   4148: </div>
1.1       cvs      4149: 
1.18      cvs      4150: <div class="subsection">
1.30      cvs      4151: <h3><a name="sectc4217">Distance units</a></h3>
1.1       cvs      4152: 
1.30      cvs      4153: <p>Some distances and dimensions appear in many rules of a presentation
                   4154: schema, especially in position rules (<tt>VertPos, HorizPos</tt>), in extent
                   4155: rules for boxes (<tt>Height, Width</tt>), in rules defining lines
                   4156: (<tt>LineSpacing, Indent</tt>), in rules controlling pagination (<tt>NoBreak1,
                   4157: NoBreak2</tt>) and in rules specifying the thickness of strokes
                   4158: (<tt>LineWeight</tt>).</p>
                   4159: 
                   4160: <p>In all these rules, the distance or extent can be expressed</p>
                   4161: <ul>
                   4162:   <li>either in relative units, which depend on the size of the characters in
                   4163:     the current font: height of the element's font or height of the letter
                   4164:     'x',</li>
                   4165:   <li>or in absolute units: centimeter, millimeter, inch, typographer's point,
                   4166:     pica or pixel.</li>
                   4167: </ul>
                   4168: 
                   4169: <p>Units can be chosen freely.  Thus, it is possible to use relative units in
                   4170: one rule, centimeters in the next rule, and typographer's points in
                   4171: another.</p>
                   4172: 
                   4173: <p>Absolute units are used to set rigid rules for the appearance of documents.
                   4174: In contrast, relative units allow changes of scale.  The editor lets the value
                   4175: of relative units be changed dynamically.  Such changes affect every box using
1.1       cvs      4176: relative units simultaneously and in the same proportion. Changing the value
                   4177: of the relative units affects the size of the characters and graphical
1.18      cvs      4178: elements, and the size of the boxes and the distances between them.</p>
1.30      cvs      4179: 
                   4180: <p>A <a name="distance">distance</a> or extent is specified by a number, which
1.1       cvs      4181: may be followed by one or more spaces and a units keyword.  When there is no
                   4182: units keyword, the number specifies the number of relative units, where a
                   4183: relative unit is the height of a character in the current font (an em).  When
                   4184: the number is followed by a units keyword, the keyword indicates the type of
1.18      cvs      4185: absolute units:</p>
                   4186: <ul>
1.30      cvs      4187:   <li><tt>em</tt>: height of the element's font,</li>
                   4188:   <li><tt>ex</tt>: height of the letter 'x',</li>
                   4189:   <li><tt>cm</tt>: centimeter,</li>
                   4190:   <li><tt>mm</tt>: millimeter,</li>
                   4191:   <li><tt>in</tt>: inch (1 in = 2.54 cm),</li>
                   4192:   <li><tt>pt</tt>: point (1 pt = 1/72 in),</li>
                   4193:   <li><tt>pc</tt>: pica (1 pc = 12 pt),</li>
                   4194:   <li><tt>px</tt>: pixel.</li>
1.18      cvs      4195: </ul>
1.30      cvs      4196: 
                   4197: <p>Whatever the chosen unit, relative or absolute, the number is not
                   4198: necessarily an integer and may be expressed in fixed point notation (using the
                   4199: American convention of a period to express the decimal point).</p>
                   4200: 
                   4201: <p>If the distance appears in a presentation rule for a numeric attribute, the
1.1       cvs      4202: number can be replaced by the name of an attribute.  In this case, the value
                   4203: of the attribute is used.  Obviously, the attribute name cannot be followed by
                   4204: a decimal point and a fractional part, but it can be followed a units keyword.
1.18      cvs      4205: However, the choice of units is limited to em, ex, pt and px.</p>
                   4206: <pre>     Distance      = [ Sign ] AbsDist .
1.1       cvs      4207:      Sign          ='+' / '-' .
                   4208:      AbsDist       = IntegerOrAttr [ '.' DecimalPart ]
                   4209:                      [ Unit ].
                   4210:      IntegerOrAttr = IntegerPart / AttrID .
                   4211:      IntegerPart   = NUMBER .
                   4212:      DecimalPart   = NUMBER .
                   4213:      Unit          ='em' / 'ex' / 'cm' / 'mm' / 'in' / 'pt' /
1.18      cvs      4214:                     'pc' / 'px' / '%' .</pre>
1.30      cvs      4215: 
1.18      cvs      4216: <blockquote class="example">
1.30      cvs      4217:   <p><strong>Example:</strong></p>
                   4218: 
                   4219:   <p>The following rules specify that a box has a height of 10.5 centimeters
                   4220:   and a width of 5.3 ems:</p>
                   4221:   <pre>Height : 10.5 cm;
1.18      cvs      4222: Width  : 5.3;</pre>
                   4223: </blockquote>
                   4224: </div>
1.1       cvs      4225: 
1.18      cvs      4226: <div class="subsection">
1.30      cvs      4227: <h3><a name="sectc4218">Relative positions</a></h3>
1.1       cvs      4228: 
1.30      cvs      4229: <p>The positioning of boxes uses the eight axes and sides, the sides generally
1.1       cvs      4230: being used to define the juxtapositioning (vertical or horizontal) of boxes,
                   4231: the middle axes being used to define centering, and the reference axes being
1.18      cvs      4232: used for alignment.</p>
1.30      cvs      4233: 
                   4234: <p>Two rules allow a box to be placed relative to other boxes.  The
1.18      cvs      4235: <tt>VertPos</tt> rule positions the box vertically.  The <tt>HorizPos</tt>
                   4236: rule positions the box horizontally.  It is possible that a box's position
                   4237: could be entirely determined by other boxes positioned relative to it. In this
                   4238: case, the position is implicit and the word <tt>nil</tt> can be used to
                   4239: specify that no position rule is needed.  Otherwise, an explicit rule must be
                   4240: given by indicating the axis or side which defines the position of the box,
                   4241: followed by an equals sign and the distance between between this axis or side
                   4242: and a parallel axis or side of another box, called the reference box.  The box
                   4243: for which the rule is written will be positioned relative to the reference
                   4244: box.</p>
                   4245: <pre>                 'VertPos' ':' VPos
1.6       cvs      4246:                  'HorizPos' ':' HPos
                   4247:      HPos      = 'nil' / VertAxis '=' HorizPosition
                   4248:                  [ 'UserSpecified' ].
                   4249:      VPos      = 'nil' / HorizAxis '=' VertPosition
                   4250:                  [ 'UserSpecified' ].
1.1       cvs      4251:      VertAxis  = 'Left' / 'VMiddle' / 'VRef' / 'Right' .
1.18      cvs      4252:      HorizAxis = 'Top' / 'HMiddle' / 'HRef' / 'Bottom' .</pre>
1.30      cvs      4253: 
                   4254: <p>The reference box is an adjacent box: enclosing, enclosed or adjacent. When
                   4255: a rule is associated with a reference type attribute (and only in this case),
                   4256: it can be a box of the element designated by the attribute.  The reference box
1.18      cvs      4257: can be either a presentation box previously defined in the <tt>BOXES</tt>
1.1       cvs      4258: section of the schema and created by a creation function, or the box
1.18      cvs      4259: associated with a structured element.</p>
1.30      cvs      4260: 
                   4261: <p>The structural position of the reference box (relative to the box for which
1.18      cvs      4262: the rule is being written) is indicated by a keyword: <tt>Enclosing</tt>,
                   4263: <tt>Enclosed</tt>, or, for sibling boxes, <tt>Previous</tt> or <tt>Next</tt>.
1.1       cvs      4264: The reference attributes, or presentation boxes created by a reference
1.18      cvs      4265: attribute, the <tt>Referred</tt> keyword may be used to designate the element
                   4266: which the reference points to.  The keyword <tt>Creator</tt> can be used in
1.1       cvs      4267: rules for presentation boxes to designate the box of the element which created
1.18      cvs      4268: the presentation box.  Finally, the <tt>Root</tt> keyword can be used to
                   4269: designate the root of the document.</p>
1.30      cvs      4270: 
                   4271: <p>When the keyword is ambiguous, it is followed by the name of an element
                   4272: type or presentation box which resolves the ambiguity (the <tt>Creator</tt>
                   4273: and <tt>Root</tt> keywords are never ambiguous).  If this name is not given,
                   4274: then the first box encountered is used as the reference box. It is also
                   4275: possible to use just the name of an element type or presentation box without
                   4276: an initial keyword. In this case, a sibling having that name will be used.  If
                   4277: the name is preceded by the keyword <tt>NOT</tt>, then the reference box will
                   4278: be the first box whose type is not the named one.</p>
                   4279: 
                   4280: <p>In place of the box or type name, the keywords <tt>AnyElem</tt>,
1.18      cvs      4281: <tt>AnyBox</tt> and <tt>ElemWithAttr</tt> can be used, representing
1.17      cvs      4282: respectively, any structured element box, any presentation box, and the box
                   4283: corresponding to any structured element having a particular attribute,
                   4284: whatever its value; the name of this attribute must follow the keyword
1.18      cvs      4285: <tt>ElemWithAttr</tt>.</p>
1.30      cvs      4286: 
                   4287: <p>A type name may be preceded by a star in order to resolve the ambiguity in
                   4288: the special case where the structure schema defines an <a
1.18      cvs      4289: href="#sectd3284">inclusion</a> without expansion (or with partial expansion)
                   4290: of the same type as an element of the scheme.  For mark pairs (and only for <a
                   4291: href="#sectd3285">mark pairs</a>) the type name <em>must</em> be preceded by
                   4292: the <tt>First</tt> or <tt>Second</tt> keyword, which indicates which of the
                   4293: two marks of the pair  should be used as the reference box.</p>
1.30      cvs      4294: 
                   4295: <p>The star character ('<tt>*</tt>') used alone designates the box to which
                   4296: the rule applies (in this case, it is obviously useless to specify the type of
                   4297: the reference box).</p>
                   4298: 
                   4299: <p>The keywords <tt>Enclosing</tt> and <tt>Enclosed</tt> can be used no matter
1.1       cvs      4300: what constructor defines the type to which the rule applies.  When applied to
1.18      cvs      4301: the element which represents the entire document, <tt>Enclosing</tt>
1.1       cvs      4302: designates the window or page in which the document's image is displayed for
                   4303: the view to which the rule applies.  A box or type name without a keyword is
                   4304: used for aggregate elements and designates another element of the same
                   4305: aggregate.  It can also be used to designate a presentation or page layout
1.18      cvs      4306: box.  The keywords <tt>Previous</tt> and <tt>Next</tt> are primarily used to
1.1       cvs      4307: denote list elements, but can also be used to denote elements of an
1.18      cvs      4308: aggregate.</p>
1.30      cvs      4309: 
                   4310: <p>In the position rule, the structural position relative to the reference box
                   4311: is followed, after a period, by the name of an axis or side.  The rule
                   4312: specifies its node's position as being some distance from this axis or side of
                   4313: the reference box.  If this distance is zero, then the distance does not
                   4314: appear in the rule.  Otherwise, it does appear as a positive or negative
                   4315: number (the sign is required for negative numbers). The sign takes into
                   4316: account the orientation of the coordinate axes: for top to bottom for the
                   4317: vertical axis and from left to right for the horizontal axis.  Thus, a
                   4318: negative distance in a vertical position indicates that the side or axis
                   4319: specified in the rule is above the side or axis of the reference box.</p>
                   4320: 
                   4321: <p>The distance can be followed by the <tt>UserSpecified</tt> keyword (even if
1.18      cvs      4322: the distance is nil and does not appear, the <tt>UserSpecified</tt> keyword
1.1       cvs      4323: can be used).  It indicates that when the element to which the rule applies is
                   4324: being created, the editor will ask the user to specify the distance himself,
                   4325: using the mouse.  In this case, the distance specified in the rule is a
                   4326: default distance which is suggested to the user but can be modified.  The
1.18      cvs      4327: <tt>UserSpecified</tt> keyword can be used either in the vertical position
                   4328: rule, the horizontal position rule, or both.</p>
                   4329: <pre>     VertPosition  = Reference '.' HorizAxis [ Distance ] .
1.1       cvs      4330:      HorizPosition = Reference '.' VertAxis [ Distance ] .
                   4331:      Reference     ='Enclosing' [ BoxTypeNot ] /
                   4332:                     'Enclosed' [ BoxTypeNot ] /
                   4333:                     'Previous' [ BoxTypeNot ] /
                   4334:                     'Next' [ BoxTypeNot ] /
                   4335:                     'Referred' [ BoxTypeNot ] /
                   4336:                     'Creator' /
                   4337:                     'Root' /
                   4338:                     '*' /
                   4339:                      BoxOrType .
                   4340:      BoxOrType     = BoxID /
                   4341:                      [ '*' ] [ FirstSec ] ElemID /
1.17      cvs      4342:                     'AnyElem' / 'AnyBox' /
                   4343:                     'ElemWithAttr' AttrID .
1.18      cvs      4344:      BoxTypeNot    = [ 'NOT' ] BoxOrType .</pre>
1.30      cvs      4345: 
1.18      cvs      4346: <blockquote class="example">
1.30      cvs      4347:   <p><strong>Example:</strong></p>
                   4348: 
                   4349:   <p>If a <a name="expos1">report</a> is defined by the following structure
                   4350:   schema:</p>
                   4351:   <pre>Report = BEGIN
1.6       cvs      4352:          Title  = Text;
                   4353:          Summary = Text;
                   4354:          Keywords = Text;
                   4355:          ...
1.18      cvs      4356:          END;</pre>
1.30      cvs      4357: 
                   4358:   <p>then the presentation schema could contain the rules:</p>
                   4359:   <pre>Report : BEGIN
1.6       cvs      4360:          VertPos  : Top = Enclosing . Top;
                   4361:          HorizPos : Left = Enclosing . Left;
                   4362:          ...
1.18      cvs      4363:          END;</pre>
1.30      cvs      4364: 
                   4365:   <p>These rules place the <a name="reportexample">report</a> in the upper
                   4366:   left corner of the enclosing box, which is the window in which the document
                   4367:   is being edited.</p>
                   4368:   <pre>Title :  BEGIN
1.6       cvs      4369:          VertPos  : Top = Enclosing . Top + 1;
                   4370:          HorizPos : VMiddle = Enclosing . VMiddle;
                   4371:          ...
1.18      cvs      4372:          END;</pre>
1.30      cvs      4373: 
                   4374:   <p>The top of the title is one line (a line has the height of the characters
                   4375:   of the title) from the top of the report, which is also the top of the
                   4376:   editing window.  The title is centered horizontally in the window (see <a
                   4377:   href="#posdim">figure</a>).</p>
                   4378:   <pre>Summary : BEGIN
1.1       cvs      4379:           VertPos  : Top = Title . Bottom + 1.5;
                   4380:           HorizPos : Left = Enclosing . Left + 2 cm;
                   4381:           ...
1.18      cvs      4382:           END;</pre>
1.30      cvs      4383: 
                   4384:   <p>The top of the summary is place a line and a half below the bottom of the
                   4385:   title and is shifted two centimeters from the side of the window.</p>
1.18      cvs      4386: </blockquote>
1.30      cvs      4387: 
1.18      cvs      4388: <blockquote class="example">
1.30      cvs      4389:   <p><strong>Example:</strong></p>
                   4390: 
                   4391:   <p>Suppose there is a <a name="expos2">Design</a> logical structure which
                   4392:   contains graphical elements:</p>
                   4393:   <pre>Design = LIST OF (ElemGraph = GRAPHICS);</pre>
                   4394: 
                   4395:   <p>The following rules allow the user to freely choose the position of each
                   4396:   element when it is created:</p>
                   4397:   <pre>ElemGraph =
1.1       cvs      4398:    BEGIN
                   4399:    VertPos : Top = Enclosing . Top + 1 cm UserSpecified;
                   4400:    HorizPos: Left = Enclosing . Left UserSpecified;
                   4401:    ...
1.18      cvs      4402:    END;</pre>
1.30      cvs      4403: 
                   4404:   <p>Thus, when a graphical element is created, its default placement is at
                   4405:   the left of the window and 1 cm from the top, but the user can move it
                   4406:   immediately, simply by moving the mouse.</p>
1.18      cvs      4407: </blockquote>
                   4408: </div>
1.1       cvs      4409: 
1.18      cvs      4410: <div class="subsection">
1.30      cvs      4411: <h3><a name="sectc4219">Box extents</a></h3>
1.1       cvs      4412: 
1.30      cvs      4413: <p>The extents (height and width) of each box are defined by the two rules
1.18      cvs      4414: <tt>Height</tt> and <tt>Width</tt>.  There are three types of extents: fixed,
                   4415: relative, and elastic.</p>
1.1       cvs      4416: 
1.18      cvs      4417: <div class="subsubsection">
1.30      cvs      4418: <h4><a name="sectd42191">Fixed extents</a></h4>
1.1       cvs      4419: 
1.30      cvs      4420: <p>A fixed dimension sets the height or width of the box independently of all
1.18      cvs      4421: other boxes.  It is expressed in <a href="#sectc4217">distance units</a>.  The
                   4422: extent can be followed by the <tt>UserSpecified</tt> keyword which indicates
1.1       cvs      4423: that when the element to which the rule applies is being created, the editor
                   4424: will ask the user to specify the extent himself, using the mouse.  In this
                   4425: case, the extent specified in the rule is a default extent which is suggested
1.18      cvs      4426: to the user but can be modified.  The <tt>UserSpecified</tt> keyword can be
                   4427: used either in the <tt>Height</tt> rule, the <tt>Width</tt> rule, or both.</p>
1.30      cvs      4428: 
                   4429: <p>A fixed extent rule can be ended by the <tt>Min</tt> keyword, which
                   4430: signifies that the indicated value is a minimum, and that, if the contents of
                   4431: the box require it, a larger extent is possible.</p>
1.18      cvs      4432: <pre>                'Height' ':' Dimension
1.1       cvs      4433:                 'Width' ':' Dimension
                   4434:      Dimension = AbsDist [ 'UserSpecified' ]  [ 'Min' ] /
1.18      cvs      4435:                  ...</pre>
1.30      cvs      4436: 
1.18      cvs      4437: <blockquote class="example">
1.30      cvs      4438:   <p><strong>Example:</strong></p>
                   4439: 
                   4440:   <p>Continuing with the <a href="#expos2">previous example</a>, it is
                   4441:   possible to allow the user to choose the size of each graphical element as
                   4442:   it is created:</p>
                   4443:   <pre>ElemGraph : BEGIN
1.6       cvs      4444:             Width :  2 cm UserSpecified;
1.1       cvs      4445:             Height : 1 cm UserSpecified;
                   4446:             ...
1.18      cvs      4447:             END;</pre>
1.30      cvs      4448: 
                   4449:   <p>Thus, when a graphical element is create, it is drawn by default with a
                   4450:   width of 2 cm and a height of 1 cm, but the user is free to resize it
                   4451:   immediately with the mouse.</p>
                   4452:   <pre>Summary :  BEGIN
1.1       cvs      4453:            Height : 5 cm Min;
                   4454:            ...
                   4455:            END;
                   4456: Keywords : BEGIN
                   4457:            VertPos : Top = Summary . Bottom;
                   4458:            ...
1.18      cvs      4459:            END;</pre>
                   4460: </blockquote>
                   4461: </div>
1.1       cvs      4462: 
1.18      cvs      4463: <div class="subsubsection">
1.30      cvs      4464: <h4><a name="sectd42192">Relative extents</a></h4>
                   4465: 
                   4466: <p>A relative extent determines the extent as a function of the extent of
                   4467: another box, just as a relative position places a box in relation to another.
                   4468: The reference box in an extent rule is designated using the same syntax as is
                   4469: used in a relative position rule.  It is followed by a period and a
                   4470: <tt>Height</tt> or <tt>Width</tt> keyword, depending on the extent being
                   4471: referred to.  Next comes the relation between the extent being defined and the
                   4472: extent of the reference box.  This relation can be either a percentage or a
                   4473: difference.</p>
1.1       cvs      4474: 
1.30      cvs      4475: <p>A percentage is indicated by a star (the multiplication symbol) followed by
1.1       cvs      4476: the numeric percentage value (which may be greater than or less than 100) and
                   4477: the percent (`%') character.  A difference is simply indicated by a signed
1.18      cvs      4478: difference.</p>
1.30      cvs      4479: 
                   4480: <p>If the rule appears in the presentation rules of a numeric attribute, the
1.1       cvs      4481: percentage value can be replaced by the name of the attribute. This attribute
1.18      cvs      4482: is then used as a percentage.  The attribute can also be used as part of a <a
                   4483: href="#distance">difference</a>.</p>
1.30      cvs      4484: 
                   4485: <p>Just as with a fixed extent, a relative extent rule can end with the
1.18      cvs      4486: <tt>Min</tt> keyword, which signifies that the extent is a minimum and that,
                   4487: if the contents of the box require it, a larger extent is possible.</p>
1.30      cvs      4488: 
                   4489: <p>A special case of relative extent rules is:</p>
1.18      cvs      4490: <pre>Height : Enclosed . Height;</pre>
1.30      cvs      4491: 
                   4492: <p>or</p>
1.18      cvs      4493: <pre>Width  : Enclosed . Width;</pre>
1.30      cvs      4494: 
                   4495: <p>which specifies that the box has a height (or width) such that it encloses
                   4496: all the boxes which it contains, excluding boxes having a rule
                   4497: <tt>VertOverflow: Yes;</tt> or <tt>HorizOverflow: Yes;</tt>.</p>
                   4498: 
                   4499: <p><strong>Note:</strong> character strings (type <tt>TEXT_UNIT</tt>)
                   4500: generally must use the sum of the widths of the characters which compose them
                   4501: as their width, which is expressed by the rule:</p>
1.18      cvs      4502: <pre>TEXT_UNIT :
                   4503:      Width : Enclosed . Width;</pre>
1.30      cvs      4504: 
                   4505: <p>If this rule is not the default <tt>Width</tt> rule, it must be given
1.18      cvs      4506: explicitly in the <tt>RULES</tt> section which defines the presentation rules
                   4507: of the logical elements.</p>
                   4508: <pre>                  'Height' ':' Extent
1.1       cvs      4509:                   'Width' ':' Extent
                   4510:      Extent      = Reference '.' HeightWidth [ Relation ]
                   4511:                    [ 'Min' ] / ...
                   4512:      HeightWidth ='Height' / 'Width' .
                   4513:      Relation    ='*' ExtentAttr '%' / Distance .
                   4514:      ExtentAttr  = ExtentVal / AttrID .
1.18      cvs      4515:      ExtentVal   = NUMBER .</pre>
1.30      cvs      4516: 
1.18      cvs      4517: <blockquote class="example">
1.30      cvs      4518:   <p><strong>Example:</strong></p>
                   4519: 
                   4520:   <p>Completing the <a href="#expos1">above example</a>, it is possible to
                   4521:   specify that the report takes its width from the editing window and its
                   4522:   height from the size of its contents (this can obviously be greater than
                   4523:   that of the window):</p>
                   4524:   <pre>Report :  BEGIN
1.1       cvs      4525:           Width : Enclosing . Width;
                   4526:           Height : Enclosed . Height;
                   4527:           ...
1.18      cvs      4528:           END;</pre>
1.30      cvs      4529: 
                   4530:   <p>Then, the following rules make the title occupy 60% of the width of the
                   4531:   report (which is that of the window) and is broken into centered lines of
                   4532:   this width (see the <a href="#sectc4222"><tt>Line</tt> rule</a>).</p>
                   4533:   <pre>Title :   BEGIN
1.1       cvs      4534:           Width : Enclosing . Width * 60%;
                   4535:           Height : Enclosed . Height;
                   4536:           Line;
                   4537:           Adjust : VMiddle;
                   4538:           ...
1.18      cvs      4539:           END;</pre>
1.30      cvs      4540: 
                   4541:   <p>The summary occupy the entire width of the window, with the exception of
                   4542:   a 2 cm margin reserved by the horizontal position rule:</p>
                   4543:   <pre>Summary : BEGIN
1.1       cvs      4544:           Width : Enclosing . Width - 2 cm;
                   4545:           Height : Enclosed . Height;
                   4546:           ...
1.18      cvs      4547:           END;</pre>
                   4548: 
1.30      cvs      4549:   <p>This set of rules, plus the <a href="#reportexample">position rules given
                   4550:   above</a>, produce the layout of boxes shown in the following<a
                   4551:   href="#posdim">figure</a>.</p>
                   4552: 
                   4553:   <div class="figure">
                   4554:   <hr>
                   4555:   <pre>-------------------------------------------------------------
1.1       cvs      4556: | Window and Report           ^                             |
                   4557: |                             | 1 line                      |
                   4558: |                             v                             |
                   4559: |           -------------------------------------           |
                   4560: |           |                                   |           |
                   4561: :    20%    :               Title               :    20%    :
1.30      cvs      4562: :&lt;---------&gt;:                                   :&lt;---------&gt;:
1.1       cvs      4563: :           :                60%                :           :
1.30      cvs      4564: :           :&lt;---------------------------------&gt;:           :
1.1       cvs      4565: |           |                                   |           |
                   4566: |           -------------------------------------           |
                   4567: |                             ^                             |
                   4568: |                             | 1.5 line                    |
                   4569: |                             |                             |
                   4570: |                             v                             |
                   4571: |        ---------------------------------------------------|
                   4572: |  2 cm  |                                                  |
1.30      cvs      4573: |&lt;------&gt;|                    Summary                       |
1.18      cvs      4574: :        :                                                  :</pre>
1.19      cvs      4575: 
1.30      cvs      4576:   <p align="center"><em><a name="posdim">Box position and
                   4577:   extent</a><em></em></em></p>
                   4578:   <hr>
                   4579:   </div>
1.18      cvs      4580: </blockquote>
                   4581: </div>
1.1       cvs      4582: 
1.18      cvs      4583: <div class="subsubsection">
1.30      cvs      4584: <h4><a name="sectd42193">Elastic extents</a></h4>
1.1       cvs      4585: 
1.30      cvs      4586: <p>The last type of extent is the elastic extent.  Either one or both extents
                   4587: can be elastic.  A box has an elastic extent when two opposite sides are
                   4588: linked by distance constraints to two sides or axes of other boxes.</p>
                   4589: 
                   4590: <p>One of the sides of the elastic box is linked by a position rule
1.18      cvs      4591: (<tt>VertPos</tt> or <tt>HorizPos</tt>) to a neighboring box.  The other side
                   4592: is link to another box by a <tt>Height</tt> or <tt>Width</tt> rule, which
1.1       cvs      4593: takes the same form as the position rule.  For the elastic box itself, the
                   4594: notions of sides (left or right, top or bottom) are fuzzy, since the movement
                   4595: of either one of the two reference boxes can, for example, make the left side
                   4596: of the elastic box move to the right of its right side.  This is not
                   4597: important.  The only requirement is that the two sides of the elastic box used
1.18      cvs      4598: in the position and extent rule are opposite sides of the box.</p>
                   4599: <pre>             'Height' ':' Extent
1.6       cvs      4600:              'Width' ':' Extent
1.18      cvs      4601:      Extent = HPos / VPos / ...</pre>
1.30      cvs      4602: 
1.18      cvs      4603: <blockquote class="example">
1.30      cvs      4604:   <p><strong>Example:</strong></p>
                   4605: 
                   4606:   <p>Suppose we want to draw an elastic arrow or line between the middle of
                   4607:   the bottom side of box A and the upper left corner of box B.  To do this, we
                   4608:   would define a graphics box whose upper left corner coincides with the
                   4609:   middle of the bottom side of A (a position rule) and whose lower right
                   4610:   corner coincides with with the upper left corner of B (dimension rules):</p>
                   4611:   <pre>LinkedBox :
1.1       cvs      4612:    BEGIN
1.6       cvs      4613:    VertPos  : Top = A .Bottom;
1.1       cvs      4614:    HorizPos : Left = A . VMiddle;
1.6       cvs      4615:    Height   : Bottom = B . Top;
                   4616:    Width    : Right = B . Left;
1.18      cvs      4617:    END;</pre>
                   4618: </blockquote>
1.30      cvs      4619: 
1.18      cvs      4620: <blockquote class="example">
1.30      cvs      4621:   <p><strong>Example:</strong></p>
                   4622: 
                   4623:   <p>The element SectionTitle creates a presentation box called SectionNum
                   4624:   which contains the number of the section.  Suppose we want to align the
                   4625:   SectionNum and SectionTitle horizontally, have the SectionNum take its width
                   4626:   from its contents (the section number), have the SectionTitle box begin 0.5
                   4627:   cm to the right of the SectionNum box and end at the right edge of its
                   4628:   enclosing box. This would make the SectionTitle box elastic, since its width
                   4629:   is defined by the position of its left and right sides.  The following rules
                   4630:   produce this effect:</p>
                   4631:   <pre>SectionNum :
1.1       cvs      4632:    BEGIN
                   4633:    HorizPos : Left = Enclosing . Left;
                   4634:    Width : Enclosed . Width;
                   4635:    ...
                   4636:    END;
                   4637: 
                   4638: SectionTitle :
                   4639:    BEGIN
                   4640:    HorizPos : Left = SectionNum . Right + 0.5 cm;
                   4641:    Width : Right = Enclosing . Right;
                   4642:    ...
1.18      cvs      4643:    END;</pre>
                   4644: </blockquote>
                   4645: </div>
                   4646: </div>
1.1       cvs      4647: 
1.18      cvs      4648: <div class="subsection">
1.30      cvs      4649: <h3><a name="sectc4220">Overflow</a></h3>
1.1       cvs      4650: 
1.30      cvs      4651: <p>A boxes corresponding to a structural element normally contain all boxes
1.1       cvs      4652: corresponding to the elements of its subtree.  However, in some cases, it
                   4653: could be necessary to allow a box to jut out from its parent box. Two
                   4654: presentation rules indicate that such an overflow is allowed, one for
1.18      cvs      4655: horizontal overflow, one for vertical overflow.</p>
1.30      cvs      4656: 
                   4657: <p>Each of these rules is expressed by a keyword followed by a colon and the
1.18      cvs      4658: keyword <tt>Yes</tt> or <tt>No</tt>.</p>
                   4659: <pre>               'VertOverflow' ':' Boolean /
1.1       cvs      4660:                'HorizOverflow' ':' Boolean .
1.18      cvs      4661:      Boolean = 'Yes' / 'No' .</pre>
                   4662: </div>
1.1       cvs      4663: 
1.30      cvs      4664: <p>@@@@@ ******</p>
                   4665: 
1.26      cvs      4666: <p>Explain Margin, Padding and Border. Refer to CSS2.</p>
                   4667: <pre>                'MarginTop' ':' MarginWidth /
                   4668:                 'MarginRight' ':' MarginWidth /
                   4669:                 'MarginBottom' ':' MarginWidth /
                   4670:                 'MarginLeft' ':' MarginWidth /
                   4671:                 'PaddingTop' ':' PaddingWidth /
                   4672:                 'PaddingRight' ':' PaddingWidth /
                   4673:                 'PaddingBottom' ':' PaddingWidth /
                   4674:                 'PaddingLeft' ':' PaddingWidth /
                   4675:                 'BorderTopWidth' ':' BorderWidth /
                   4676:                 'BorderRightWidth' ':' BorderWidth /
                   4677:                 'BorderBottomWidth' ':' BorderWidth /
                   4678:                 'BorderLeftWidth' ':' BorderWidth /
                   4679:                 'BorderTopColor' ':' BorderColor /
                   4680:                 'BorderRightColor' ':' BorderColor /
                   4681:                 'BorderBottomColor' ':' BorderColor /
                   4682:                 'BorderLeftColor' ':' BorderColor /
                   4683:                 'BorderTopStyle' ':' BorderStyle /
                   4684:                 'BorderRightStyle' ':' BorderStyle /
                   4685:                 'BorderBottomStyle' ':' BorderStyle /
                   4686:                 'BorderLeftStyle' ':' BorderStyle .
                   4687: 
                   4688: MarginWidth   = InheritParent / 'Auto' / Distance .
                   4689: PaddingWidth  = InheritParent / Distance .
                   4690: BorderWidth   = InheritParent / 'Thin' / 'Medium' / 'Thick' / Distance .
                   4691: BorderColor   = InheritParent / 'Transparent' / 'Foreground' /
                   4692:                 ColorName .
                   4693: BorderStyle   = InheritParent /
                   4694:                 'None' / 'Hidden' / 'Dotted' / 'Dashed' / 'Solid' /
                   4695:                 'Double' / 'Groove' / 'Ridge' / 'Inset' / 'Outset' .
1.27      cvs      4696: InheritParent = 'Enclosing' '=' / 'Creator' '=' .
1.26      cvs      4697: ColorName     =  NAME .</pre>
1.30      cvs      4698: 
                   4699: <p>@@@@@ ******</p>
1.26      cvs      4700: 
1.18      cvs      4701: <div class="subsection">
1.30      cvs      4702: <h3><a name="sectc4221">Inheritance</a></h3>
1.1       cvs      4703: 
1.34    ! cvs      4704: <p>A presentation property can be defined by reference to the same property of
        !          4705: another box in the tree of boxes.  These structural links are expressed by
1.1       cvs      4706: kinship.  The reference box can be that of the element immediately above in
1.18      cvs      4707: the structure (<tt>Enclosing</tt>), two levels above (<tt>GrandFather</tt>),
                   4708: immediately below (<tt>Enclosed</tt>) or immediately before
                   4709: (<tt>Previous</tt>).  In the case of a presentation box, and only in that
1.1       cvs      4710: case, the reference box may be the element which created the presentation box
1.18      cvs      4711: (<tt>Creator</tt>).</p>
1.30      cvs      4712: 
                   4713: <p>Kinship is expressed in terms of the logical structure of the document and
                   4714: not in terms of the tree of boxes.  The presentation box cannot transmit any
1.34    ! cvs      4715: of their properties by inheritance; only structured element boxes can do so.
1.30      cvs      4716: As an example, consider an element B which follows an element A in the logical
1.1       cvs      4717: structure.  The element B creates a presentation box P in front of itself,
1.18      cvs      4718: using the <tt>CreateBefore</tt> rule (see the <a href="#sectc4232">creation
                   4719: rules</a>).  If element B's box inherits its character style using the
                   4720: <tt>Previous</tt> kinship operation, it gets its character style from A's box,
1.1       cvs      4721: not from P's box.  Inheritance works differently for positions and extents,
1.18      cvs      4722: which can refer to presentation boxes.</p>
1.30      cvs      4723: 
1.34    ! cvs      4724: <p>The inherited property value can be the same as that of the reference box.
        !          4725: This is indicated by an equals sign.  However, for numeric properties, a
1.1       cvs      4726: different value can be obtained by adding or subtracting a number from the
1.34    ! cvs      4727: reference box's property value.  Addition is indicated by a plus sign before
1.1       cvs      4728: the number, while subtraction is specified with a minus sign.  The value of a
1.34    ! cvs      4729: property can also be given a maximum (if the sign is a plus) or minimum (if
1.18      cvs      4730: the sign is a minus).</p>
1.30      cvs      4731: 
                   4732: <p>If the rule is being applied to a numeric attribute, the number to add or
1.1       cvs      4733: subtract can be replaced by the attribute name.  The value of a maximum or
                   4734: minimum may also be replaced by an attribute name.  In these cases, the value
1.18      cvs      4735: of the attribute is used.</p>
                   4736: <pre>  Inheritance    = Kinship  InheritedValue .
1.6       cvs      4737:   Kinship        ='Enclosing' / 'GrandFather' / 'Enclosed' /
                   4738:                   'Previous' / 'Creator' .
1.1       cvs      4739:   InheritedValue ='+' PosIntAttr [ 'Max' maximumA ] /
1.6       cvs      4740:                   '-' NegIntAttr [ 'Min' minimumA ] /
                   4741:                   '=' .
                   4742:   PosIntAttr     = PosInt / AttrID .
                   4743:   PosInt         = NUMBER .
                   4744:   NegIntAttr     = NegInt / AttrID .
                   4745:   NegInt         = NUMBER .
                   4746:   maximumA       = maximum / AttrID .
                   4747:   maximum        = NUMBER .
                   4748:   minimumA       = minimum / AttrID .
1.18      cvs      4749:   minimum        = NUMBER .</pre>
1.30      cvs      4750: 
1.34    ! cvs      4751: <p>The properties which can be obtained by inheritance are justification,
1.1       cvs      4752: hyphenation, interline spacing, character font (font family), font style, font
                   4753: size, visibility, indentation, underlining, alignment of text, stacking order
                   4754: of objects, the style and thickness of lines, fill pattern and the colors of
1.18      cvs      4755: lines and characters.</p>
                   4756: </div>
1.1       cvs      4757: 
1.18      cvs      4758: <div class="subsection">
1.30      cvs      4759: <h3><a name="sectc4222">Line breaking</a></h3>
1.1       cvs      4760: 
1.30      cvs      4761: <p>The <tt>Line</tt> rule specifies that the contents of the box should be
                   4762: broken into lines: the boxes included in the box to which this rule is
                   4763: attached are displayed one after the other, from left to right, with their
                   4764: horizontal reference axes aligned so that they form a series of lines.  The
                   4765: length of these lines is equal to the width of the box to which the
                   4766: <tt>Line</tt> rule is attached.</p>
                   4767: 
                   4768: <p>When an included box overflows the current line, it is either carried
                   4769: forward to the next line, cur, or left the way it is.  The <a
1.18      cvs      4770: href="#sectc4223"><tt>LineBreak</tt> rule</a> is used to allow or prevent the
1.1       cvs      4771: breaking of included boxes.  If the included box is not breakable but is
                   4772: longer than the space remaining on the line, it is left as is.  When a
                   4773: character string box is breakable, the line is broken between words or, if
1.18      cvs      4774: necessary, by <a href="#sectd42225">hyphenating a word</a>.  When a compound
                   4775: box is breakable, the box is transparent in regard to line breaking. The boxes
                   4776: included in the compound box are treated just like included boxes which have
                   4777: the <tt>LineBreak</tt> rule.  Thus, it is possible to traverse a complete
                   4778: subtree of boxes to line break the text leaves of a complex structure.</p>
1.30      cvs      4779: 
                   4780: <p>The relative position rules of the included boxes are ignored, since the
                   4781: boxes will be placed according to the line breaking rules.</p>
                   4782: 
                   4783: <p>The <tt>Line</tt> rule does not have a parameter.  The characteristics of
                   4784: the lines that will be constructed are determined by the <tt>LineSpacing</tt>,
1.18      cvs      4785: <tt>Indent</tt>, <tt>Adjust</tt>, <tt>Justify</tt>, and <tt>Hyphenate</tt>
                   4786: rules.  Moreover, the <a href="#insectd42226"><tt>Inline</tt> rule</a> permits
                   4787: the exclusion of certain elements from the line breaking process.</p>
1.30      cvs      4788: 
                   4789: <p>When the <tt>Line</tt> rule appears in the rules sequence of a non-primary
1.18      cvs      4790: view, it applies only to that view, but when the <tt>Line</tt> rule appears in
1.1       cvs      4791: the rules sequence of the primary view, it also applies to the other views by
1.18      cvs      4792: default, except for those views which explicitly invoke the <tt>NoLine</tt>
                   4793: rule.  Thus, the <tt>NoLine</tt> rule can be used in a non-primary view to
                   4794: override the primary view's <tt>Line</tt> rule.  The <tt>NoLine</tt> rule must
                   4795: not be used with the primary view because the absence of the <tt>Line</tt>
                   4796: rule has the same effect. Like the <tt>Line</tt> rule, the <tt>NoLine</tt>
                   4797: rule does not take any parameters.</p>
                   4798: <pre>              'Line'
                   4799:               'NoLine'</pre>
                   4800: 
                   4801: <div class="subsubsection">
1.30      cvs      4802: <h4><a name="sectd42221">Line spacing</a></h4>
1.18      cvs      4803: 
1.30      cvs      4804: <p>The <tt>LineSpacing</tt> rule defines the line spacing to be used in the
                   4805: line breaking process.  The line spacing is the distance between the baselines
1.1       cvs      4806: (horizontal reference axis) of the successive lines produced by the
1.18      cvs      4807: <tt>Line</tt> rule.  The value of the line spacing can be specified as a
                   4808: constant or by inheritance.  It is expressed in any of the available <a
                   4809: href="#sectc4217">distance units</a>.</p>
1.30      cvs      4810: 
                   4811: <p>Inheritance allows the value to be obtained from a relative in the
                   4812: structure tree, either without change (an equals sign appears after the
                   4813: inheritance keyword), with a positive difference (a plus sign), or a negative
                   4814: difference (a minus sign).  When the rule uses a difference, the value of the
                   4815: difference follows the sign and is expressed as a <a
                   4816: href="#sectc4217">distance</a>.</p>
1.18      cvs      4817: <pre>                     'LineSpacing' ':' DistOrInherit
1.6       cvs      4818:      DistOrInherit =  Kinship InheritedDist / Distance .
1.18      cvs      4819:      InheritedDist = '=' / '+' AbsDist / '-' AbsDist .</pre>
1.30      cvs      4820: 
                   4821: <p>When the line spacing value (or its difference from another element) is
1.1       cvs      4822: expressed in relative units, it changes with the size of the characters. Thus,
                   4823: when a larger font is chosen for a part of the document, the line spacing of
                   4824: that part expands proportionally.  In contrast, when the line spacing value is
                   4825: expressed in absolute units (centimeters, inches, typographer's points), it is
                   4826: independent of the characters, which permits the maintenance of a consistent
                   4827: line spacing, whatever the character font.  Either approach can be taken,
1.18      cvs      4828: depending on the desired effect.</p>
                   4829: </div>
1.1       cvs      4830: 
1.18      cvs      4831: <div class="subsubsection">
1.30      cvs      4832: <h4><a name="sectd42222">First line indentation</a></h4>
1.1       cvs      4833: 
1.30      cvs      4834: <p>The <tt>Indent</tt> rule is used to specify the indentation of the first
                   4835: line of the elements broken into lines by the <tt>Line</tt> function. The
1.1       cvs      4836: indentation determines how far the first line of the element is shifted with
                   4837: respect to the other lines of the same element.  It can be specified as a
                   4838: constant or by inheritance.  The constant value is a positive integer (shifted
                   4839: to the right; the sign is optional), a negative integer (shifted to the left)
1.18      cvs      4840: or zero (no shift).  All available <a href="#sectc4217">units</a> can be
                   4841: used.</p>
1.30      cvs      4842: 
                   4843: <p>Indentation can be defined for any box, regardless of whether the box is
                   4844: line broken, and transmitted by inheritance to elements that are line broken.
                   4845: The size of the indentation is specified in the same manner as the <a
1.18      cvs      4846: href="#sectd42221">line spacing</a>.</p>
                   4847: <pre>              'Indent' ':' DistOrInherit</pre>
                   4848: </div>
1.1       cvs      4849: 
1.18      cvs      4850: <div class="subsubsection">
1.30      cvs      4851: <h4><a name="sectd42223">Alignment</a></h4>
1.1       cvs      4852: 
1.30      cvs      4853: <p>The alignment style of the lines constructed during line breaking is
                   4854: defined by the <tt>Adjust</tt> rule.  The alignment value can be a constant or
1.18      cvs      4855: inherited.  A constant value is specified by a keyword:</p>
                   4856: <ul>
1.30      cvs      4857:   <li><tt>Left</tt>: at the left edge,</li>
                   4858:   <li><tt>Right</tt>: at the right edge,</li>
                   4859:   <li><tt>VMiddle</tt>: centered</li>
                   4860:   <li><tt>LeftWithDots</tt>: at the left edge with a dotted line filling out
                   4861:     the last line up to the right edge of the line breaking box.</li>
1.18      cvs      4862: </ul>
1.30      cvs      4863: 
                   4864: <p>An inherited value can only be the same as that of the reference box and is
1.18      cvs      4865: specified by a kinship keyword followed by an equals sign.</p>
                   4866: <pre>                      'Adjust' ':' AlignOrInherit
1.1       cvs      4867:      AlignOrInherit = Kinship '=' / Alignment .
                   4868:      Alignment      = 'Left' / 'Right' / 'VMiddle' /
1.18      cvs      4869:                       'LeftWithDots' .</pre>
                   4870: </div>
1.1       cvs      4871: 
1.18      cvs      4872: <div class="subsubsection">
1.30      cvs      4873: <h4><a name="sectd42224">Justification</a></h4>
1.1       cvs      4874: 
1.30      cvs      4875: <p>The <tt>Justify</tt> rule indicates whether the lines contained in the box
                   4876: and produced by a <tt>Line</tt> rule should be extended horizontally to occupy
                   4877: the entire width of their enclosing box.  The first and last lines are treated
1.1       cvs      4878: specially: the position of the beginning of the first line is fixed by the
1.18      cvs      4879: <tt>Indent</tt> rule and last line is not extended.  The justification
1.34    ! cvs      4880: property defined by this rule takes a boolean value, which can be a constant
1.1       cvs      4881: or inherited.  A constant boolean value is expressed by either the
1.18      cvs      4882: <tt>Yes</tt> or the <tt>No</tt> keyword.  An inherited value can only be the
1.1       cvs      4883: same as that of the reference box and is specified by a kinship keyword
1.18      cvs      4884: followed by an equals sign.</p>
                   4885: <pre>                  'Justify' ':' BoolInherit
1.1       cvs      4886:      BoolInherit = Boolean / Kinship '=' .
1.18      cvs      4887:      Boolean     ='Yes' / 'No' .</pre>
1.30      cvs      4888: 
1.34    ! cvs      4889: <p>When the lines are justified, the alignment property specified in the
1.18      cvs      4890: <tt>Adjust</tt> rule has no influence, other than on the last line produced.
1.1       cvs      4891: This occurs because, when the other are extended to the limits of the box, the
1.18      cvs      4892: alignment style is no longer perceptible.</p>
1.30      cvs      4893: 
1.18      cvs      4894: <blockquote class="example">
1.30      cvs      4895:   <p><strong>Example:</strong></p>
                   4896: 
                   4897:   <p>An important use of inheritance is to vary the characteristics of lines
                   4898:   for an element type (for example, Paragraph) according to the enclosing
                   4899:   environment (for example, Summary or Section), and thus obtain different
                   4900:   line breaking styles for the same elements when they appear in different
                   4901:   environments.  The following rules specify that paragraphs inherit their
                   4902:   alignment, justification, and line spacing:</p>
                   4903:   <pre>Paragraph :
1.1       cvs      4904:    BEGIN
                   4905:    Justify : Enclosing = ;
                   4906:    LineSpacing : Enclosing = ;
                   4907:    Adjust : Enclosing =;
                   4908:    Line;
1.18      cvs      4909:    END;</pre>
1.30      cvs      4910: 
                   4911:   <p>If the alignment, justification, and line spacing of the Section and
                   4912:   Summary elements is fixed:</p>
                   4913:   <pre>Section :
1.1       cvs      4914:    BEGIN
                   4915:    Adjust : Left;
                   4916:    Justify : Yes;
                   4917:    LineSpacing : 1;
                   4918:    END;
                   4919: Summary :
                   4920:    BEGIN
                   4921:    Adjust : VMiddle;
                   4922:    Justify : No;
                   4923:    LineSpacing : 1.3;
1.18      cvs      4924:    END;</pre>
1.30      cvs      4925: 
                   4926:   <p>then the paragraphs appearing in sections are justified with a simple
                   4927:   line spacing while those appearing in summaries are centered and not
                   4928:   justified and have a larger line spacing.  These are nevertheless the very
                   4929:   same type of paragraph defined in the logical structure schema.</p>
1.18      cvs      4930: </blockquote>
                   4931: </div>
                   4932: 
                   4933: <div class="subsubsection">
1.30      cvs      4934: <h4><a name="sectd42225">Hyphenation</a></h4>
1.18      cvs      4935: 
1.30      cvs      4936: <p>The <tt>Hyphenate</tt> rule indicates whether or not words should be broken
                   4937: by hyphenation at the end of lines.  It affects the lines produced by the
1.18      cvs      4938: <tt>Line</tt> rule and contained in the box carrying the <tt>Hyphenate</tt>
                   4939: rule.</p>
1.30      cvs      4940: 
1.34    ! cvs      4941: <p>The hyphenation property takes a boolean value, which can be either
1.30      cvs      4942: constant or inherited.  A constant boolean value is expressed by either the
1.18      cvs      4943: <tt>Yes</tt> or the <tt>No</tt> keyword.  An inherited value can only be the
1.1       cvs      4944: same as that of the reference box and is specified by a kinship keyword
1.18      cvs      4945: followed by an equals sign.</p>
                   4946: <pre>                   'Hyphenate' ':' BoolInherit
1.1       cvs      4947:      BoolInherit = Boolean / Kinship '=' .
1.18      cvs      4948:      Boolean     = 'Yes' / 'No' .</pre>
                   4949: </div>
                   4950: 
                   4951: <div class="subsubsection">
1.30      cvs      4952: <h4><a name="sectd42226">Avoiding line breaking</a></h4>
1.18      cvs      4953: 
1.30      cvs      4954: <p>The <tt>InLine</tt> rule is used to specify that a box that would otherwise
1.18      cvs      4955: participate in line breaking asked for by the <tt>Line</tt> rule of an
1.1       cvs      4956: enclosing box, instead avoids the line breaking process and positions itself
1.18      cvs      4957: according to the <tt>HorizPos</tt> and <tt>VertPos</tt> rules that apply to
                   4958: it.  When the <tt>InLine</tt> rule applies to a box which would not be line
                   4959: broken, it has no effect.</p>
1.30      cvs      4960: 
                   4961: <p>The rule is expressed by the <tt>InLine</tt> keyword followed by a colon
                   4962: and the keyword <tt>Yes</tt>, if the box should participate in line breaking,
                   4963: or the keyword <tt>No</tt>, if it should not.  This is the only form possible:
1.1       cvs      4964: this rule cannot be inherited.  Moreover, it can only appear in the rules of
                   4965: the primary view and applies to all views defined in the presentation
1.18      cvs      4966: schema.</p>
                   4967: <pre>               'InLine' ':' Boolean .
                   4968:      Boolean = 'Yes' / 'No' .</pre>
1.30      cvs      4969: 
1.18      cvs      4970: <blockquote class="example">
1.30      cvs      4971:   <p><strong>Example:</strong></p>
                   4972: 
                   4973:   <p>Suppose the structure schema defines a logical attribute called
                   4974:   <tt>New</tt> which is used to identify the passages in a document which were
                   4975:   recently modified.  It would be nice to have the presentation schema make a
                   4976:   bar appear in the left margin next to each passage having the <tt>New</tt>
                   4977:   attribute.  A new passage can be an entire element, such as a paragraph or
                   4978:   section, or it can be some words in the middle of a paragraph.  To produce
                   4979:   the desired effect, the <tt>New</tt> attribute is given a creation rule
                   4980:   which generates a <tt>VerticalBar</tt> presentation box.</p>
                   4981: 
                   4982:   <p>When the <tt>New</tt> attribute is attached to a character string which
                   4983:   is inside a line broken element (inside a paragraph, for example), the bar
                   4984:   is one of the elements which participates in line breaking and it is placed
                   4985:   normally in the current line, at the end of the character string which has
                   4986:   the attribute.  To avoid this, the <tt>InLine</tt> rule is used in the
                   4987:   following way:</p>
                   4988:   <pre>BOXES
1.1       cvs      4989:   VerticalBar:
                   4990:      BEGIN
                   4991:      Content: Graphics 'l';
                   4992:      HorizPos: Left = Root . Left;
                   4993:      VertPos: Top = Creator . Top;
                   4994:      Height: Bottom = Creator . Bottom;
                   4995:      Width: 1 pt;
                   4996:      InLine: No;
                   4997:      ...
                   4998:      END;
                   4999: ...
                   5000: ATTRIBUTES
                   5001:   Nouveau:
                   5002:      BEGIN
                   5003:      CreateAfter(VerticalBar);
1.18      cvs      5004:      END;</pre>
                   5005: </blockquote>
                   5006: </div>
                   5007: </div>
1.1       cvs      5008: 
1.18      cvs      5009: <div class="subsection">
1.30      cvs      5010: <h3><a name="sectc4223">Page breaking and line breaking conditions</a></h3>
1.1       cvs      5011: 
1.30      cvs      5012: <p>Pages are constructed by the editor in accordance with the model specified
                   5013: by a <a href="#sectc4233"><tt>Page</tt> rule</a>.  The page model describes
                   5014: only the composition of the pages but does not give any rules for breaking
1.18      cvs      5015: different element types across pages.  Now, it is possible that certain
                   5016: elements must not be cut by page breaks, while others can be cut anywhere. The
                   5017: <tt>PageBreak</tt>, <tt>NoBreak1</tt>, and <tt>NoBreak2</tt> rules are used to
                   5018: specify the conditions under which each element type can be cut.</p>
1.30      cvs      5019: 
                   5020: <p>The <tt>PageBreak</tt> rule is used to indicate whether or not the box can
                   5021: be cut during the construction of pages.  If cutting is authorized, the box
                   5022: can be cut, with one part appearing at the bottom of a page and the other part
1.1       cvs      5023: appearing at the top of the next page. The rule is formed by the
1.18      cvs      5024: <tt>PageBreak</tt> keyword followed by a colon and a constant boolean value
                   5025: (<tt>Yes</tt> or <tt>No</tt>).  This is the only form possible: this rule
1.1       cvs      5026: cannot be inherited.  Moreover, it can only appear in the rules of the primary
1.18      cvs      5027: view and applies to all views defined in the presentation schema.</p>
1.30      cvs      5028: 
                   5029: <p>Whether objects can be cut by line breaks can be controlled in a similar
                   5030: way using the <tt>LineBreak</tt> rule.  This rule allows the specification of
1.1       cvs      5031: whether or not the box can be cut during the construction of lines.  If
                   5032: cutting is authorized, the box can be cut, with one part appearing at the end
                   5033: of a line and the other part appearing at the beginning of the next line.  The
1.18      cvs      5034: rule is formed by the <tt>LineBreak</tt> keyword followed by a colon and a
                   5035: constant boolean value (<tt>Yes</tt> or <tt>No</tt>).  This is the only form
1.1       cvs      5036: possible: this rule cannot be inherited.  Moreover, it can only appear in the
                   5037: rules of the primary view and applies to all views defined in the presentation
1.18      cvs      5038: schema.</p>
                   5039: <pre>               'PageBreak' ':' Boolean .
1.1       cvs      5040:                'LineBreak' ':' Boolean .
1.18      cvs      5041:      Boolean = 'Yes' / 'No' .</pre>
1.30      cvs      5042: 
                   5043: <p>When a box can be cut by a page break, it is possible that a page break
                   5044: will fall an inappropriate spot, creating, for example, a widow or orphan, or
1.1       cvs      5045: separating the title of a section from the first paragraph of the section. The
1.18      cvs      5046: <tt>NoBreak1</tt> and <tt>NoBreak2</tt> rules are used to avoid this. They
                   5047: specify that the box of the element to which they apply cannot be cut within a
                   5048: certain zone at the top (<tt>NoBreak1</tt> rule) or at the bottom
                   5049: (<tt>NoBreak2</tt> rule).  These two rules specify the height of the zones in
                   5050: which page breaks are prohibited.</p>
1.30      cvs      5051: 
                   5052: <p>The <tt>NoBreak1</tt> and <tt>NoBreak2</tt> rules give the height of the
                   5053: zone in which page breaking is prohibited.  The height is given as a constant
                   5054: value using any of the <a href="#sectc4217">available units</a>, absolute or
1.18      cvs      5055: relative.  The value may not be inherited.</p>
                   5056: <pre>                   'NoBreak1' ':' AbsDist .
                   5057:                    'NoBreak2' ':' AbsDist .</pre>
1.30      cvs      5058: 
1.18      cvs      5059: <blockquote class="example">
1.30      cvs      5060:   <p><strong>Example:</strong></p>
                   5061: 
                   5062:   <p>The following rules prevent widows and orphans in a paragraph:</p>
                   5063:   <pre>Paragraph :
1.1       cvs      5064:    BEGIN
                   5065:    NoBreak1 : 2;
                   5066:    NoBreak2 : 2;
1.18      cvs      5067:    END;</pre>
1.30      cvs      5068: 
                   5069:   <p>This rule prevents a section title from becoming separated from the first
                   5070:   paragraph of the section by prohibiting page breaks at the beginning of the
                   5071:   section rule:</p>
                   5072:   <pre>Section :
1.18      cvs      5073:    NoBreak1 : 1.5 cm;</pre>
1.30      cvs      5074: 
                   5075:   <p>Finally, this rule prevents a figure from being page broken in any
                   5076:   way:</p>
                   5077:   <pre>Figure :
1.18      cvs      5078:    PageBreak : No;</pre>
                   5079: </blockquote>
1.30      cvs      5080: 
                   5081: <p>The Thot editor constructs the document images displayed on the screen
1.1       cvs      5082: dynamically.  As the user moves in the document or makes the document scroll
                   5083: in a window, the editor constructs the image to be displayed in little bits,
                   5084: filling the gaps which are produced in the course of these operations.  It
                   5085: stops filling in the image when an element reaches the edge of the window in
                   5086: which the gap appears.  If the appearance of the document is complex, it is
                   5087: possible that the image in incomplete, even though the edge of the window was
                   5088: reached.  For example, an element might need to be presented to the side of
                   5089: the last element displayed, but its image was not constructed.  The user will
                   5090: not know whether the element is really absent or if its image has simply not
1.18      cvs      5091: been constructed.</p>
1.30      cvs      5092: 
                   5093: <p>The <tt>Gather</tt> rule is used to remedy this problem.  When the rule
1.18      cvs      5094: <tt>Gather : Yes;</tt> is associated with an element type, the image of such
                   5095: elements is constructed as a block by the editor: it is never split up.</p>
1.30      cvs      5096: 
                   5097: <p>The <tt>Gather</tt> rule may not appear in the <a href="#sectc427">default
1.18      cvs      5098: rules</a>.  Elements which do not have the <tt>Gather</tt> rule are considered
                   5099: susceptible to being split up during display.  Thus, it is not necessary to
                   5100: use the <tt>Gather : No;</tt> form. This rule must be used prudently and only
                   5101: for those elements which truly need it.  If used incorrectly, it can
                   5102: pointlessly increase the size of the image constructed by the editor and lead
                   5103: to excessive memory consumption by the editor.</p>
1.30      cvs      5104: 
                   5105: <p>Like the <tt>PageBreak</tt> and <tt>LineBreak</tt> rules, the
                   5106: <tt>Gather</tt> rule can only appear in rules of the primary view and applies
                   5107: to all views defined in the presentation schema.</p>
1.18      cvs      5108: <pre>                   'Gather' ':' Boolean .</pre>
                   5109: </div>
1.1       cvs      5110: 
1.18      cvs      5111: <div class="subsection">
1.30      cvs      5112: <h3><a name="sectc4224">Visibility</a></h3>
1.1       cvs      5113: 
1.34    ! cvs      5114: <p>The visibility property is used to control which elements should or should
1.1       cvs      5115: not be displayed, based on context.  An element can have different
                   5116: visibilities in different views.  If an element's visibility is zero for a
                   5117: view, that element is not displayed in that view and does not occupy any space
1.18      cvs      5118: (its extents are zero).</p>
1.30      cvs      5119: 
                   5120: <p>Visibility takes non-negative integer values (positive or zero).  If values
1.1       cvs      5121: greater than 1 are used, they allow the user to choose a degree of visibility
1.34    ! cvs      5122: and, thus, to see only those boxes whose visibility property exceeds a certain
        !          5123: threshold.  This gives the user control over the granularity of the displayed
        !          5124: pictures.</p>
1.30      cvs      5125: 
1.34    ! cvs      5126: <p>The visibility property can be defined as a constant or by inheritance. If
1.1       cvs      5127: defined by inheritance, it cannot be based on the value of the next or
1.18      cvs      5128: previous box.  Visibility can only be inherited from above.</p>
1.30      cvs      5129: 
                   5130: <p>If it is a numeric attribute's presentation rule, the visibility can be
1.1       cvs      5131: specified by the attribute's name, in which case the value of the attribute is
1.18      cvs      5132: used.</p>
                   5133: <pre>                   'Visibility' ':' NumberInherit
1.1       cvs      5134:      NumberInherit = Integer / AttrID / Inheritance .
1.18      cvs      5135:      Integer       = NUMBER .</pre>
1.30      cvs      5136: 
1.18      cvs      5137: <blockquote class="example">
1.30      cvs      5138:   <p><strong>Example:</strong></p>
                   5139: 
                   5140:   <p>Suppose that only <tt>Formula</tt> elements should be displayed in the
                   5141:   <tt>MathView</tt> view.  Then, the default rules should include:</p>
                   5142:   <pre>DEFAULT
1.18      cvs      5143:      IN MathView Visibility:0;</pre>
1.30      cvs      5144: 
1.31      cvs      5145:   <p>which makes all elements invisible in the <tt>MathView</tt> view.
1.30      cvs      5146:   However, the <tt>Formula</tt> element also has a <tt>Visibility</tt>
                   5147:   rule:</p>
                   5148:   <pre>Formula :
1.18      cvs      5149:      IN MathView Visibility:5;</pre>
1.30      cvs      5150: 
                   5151:   <p>which makes formulas, and only formulas, visible.</p>
1.18      cvs      5152: </blockquote>
                   5153: </div>
1.1       cvs      5154: 
1.18      cvs      5155: <div class="subsection">
1.34    ! cvs      5156: <h3><a name="sectc4225">Character style properties</a></h3>
1.1       cvs      5157: 
1.34    ! cvs      5158: <p>Four properties are used to determine which characters are used to display
1.18      cvs      5159: text.  They are size, font, style, and underlining.</p>
1.1       cvs      5160: 
1.18      cvs      5161: <div class="subsubsection">
1.30      cvs      5162: <h4><a name="sectd42251">Character size</a></h4>
                   5163: 
1.34    ! cvs      5164: <p>The size property has two effects.  First, it is used to specify the actual
        !          5165: size and distance units for boxes defined in <a href="#sectc4217">relative
        !          5166: units</a>.  Second, it defines the size of the characters contained in the
        !          5167: box.</p>
1.1       cvs      5168: 
1.30      cvs      5169: <p>As a distance or length, the size can be expressed in abstract or absolute
1.1       cvs      5170: units.  It can also be inherited.  If it is not inherited, it is expressed
1.18      cvs      5171: simply as an integer followed by the <tt>pt</tt> keyword, which indicates that
                   5172: the size is expressed in typographer's points. The absence of the <tt>pt</tt>
1.1       cvs      5173: keyword indicates that it is in abstract units in which the value 1 represents
                   5174: the smallest size while the value 16 is the largest size.  The relationship
                   5175: between these abstract sizes and the real character sizes is controlled by a
                   5176: table which can be modified statically or even dynamically during the
1.18      cvs      5177: execution of the Thot editor.</p>
1.30      cvs      5178: 
                   5179: <p>If the <tt>Size</tt> rule is a numeric attribute's presentation rule, the
1.34    ! cvs      5180: value of the size property can be specified by the attribute's name, in which
1.30      cvs      5181: case the value of the attribute is used.</p>
                   5182: 
                   5183: <p><strong>Note:</strong> the only unit available for  defining an absolute
                   5184: size is the typographer's point.  Centimeters and inches may not be used.</p>
                   5185: 
                   5186: <p>If the size is inherited, the rule must specify the relative from which to
                   5187: inherit and any percentage or difference from that relative's value. A
                   5188: percentage is indicated by a <tt>*</tt> followed by the value of the
                   5189: percentage and a <tt>%</tt>. A difference can be expressed in either
                   5190: typographer's points or in abstract units and the maximum or minimum size can
                   5191: be specified, but without specifying the unit: it is the same as was specified
                   5192: for the difference.</p>
                   5193: 
                   5194: <p>In a numeric attribute's presentation rule, the difference in size or the
1.22      cvs      5195: percentage can be indicated by the attribute's name instead of the numeric
                   5196: value, which means that the attribute's value should be used as the difference
                   5197: or percentage.  The attribute can also be used as the minimum or maximum size
                   5198: for a difference.</p>
                   5199: <pre>                      'Size' ':' SizeInherit
                   5200:      SizeInherit     = SizeAttr [ 'pt' ] /
                   5201:                        Kinship InheritedSize .
                   5202:      InheritedSize   ='+' SizeAttr [ 'pt' ]
                   5203:                        [ 'Max' MaxSizeAttr ] /
                   5204:                       '-' SizeAttr [ 'pt' ]
                   5205:                        [ 'Min' MinSizeAttr ] /
                   5206:                       '*' PercentSizeAttr '%' /
                   5207:                       '=' .
                   5208:      SizeAttr        = Size / AttrID .
                   5209:      Size            = NUMBER .
                   5210:      MaxSizeAttr     = MaxSize / AttrID .
                   5211:      MaxSize         = NUMBER .
                   5212:      MinSizeAttr     = MinSize / AttrID .
                   5213:      MinSize         = NUMBER .
                   5214:      PercentSizeAttr = PercentSize / AttrID .
                   5215:      PercentSize     = NUMBER .</pre>
1.30      cvs      5216: 
1.18      cvs      5217: <blockquote class="example">
1.30      cvs      5218:   <p><strong>Example:</strong></p>
                   5219: 
                   5220:   <p>The rule</p>
                   5221:   <pre>Size : Enclosing - 2 pt Min 7;</pre>
                   5222: 
                   5223:   <p>states that the character size is 2 points less than that of the
                   5224:   enclosing box, but that it may not be less than 7 points, whatever the
                   5225:   enclosing box's value.</p>
                   5226: 
                   5227:   <p>The following rules make the text of a report be displayed with
                   5228:   medium-sized characters (for example, size 5), while the title is displayed
                   5229:   with larger characters and the summary is displayed with smaller
                   5230:   characters:</p>
                   5231:   <pre>Report :
1.1       cvs      5232:      Size : 5;
                   5233: Title :
                   5234:      Size : Enclosing + 2;
                   5235: Summary :
1.18      cvs      5236:      Size : Enclosing - 1;</pre>
1.30      cvs      5237: 
                   5238:   <p>Thus, the character sizes in the entire document can be changed by
1.34    ! cvs      5239:   changing the size property of the Report element, while preserving the
1.30      cvs      5240:   relationships between the sizes of the different elements.</p>
1.18      cvs      5241: </blockquote>
                   5242: </div>
                   5243: 
                   5244: <div class="subsubsection">
1.30      cvs      5245: <h4><a name="sectd42252">Font and character style</a></h4>
1.18      cvs      5246: 
1.30      cvs      5247: <p>The <tt>Font</tt> rule determines the font family to be used to display the
1.18      cvs      5248: characters contained in the box, while the <tt>Style</tt> rule determines
1.23      cvs      5249: their style and the <tt>Weight</tt> rule determines their weight.  Thot
                   5250: recognizes three character fonts (Times, Helvetica, and Courier), three
                   5251: styles: Roman, Italics, and Oblique, and two weights: Normal and Bold.</p>
1.30      cvs      5252: 
                   5253: <p>The font family, style and weight can be specified by a named constant or
                   5254: can be inherited.  For the name of the font family only the first character is
                   5255: used.</p>
                   5256: 
                   5257: <p>Only identical inheritance is allowed: the box takes the same font, style
                   5258: or weight as the box from which it inherits.  This is indicated by an equals
1.23      cvs      5259: sign after the kinship specification.</p>
                   5260: <pre>               'Font' ':'          NameInherit /
                   5261:                'Style' ':'         StyleInherit /
                   5262:                'Weight' ':'        WeightInherit /
                   5263: 
                   5264: NameInherit   = Kinship '=' / FontName .
                   5265: FontName      = NAME .
                   5266: StyleInherit  = Kinship '=' /
                   5267:                 'Roman' / 'Italics' / 'Oblique' .
                   5268: WeightInherit = Kinship '=' /
                   5269:                 'Normal' / 'Bold' .</pre>
1.30      cvs      5270: 
1.18      cvs      5271: <blockquote class="example">
1.30      cvs      5272:   <p><strong>Example:</strong></p>
                   5273: 
                   5274:   <p>To specify that the summary uses the font family of the rest of the
                   5275:   document, but in the italic style, the following rules are used:</p>
                   5276:   <pre>Summary :
1.1       cvs      5277:    BEGIN
                   5278:    Font : Enclosing =;
                   5279:    Style : Italics;
1.18      cvs      5280:    END;</pre>
                   5281: </blockquote>
                   5282: </div>
                   5283: 
                   5284: <div class="subsubsection">
1.30      cvs      5285: <h4><a name="sectd42253">Underlining</a></h4>
1.18      cvs      5286: 
1.30      cvs      5287: <p>The <tt>Underline</tt> rule is used to specify if the characters contained
                   5288: in a box should have lines drawn on or near them.  There are four underlining
1.18      cvs      5289: styles: <tt>Underlined</tt>, <tt>Overlined</tt>, <tt>CrossedOut</tt>, and
                   5290: <tt>NoUnderline</tt>.  The <tt>Thickness</tt> rule specifies the thickness of
                   5291: the line, <tt>Thin</tt> or <tt>Thick</tt>.</p>
1.30      cvs      5292: 
                   5293: <p>As with font family and style, only identical inheritance is allowed: the
                   5294: box has the same underlining type as the box from which it inherits the value.
1.18      cvs      5295: This is indicated by an equals sign after the kinship specification.</p>
                   5296: <pre>                   'Underline' ':' UnderLineInherit /
1.1       cvs      5297:                    'Thickness' ':' ThicknessInherit /
                   5298: 
                   5299: UnderLineInherit = Kinship '=' / 'NoUnderline' /
                   5300:                    'Underlined' / 
                   5301:                    'Overlined' / 'CrossedOut' .
1.18      cvs      5302: ThicknessInherit = Kinship '=' / 'Thick' / 'Thin' .</pre>
                   5303: </div>
                   5304: </div>
                   5305: 
                   5306: <div class="subsection">
1.30      cvs      5307: <h3><a name="sectc4226">Stacking order</a></h3>
1.18      cvs      5308: 
1.30      cvs      5309: <p>The <tt>Depth</tt> rule is used to define the stacking order of terminal
                   5310: boxes when multiple boxes at least partially overlap.  This rule defines how
1.34    ! cvs      5311: the depth property, which is zero or a positive integer, is calculated.  The
        !          5312: depth property has a value for all boxes.  For terminal boxes in the structure
        !          5313: and for presentation boxes, the depth value is used during display and
        !          5314: printing: the boxes with the lowest value overlap those with higher depths.
        !          5315: For non-terminal boxes, the depth is not interpreted during display, but it is
        !          5316: used to calculate the depth of terminal boxes by inheritance.</p>
1.30      cvs      5317: 
                   5318: <p>Like most other rules, the depth rule is defined in the <a
1.18      cvs      5319: href="#sectc427">default rules</a> of each presentation schema.  Thus, there
                   5320: is always a depth value, even when it is not necessary because there is no
                   5321: overlapping.  To avoid useless operations, a zero value can be given to the
1.34    ! cvs      5322: depth property, which signifies that overlapping is never a problem.</p>
1.30      cvs      5323: 
                   5324: <p>The depth rule has the same form as the <a href="#sectc4224">visibility
1.18      cvs      5325: rule</a>. It can be defined by inheritance or by a constant numeric value.
                   5326: When the rule is attached to a numeric attribute, it can take the value of
                   5327: that attribute.</p>
                   5328: <pre>                'Depth' ':' NumberInherit</pre>
1.30      cvs      5329: 
1.18      cvs      5330: <blockquote class="example">
1.30      cvs      5331:   <p><strong>Example:</strong></p>
                   5332: 
                   5333:   <p>For a purely textual document, in which overlapping never poses a
                   5334:   problem, a single default <tt>Depth</tt> rule in the presentation schema is
                   5335:   sufficient:</p>
                   5336:   <pre>DEFAULT
1.1       cvs      5337:     Depth : 0;
1.18      cvs      5338:     ...</pre>
1.30      cvs      5339: 
                   5340:   <p>To make the text of examples appear on a light blue background, a
                   5341:   presentation box is defined:</p>
                   5342:   <pre>BOXES
1.1       cvs      5343:    BlueBG :
                   5344:       BEGIN
                   5345:       Content : Graphics 'R';
                   5346:       Background : LightBlue3;
                   5347:       FillPattern: backgroundcolor;
                   5348:       Depth : 2;
                   5349:       ...
1.18      cvs      5350:       END;</pre>
1.30      cvs      5351: 
                   5352:   <p>and is created by the <tt>Example</tt> element, which has the rules:</p>
                   5353:   <pre>RULES
1.1       cvs      5354:    Example :
                   5355:       BEGIN
                   5356:       CreateFirst (BlueBG);
                   5357:       Depth : 1;
                   5358:       ...
1.18      cvs      5359:       END;</pre>
1.30      cvs      5360: 
                   5361:   <p>In this way, the text of an example (if it inherits its depth from its
                   5362:   ancestor) will be superimposed on a light blue background, and not the
                   5363:   reverse).</p>
1.18      cvs      5364: </blockquote>
                   5365: </div>
                   5366: 
                   5367: <div class="subsection">
1.30      cvs      5368: <h3><a name="sectc4227">Line style</a></h3>
1.18      cvs      5369: 
1.30      cvs      5370: <p>The <tt>LineStyle</tt> rule determines the style of line which should be
                   5371: used to draw all the elements contained in the box and the box itself, if it
                   5372: has a <a href="#sectc4230a"><tt>ShowBox</tt> rule</a>.  The line style can be
1.18      cvs      5373: indicated by a name (<tt>Solid</tt>, <tt>Dashed</tt>, <tt>Dotted</tt>) or it
1.13      cvs      5374: can be inherited.  All elements of the graphic base type are affected by this
1.1       cvs      5375: rule, but it can be attached to any box and transmitted by inheritance to the
1.18      cvs      5376: graphic elements.  The border of elements having a <a
                   5377: href="#sectc4230a"><tt>ShowBox</tt> rule</a> is drawn according to the line
                   5378: style specified by this rule.</p>
1.30      cvs      5379: 
                   5380: <p>Only identical inheritance is allowed: the box takes the same line style as
1.1       cvs      5381: the box from which it inherits.  This is indicated by an equals sign after the
1.18      cvs      5382: kinship specification.</p>
                   5383: <pre>                      'LineStyle' ':' LineStyleInherit
1.1       cvs      5384:      LineStyleInherit = Kinship '=' /
1.18      cvs      5385:                       'Solid' / 'Dashed' / 'Dotted' .</pre>
1.30      cvs      5386: 
1.18      cvs      5387: <blockquote class="example">
1.30      cvs      5388:   <p><strong>Example:</strong></p>
                   5389: 
                   5390:   <p>To specify that, in Figures, the graphical parts should be drawn in solid
                   5391:   lines, the Figure element is given a rule using the <tt>Solid</tt> name:</p>
                   5392:   <pre>Figure :
1.18      cvs      5393:    LineStyle : Solid;</pre>
1.30      cvs      5394: 
                   5395:   <p>and the elements composing figures are given an inheritance rule:</p>
                   5396:   <pre>   LineStyle : Enclosing =;</pre>
1.18      cvs      5397: </blockquote>
                   5398: </div>
                   5399: 
                   5400: <div class="subsection">
1.30      cvs      5401: <h3><a name="sectc4228">Line thickness</a></h3>
1.18      cvs      5402: 
1.30      cvs      5403: <p>The <tt>LineWeight</tt> rule determines the thickness of the lines  of all
1.1       cvs      5404: graphical elements which appear in the box, no matter what their line style.
                   5405: Line thickness can be specified by a constant value or by inheritance.  A
                   5406: constant value is a positive number followed by an optional unit specification
1.18      cvs      5407: (which is absent when using relative units).  All available <a
                   5408: href="#sectc4217">distance units</a> can be used.  Line thickness is expressed
                   5409: in the same way as <a href="#sectd42221">line spacing</a>.</p>
                   5410: <pre>                 'LineWeight' ':' DistOrInherit</pre>
1.30      cvs      5411: 
                   5412: <p>All elements of the graphic base type are affected by this rule, but it can
                   5413: be attached to any box and transmitted by inheritance to the graphic elements.
1.18      cvs      5414: The border of element having a <a href="#sectc4230a"><tt>ShowBox</tt> rule</a>
                   5415: is also drawn according to the thickness specified by this rule.</p>
1.30      cvs      5416: 
1.18      cvs      5417: <blockquote class="example">
1.30      cvs      5418:   <p><strong>Example:</strong></p>
                   5419: 
                   5420:   <p>To specify that, in Figures, the graphical parts should be drawn with
                   5421:   lines 0.3 pt thick, the Figure element is given this rule:</p>
                   5422:   <pre>Figure :
1.18      cvs      5423:    LineWeight : 0.3 pt;</pre>
1.30      cvs      5424: 
                   5425:   <p>and the elements composing figures are given an inheritance rule:</p>
                   5426:   <pre>   LineWeight : Enclosing =;</pre>
1.18      cvs      5427: </blockquote>
                   5428: </div>
                   5429: 
                   5430: <div class="subsection">
1.30      cvs      5431: <h3><a name="sectc4229">Fill pattern</a></h3>
1.18      cvs      5432: 
1.30      cvs      5433: <p>The <tt>FillPattern</tt> rule determines the pattern used to fill closed
1.1       cvs      5434: graphical elements (circles, rectangles, etc.) which appear in the box.  This
1.18      cvs      5435: rule also specifies the pattern used to fill the box associated with elements
                   5436: having a <a href="#sectc4230a"><tt>ShowBox</tt> rule</a><a>.  This pattern can
                   5437: be indicated by a named constant or by inheritance.  The named constant
                   5438: identifies one of the patterns available in Thot.  The names of the available
                   5439: patterns are: nopattern, foregroundcolor, backgroundcolor, gray1, gray2,
                   5440: gray3, gray4, gray5, gray6, gray7, horiz1, horiz2, horiz3, vert1, vert2,
                   5441: vert3, left1, left2, left3, right1, right2, right3, square1, square2, square3,
                   5442: lozenge, brick, tile, sea, basket.</a></p>
1.30      cvs      5443: 
                   5444: <p>Like the other rules peculiar to graphics, <tt>LineStyle</tt> and
1.18      cvs      5445: <tt>LineWeight</tt>, only elements of the graphic base type are affected by
                   5446: the <tt>FillPattern</tt> rule, but the rule can be attached to any box and
1.1       cvs      5447: transmitted by inheritance to the graphic elements.  As with the other rules
1.18      cvs      5448: specific to graphics, only identical inheritance is allowed.</p>
1.30      cvs      5449: 
                   5450: <p>The <tt>FillPattern</tt> rule can also be used to determine whether or not
1.12      cvs      5451: text characters, symbols and pictures should be colored.  For these element
                   5452: types (text, symbols, and pictures), the only valid values are
1.18      cvs      5453: <tt>nopattern</tt>, <tt>foregroundcolor</tt>, and <tt>backgroundcolor</tt>.
                   5454: When <tt>FillPattern</tt> has the value <tt>backgroundcolor</tt>, text
                   5455: characters, symbols, and bitmaps are given the color specified by the <a
                   5456: href="#sectc4230"><tt>Background</tt> rule</a> which applies to these
                   5457: elements.  When <tt>FillPattern</tt> has the value <tt>foregroundcolor</tt>,
                   5458: these same elements are given the color specified by the <a
                   5459: href="#sectc4230"><tt>Foreground</tt> rule</a> which applies to these
                   5460: elements.  In all other case, text characters are not colored.</p>
                   5461: <pre>                 'FillPattern' ':' NameInherit</pre>
1.30      cvs      5462: 
1.18      cvs      5463: <blockquote class="example">
1.30      cvs      5464:   <p><strong>Example:</strong></p>
                   5465: 
                   5466:   <p>To specify that, in Figures, the closed graphical elements should be
                   5467:   filled with a pattern resembling a brick wall, the Figure element is given
                   5468:   this rule:</p>
                   5469:   <pre>Figure :
1.18      cvs      5470:    FillPattern : brick;</pre>
1.30      cvs      5471: 
                   5472:   <p>and the elements composing figures are given an inheritance rule:</p>
                   5473:   <pre>   FillPattern : Enclosing =;</pre>
1.18      cvs      5474: </blockquote>
                   5475: </div>
                   5476: 
                   5477: <div class="subsection">
1.30      cvs      5478: <h3><a name="sectc4230">Colors</a></h3>
1.18      cvs      5479: 
1.30      cvs      5480: <p>The <tt>Foreground</tt> and <tt>Background</tt> rules determine the
                   5481: foreground and background colors of the base elements which appear in the box.
                   5482: They also control the color of boxes associated with elements having a <a
1.18      cvs      5483: href="#sectc4230a"><tt>ShowBox</tt> rule</a>.  These colors can be specified
                   5484: with a named constant or by inheritance.  The named constants specify one of
                   5485: the available colors in Thot.  The available color names can be found in the
1.30      cvs      5486: file <tt>thot.color</tt>. In addition to those names, you can use the keyword
                   5487: <code>Transparent</code>, to not draw anything.</p>
                   5488: 
                   5489: <p>The color rules affect the same way all base elements and elements having a
                   5490: <a href="#sectc4230a"><tt>ShowBox</tt> rule</a>, no matter what their type
                   5491: (text, graphics, pictures, symbols).  The color rules can be associated with
                   5492: any box and can be transmitted by inheritance to the base elements or the
                   5493: elements having a <a href="#sectc4230a"><tt>ShowBox</tt> rule</a>.  Like the
                   5494: preceding rules, only inheritance of the same value is allowed.</p>
                   5495: <pre>                 'Foreground' ':' Color
                   5496:                  'Background' ':' Color
                   5497:       Color = 'Transparent' / Link '=' / FontColorName .</pre>
                   5498: 
                   5499: <p><strong>Note:</strong> text colors only appear for text elements whose <a
1.18      cvs      5500: href="#sectc4229">fill pattern</a> does not prevent the use of color.</p>
1.30      cvs      5501: 
1.18      cvs      5502: <blockquote class="example">
1.30      cvs      5503:   <p><strong>Example:</strong></p>
                   5504: 
                   5505:   <p>To specify that, in Figures, everything must be drawn in blue on a
                   5506:   background of yellow, the Figure element is given these rules:</p>
                   5507:   <pre>Figure :
1.1       cvs      5508:    BEGIN
                   5509:    Foreground : Blue;
                   5510:    Background : Yellow;
                   5511:    Fillpattern : backgroundcolor;
1.18      cvs      5512:    END;</pre>
1.30      cvs      5513: 
                   5514:   <p>and the elements composing figures are given inheritance rules:</p>
                   5515:   <pre>   Foreground : Enclosing =;
1.1       cvs      5516:    Background : Enclosing =;
1.18      cvs      5517:    FillPattern : Enclosing =;</pre>
                   5518: </blockquote>
                   5519: </div>
                   5520: 
                   5521: <div class="subsection">
1.30      cvs      5522: <h3><a name="sectc4230a">Background color and border</a></h3>
1.18      cvs      5523: 
1.30      cvs      5524: <p>Boxes associated with structural elements are normally not visible, but it
                   5525: is possible to draw their border and/or to paint their area when it is needed.
1.18      cvs      5526: This is achieved by associating the <tt>ShowBox</tt> rule with the concerned
1.13      cvs      5527: element.  This rule has no parameter and no value. It is simply written
1.18      cvs      5528: <tt>Showbox;</tt>. It is not inherited nor transmitted to any other element.
                   5529: It applies only to the element with which it is associated.</p>
                   5530: <pre>                 'ShowBox'</pre>
1.30      cvs      5531: 
                   5532: <p>When an element has a <tt>ShowBox</tt> rule, the border is drawn only if
                   5533: the <tt>LineWeight</tt> rule that applies to that element has a non-zero value
1.18      cvs      5534: (this value can be inherited).  The color, style and thickness of the border
                   5535: are defined by the <tt>Foreground</tt>, <tt>LineStyle</tt>, and
                   5536: <tt>LineWeight</tt> rules that apply to the element.</p>
1.30      cvs      5537: 
                   5538: <p>When an element has a <tt>ShowBox</tt> rule, the background of this element
                   5539: is paint only if the value of the <tt>FillPattern</tt> rule that applies to
                   5540: that element is not <tt>nopattern</tt>.  The pattern and color(s) of the
                   5541: background are defined by the <tt>FillPattern</tt>, <tt>Background</tt>, and
1.18      cvs      5542: <tt>Foreground</tt> rules that apply to the element.</p>
                   5543: </div>
                   5544: 
                   5545: <div class="subsection">
1.30      cvs      5546: <h3><a name="sectc4230b">Background pictures</a></h3>
1.18      cvs      5547: 
1.30      cvs      5548: <p>The <tt>BackgroundPicture</tt> rule allows to display a picture as the
1.13      cvs      5549: background of an element.  It has a single parameter, the file name of the
1.18      cvs      5550: picture.  This is a string delimited by single quotes.  If the first character
                   5551: in this string is '/', it is considered as an absolute path, otherwise the
                   5552: file is searched for along the schema directory path.  This file may contain a
                   5553: picture in any format accepted by Thot (xbm, xpm, gif, jpeg, png, etc.)</p>
1.30      cvs      5554: 
                   5555: <p>The <tt>BackgroundPicture</tt> and <tt>PictureMode</tt> rules apply only to
1.13      cvs      5556: the element with which they are associated.  They are not inherited nor
1.18      cvs      5557: transmitted to children elements.</p>
1.30      cvs      5558: 
                   5559: <p>The background picture has not always the same size as the element's box.
1.13      cvs      5560: There are diffrent ways to fill the element box with the picture.  This is
1.18      cvs      5561: specified by the <tt>PictureMode</tt> rule, which should be associated to the
                   5562: same element.  This rule may take one of the following values:</p>
                   5563: <dl>
1.30      cvs      5564:   <dt><tt>NormalSize</tt></dt>
                   5565:     <dd>The picture is centered in the box, and clipped if it is too
                   5566:     large.</dd>
                   5567:   <dt><tt>Scale</tt></dt>
                   5568:     <dd>The picture is zoomed to fit the box size.</dd>
                   5569:   <dt><tt>RepeatX</tt></dt>
                   5570:     <dd>The picture is repeated horizontally to fit the box width.</dd>
                   5571:   <dt><tt>RepeatY</tt></dt>
                   5572:     <dd>The picture is repeated vertically to fit the box height.</dd>
                   5573:   <dt><tt>RepeatXY</tt></dt>
                   5574:     <dd>The picture is repeated both horizontally and vertically to fill the
                   5575:       box.</dd>
1.18      cvs      5576: </dl>
1.30      cvs      5577: 
                   5578: <p>If an element has a <tt>BackgroundPicture</tt> rule and no
1.18      cvs      5579: <tt>PictureMode</tt> rule, the <tt>NormalSize</tt> value is assumed.</p>
                   5580: <pre>                 'BackgroundPicture' ':' FileName /
1.13      cvs      5581:                  'PictureMode' ':' PictMode .
                   5582:  
                   5583:       FileName = STRING .
1.18      cvs      5584:       PictMode = 'NormalSize' / 'Scale' / 'RepeatXY' / 'RepeatX' / 'RepeatY' .</pre>
1.30      cvs      5585: 
                   5586: <p>The <tt>BackgroundPicture</tt> and <tt>PictureMode</tt> rules apply only to
1.13      cvs      5587: the element with which they are associated.  They are not inherited nor
1.18      cvs      5588: transmitted to children elements.</p>
                   5589: </div>
1.13      cvs      5590: 
1.18      cvs      5591: <div class="subsection">
1.30      cvs      5592: <h3><a name="sectc4231">Presentation box content</a></h3>
1.1       cvs      5593: 
1.30      cvs      5594: <p>The <tt>Content</tt> rule applies to presentation boxes.  It indicates the
1.1       cvs      5595: content given to a box.  This content is either a variable's value or a
1.18      cvs      5596: constant value.  In the special case of <a href="#sectc4233">header or footer
                   5597: boxes</a>, the content can also be a structured element type.</p>
1.30      cvs      5598: 
                   5599: <p>If the content is a constant, it can be specified, as in a variable
1.18      cvs      5600: declaration, either by the name of a constant declared in the <tt>CONST</tt>
1.1       cvs      5601: section or by direct specification of the type and value of the box's
1.18      cvs      5602: content.</p>
1.30      cvs      5603: 
                   5604: <p>Similarly, if it is a variable, the name of a variable declared in
1.18      cvs      5605: <tt>VAR</tt> section can be given or the variable may be defined within
                   5606: parentheses.  The content inside the parentheses has the same syntax as a <a
                   5607: href="#sectc426">variable declaration</a>.</p>
1.30      cvs      5608: 
                   5609: <p>When the content is a structured element type, the name of the element type
                   5610: is given after the colon.  In this case,  the box's content is all elements of
1.1       cvs      5611: the named type which are designated by references which are part of the page
1.18      cvs      5612: on which the header or footer with this <tt>Content</tt> rule appears.  Only
                   5613: associated elements can appear in a <tt>Content</tt> rule and the structure
1.1       cvs      5614: must provide references to these elements.  Moreover, the box whose content
                   5615: they are must be a header or footer box generated by a page box of the primary
1.18      cvs      5616: view.</p>
                   5617: <pre>               'Content' ':' VarConst
1.1       cvs      5618:      VarConst = ConstID / ConstType ConstValue /
                   5619:                 VarID / '(' FunctionSeq ')' /
1.18      cvs      5620:                 ElemID .</pre>
1.30      cvs      5621: 
                   5622: <p>A presentation box can have only one <tt>Content</tt> rule, which means
                   5623: that the content of a presentation box cannot vary from view to view. However,
                   5624: such an effect can be achieved by creating several presentation boxes, each
                   5625: with different content and visible in different views.</p>
                   5626: 
                   5627: <p>The <tt>Content</tt> rule also applies to elements defined as references in
1.1       cvs      5628: the structure schema.  In this case, the content defined by the rule  must be
                   5629: a constant.  It is this content which appears on the screen or paper to
                   5630: represent references of the type to which the rule applies.  A reference can
1.18      cvs      5631: have a <tt>Content</tt> rule or a <a href="#sectc4234"><tt>Copy</tt> rule</a>
1.1       cvs      5632: for each view.  If neither of these rules appears, the reference is displayed
1.18      cvs      5633: as <tt>[*]</tt>, which is equivalent to the rule:</p>
                   5634: <pre>     Content: Text '[*]';</pre>
1.30      cvs      5635: 
1.18      cvs      5636: <blockquote class="example">
1.30      cvs      5637:   <p><strong>Example:</strong></p>
                   5638: 
                   5639:   <p>The content of the presentation box created to make the chapter number
                   5640:   and section number appear before each section title can be defined by:</p>
                   5641:   <pre>BOXES
1.1       cvs      5642:      SectionNumBox :
                   5643:           BEGIN
                   5644:           Content : NumSection;
                   5645:           ...
1.18      cvs      5646:           END;</pre>
1.30      cvs      5647: 
                   5648:   <p>if the <tt>NumSection</tt> variable has been defined in the variable
                   5649:   definition section of the presentation schema.  Otherwise the
                   5650:   <tt>Content</tt> would be written:</p>
                   5651:   <pre>BOXES
1.1       cvs      5652:      SectionNumBox :
                   5653:           BEGIN
                   5654:           Content : (VALUE (ChapterCtr, Roman) TEXT '.'
                   5655:                      VALUE (SectionCtr, Arabic));
                   5656:           ...
1.18      cvs      5657:           END;</pre>
1.30      cvs      5658: 
                   5659:   <p>To specify that a page footer should contain all elements of the
                   5660:   <tt>Note</tt> type are referred to in the page, the following rule is
                   5661:   written:</p>
                   5662:   <pre>BOXES
1.1       cvs      5663:      NotesFooterBox :
                   5664:           BEGIN
                   5665:           Content : Note;
                   5666:           ...
1.18      cvs      5667:           END;</pre>
1.30      cvs      5668: 
                   5669:   <p><tt>Note</tt> is defined as an associated element in the structure schema
                   5670:   and NotesFooterBox is created by a page box of the primary view.</p>
1.18      cvs      5671: </blockquote>
                   5672: </div>
1.1       cvs      5673: 
1.18      cvs      5674: <div class="subsection">
1.30      cvs      5675: <h3><a name="sectc4232">Presentation box creation</a></h3>
1.1       cvs      5676: 
1.30      cvs      5677: <p>A creation rule specifies that a presentation box should be created when an
1.18      cvs      5678: element of the type to which the rule is attached appears in the document.</p>
1.30      cvs      5679: 
                   5680: <p>A keyword specifies the position, relative to the creating box, at which
                   5681: the created box will be placed in the structure:</p>
1.18      cvs      5682: <dl>
1.30      cvs      5683:   <dt><tt>CreateFirst</tt></dt>
                   5684:     <dd>specifies that the box should be created as the first box of the next
                   5685:       lower level, before any already existing boxes, and only if the
                   5686:       beginning of the creating element is visible;</dd>
                   5687:   <dt><tt>CreateLast</tt></dt>
                   5688:     <dd>specifies that the box should be created as the last box of the next
                   5689:       lower level, after any existing boxes, and only if the end of the
                   5690:       creating element is visible;</dd>
                   5691:   <dt><tt>CreateBefore</tt></dt>
                   5692:     <dd>specifies that the box should be created before the creating box, on
                   5693:       the same level as the creating box, and only if the beginning of the
                   5694:       creating element is visible;</dd>
                   5695:   <dt><tt>CreateAfter</tt></dt>
                   5696:     <dd>specifies that the box should be created after the creating box, on
                   5697:       the same level as the creating box, and only if the beginning of the
                   5698:       creating element is visible;</dd>
                   5699:   <dt><tt>CreateEnclosing</tt></dt>
                   5700:     <dd>specifies that the box should be created at the upper level relatively
                   5701:       to the creating box, and that it must contain that creating box and all
                   5702:       presentation boxes created by the same creating box.</dd>
1.18      cvs      5703: </dl>
1.30      cvs      5704: 
                   5705: <p>This keyword can be followed by the <tt>Repeated</tt> keyword to indicate
                   5706: that the box must be created for each part of the creating element. These
                   5707: parts result from the division of the element by page breaks or column
                   5708: changes.  If the <tt>Repeated</tt> keyword is missing, the box is only created
                   5709: for the first part of the creating element (<tt>CreateFirst</tt> and
1.18      cvs      5710: <tt>CreateBefore</tt> rules) or for the last part (<tt>CreateLast</tt> and
                   5711: <tt>CreateAfter</tt> rules).</p>
1.30      cvs      5712: 
                   5713: <p>The type of presentation to be created is specified at the end of the rule
1.18      cvs      5714: between parentheses.</p>
1.30      cvs      5715: 
                   5716: <p>Creation rules cannot appear in the <a href="#sectc427">default
                   5717: presentation rules</a>.  The boxes being created should have a
                   5718: <tt>Content</tt> rule which indicates their <a
                   5719: href="#sectc4231">content</a>.</p>
                   5720: 
                   5721: <p>Creation rules can only appear in the block of rules for the primary view;
1.1       cvs      5722: creation is provoked by a document element for all views. However, for each
                   5723: view, the presentation box is only created if the creating element is itself a
1.34    ! cvs      5724: box in the view. Moreover, the visibility property of the presentation box can
        !          5725: be adjusted to control the creation of the box on a view-by-view basis.</p>
1.18      cvs      5726: <pre>                     Creation '(' BoxID ')'
1.1       cvs      5727:      Creation      = Create [ 'Repeated' ] .
                   5728:      Create        ='CreateFirst' / 'CreateLast' /
                   5729:                     'CreateBefore' / 'CreateAfter' /
1.18      cvs      5730:                     'CreateEnclosing' .</pre>
1.30      cvs      5731: 
1.18      cvs      5732: <blockquote class="example">
1.30      cvs      5733:   <p><strong>Example:</strong></p>
                   5734: 
                   5735:   <p>Let us define an object type, called Table, which is composed of a
                   5736:   sequence of columns, all having the same fixed width, where the columns are
                   5737:   separated by vertical lines.  There is a line to the left of the first
                   5738:   column and one to the right of the last.  Each column has a variable number
1.31      cvs      5739:   of cells, placed one on top of the other and separated by horizontal lines.
                   5740:   There are no horizontal lines above the first cell or below the last cell.
1.30      cvs      5741:   The text contained in each cell is  broken into lines and these lines are
                   5742:   centered horizontally in the cell. The logical structure of this object is
                   5743:   defined by:</p>
                   5744:   <pre>Table   = LIST OF (Column);
1.18      cvs      5745: Column  = LIST OF (Cell = Text);</pre>
                   5746: 
1.30      cvs      5747:   <div class="figure">
                   5748:   <hr>
                   5749:   <pre>|                |                |               |
1.1       cvs      5750: |  xx xxxx xxxx  |x xxxx xxx xxxxx|  x xxx x xxx  |
                   5751: | xxx xxx xxxx x |   x xx x xxx   | xxxxx xxxx xx |
                   5752: |   xxxxx xxxx   |----------------|  xxx xxxxx x  |
                   5753: | xxxxx xxx xxxx | xxxx xx xx xxx |     xx xx     |
                   5754: | xxx xxxx x xxx |  xxxx x xxx x  |---------------|
                   5755: |----------------| xxx xxxx xxxxx |  xxxxx xxxxx  |
                   5756: | xxx xxx xxxxxx |----------------| xxx xxxx xxxx |
                   5757: |  xxxx xxxx xx  |  xxxx xx x xx  |  xxx xx x xx  |
                   5758: |----------------| xxx xxxxx xxxx | xxxx xxxx xxx |
                   5759: | xxxxx xxx xxxx |  xxxx xx x xx  |   xxxxx xxx   |
1.18      cvs      5760: |xxxx xx x xxxxxx| xxxx xx xxxxxx |  xxxxx xxxxx  |</pre>
1.19      cvs      5761: 
1.30      cvs      5762:   <p align="center"><em><a name="table">The design of a table</a></em></p>
                   5763:   <hr>
                   5764:   </div>
                   5765: 
                   5766:   <p>The presentation of the table should resemble the design of the above <a
                   5767:   href="#table">figure</a>.  It is defined by the following presentation
                   5768:   schema fragment:</p>
                   5769:   <pre>BOXES
1.1       cvs      5770:      VertLine : BEGIN
                   5771:                 Width : 0.3 cm;
                   5772:                 Height : Enclosing . Height;
                   5773:                 VertPos : Top = Enclosing . Top;
                   5774:                 HorizPos : Left = Previous . Right;
                   5775:                 Content : Graphics 'v';
                   5776:                 END;
                   5777: 
                   5778:      HorizLine: BEGIN
                   5779:                 Width : Enclosing . Width;
                   5780:                 Height : 0.3 cm;
                   5781:                 VertPos : Top = Previous . Bottom;
                   5782:                 HorizPos : Left = Enclosing . Left;
                   5783:                 Content : Graphics 'h';
                   5784:                 END;
                   5785: 
                   5786: RULES
1.6       cvs      5787:      Column   : BEGIN
                   5788:                 CreateBefore (VertLine);
                   5789:                 IF LAST CreateAfter (VertLine);
                   5790:                 Width : 2.8 cm;
                   5791:                 Height : Enclosed . Height;
                   5792:                 VertPos : Top = Enclosing . Top;
                   5793:                 HorizPos : Left = Previous . Right;
                   5794:                 END;
                   5795: 
                   5796:      Cell     : BEGIN
                   5797:                 IF NOT FIRST CreateBefore (HorizLine);
                   5798:                 Width : Enclosing . Width;
                   5799:                 Height : Enclosed . Height;
                   5800:                 VertPos : Top = Previous . Bottom;
                   5801:                 HorizPos : Left = Enclosing . Left;
                   5802:                 Line;
                   5803:                 Adjust : VMiddle;
1.18      cvs      5804:                 END;</pre>
1.30      cvs      5805: 
                   5806:   <p>It is useful to note that the horizontal position rule of the first
                   5807:   vertical line will not be applied, since there is no preceding box. In this
                   5808:   case, the box is simply placed on the left side of the enclosing box.</p>
1.18      cvs      5809: </blockquote>
                   5810: </div>
                   5811: 
                   5812: <div class="subsection">
1.30      cvs      5813: <h3><a name="sectc4233">Page layout</a></h3>
1.18      cvs      5814: 
1.30      cvs      5815: <p>The page models specified in the <tt>Page</tt> rule are defined by boxes
1.18      cvs      5816: declared in the <tt>BOXES</tt> section of the presentation schema.  Pages are
1.1       cvs      5817: not described as frames which will be filled by the document's text, but as
                   5818: element are inserted in the flow of the document and which mark the page
                   5819: breaks.  Each of these page break elements contains presentation boxes which
                   5820: represent the footer boxes of a page followed by header boxes of the next
                   5821: page.  The page box itself is the simple line which separates two pages on the
                   5822: screen.  Both the footer and header boxes placed themselves with respect to
                   5823: this page box, with the footer being placed above it and the header boxes
1.18      cvs      5824: being placed above it.</p>
1.30      cvs      5825: 
                   5826: <p>The boxes created by a page box are headers and footers and can only place
1.1       cvs      5827: themselves vertically with respect to the page box itself (which is in fact
                   5828: the separation between two pages).  Besides, it is their vertical position
                   5829: rule  which determines whether they are header or footer boxes.  Header and
                   5830: footer boxes must have an explicit vertical position rule (they must not use
1.18      cvs      5831: the default rule).</p>
1.30      cvs      5832: 
                   5833: <p>Footer boxes must have an absolute height or inherit the height of their
1.18      cvs      5834: contents:</p>
                   5835: <pre>Height : Enclosed . Height;</pre>
1.30      cvs      5836: 
                   5837: <p>A page box must have height and width rules and these two rules must be
1.1       cvs      5838: specified with constant values, expressed in centimeters, inches, or
                   5839: typographer's points.  These two rules are interpreted in a special way for
                   5840: page boxes:  they determine the width of the page and the vertical distance
                   5841: between two page separators, which is the height of the page and its header
1.18      cvs      5842: and footer together.</p>
1.30      cvs      5843: 
                   5844: <p>A page box should also have vertical and horizontal position rules and
                   5845: these two rules should specify the position on the sheet of paper of the
                   5846: rectangle enclosing the page's contents.  These two rules must position the
                   5847: upper left corner of the enclosing rectangle in relation to the upper left
                   5848: corner of the sheet of paper, considered to be the enclosing element.  In both
                   5849: rules, distances must be expressed in fixed units: centimeters (<tt>cm</tt>),
                   5850: inches (<tt>in</tt>), or typographer's points (<tt>pt</tt>).  Thus, rules
                   5851: similar to the following should be found in the rules for a page box:</p>
1.18      cvs      5852: <pre>BOXES
1.1       cvs      5853:    ThePage :
                   5854:       BEGIN
                   5855:       VertPos : Top = Enclosing . Top + 3 cm;
                   5856:       HorizPos : Left = Enclosing . Left + 2.5 cm;
                   5857:       Width : 16 cm;
                   5858:       Height : 22.5 cm;
1.18      cvs      5859:       END;</pre>
1.30      cvs      5860: 
                   5861: <p>When a document must be page broken, the page models to be constructed are
1.18      cvs      5862: defined in the <tt>BOXES</tt> section of the presentation schema by declaring
                   5863: page boxes and header and footer boxes.  Also, the <tt>Page</tt> rule is used
1.1       cvs      5864: to specify to which parts of the document and to which views each model should
1.18      cvs      5865: be applied.</p>
1.30      cvs      5866: 
                   5867: <p>The <tt>Page</tt> rule has only one parameter, given between parentheses
                   5868: after the <tt>Page</tt> keyword.  This parameter is the name of the box which
                   5869: must serve as the model for page construction.  When a <tt>Page</tt> rule is
1.1       cvs      5870: attached to an element type, each time such an element appears in a document,
                   5871: a page break takes place and the page model indicated in the rule is applied
                   5872: to all following pages, until reaching the next element which has a
1.18      cvs      5873: <tt>Page</tt> rule.</p>
1.30      cvs      5874: 
                   5875: <p>The <tt>Page</tt> rule applies to only one view; if it appears in the
                   5876: primary view's block of rules, a <tt>Page</tt> rule applies only to that view.
                   5877: Thus, different page models can be defined for the full document and for its
                   5878: table of contents, which is another view of the same document. Some views can
                   5879: be specified with pages, and other views of the same document can be specified
1.18      cvs      5880: without pages.</p>
                   5881: <pre>                   'Page' '(' BoxID ')'</pre>
                   5882: </div>
                   5883: 
                   5884: <div class="subsection">
1.30      cvs      5885: <h3><a name="sectc4234">Box copies</a></h3>
1.18      cvs      5886: 
1.30      cvs      5887: <p>The <tt>Copy</tt> rule can be used for an element which is defined as a
1.7       cvs      5888: reference in the structure schema.  In this case, the rule specifies, between
1.18      cvs      5889: parenthesis, the name of the box (declared in the <tt>BOXES</tt> section)
1.1       cvs      5890: which must be produced when this reference appears in the structure of a
                   5891: document.  The box produced is a copy (same contents, but possible different
                   5892: presentation) of the box type indicated by the parameter between parentheses,
                   5893: and which is in the element designated by the reference.  The name of a box
                   5894: can be replaced by type name. Then what is copied is the contents of the
1.18      cvs      5895: element of this type which is inside the referenced element.</p>
1.30      cvs      5896: 
                   5897: <p>Whether a box name or type name is given, it may be followed by the name of
                   5898: a structure schema between parentheses.  This signifies that the box or type
                   5899: is defined in the indicated structure schema and not in the structure schema
                   5900: with which the rule's presentation schema is associated.</p>
                   5901: 
                   5902: <p>The <tt>Copy</tt> rule can also be applied to a presentation box.  If the
1.1       cvs      5903: presentation box was created by a reference attribute, the rule is applied as
                   5904: in the case of a reference element: the contents of the box having the
1.18      cvs      5905: <tt>Copy</tt> rule are based on the element designated by the reference
                   5906: attribute.  For other presentation boxes, the <tt>Copy</tt> rule takes a type
1.1       cvs      5907: name parameter which can be followed, between parentheses, by the name of the
                   5908: structure schema in which the type is defined, if it is not defined in the
                   5909: same schema.  The contents of the box which has this rule are a copy of the
                   5910: element of this type which is in the element creating the presentation box, or
                   5911: by default, the box of this type which precedes the presentation box.  This
                   5912: last facility is used, for example, to define the running titles in headers or
1.18      cvs      5913: footers.</p>
                   5914: <pre>                  'Copy' '(' BoxTypeToCopy ')' .
1.1       cvs      5915:   BoxTypeToCopy = BoxID [ ExtStruct ] /
1.6       cvs      5916:                   ElemID [ ExtStruct ] .
1.18      cvs      5917:   ExtStruct     = '(' ElemID ')' .</pre>
1.30      cvs      5918: 
                   5919: <p>Like the creation rules, the <tt>Copy</tt> rule cannot appear in the <a
1.18      cvs      5920: href="#sectc427">default presentation rules</a>.  Moreover, this rule can only
                   5921: appear in the primary view's block of rules; the copy rule is applied to all
                   5922: views.</p>
1.30      cvs      5923: 
1.18      cvs      5924: <blockquote class="example">
1.30      cvs      5925:   <p><strong>Example:</strong></p>
                   5926: 
                   5927:   <p>If the following definitions are in the structure schema:</p>
                   5928:   <pre>Body = LIST OF (Chapter =
1.1       cvs      5929:                      BEGIN
                   5930:                      ChapterTitle = Text;
                   5931:                      ChapterBody = SectionSeq;
                   5932:                      END);
1.18      cvs      5933: RefChapter = REFERENCE (Chapter);</pre>
1.30      cvs      5934: 
                   5935:   <p>then the following presentation rules (among many other rules in the
                   5936:   presentation schema) can be specified:</p>
                   5937:   <pre>COUNTERS
1.1       cvs      5938:    ChapterCtr : RANK OF Chapter;
                   5939: BOXES
                   5940:    ChapterNumber :
                   5941:       BEGIN
                   5942:       Content : (VALUE (ChapterCtr, URoman));
                   5943:       ...
                   5944:       END;
                   5945: RULES
                   5946:    Chapter :
                   5947:       BEGIN
                   5948:       CreateFirst (ChapterNumber);
                   5949:       ...
                   5950:       END;
                   5951:    RefChapter :
                   5952:       BEGIN
                   5953:       Copy (ChapterNumber);
                   5954:       ...
1.18      cvs      5955:       END;</pre>
1.30      cvs      5956: 
                   5957:   <p>which makes the number of the chapter designated by the reference appear
                   5958:   in uppercase roman numerals, in place of the reference to a chapter itself.
                   5959:   Alternatively, the chapter title can be made to appear in place of the
                   5960:   reference by writing this <tt>Copy</tt>rule:</p>
                   5961:   <pre>      Copy (ChapterTitle);</pre>
                   5962: 
                   5963:   <p>To define a header box, named <tt>RunningTitle</tt>, which contains the
                   5964:   title of the current chapter, the box's contents are defined in this
                   5965:   way:</p>
                   5966:   <pre>BOXES
1.1       cvs      5967:    RunningTitle :
1.18      cvs      5968:       Copy (ChapterTitle);</pre>
                   5969: </blockquote>
                   5970: </div>
                   5971: </div>
                   5972: <hr>
                   5973: </div>
1.1       cvs      5974: 
1.18      cvs      5975: <div class="chapter">
                   5976: <h1><a name="sect5">The T language</a></h1>
1.1       cvs      5977: 
1.18      cvs      5978: <div class="section">
1.30      cvs      5979: <h2><a name="sectb51">Document translation</a></h2>
1.1       cvs      5980: 
1.30      cvs      5981: <p>Because of its document model, Thot can produce documents in a high-level
1.18      cvs      5982: abstract form.  This form, called the <em>canonical form</em> is specific to
1.1       cvs      5983: Thot; it is well suited to the editor's manipulations, but it does not
                   5984: necessarily suit other operations which might be applied to documents. Because
                   5985: of this, the Thot editor offers the choice of saving documents in its own form
                   5986: (the canonical form) or a format defined by the user.  In the latter case, the
                   5987: Thot document is transformed by the translation program.  This facility can
                   5988: also be used to export documents from Thot to systems using other
1.18      cvs      5989: formalisms.</p>
1.1       cvs      5990: 
1.18      cvs      5991: <div class="subsection">
1.30      cvs      5992: <h3><a name="sectc511">Translation principles</a></h3>
1.1       cvs      5993: 
1.30      cvs      5994: <p>Document translation allows the export of documents to other systems which
                   5995: do not accept Thot's canonical form.  Translation can be used to export
                   5996: document to source-based formatters like T<sub><big>E</big></sub>X,
1.18      cvs      5997: L<sup>A</sup>T<sub><big>E</big></sub>X, and <tt>troff</tt>.  It can also be
1.1       cvs      5998: used to translate documents into interchange formats like SGML or HTML.  To
                   5999: allow the widest range of possible exports, Thot does not limit the choice of
                   6000: translations, but rather allows the user to define the formalisms into which
1.18      cvs      6001: documents can be translated.</p>
1.30      cvs      6002: 
                   6003: <p>For each document or object class, a set of translation rules can be
                   6004: defined, specifying how the canonical form should be transformed into a given
1.18      cvs      6005: formalism.  These translation rules are grouped into <em>translation
                   6006: schemas</em>, each schema containing the rules necessary to translate a
1.1       cvs      6007: generic logical structure (document or object structure) into a particular
                   6008: formalism.  The same generic logical structure can have several different
                   6009: translation schemas, each defining translation rules for a different
1.18      cvs      6010: formalism.</p>
1.30      cvs      6011: 
                   6012: <p>Like presentation schemas, translation schemas are generic.  Thus, they
                   6013: apply to an entire object or document class and permit translation of all
                   6014: documents or objects of that class.</p>
1.18      cvs      6015: </div>
1.1       cvs      6016: 
1.18      cvs      6017: <div class="subsection">
1.30      cvs      6018: <h3><a name="sectc512">Translation procedure</a></h3>
1.1       cvs      6019: 
1.30      cvs      6020: <p>The translator works on the specific logical structure of the document
                   6021: being translated.  It traverses the primary tree of this logical structure in
1.1       cvs      6022: pre-order and, at each node encountered, it applies the corresponding
                   6023: translation rules defined in the translation schema. Translation can be
1.18      cvs      6024: associated:</p>
                   6025: <ul>
1.30      cvs      6026:   <li>with element types defined in the structure schema,</li>
                   6027:   <li>with global or local attributes defined in the structure schema,</li>
                   6028:   <li>with specific presentation rules,</li>
                   6029:   <li>with the content of the leaves of  the structure (characters, symbols
                   6030:     and graphical elements)</li>
1.18      cvs      6031: </ul>
1.30      cvs      6032: 
                   6033: <p>Thus, for each node, the translator applies all rules associated with the
1.1       cvs      6034: element type, all rules associated with each attribute (local or global)
                   6035: carried by the element, and if the element is a leaf of the tree, it also
1.10      cvs      6036: applies translation rules for characters, symbols, or graphical elements,
1.18      cvs      6037: depending on the type of the leaf.</p>
1.30      cvs      6038: 
                   6039: <p>Rules associated with the content of leaves are different from all other
1.1       cvs      6040: rules: they specify only how to translate character strings, symbols, and
                   6041: graphical elements.  All other rules, whether associated with element types,
                   6042: with specific presentation rules or with attributes, are treated similarly.
1.18      cvs      6043: These rules primarily allow:</p>
                   6044: <ul>
1.30      cvs      6045:   <li>generation of a text constant or variable before or after the contents
                   6046:     of an element,</li>
                   6047:   <li>modification of the order in which elements appear after
                   6048:   translation,</li>
                   6049:   <li>removal of an element in the translated document,</li>
                   6050:   <li>and writing messages on the user's terminal during translation.</li>
1.18      cvs      6051: </ul>
                   6052: </div>
                   6053: </div>
1.1       cvs      6054: 
1.18      cvs      6055: <div class="section">
1.30      cvs      6056: <h2><a name="sectb52">Translation definition language</a></h2>
1.1       cvs      6057: 
1.30      cvs      6058: <p>Translation schemas are written in a custom language, called T, which is
1.1       cvs      6059: described in the rest of this chapter.  The grammar of T is specified using
1.18      cvs      6060: the same <a href="#sectc321">meta-language</a> as was used for the S and P
1.1       cvs      6061: languages and the translation schemas are written using the same conventions
                   6062: as the structure and presentation schemas.  In particular, the keywords of the
                   6063: T language (the stings between apostrophes in the following syntax rules) can
                   6064: be written in any combination of upper-case and lower-case letters, but
                   6065: identifiers created by the programmer must always be written in the same
1.18      cvs      6066: way.</p>
1.1       cvs      6067: 
1.18      cvs      6068: <div class="subsection">
1.30      cvs      6069: <h3><a name="sectc521">Organization of a translation schema</a></h3>
1.1       cvs      6070: 
1.30      cvs      6071: <p>A translation schema is begun by the <tt>TRANSLATION</tt> keyword and is
1.18      cvs      6072: terminated by the <tt>END</tt> keyword.  The <tt>TRANSLATION</tt> keyword is
1.1       cvs      6073: followed by the name of the generic structure for which a translation is being
                   6074: defined and a semicolon.  This name must be identical to the name which
1.18      cvs      6075: appears after the <tt>STRUCTURE</tt> keyword in the corresponding structure
                   6076: schema.</p>
1.30      cvs      6077: 
                   6078: <p>After this declaration of the structure, the following material appears in
1.18      cvs      6079: order:</p>
                   6080: <ul>
1.30      cvs      6081:   <li>the length of lines produced by the translation,</li>
                   6082:   <li>the character delimiting the end of the line,</li>
                   6083:   <li>the character string which the translator will insert if it must
                   6084:     line-break the translated text,</li>
                   6085:   <li>declarations of
                   6086:     <ul>
                   6087:       <li>buffers,</li>
                   6088:       <li>counters,</li>
                   6089:       <li>constants,</li>
                   6090:       <li>variables,</li>
                   6091:     </ul>
                   6092:   </li>
                   6093:   <li>translation rules associated with element types,</li>
                   6094:   <li>translation rules associated with attributes,</li>
                   6095:   <li>translation rules associated with specific presentation rules,</li>
                   6096:   <li>translation rules associated with characters strings, symbols and
                   6097:     graphical elements.</li>
1.18      cvs      6098: </ul>
1.30      cvs      6099: 
                   6100: <p>Each of these sections is introduced by a keyword followed by a sequence of
1.1       cvs      6101: declarations.  All of these sections are optional, expect for the translation
1.18      cvs      6102: rules associated with element types. Many <tt>TEXTTRANSLATE</tt> sections can
1.1       cvs      6103: appear, each defining the rules for translating character strings of a
1.18      cvs      6104: particular alphabet.</p>
                   6105: <pre>     TransSchema ='TRANSLATION' ElemID ';'
1.1       cvs      6106:                 [ 'LINELENGTH' LineLength ';' ]
                   6107:                 [ 'LINEEND' CHARACTER ';' ]
                   6108:                 [ 'LINEENDINSERT' STRING ';' ]
                   6109:                 [ 'BUFFERS' BufferSeq ]
                   6110:                 [ 'COUNTERS' CounterSeq ]
                   6111:                 [ 'CONST' ConstSeq ]
                   6112:                 [ 'VAR' VariableSeq ]
                   6113:                   'RULES' ElemSeq
                   6114:                 [ 'ATTRIBUTES' AttrSeq ]
                   6115:                 [ 'PRESENTATION' PresSeq ]
1.30      cvs      6116:                 &lt; 'TEXTTRANSLATE' TextTransSeq &gt;
1.1       cvs      6117:                 [ 'SYMBTRANSLATE' TransSeq ]
                   6118:                 [ 'GRAPHTRANSLATE' TransSeq ]
1.18      cvs      6119:                   'END' .</pre>
                   6120: </div>
1.1       cvs      6121: 
1.18      cvs      6122: <div class="subsection">
1.30      cvs      6123: <h3><a name="sectc522">Line length</a></h3>
1.1       cvs      6124: 
1.30      cvs      6125: <p>If a <tt>LINELENGTH</tt> instruction is present after the structure
1.1       cvs      6126: declaration, the translator divides the text it produces into lines, each line
                   6127: having a length less than or equal to the integer which follows the
1.18      cvs      6128: <tt>LINELENGTH</tt> keyword.  This maximum line length is expressed as a
1.1       cvs      6129: number of characters.  The end of the line is marked by the character defined
1.18      cvs      6130: by the <tt>LINEEND</tt> instruction.  When the translator breaks the lines on
1.1       cvs      6131: a space character in generated text, this space will be replaced by the
1.18      cvs      6132: character string defined by the <tt>LINEENDINSERT</tt> instruction.</p>
1.30      cvs      6133: 
                   6134: <p>If the <tt>LINEEND</tt> instruction is not defined then the linefeed
                   6135: character (octal code 12) is used as the default line end character. If the
1.18      cvs      6136: <tt>LINEENDINSERT</tt> instruction is not defined, the linefeed character is
                   6137: inserted at the end of the produced lines.  If there is no <tt>LINELENGTH</tt>
1.1       cvs      6138: instruction, the translated text is not divided into lines.  Otherwise, if the
                   6139: translation rules generate line end marks, these marks remain in the
                   6140: translated text, but the length of the lines is not controlled by the
1.18      cvs      6141: translator.</p>
                   6142: <pre>     LineLength = NUMBER .</pre>
1.30      cvs      6143: 
1.18      cvs      6144: <blockquote class="example">
1.30      cvs      6145:   <p><strong>Example:</strong></p>
                   6146: 
                   6147:   <p>To limit the lines produced by the translator to a length of 80
                   6148:   characters, the following rule is written at the beginning of the
                   6149:   translation schema.</p>
                   6150:   <pre>LineLength 80;</pre>
1.18      cvs      6151: </blockquote>
                   6152: </div>
1.1       cvs      6153: 
1.18      cvs      6154: <div class="subsection">
1.30      cvs      6155: <h3><a name="sectc523">Buffers</a></h3>
1.1       cvs      6156: 
1.30      cvs      6157: <p>A buffer is a  unit of memory managed by the translator, which can either
1.18      cvs      6158: contain text read from the terminal during the translation (see the <a
                   6159: href="#sectc5212"><tt>Read</tt> rule</a>), or the name of the last picture
1.1       cvs      6160: (bit-map) encountered by the translator in its traversal of the document.
1.2       cvs      6161: Remember the pictures are stored in files that are separate for the document
1.1       cvs      6162: files and that the canonical form contains only the names of the files in
1.18      cvs      6163: which the pictures are found.</p>
1.30      cvs      6164: 
                   6165: <p>Thus, there are two types of buffers:  buffers for reading from the
                   6166: terminal (filled by the <tt>Read</tt> rule) and the buffer of picture names
                   6167: (containing the name of the last picture encountered).  A translation schema
                   6168: can use either type, one or several read buffers and one (and only one)
                   6169: picture name buffer.</p>
                   6170: 
                   6171: <p>If any buffers are used, the <tt>BUFFERS</tt> keyword must be present,
1.1       cvs      6172: followed by declarations of every buffer used in the translation schema.  Each
                   6173: buffer declaration  is composed only of the name of the buffer, chosen freely
1.2       cvs      6174: by the programmer.  The picture name buffer is identified by the
1.18      cvs      6175: <tt>Picture</tt> keyword, between parentheses, following the buffer name.  The
                   6176: <tt>Picture</tt> keyword may only appear once.  Each buffer declaration is
                   6177: terminated by a semicolon.</p>
1.30      cvs      6178: <pre>     BufferSeq = Buffer &lt; Buffer &gt; .
1.1       cvs      6179:      Buffer    = BufferID [ '(' 'Picture' ')' ] ';' .
1.18      cvs      6180:      BufferID  = NAME .</pre>
1.30      cvs      6181: 
1.18      cvs      6182: <blockquote class="example">
1.30      cvs      6183:   <p><strong>Example:</strong></p>
                   6184: 
                   6185:   <p>The following buffer declarations create a picture name buffer named
                   6186:   <tt>pictureName</tt> and a read buffer named <a
                   6187:   name="destname"><tt>DestName</tt></a>:</p>
                   6188:   <pre>BUFFERS
1.18      cvs      6189:      pictureName (Picture); DestName;</pre>
                   6190: </blockquote>
                   6191: </div>
1.1       cvs      6192: 
1.18      cvs      6193: <div class="subsection">
1.30      cvs      6194: <h3><a name="sectc524">Counters</a></h3>
                   6195: 
                   6196: <p>Certain translation rules generate text that varies according to the
                   6197: context of the element to which the rules apply.  Variable text is defined
                   6198: either in the <a href="#sectc526"><tt>VAR</tt> section</a> of the translation
                   6199: schema or in the rule itself (see the <tt>Create</tt> and <tt>Write</tt>
                   6200: rules).  Both types of definition rely on counters for the calculation of
                   6201: variable material.</p>
                   6202: 
                   6203: <p>There are two types of counter: counters whose value is explicitely
                   6204: computed by applying <a href="#sectc5221"><tt>Set</tt> and <tt>Add</tt>
                   6205: rules</a>, and counters whose value is computed by a function associated with
                   6206: the counter. Those functions allow the same calculations as can be used in
                   6207: presentation schemas. As in a presentation schema, counters must be defined in
                   6208: the <tt>COUNTERS</tt> section of the translation schema before they are
                   6209: used.</p>
                   6210: 
                   6211: <p>When counters are used in a translation schema, the <tt>COUNTERS</tt>
                   6212: keyword is followed by the declarations of every counter used.  Each
                   6213: declaration is composed of the counter's name possibly followed by a colon and
                   6214: the counting function to be used for the counter.  The declaration is
                   6215: terminated by a semi-colon. If the counter is explicitely computed by
                   6216: <tt>Set</tt> and <tt>Add</tt> rules, no counting function is indicated. If a
                   6217: counting function is indicated, <tt>Set</tt> and <tt>Add</tt> rules cannot be
                   6218: applied to that counter.</p>
1.1       cvs      6219: 
1.30      cvs      6220: <p>The counting function indicates how the counter's value will be computed.
1.18      cvs      6221: Three functions are available: <tt>Rank</tt>, <tt>Rlevel</tt>, and
                   6222: <tt>Set</tt>.</p>
                   6223: <ul>
1.30      cvs      6224:   <li><tt>Rank of ElemID</tt> indicates that the counter's value is the rank
                   6225:     of the element of type <tt>ElemID</tt> which encloses the element for
                   6226:     which the counter is being evaluated.  For the purposes of this function,
                   6227:     an element of type <tt>ElemID</tt> is considered to enclose itself.  This
                   6228:     function is primarily used  when the element of type <tt>ElemID</tt> is
                   6229:     part of an aggregate or list, in which case the counter's value is the
                   6230:     element's rank in its list or aggregate.  Note that, unlike the
                   6231:     <tt>Rank</tt> function for presentation schemas, the <tt>Page</tt> keyword
                   6232:     cannot be used in place of the <tt>ElemID</tt>.
                   6233:     <p>The type name <tt>ElemID</tt> can be followed by an integer.  That
                   6234:     number represents the relative level, among the ancestors of the concerned
                   6235:     element, of the element whose rank is asked.  If that relative level
                   6236:     <i>n</i> is unsigned, the <i>n<sup>th</sup></i> element of type
                   6237:     <tt>ElemID</tt> encountered when travelling the logical structure from the
                   6238:     root to the concerned element is taken into account.  If the relative
                   6239:     level is negative, the logical structure is travelled in the other
                   6240:     direction, from the concerned element to the root.</p>
                   6241:   </li>
                   6242:   <li><tt>Rlevel of ElemID</tt> indicates that the counter's values is the
                   6243:     relative level in the tree of the element for which the counter is being
                   6244:     evaluated. The counter counts the number of elements of type
                   6245:     <tt>ElemID</tt> which are found on the path between the root of the
                   6246:     document's logical structure tree and the element (inclusive).</li>
                   6247:   <li><tt>Set n on Type1 Add m on Type2</tt> indicates that the counter's
                   6248:     value is calculated as follows:  in traversing the document from the
                   6249:     beginning to the element for which the counter is being evaluated, the
                   6250:     counter is set to the value <tt>n</tt> each time a <tt>Type1</tt> element
                   6251:     is encountered and is incremented by the amount <tt>m</tt> each time a
                   6252:     <tt>Type2</tt> element is encountered.  The initial value <tt>n</tt> and
                   6253:     the increment <tt>m</tt> are integers.</li>
                   6254: </ul>
                   6255: 
                   6256: <p>As in a presentation schema, the <tt>Rank</tt> and <tt>Set</tt> functions
                   6257: can be modified by a numeric attribute which changes their initial value. This
                   6258: is indicated by the <tt>Init</tt> keyword followed by the numeric attribute's
1.18      cvs      6259: name.  The <tt>Set</tt> function takes the value of the attribute instead of
                   6260: the <tt>InitValue</tt> (<tt>n</tt>).  For the <tt>Rank</tt> function, the
1.1       cvs      6261: value of the attribute is considered to be the rank of the first element of
                   6262: the list (rather than the normal value of 1). Subsequent items in the list
                   6263: have their ranks shifted accordingly.  In both cases, the attribute must be
1.18      cvs      6264: numeric and must be a local attribute of the root of the document itself.</p>
1.30      cvs      6265: <pre>     CounterSeq  = Counter &lt; Counter &gt; .
1.1       cvs      6266:      Counter     = CounterID [ ':' CounterFunc ] ';' .
                   6267:      CounterID   = NAME .
                   6268:      CounterFunc = 'Rank' 'of' ElemID [ SLevelAsc ]
                   6269:                    [ 'Init' AttrID ] /
                   6270:                    'Rlevel' 'of' ElemID /
                   6271:                    'Set' InitValue 'On' ElemID
                   6272:                          'Add' Increment 'On' ElemID
                   6273:                          [ 'Init' AttrID ] .
                   6274:      SLevelAsc   = [ '-' ] LevelAsc .
                   6275:      LevelAsc    =  NUMBER .
                   6276:      InitValue   = NUMBER .
                   6277:      Increment   = NUMBER .
                   6278:      ElemID      = NAME .
1.18      cvs      6279:      AttrID      = NAME .</pre>
1.30      cvs      6280: 
1.18      cvs      6281: <blockquote class="example">
1.30      cvs      6282:   <p><strong>Example:</strong></p>
                   6283: 
                   6284:   <p>If the body of a chapter is defined in the structure schema by:</p>
                   6285:   <pre>Chapter_Body = LIST OF
1.1       cvs      6286:          (Section = BEGIN
                   6287:                     Section_Title = Text;
                   6288:                     Section_Body  = BEGIN
                   6289:                                     Paragraphs;
                   6290:                                     Section;
                   6291:                                     END;
                   6292:                     END
1.18      cvs      6293:          );</pre>
1.30      cvs      6294: 
                   6295:   <p>(sections are defined recursively), a counter can be defined giving the
                   6296:   <a name="sectnum">number of a section</a> within its level in the
                   6297:   hierarchy:</p>
                   6298:   <pre>COUNTERS
1.18      cvs      6299:    SectionNumber : Rank of Section;</pre>
1.30      cvs      6300: 
                   6301:   <p>A counter holding the hierarchic level of a section:</p>
                   6302:   <pre>   SectionLevel : Rlevel of Section;</pre>
                   6303: 
                   6304:   <p>A <a name="uniquenum">counter</a> which sequentially numbers all the
                   6305:   document's sections, whatever their hierarchic level:</p>
                   6306:   <pre>   UniqueSectNum : Set 0 on Document Add 1 on Section;</pre>
1.18      cvs      6307: </blockquote>
                   6308: </div>
1.1       cvs      6309: 
1.18      cvs      6310: <div class="subsection">
1.30      cvs      6311: <h3><a name="sectc525">Constants</a></h3>
1.1       cvs      6312: 
1.30      cvs      6313: <p>A common feature of translation rules is the generation of constant text.
                   6314: This text can be defined in the rule that generates it (see for example the <a
1.18      cvs      6315: href="#sectc5210"><tt>Create</tt></a> and <a
                   6316: href="#sectc5211"><tt>Write</tt></a> rules); but it can also be defined once
                   6317: in the constant declaration section and used many times in different rules.
                   6318: The latter option is preferable when the same text is used in several rules or
                   6319: several <a href="#sectc526">variables</a>.</p>
1.30      cvs      6320: 
                   6321: <p>The <tt>CONST</tt> keyword begins the constant declaration section of the
1.1       cvs      6322: translation schema.  It must be omitted if no constants are declared. Each
                   6323: constant declaration is composed of the constant name, an equals sign, and the
                   6324: constant's value, which is a character string between apostrophes.  A constant
1.18      cvs      6325: declaration is terminated by a semicolon.</p>
1.30      cvs      6326: <pre>     ConstSeq   = Const &lt; Const &gt; .
1.1       cvs      6327:      Const      = ConstID '=' ConstValue ';' .
                   6328:      ConstID    = NAME .
1.18      cvs      6329:      ConstValue = STRING .</pre>
1.30      cvs      6330: 
1.18      cvs      6331: <blockquote class="example">
1.30      cvs      6332:   <p><strong><a name="levelexample">Example:</a></strong></p>
                   6333: 
                   6334:   <p>The following rule assigns the name <tt>TxtLevel</tt> to the character
                   6335:   string ``Level'':</p>
                   6336:   <pre>CONST
1.18      cvs      6337:      TxtLevel = 'Level';</pre>
                   6338: </blockquote>
                   6339: </div>
1.1       cvs      6340: 
1.18      cvs      6341: <div class="subsection">
1.30      cvs      6342: <h3><a name="sectc526">Variables</a></h3>
1.1       cvs      6343: 
1.30      cvs      6344: <p>Variables allow to define variable text which is generated by the
1.18      cvs      6345: <tt>Create</tt> and <tt>Write</tt> rules.  They are also used to define file
                   6346: names which are used in the <tt>Create</tt>, <tt>ChangeMainFile</tt>,
                   6347: <tt>RemoveFile</tt>, and <tt>Indent</tt> rules.  Variables can be defined
                   6348: either in the <tt>VAR</tt> section of the translation schema or directly in
                   6349: the rules which use them.  Variables that define file names must be declared
                   6350: in the <tt>VAR</tt> section, and when the same variable is used several times
                   6351: in the translation schema, it makes sense to define it globally in the
                   6352: <tt>VAR</tt> section.  This section is only present if at least one variable
                   6353: is defined globally.</p>
1.30      cvs      6354: 
                   6355: <p>After the <tt>VAR</tt> keyword, each global variable is defined by its
                   6356: name, a colon separator and a sequence of functions (at least one function).
                   6357: Each variable definition is terminated by a semicolon. Functions determine the
1.1       cvs      6358: different parts which together give the value of the variable.  The value is
                   6359: obtained by concatenating the strings produced by each of the functions. Seven
                   6360: types of functions are available.  Each variable definition may use any number
1.18      cvs      6361: of functions of each type.</p>
                   6362: <ul>
1.30      cvs      6363:   <li>The function <tt>Value(Counter)</tt>returns a string representing the
                   6364:     value taken by the counter when it is evaluated for the element in whose
                   6365:     rule the variable is used.  The counter must have been declared in the
                   6366:     <tt>COUNTERS</tt> section of the translation schema.  When the counter is
                   6367:     expressed in arabic numerals, the counter name can be followed by a colon
                   6368:     and an integer indicating a minimum length (number of characters) for the
                   6369:     string; if the counter's value is normally expressed with fewer characters
                   6370:     than the required minimum, zeroes are added to the front of the string to
                   6371:     achieve the minimum length.
                   6372:     <p>By default, the counter value is written in arabic digits. If another
                   6373:     representation of that value is needed, the counter name must be followed
                   6374:     by a comma and one of the following keywords:</p>
                   6375:     <ul>
                   6376:       <li><tt>Arabic</tt>: arabic numerals (default value),</li>
                   6377:       <li><tt>LRoman</tt>: lower-case roman numerals,</li>
                   6378:       <li><tt>URoman</tt>: upper-case roman numerals,</li>
                   6379:       <li><tt>Uppercase</tt>: upper-case letter,</li>
                   6380:       <li><tt>Lowercase</tt>: lower-case letter.</li>
                   6381:     </ul>
                   6382:   </li>
                   6383:   <li>The function <tt>FileDir</tt>, without parameter, returns a string
                   6384:     representing the name of the directory of the output file that has been
                   6385:     given as a parameter to the translation program. The string includes a
                   6386:     character '/' at the end.</li>
                   6387:   <li>The function <tt>FileName</tt>, without parameter, returns a string
                   6388:     representing the name of the output file that has been given as a
                   6389:     parameter to the translation program. The file extension (the character
                   6390:     string that terminate the file name, after a dot) is not part of that
                   6391:     string.</li>
                   6392:   <li>The function <tt>Extension</tt>, without parameter, returns a string
                   6393:     representing the extension of the file name. That string is empty if the
                   6394:     file name that has been given as a parameter to the translation program
                   6395:     has no extension. If there is an extension, its first character is a
                   6396:   dot.</li>
                   6397:   <li>The function <tt>DocumentName</tt>, without parameter, returns a string
                   6398:     representing the name of the document being translated.</li>
                   6399:   <li>The function <tt>DocumentDir</tt>, without parameter, returns a string
                   6400:     representing the directory containing the document being translated.</li>
                   6401:   <li>The function formed by the name of a constant returns that constant's
                   6402:     value.</li>
                   6403:   <li>The function formed by a character string between apostrophes returns
                   6404:     that string.</li>
                   6405:   <li>The function formed by the name of a buffer returns the contents of that
                   6406:     buffer.  If the named buffer is the picture buffer, then the name of the
                   6407:     last picture encountered is returned.  Otherwise, the buffer is a read
1.31      cvs      6408:     buffer and the value returned is text previously read from the terminal.
1.30      cvs      6409:     If the buffer is empty (no picture has been encountered or the
                   6410:     <tt>Read</tt> rule has not been executed for the buffer), then the empty
                   6411:     string is returned.</li>
                   6412:   <li>The function formed by an attribute name takes the value of the
                   6413:     indicated attribute for the element to which the variable applies.  If the
                   6414:     element does not have that attribute, then the element's ancestor are
                   6415:     searched toward the root of the tree.  If one of the ancestors does have
                   6416:     the attribute then its value is used.  If no ancestors have the attribute,
                   6417:     then the value of the function is the empty string.</li>
1.18      cvs      6418: </ul>
1.30      cvs      6419: <pre>     VariableSeq = Variable &lt; Variable &gt; .
                   6420:      Variable    = VarID ':' Function &lt; Function &gt; ';' .
1.1       cvs      6421:      VarID       = NAME .
                   6422:      Function    ='Value' '(' CounterID [ ':' Length ]
                   6423:                             [ ',' CounterStyle ] ')' /
                   6424:                   'FileDir' / 'FileName' / 'Extension' /
                   6425:                   'DocumentName' / 'DocumentDir' /
                   6426:                    ConstID / CharString / 
                   6427:                    BufferID / AttrID .
                   6428:      Length      = NUMBER .
                   6429:      CounterStyle= 'Arabic' / 'LRoman' / 'URoman' /
                   6430:                    'Uppercase' / 'Lowercase' .
1.18      cvs      6431:      CharString  = STRING .</pre>
1.30      cvs      6432: 
1.18      cvs      6433: <blockquote class="example">
1.30      cvs      6434:   <p><strong>Example:</strong></p>
                   6435: 
                   6436:   <p>To create, at the beginning of each section of the translated document,
                   6437:   text composed of the string ``Section'' followed by the section number, the
                   6438:   following <a name="varsectexample">variable definition</a> might be
                   6439:   used:</p>
                   6440:   <pre>VAR
1.18      cvs      6441:      SectionVar : 'Section' Value(SectionNumber);</pre>
1.30      cvs      6442: 
                   6443:   <p>(see the definition of <a
                   6444:   href="#sectnum"><tt>SectionNumber</tt></a>).</p>
                   6445: 
                   6446:   <p>The following variable definition can be used to create, at the beginning
                   6447:   of each section, the text ``Level'' followed by the hierarchical level of
                   6448:   the section. It used the constant defined above.</p>
                   6449:   <pre>     LevelVar : TxtLevel Value(SectionLevel);</pre>
                   6450: 
                   6451:   <p>(see the definitions of <a href="#sectnum"><tt>SectionLevel</tt></a> and
                   6452:   of <a href="#levelexample"><tt>TxtLevel</tt></a>).</p>
                   6453: 
                   6454:   <p>To generate the translation of each section in a different file (see <a
                   6455:   href="#sectc5220">rule <tt>ChangeMainFile</tt></a>), the name of these files
                   6456:   might be defined by the following variable:</p>
                   6457:   <pre>     VarOutpuFile : FileName Value(SectionNumber)
1.18      cvs      6458:                     Extension;</pre>
1.30      cvs      6459: 
                   6460:   <p>If <tt>output.txt</tt> is the name of the <a name="varoutputfile">output
                   6461:   file</a> specified when starting the translation program, translated
                   6462:   sections are written in files <tt>output1.txt</tt>, <tt>output2.txt</tt>,
                   6463:   etc.</p>
1.18      cvs      6464: </blockquote>
                   6465: </div>
                   6466: 
                   6467: <div class="subsection">
1.30      cvs      6468: <h3><a name="sectc527">Translating structure elements</a></h3>
1.18      cvs      6469: 
1.30      cvs      6470: <p>The <tt>RULES</tt> keyword introduces the translation rules which will be
1.1       cvs      6471: applied to the various structured element types.  Translation rules can be
                   6472: specified for each element type defined in the structure schema, including the
1.18      cvs      6473: base types defined implicitly, whose names are <tt>TEXT_UNIT</tt>,
                   6474: <tt>PICTURE_UNIT</tt>, <tt>SYMBOL_UNIT</tt>, <tt>GRAPHIC_UNIT</tt> and
                   6475: <tt>PAGE_UNIT</tt>.  But it is not necessary to specify rules for every
                   6476: defined type.</p>
1.30      cvs      6477: 
                   6478: <p>If there are no translation rules for an element type, the elements that it
1.1       cvs      6479: contains (and which may have rules themselves) will still be translated, but
                   6480: the translator will produce nothing for the element itself.  To make the
1.18      cvs      6481: translator completely ignore the content of an element the <a
                   6482: href="#sectc5217"><tt>Remove</tt> rule</a> must be used.</p>
1.30      cvs      6483: 
                   6484: <p>The translation rules for an element type defined in the structure schema
                   6485: are written using the name of the type followed by a colon and the list of
1.18      cvs      6486: applicable rules.  When the element  type is a <a href="#sectd3285">mark
                   6487: pair</a>, but only in this case, the type name must be preceded by the
                   6488: <tt>First</tt> or <tt>Second</tt> keyword.  This keyword indicates whether the
                   6489: rules that follow apply to the first or second mark of the pair.</p>
1.30      cvs      6490: 
                   6491: <p>The list of rules can take several forms.  It may be a simple
                   6492: non-conditional rule.  It can also be formed by a condition followed by one or
                   6493: more simple rules.  Or it can be a block of rules beginning with the
                   6494: <tt>BEGIN</tt> keyword and ending with the <tt>END</tt> keyword and a
                   6495: semicolon.  This block of rules can contain one or more simple rules and/or
                   6496: one or more conditions, each followed by one or more simple rules.</p>
                   6497: <pre>     ElemSeq        = TransType &lt; TransType &gt; .
1.1       cvs      6498:      TransType      = [ FirstSec ] ElemID ':' RuleSeq .
                   6499:      FirstSec       = 'First' / 'Second' .
1.30      cvs      6500:      RuleSeq        = Rule / 'BEGIN' &lt; Rule &gt; 'END' ';' .
1.1       cvs      6501:      Rule           = SimpleRule / ConditionBlock .
                   6502:      ConditionBlock = 'IF' ConditionSeq SimpleRuleSeq .
1.30      cvs      6503:      SimpleRuleSeq  = 'BEGIN' &lt; SimpleRule &gt; 'END' ';' / 
1.18      cvs      6504:                       SimpleRule .</pre>
                   6505: </div>
1.1       cvs      6506: 
1.18      cvs      6507: <div class="subsection">
1.30      cvs      6508: <h3><a name="sectc528">Conditional rules</a></h3>
1.1       cvs      6509: 
1.30      cvs      6510: <p>In a translation schema, the translation rules are either associated with
1.1       cvs      6511: element types or with attribute values or with a specific presentation.  They
                   6512: are applied by the translator each time an element of the corresponding type
                   6513: is encountered in the translated document or each time the attribute value is
                   6514: carried by an element or also, each time the specific translation is attached
                   6515: to an element.  This systematic application of the rules can be relaxed: it is
                   6516: possible to add a condition to one or more rules, so that these rules are only
1.18      cvs      6517: applied when the condition is true.</p>
1.30      cvs      6518: 
                   6519: <p>A condition begins with the keyword <tt>IF</tt>, followed by a sequence of
1.1       cvs      6520: elementary conditions.  Elementary conditions are separated from each other by
1.18      cvs      6521: the <tt>AND</tt> keyword.  If there is only one elementary condition, this
1.1       cvs      6522: keyword is absent.  The rules are only applied if all the elementary
                   6523: conditions are true.  The elementary condition can be negative; it is then
1.18      cvs      6524: preceded by the <tt>NOT</tt> keyword.</p>
1.30      cvs      6525: 
                   6526: <p>When the translation rule(s) controlled by the condition apply to a
                   6527: reference element or a reference attribute, an elementary condition can also
                   6528: apply to element referred by this reference.  The <tt>Target</tt> keyword is
                   6529: used for that purpose.  It must appear before the keyword defining the
                   6530: condition type.</p>
                   6531: 
                   6532: <p>Depending on their type, some conditions may apply either to the element
                   6533: with which they are associated, or to one of its ancestor.  In the case of an
1.18      cvs      6534: ancestor, the key word <tt>Ancestor</tt> must be used, followed by</p>
                   6535: <ul>
1.30      cvs      6536:   <li>either an integer which represents the number of levels in the tree
                   6537:     between the element and the ancestor of interest,</li>
                   6538:   <li>or the type name of the ancestor of interest.  If that type is defined
                   6539:     in a separate structure schema, the name of that schema must follow
                   6540:     between parentheses.</li>
1.18      cvs      6541: </ul>
1.30      cvs      6542: 
                   6543: <p>There is a special case for the parent element, which can be simply written
1.18      cvs      6544: <tt>Parent</tt> instead of <tt>Ancestor 1</tt>.</p>
1.30      cvs      6545: 
                   6546: <p>Only conditions <tt>First</tt>, <tt>Last</tt>, <tt>Referred</tt>,
1.34    ! cvs      6547: <tt>Within</tt>, <tt>Attributes</tt>, <tt>Presentation</tt>, and those
        !          6548: concerning an attribute or a specific presentation can apply to an ancestor.
        !          6549: Conditions <tt>FirstRef</tt>, <tt>LastRef</tt>, <tt>ExternalRef</tt>,
        !          6550: <tt>Alphabet</tt>, <tt>FirstAttr</tt>, <tt>LastAttr</tt>,
        !          6551: <tt>ComputedPage</tt>, <tt>StartPage</tt>, <tt>UserPage</tt>,
        !          6552: <tt>ReminderPage</tt>, <tt>Empty</tt> cannot be preceded by keywords
        !          6553: <tt>Parent</tt> or <tt>Ancestor</tt>.</p>
1.30      cvs      6554: 
                   6555: <p>In condition <tt>Referred</tt> and in the condition that applies to a named
1.18      cvs      6556: attribute, a symbol '<tt>*</tt>' can indicate that the condition is related
1.5       cvs      6557: only to the element itself. If this symbol is not present, not only the
1.18      cvs      6558: element is considered, but also its ancestor, at any level.</p>
1.30      cvs      6559: 
                   6560: <p>The form of an elementary condition varies according to the type of
1.18      cvs      6561: condition.</p>
1.1       cvs      6562: 
1.18      cvs      6563: <div class="subsubsection">
                   6564: <h4><a name="sectd5281">Conditions based on the logical position of the
                   6565: element</a></h4>
1.30      cvs      6566: 
                   6567: <p>The condition can be on the position of the element in the document's
                   6568: logical structure tree.  It is possible to test whether the element is the
                   6569: first (<tt>First</tt>) or last (<tt>Last</tt>) among its siblings or if it is
                   6570: not the first (<tt>NOT First</tt>) or not the last (<tt>NOT Last</tt>).</p>
                   6571: 
                   6572: <p>It is also possible to test if the element is contained in an element of a
1.18      cvs      6573: given type (<tt>Within</tt>) or if it is not (<tt>NOT Within</tt>). If that
1.1       cvs      6574: element type is defined in a structure schema which is not the one which
                   6575: corresponds to the translation schema, the type name of this element must be
                   6576: followed, between parentheses, by the name of the structure schema which
1.18      cvs      6577: defines it.</p>
1.30      cvs      6578: 
                   6579: <p>If the keyword <tt>Within</tt> is preceded by <tt>Immediately</tt>, the
1.18      cvs      6580: condition is satisfied only if the <em>parent</em> element has the type
                   6581: indicated. If the word <tt>Immediately</tt> is missing, the condition is
                   6582: satisfied if any <em>ancestor</em> has the type indicated.</p>
1.30      cvs      6583: 
                   6584: <p>An integer <i>n</i> can appear between the keyword <tt>Within</tt> and the
1.1       cvs      6585: type.  It specifies the number of ancestors of the indicated type that must be
                   6586: present for the condition to be satisfied.  If the keyword
1.18      cvs      6587: <tt>Immediately</tt> is also present, the <i>n</i> immediate ancestors of the
                   6588: element must have the indicated type.  The integer <i>n</i> must be positive
1.30      cvs      6589: or zero.  It can be preceded by <tt>&lt;</tt> or <tt>&gt;</tt> to indicate a
1.1       cvs      6590: maximum or minimum number of ancestors.  If these symbols are missing, the
1.18      cvs      6591: condition is satisfied only if it exists exactly <i>n</i> ancestors.  When
1.30      cvs      6592: this number is missing, it is equivalent to &gt; 0.</p>
                   6593: 
                   6594: <p>If the condition applies to translation rules associated with an attribute,
1.18      cvs      6595: i.e. if it is in the <tt>ATTRIBUTES</tt> section of the presentation schema,
1.11      cvs      6596: the condition can be simply an element name. Translation rules are then
1.18      cvs      6597: executed only if the attribute is attached to an element of that type. The
                   6598: keyword <tt>NOT</tt> before the element name indicates that the translation
                   6599: rules must be executed only if the element is not of the type indicated.</p>
                   6600: </div>
1.1       cvs      6601: 
1.18      cvs      6602: <div class="subsubsection">
1.30      cvs      6603: <h4><a name="sectd5282">Conditions on references</a></h4>
1.1       cvs      6604: 
1.30      cvs      6605: <p>References may be taken into account in conditions, which can be based on
                   6606: the fact that the element, or one of its ancestors (unless symbol <tt>*</tt>
                   6607: is present), is designated by a at least one reference (<tt>Referred</tt>) or
                   6608: by none (<tt>NOT Referred</tt>).  If the element or attribute to which the
1.1       cvs      6609: condition is attached is a reference, the condition can be based on the fact
                   6610: that it acts as the first reference to the designated element
1.18      cvs      6611: (<tt>FirstRef</tt>), or as the last (<tt>LastRef</tt>), or as a reference to
                   6612: an element located in another document (<tt>ExternalRef</tt>).  Like all
                   6613: conditions, conditions on references can be inverted by the <tt>NOT</tt>
                   6614: keyword.</p>
                   6615: </div>
                   6616: 
                   6617: <div class="subsubsection">
1.30      cvs      6618: <h4><a name="sectd5284">Conditions on the alphabets</a></h4>
1.1       cvs      6619: 
1.30      cvs      6620: <p>The character string base type (and only this type) can use the condition
1.18      cvs      6621: <tt>Alphabet = a</tt> which indicates that the translation rule(s) should only
1.1       cvs      6622: apply if the alphabet of the character string is the one whose name appears
1.18      cvs      6623: after the equals sign (or is not, if there is a preceding <tt>NOT</tt>
1.1       cvs      6624: keyword).  This condition cannot be applied to translation rules of an
1.18      cvs      6625: attribute.</p>
1.30      cvs      6626: 
                   6627: <p>In the current implementation of Thot, the available alphabets are the
1.18      cvs      6628: <tt>Latin</tt> alphabet and the <tt>Greek</tt> alphabet.</p>
                   6629: </div>
1.1       cvs      6630: 
1.18      cvs      6631: <div class="subsubsection">
1.30      cvs      6632: <h4><a name="sectd5285">Conditions on page breaks</a></h4>
1.1       cvs      6633: 
1.30      cvs      6634: <p>The page break base type (and only this type) can use the following
1.18      cvs      6635: conditions: <tt>ComputedPage</tt>, <tt>StartPage</tt>, <tt>UserPage</tt>, and
                   6636: <tt>ReminderPage</tt>.  The <tt>ComputedPage</tt> condition indicates that the
1.1       cvs      6637: translation rule(s) should apply if the page break was created automatically
1.18      cvs      6638: by Thot;  the <tt>StartPage</tt> condition is true if the page break is
                   6639: generated before the element by the <tt>Page</tt> rule of the P language; the
                   6640: <tt>UserPage</tt> condition applies if the page break was inserted by the
                   6641: user; and the <tt>ReminderPage</tt> is applied if the page break is a reminder
                   6642: of page breaking.</p>
                   6643: </div>
1.1       cvs      6644: 
1.18      cvs      6645: <div class="subsubsection">
1.30      cvs      6646: <h4><a name="sectd5286">Conditions on the element's content</a></h4>
1.1       cvs      6647: 
1.30      cvs      6648: <p>The condition can be based on whether or not the element is empty.  An
                   6649: element which has no children or whose leaves are all empty is considered to
                   6650: be empty itself.  This condition is expressed by the <tt>Empty</tt> keyword,
                   6651: optionally preceded by the <tt>NOT</tt> keyword.</p>
1.18      cvs      6652: </div>
1.1       cvs      6653: 
1.18      cvs      6654: <div class="subsubsection">
                   6655: <h4><a name="sectd5288">Conditions on the presence of specific presentation
                   6656: rules</a></h4>
1.30      cvs      6657: 
                   6658: <p>The condition can be based on the presence or absence of specific
                   6659: presentation rules associated with the translated element, whatever the rules,
                   6660: their value or their number.  This condition is expressed by the keyword
1.18      cvs      6661: <tt>Presentation</tt>, optionally preceded by the <tt>NOT</tt> keyword.</p>
                   6662: </div>
1.1       cvs      6663: 
1.18      cvs      6664: <div class="subsubsection">
                   6665: <h4><a name="sectd5289">Conditions on the presence of logical
                   6666: attributes</a></h4>
1.30      cvs      6667: 
                   6668: <p>In the same way, the condition can be based on the presence or absence of
1.1       cvs      6669: attributes associated with the translated elements, no matter what the
1.18      cvs      6670: attributes or their values.  The <tt>Attributes</tt> keyword expresses this
                   6671: condition.</p>
                   6672: </div>
1.1       cvs      6673: 
1.18      cvs      6674: <div class="subsubsection">
1.30      cvs      6675: <h4><a name="sectd52810">Conditions on logical attributes</a></h4>
1.1       cvs      6676: 
1.30      cvs      6677: <p>If the condition appears in the translation rules of an attribute, the
1.18      cvs      6678: <tt>FirstAttr</tt> and <tt>LastAttr</tt> keywords can be used to indicate that
1.1       cvs      6679: the rules must only be applied if this attribute is the first attribute for
                   6680: the translated element or if it is the last (respectively).  These conditions
1.18      cvs      6681: can also be inverted by the <tt>NOT</tt> keyword.</p>
1.30      cvs      6682: 
                   6683: <p>Another type of condition can only be applied to the translation rules when
1.18      cvs      6684: the element being processed (or one of its ancestors if symbol <tt>*</tt> is
1.1       cvs      6685: missing) has a certain attribute, perhaps with a certain value or, in
                   6686: contrast, when the element does not have this attribute with this value.  The
                   6687: condition is specified by writing the name of the attribute after the keyword
1.18      cvs      6688: <tt>IF</tt> or <tt>AND</tt>.  The <tt>NOT</tt> keyword can be used to invert
1.1       cvs      6689: the condition.  If the translation rules must be applied to any element which
                   6690: has this attribute (or does not have it, if the condition is inverted) no
                   6691: matter what the attribute's value, the condition is complete.  If, in
                   6692: contrast, the condition applies to one or more values of the attribute, these
                   6693: are indicated after the name of the attribute, except for reference attributes
1.18      cvs      6694: which do not have values.</p>
1.30      cvs      6695: 
                   6696: <p>The representation of the values of an <a name="relattr">attribute</a> in a
1.1       cvs      6697: condition depends on the attribute's type.  For attributes with enumerated or
                   6698: textual types, the value (a name or character string between apostrophes,
                   6699: respectively) is simply preceded by an equals sign.  For numeric attributes,
                   6700: the condition can be based on a single value or on a range of values.  In the
                   6701: case of a unique value, this value (an integer) is simply preceded by an
1.18      cvs      6702: equals sign.  Conditions based on ranges of values have several forms:</p>
                   6703: <ul>
1.30      cvs      6704:   <li>all values less than a given value (the value is preceded by a ``less
                   6705:     than'' sign).</li>
                   6706:   <li>all values greater than a given value (the value is preceded by a
                   6707:     ``greater than'' sign).</li>
                   6708:   <li>all values falling in an interval, bounds included.  The range of values
                   6709:     is then specified <tt>IN [</tt>Minimum <tt>..</tt>Maximum<tt>]</tt>, where
                   6710:     Minimum and Maximum are integers.</li>
1.18      cvs      6711: </ul>
1.30      cvs      6712: 
                   6713: <p>All numeric values may be negative.  The integer is simply preceded by a
                   6714: minus sign.</p>
                   6715: 
                   6716: <p>Both local and global attributes can be used in conditions.</p>
1.18      cvs      6717: </div>
1.1       cvs      6718: 
1.18      cvs      6719: <div class="subsubsection">
1.30      cvs      6720: <h4><a name="sectd52811">Conditions on specific presentation rules</a></h4>
1.1       cvs      6721: 
1.30      cvs      6722: <p>It is possible to apply translation rules only when the element being
1.1       cvs      6723: processed has or does not have a specific presentation rule, possibly with a
                   6724: certain value.  The condition is specified by writing the name of the
1.18      cvs      6725: presentation rule after the keyword <tt>IF</tt> or <tt>AND</tt>.  The
                   6726: <tt>NOT</tt> keyword can be used to invert the condition.  If the translation
1.1       cvs      6727: rules must be applied to any element which has this presentation rule (or does
                   6728: not have it, if the condition is inverted) no matter what the rule's value,
                   6729: the condition is complete.  If, in contrast, the condition applies to one or
                   6730: more values of the rule, these are indicated after the name of the
1.18      cvs      6731: attribute.</p>
1.30      cvs      6732: 
                   6733: <p>The representation of presentation rule values in a condition is similar to
1.1       cvs      6734: that for attribute values.  The representation of these values depend on the
                   6735: type of the presentation rule. There are three categories of presentation
1.18      cvs      6736: rules:</p>
                   6737: <ul>
1.30      cvs      6738:   <li>those taking numeric values (<tt>Size, Indent, LineSpacing,
                   6739:     LineWeight</tt>),</li>
                   6740:   <li>those with values taken from a predefined list (<tt>Adjust, Justify,
                   6741:     Hyphenate, Style, Weight, Font, UnderLine, Thickness,
                   6742:   LineStyle</tt>),</li>
                   6743:   <li>those whose value is a name (<tt>FillPattern, Background,
                   6744:     Foreground</tt>).</li>
1.18      cvs      6745: </ul>
1.30      cvs      6746: 
                   6747: <p>For presentation rules which take numeric values, the condition can take a
1.1       cvs      6748: unique value or a range of values.  In the case of a unique value, this value
                   6749: (an integer) is simply preceded by an equals sign. Conditions based on ranges
1.18      cvs      6750: of values have several forms:</p>
                   6751: <ul>
1.30      cvs      6752:   <li>all values less than a given value (the value is preceded by a ``less
                   6753:     than'' sign).</li>
                   6754:   <li>all values greater than a given value (the value is preceded by a
                   6755:     ``greater than'' sign).</li>
                   6756:   <li>all values falling in an interval, bounds included.  The range of values
                   6757:     is then specified <tt>IN [</tt>Minimum <tt>..</tt>Maximum<tt>]</tt>, where
                   6758:     Minimum and Maximum are integers.</li>
1.18      cvs      6759: </ul>
1.30      cvs      6760: 
                   6761: <p>Values for the <tt>Indent</tt>rule may be negative.  The integer is then
1.2       cvs      6762: simply preceded by a minus sign and represents how far the first line starts
1.18      cvs      6763: to the left of the other lines.</p>
1.30      cvs      6764: 
                   6765: <p>For presentation rules whose values are taken from predefined lists, the
                   6766: value which satisfies the condition is indicated by an equals sign followed by
                   6767: the name of the value.</p>
                   6768: 
                   6769: <p>For presentation rule whose values are names, the value which satisfies the
1.1       cvs      6770: condition is indicated by the equals sign followed by the value's name. The
1.18      cvs      6771: names of fill patterns (the <tt>FillPattern</tt> rule) and of colors (the
                   6772: <tt>Foreground</tt> and <tt>Background</tt> rules) known to Thot are the same
                   6773: as in the P language.</p>
1.30      cvs      6774: 
                   6775: <p>The syntax of conditions based on the specific presentation is the same as
                   6776: the syntax used to express the <a href="#sectc5224">translation of specific
1.18      cvs      6777: presentation rules</a>.</p>
1.30      cvs      6778: 
                   6779: <p>When a condition has only one rule, the condition is simply followed by
                   6780: that rule.  If it has several rules, they are placed after the condition
                   6781: between the keywords <tt>BEGIN</tt> and <tt>END</tt>.</p>
1.18      cvs      6782: <pre>   ConditionSeq = Condition [ 'AND' Condition ] .
1.1       cvs      6783:    Condition    = [ 'NOT' ] [ 'Target' ] Cond .
                   6784:    Cond         = CondElem / CondAscend .
                   6785:    CondElem     ='FirstRef' / 'LastRef' /
                   6786:                  'ExternalRef' /
                   6787:                  'Alphabet' '=' Alphabet /
                   6788:                  'ComputedPage' / 'StartPage' / 
                   6789:                  'UserPage' / 'ReminderPage' /
                   6790:                  'Empty' /
1.11      cvs      6791:                   ElemID /
1.1       cvs      6792:                  'FirstAttr' / 'LastAttr' .
                   6793:    CondAscend   = [ Ascend ] CondOnAscend .
                   6794:    Ascend       = '*' / 'Parent' / 'Ancestor' LevelOrType .
                   6795:    LevelOrType  = CondRelLevel / ElemID [ ExtStruct ] .
                   6796:    CondRelLevel = NUMBER .
                   6797:    CondOnAscend ='First' / 'Last' /
                   6798:                  'Referred' / 
                   6799:                   [ 'Immediately' ] 'Within' [ NumParent ]
                   6800:                                     ElemID [ ExtStruct ] /
                   6801:                  'Attributes' /
                   6802:                   AttrID [ RelatAttr ] /
                   6803:                  'Presentation' /
1.34    ! cvs      6804:                   PresRule .
1.1       cvs      6805:    NumParent    = [ GreaterLess ] NParent .
1.30      cvs      6806:    GreaterLess  = '&gt;' / '&lt;' .
1.1       cvs      6807:    NParent      = NUMBER.
                   6808:    ExtStruct    = '(' ElemID ')' .
                   6809:    Alphabet     = NAME .
                   6810:    RelatAttr    ='=' Value /
1.30      cvs      6811:                  '&gt;' [ '-' ] Minimum /
1.1       cvs      6812:                  '&lt;' [ '-' ] Maximum /
                   6813:                  'IN' '[' [ '-' ] MinInterval '..'
                   6814:                           [ '-' ] MaxInterval ']' .
                   6815:    Value        = [ '-' ] IntegerVal / TextVal / AttrValue .
                   6816:    Minimum      = NUMBER .
                   6817:    Maximum      = NUMBER .
                   6818:    MinInterval  = NUMBER .
                   6819:    MaxInterval  = NUMBER .
                   6820:    IntegerVal   = NUMBER .
                   6821:    TextVal      = STRING .
1.18      cvs      6822:    AttrValue    = NAME .</pre>
1.30      cvs      6823: 
1.18      cvs      6824: <blockquote class="example">
1.30      cvs      6825:   <p><strong>Example:</strong></p>
                   6826: 
                   6827:   <p>Suppose that after each element of type Section_Title it is useful to
                   6828:   produce the text <tt>\label{SectX}</tt> where <tt>X</tt> represents the
                   6829:   section number, but only if the section is designated by one or more
                   6830:   references in the document.  The following conditional rule produces this
                   6831:   effect:</p>
                   6832:   <pre>RULES
1.1       cvs      6833:   Section_Title :
                   6834:     IF Referred
1.18      cvs      6835:       Create ('\label{Sect' Value(UniqueSectNum) '}\12') After;</pre>
1.30      cvs      6836: 
                   6837:   <p>(the declaration of the <a href="#sectc5224"><tt>UniqueSectNum</tt>
                   6838:   counter</a> is given above).  The string <tt>\12</tt> represents a line
                   6839:   break.</p>
1.18      cvs      6840: </blockquote>
1.30      cvs      6841: 
1.18      cvs      6842: <blockquote class="example">
1.30      cvs      6843:   <p><strong>Example:</strong></p>
                   6844: 
                   6845:   <p>Suppose that for elements of the Elmnt type it would be useful to produce
                   6846:   a character indicating the value of the numeric attribute Level associated
                   6847:   with the element: an  ``A'' for all values of Level less than 3, a ``B'' for
                   6848:   values between 3 and 10 and a ``C'' for values greater than 10.  This can be
                   6849:   achieved by writing the following rules for the Elmnt type:</p>
                   6850:   <pre>RULES
1.1       cvs      6851:   Elmnt :
                   6852:     BEGIN
                   6853:     IF Level &lt; 3
                   6854:       Create 'A';
                   6855:     IF Level IN [3..10]
                   6856:       Create 'B';
1.30      cvs      6857:     IF Level &gt; 10
1.1       cvs      6858:       Create 'C';
1.18      cvs      6859:     END;</pre>
                   6860: </blockquote>
                   6861: </div>
                   6862: </div>
1.1       cvs      6863: 
1.18      cvs      6864: <div class="subsection">
1.30      cvs      6865: <h3><a name="sectc529">Translation rules</a></h3>
1.1       cvs      6866: 
1.30      cvs      6867: <p>Fifteen types of translation rules can be associated with element types and
1.18      cvs      6868: attribute values.  They are the <tt>Create</tt>, <tt>Write</tt>,
                   6869: <tt>Read</tt>, <tt>Include</tt>, <tt>Get</tt>, <tt>Copy</tt>, <tt>Use</tt>,
1.31      cvs      6870: <tt>Remove</tt>, <tt>Ignore</tt>, <tt>NoTranslation</tt>,
                   6871: <tt>NoLineBreak</tt>, <tt>ChangeMainFile</tt>, <tt>RemoveFile</tt>,
                   6872: <tt>Set</tt>, <tt>Add</tt>, <tt>Indent</tt>, rules.  Each rule has its own
                   6873: syntax, although they are all based on very similar models.</p>
1.18      cvs      6874: <pre>     SimpleRule = 'Create' [ 'IN' VarID ] Object
1.1       cvs      6875:                         [ Position ] ';' /
                   6876:                   'Write' Object [ Position ] ';' /
                   6877:                   'Read' BufferID [ Position ] ';' /
                   6878:                   'Include' File [ Position ] ';' /
                   6879:                   'Get' [ RelPosition ] ElemID 
                   6880:                         [ ExtStruct ] 
                   6881:                         [ Position ] ';' /
                   6882:                   'Copy' [ RelPosition ] ElemID 
                   6883:                         [ ExtStruct ] 
                   6884:                         [ Position ] ';' /
                   6885:                   'Use' TrSchema [ 'For' ElemID ] ';' /
                   6886:                   'Remove' ';' /
1.31      cvs      6887:                   'Ignore' ';' /
1.1       cvs      6888:                   'NoTranslation' ';' /
                   6889:                   'NoLineBreak' ';' /
                   6890:                   'ChangeMainFile' VarID [ Position ] ';' /
1.14      cvs      6891:                   'RemoveFile' VarID [ Position ] ';' /
1.10      cvs      6892:                   'Set' CounterID InitValue [ Position ] ';' /
                   6893:                   'Add' CounterID Increment [ Position ] ';' /
1.25      cvs      6894:                   'Indent' [ 'IN' VarID ] Indent [ Position ] ';' .</pre>
1.18      cvs      6895: </div>
                   6896: 
                   6897: <div class="subsection">
1.30      cvs      6898: <h3><a name="sectc5210">The <tt>Create</tt> rule</a></h3>
1.18      cvs      6899: 
1.30      cvs      6900: <p>The most frequently used rule is undoubtedly the <tt>Create</tt> rule,
                   6901: which generates fixed or variable text (called an <em>object</em>) in the
                   6902: output file.  The generated text can be made to appear either before or after
                   6903: the content of the element to which the rule applies. The rule begins with the
1.18      cvs      6904: <tt>Create</tt> keyword, followed by a specifier for the object and a keyword
                   6905: (<tt>Before</tt> or <tt>After</tt>) indicating the position of the generated
                   6906: text (<a href="#sectc5222">before or after</a> the element's content).  If the
1.1       cvs      6907: position is not indicated, the object will be generated before the element's
                   6908: content.  This rule, like all translation rules, is terminated by a
1.18      cvs      6909: semicolon.</p>
1.30      cvs      6910: 
                   6911: <p>The <tt>Create</tt> keyword can be followed by the <tt>IN</tt> keyword and
                   6912: by the name of a variable.  This means that the text generated by the rule
                   6913: must not be written in the main output file, but in the file whose name is
1.18      cvs      6914: specified by the variable.</p>
1.30      cvs      6915: 
                   6916: <p>This allows the translation program to generate text in different files
                   6917: during the same run. These files do not need to be explicitely declared or
                   6918: opened. They do not need to be closed either, but if they contain temporary
                   6919: data, they can be removed (see the <a href="#sectc5220a"><tt>RemoveFile</tt>
                   6920: rule</a>). As soon as the translation program executes a <tt>Create</tt> rule
                   6921: for a file that is not yet open, it opens the file. These files are closed
                   6922: when the translation is finished.</p>
1.18      cvs      6923: <pre>               'Create' [ 'IN' VarID ] Object
1.1       cvs      6924:                         [ Position ] ';'
                   6925:      Object   = ConstID / CharString /
                   6926:                 BufferID /
                   6927:                 VarID /
1.30      cvs      6928:                '(' Function &lt; Function &gt; ')' /
1.21      cvs      6929:                 [ 'Translated' ] AttrID /
1.1       cvs      6930:                'Value' /
                   6931:                'Content' /
                   6932:                'Attributes' /
                   6933:                'Presentation' /
                   6934:                'RefId' /
                   6935:                'PairId' /
                   6936:                'FileDir' /
                   6937:                'FileName' /
                   6938:                'Extension' /
                   6939:                'DocumentName' /
                   6940:                'DocumentDir' /
                   6941:                 [ 'Referred' ] ReferredObject .
                   6942:      Position ='After' / 'Before' .
                   6943: 
                   6944:      ReferredObject = VarID /
                   6945:                 ElemID [ ExtStruct ] /
                   6946:                'RefId' /
                   6947:                'DocumentName' /
1.18      cvs      6948:                'DocumentDir' .</pre>
1.30      cvs      6949: 
                   6950: <p>The object to be generated can be:</p>
1.18      cvs      6951: <ul>
1.30      cvs      6952:   <li>a constant string, specified by its name if it is declared in the
                   6953:     schema's <tt>CONST</tt> section, or given directly as a value between
                   6954:     apostrophes;</li>
                   6955:   <li>the contents of a buffer, designated by the name of the buffer;</li>
                   6956:   <li>a variable, designated by its name if it is declared in the translation
                   6957:     schema's <tt>VAR</tt> section, or given directly between parentheses.  The
                   6958:     text generated is the value of that variable evaluated for the element to
                   6959:     which the rule applies.</li>
                   6960:   <li>the value of an attribute, if the element being translated has this
                   6961:     attribute. The attribute is specified by its name. If it's a text
                   6962:     attribute, it can be preceded by the <code>Translated</code> keyword,
                   6963:     which causes the attribute value to be recoded using the text translation
                   6964:     table defined by section <code><a
                   6965:     href="#sectc5225">TEXTTRANSLATE</a></code>;</li>
                   6966:   <li>the value of a specific presentation rule.  This object can only be
                   6967:     generated if the translation rule is for a <a href="#prestransl">specific
                   6968:     presentation rule</a>.  It is specified by the <tt>Value</tt>
                   6969:   keyword;</li>
                   6970:   <li>the element's content.  That is, the content of the leaves of the
                   6971:     subtree of the translated element.  This is specified by the
                   6972:     <tt>Content</tt> keyword;</li>
                   6973:   <li>the translation of all attributes of the element (which is primarily
                   6974:     used to apply the attribute translation rules <a
                   6975:     href="#sectc5222">before</a> those of the element type).  This is
                   6976:     specified by the <tt>Attributes</tt> keyword.</li>
                   6977:   <li>the translation of all of the element's specific presentation rules
                   6978:     (which is primarily used to apply the translation rules for the specific
                   6979:     presentation rules <a href="#sectc5222">before</a> those of the element or
                   6980:     its attributes). This option is specified by the <tt>Presentation</tt>
                   6981:     keyword;</li>
                   6982:   <li>The value of the reference's identifier.<br>
                   6983:     Thot associates a unique identifier with each element in a document.  This
                   6984:     identifier (called <em>reference's identifier</em> or <em>label</em>) is a
                   6985:     character string containing the letter `L' followed by digits.  Thot uses
                   6986:     it in references for identifying the referred element.<br>
                   6987:     The <tt>RefId</tt> keyword produces the reference's identifier of the
                   6988:     element to which the translation rule is applied, or the reference's
                   6989:     identifier of its first ancestor that is referred by a reference or that
                   6990:     can be referred by a reference.</li>
                   6991:   <li>the value of a mark pair's unique identifier.  This may only be used for
                   6992:     <a href="#sectd3285">mark pairs</a> and is indicated by the
                   6993:     <tt>PairId</tt> keyword.</li>
                   6994:   <li>the directory containing the file being generated (this string includes
                   6995:     an ending '/', if it is not empty).  This is indicated by the
                   6996:     <tt>FileDir</tt> keyword.</li>
                   6997:   <li>the name of the file being generated (only the name, without the
                   6998:     directory and without the extension). This is indicated by the
                   6999:     <tt>FileName</tt> keyword.</li>
                   7000:   <li>the extension of the file being generated (this string starts with a
                   7001:     dot, if it is not empty).  This is indicated by the <tt>Extension</tt>
                   7002:     keyword.</li>
                   7003:   <li>the name of the document being translated.  This is indicated by the
                   7004:     <tt>DocumentName</tt> keyword.</li>
                   7005:   <li>the directory containing the document being translated.  This is
                   7006:     indicated by the <tt>DocumentDir</tt> keyword.</li>
1.18      cvs      7007: </ul>
1.30      cvs      7008: 
                   7009: <p>When the rule applies to a reference (an element or an attribute defined as
                   7010: a reference in the structure schema), it can generate a text related to the
1.21      cvs      7011: element referred by that reference.  The rule name is then followed by the
1.18      cvs      7012: <tt>Referred</tt> keyword and a specification of the object to be generated
                   7013: for the referred element.  This specification can be:</p>
                   7014: <ul>
1.30      cvs      7015:   <li>the name of a variable.  The rule generates the value of that variable,
                   7016:     computed for the referred element.</li>
                   7017:   <li>an element type.  The rule generates the translation of the element of
                   7018:     that type, which is in the subtree of the referred element.  If this
                   7019:     element is not defined in the structure schema which corresponds to the
                   7020:     translation schema (that is, an object defined in another schema), the
                   7021:     element's type name must be followed by the name of its structure schema
                   7022:     between parentheses.</li>
                   7023:   <li>the <tt>RefId</tt> keyword.  The rule generates the reference's
                   7024:     identifier of the referred element.</li>
                   7025:   <li>the <tt>DocumentName</tt> keyword.  The rule generates the name of the
                   7026:     document to which the referred element belongs.</li>
                   7027:   <li>the <tt>DocumentDir</tt> keyword.  The rule generates the name of the
                   7028:     directory that contains the document of the referred element.</li>
1.18      cvs      7029: </ul>
                   7030: </div>
1.1       cvs      7031: 
1.18      cvs      7032: <div class="subsection">
1.30      cvs      7033: <h3><a name="sectc5211">The <tt>Write</tt> rule</a></h3>
1.1       cvs      7034: 
1.30      cvs      7035: <p>The <tt>Write</tt> has the same syntax as the <tt>Create</tt> rule.  It
                   7036: also produces the same effect, but the generated text is displayed on the
                   7037: user's terminal during the translation of the document, instead of being
                   7038: produced in the translated document.  This is useful for helping the user keep
                   7039: track of the progress of the translation and for prompting the user on the
                   7040: terminal for input required by the <tt>Read</tt> rule.</p>
1.18      cvs      7041: <pre>               'Write' Object [ Position ] ';'</pre>
1.30      cvs      7042: 
                   7043: <p>Notice: if the translator is launched by the editor (by the ``Save as''
1.18      cvs      7044: command), messages produced by the <tt>Write</tt> rule are not displayed.</p>
1.30      cvs      7045: 
1.18      cvs      7046: <blockquote class="example">
1.30      cvs      7047:   <p><strong>Example:</strong></p>
                   7048: 
                   7049:   <p>To make the translator display the number of each section being
                   7050:   translated on the user's terminal, the following rule is specified for the
                   7051:   <tt>Section</tt> element type:</p>
                   7052:   <pre>Section : BEGIN
1.1       cvs      7053:           Write VarSection;
                   7054:           ...
1.18      cvs      7055:           END;</pre>
1.30      cvs      7056: 
                   7057:   <p>(see <a href="#varsectexample">above</a> for the definition of the
                   7058:   <tt>VarSection</tt> variable).</p>
                   7059: 
                   7060:   <p>To display text on the terminal before issuing a read operation with the
                   7061:   <tt>Read</tt> rule, the following rule is used:</p>
                   7062:   <pre>BEGIN
1.1       cvs      7063: Write 'Enter the name of the destination: ';
                   7064: ...
1.18      cvs      7065: END;</pre>
                   7066: </blockquote>
                   7067: </div>
                   7068: 
                   7069: <div class="subsection">
1.30      cvs      7070: <h3><a name="sectc5212">The <tt>Read</tt> rule</a></h3>
1.18      cvs      7071: 
1.30      cvs      7072: <p>The <tt>Read</tt> rule reads text from the terminal during the translation
                   7073: of the document and saves the text read in one of the buffers declared in the
1.18      cvs      7074: <tt>BUFFERS</tt> section of the schema.  The buffer to be used is indicated by
                   7075: its name, after the <tt>READ</tt> keyword.  This name can be followed, as in
                   7076: the <tt>Create</tt> and <tt>Write</tt> rules, by a keyword indicating if the
                   7077: read operation must be performed <tt>Before</tt> or <tt>After</tt> the
1.1       cvs      7078: translation of the element's content.  If this keyword is absent, the read
                   7079: operation is done beforehand.  The text is read into the buffer and remains
1.5       cvs      7080: there until a rule using the same buffer - possibly the same rule - is
1.18      cvs      7081: applied.</p>
                   7082: <pre>               'Read' BufferID [ Position ] ';'</pre>
1.30      cvs      7083: 
1.18      cvs      7084: <blockquote class="example">
1.30      cvs      7085:   <p><strong>Example:</strong></p>
                   7086: 
                   7087:   <p>The following set of rules tells the user that the translator is waiting
                   7088:   for the entry of some text, reads this text into a buffer and copies the
                   7089:   text into the translated document.</p>
                   7090:   <pre>BEGIN
1.1       cvs      7091: Write 'Enter the name of the destination: ';
                   7092: Read DestName;
                   7093: Create DestName;
                   7094: ...
1.18      cvs      7095: END;</pre>
1.30      cvs      7096: 
                   7097:   <p>(see <a href="#destname">above</a> the definition of
                   7098:   <tt>DestName</tt>).</p>
1.18      cvs      7099: </blockquote>
                   7100: </div>
                   7101: 
                   7102: <div class="subsection">
1.30      cvs      7103: <h3><a name="sectc5213">The <tt>Include</tt> rule</a></h3>
1.18      cvs      7104: 
1.30      cvs      7105: <p>The <tt>Include</tt> rule, like the <tt>Create</tt> rule, is used to
                   7106: produce text in the translated document.  It inserts constant text which is
                   7107: not defined in the translation schema, but is instead taken from a file.  The
1.18      cvs      7108: file's name  is specified after the <tt>Include</tt> keyword, either directly
1.1       cvs      7109: as a character string between apostrophes or as the name of one of the buffers
1.18      cvs      7110: declared in the <tt>BUFFERS</tt> section of the schema.  In the latter case,
1.1       cvs      7111: the buffer is assumed to contain the file's name.  This can be used when the
                   7112: included file's name is known only at the moment of translation.  This only
1.18      cvs      7113: requires that the <tt>Include</tt> rule is preceded by a <tt>Read</tt> rule
                   7114: which puts the name of the file desired by the user into the buffer.</p>
1.30      cvs      7115: 
                   7116: <p>Like the other rules, it is possible to specify whether the inclusion will
1.1       cvs      7117: occur before or after the element's content, with the default being before.
                   7118: The file inclusion is only done at the moment of translation, not during the
                   7119: compilation of the translation schema. Thus, the file to be included need not
                   7120: exist during the compilation, but it must be accessible at the time of
                   7121: translation.  Its contents can also be modified between two translations, thus
                   7122: producing different results, even if neither the document or the translation
1.18      cvs      7123: schema are modified.</p>
1.30      cvs      7124: 
                   7125: <p>During translation, the file to be included is searched for along the
                   7126: schema directory path (indicated by the environment variable
                   7127: <tt>THOTSCH</tt>).  The file name is normally only composed of a simple name,
                   7128: without specification of a complete file path.  However, if the filename
                   7129: starts with a '/', it is considered as an absolute path.</p>
1.18      cvs      7130: <pre>                'Include' File [ Position ] ';'
1.6       cvs      7131:      File     = FileName / BufferID .
1.18      cvs      7132:      FileName = STRING .</pre>
1.30      cvs      7133: 
1.18      cvs      7134: <blockquote class="example">
1.30      cvs      7135:   <p><strong>Example:</strong></p>
                   7136: 
                   7137:   <p>Suppose that it is desirable to print documents of the Article class with
                   7138:   a formatter which requires a number of declarations and definitions at the
                   7139:   beginning of the file.  The <tt>Include</tt>rule can be used to achieve
                   7140:   this. All the declarations and definitions a replaced in a file called
                   7141:   <tt>DeclarArt</tt> and then the <tt>Article</tt> element type is given the
                   7142:   following rule:</p>
                   7143:   <pre>Article : BEGIN
1.1       cvs      7144:           Include 'DeclarArt' Before;
                   7145:           ...
1.18      cvs      7146:           END;</pre>
                   7147: </blockquote>
                   7148: </div>
                   7149: 
                   7150: <div class="subsection">
1.30      cvs      7151: <h3><a name="sectc5214">The <tt>Get</tt> rule</a></h3>
1.18      cvs      7152: 
1.30      cvs      7153: <p>The <tt>Get</tt> rule is used to change the order in which the elements
                   7154: appear in the translated document.  More precisely, it produces  the
                   7155: translation of a specified element before or after the translation of the
                   7156: content of the element to which the rule applies.  The <tt>Before</tt> and
                   7157: <tt>After</tt> keywords are placed at the end of the rule to specify whether
                   7158: the operation should be performed before or after translation of the rule's
                   7159: element (the default is before). The type of the element to be moved must be
                   7160: specified after the <tt>Get</tt> keyword, optionally preceded by a keyword
                   7161: indicating where the element will be found in the logical structure of the
                   7162: document:</p>
1.18      cvs      7163: <dl>
1.30      cvs      7164:   <dt><tt>Included</tt></dt>
                   7165:     <dd>The element to be moved is the first element of the indicated type
                   7166:       which is found inside the element to which the rule applies.</dd>
                   7167:   <dt><tt>Referred</tt></dt>
                   7168:     <dd>This keyword can only be used if the rule applies to a reference
                   7169:       element. The element to be moved is either the element designated by the
                   7170:       reference (if that element is of the specified type), or the first
                   7171:       element of the desired type contained within the element designated by
                   7172:       the reference.</dd>
                   7173:   <dt>no keyword</dt>
                   7174:     <dd>If the element to be moved is an associated element, defined in the <a
                   7175:       href="#sectc314"><tt>ASSOC</tt> section</a> of the structure schema, all
                   7176:       associated elements of this type which have not been translated yet are
                   7177:       then translated.  Certain elements may in fact have already been
                   7178:       translated by a <tt>Get Referred</tt> rule.
                   7179:       <p>If the element to be moved is not an associated element, the
                   7180:       translator takes the first element of the indicated type from among the
                   7181:       siblings of the rule's element.  This is primarily used to change the
                   7182:       order of the components of an aggregate.</p>
                   7183:     </dd>
1.18      cvs      7184: </dl>
1.30      cvs      7185: 
                   7186: <p>If the element to be moved is defined in a structure schema which is not
                   7187: the one which corresponds to the translation schema (in the case of an
                   7188: included object with a different schema), the type name of this element must
                   7189: be followed, between parentheses, by the name of the structure schema which
1.18      cvs      7190: defines it.</p>
                   7191: <pre>                   'Get' [ RelPosition ] ElemID 
1.6       cvs      7192:                          [ ExtStruct ]
                   7193:                          [ Position ] ';' /
                   7194:      RelPosition = 'Included' / 'Referred' .
1.18      cvs      7195:      ExtStruct   = '(' ElemID ')' .</pre>
1.30      cvs      7196: 
                   7197: <p>The <tt>Get</tt> rule has no effect if the element which it is supposed to
1.1       cvs      7198: move has already been translated.  Thus, the element will not be duplicated.
                   7199: It is generally best to associate the rule with the first element which will
                   7200: be encountered by the translator in its traversal of the document.  Suppose an
1.18      cvs      7201: aggregate has two elements <tt>A</tt> and <tt>B</tt>, with <tt>A</tt>
1.1       cvs      7202: appearing first in the logical structure.  To permute these two elements, a
1.18      cvs      7203: <tt>Get B before</tt> rule should be associated with the <tt>A</tt> element
                   7204: type, not the inverse.  Similarly, a rule of the form <tt>Get Included X
                   7205: After</tt>, even though syntactically correct, makes no sense since, by the
1.1       cvs      7206: time it will be applied, after the translation of the contents of the element
1.18      cvs      7207: to which it is attached, the <tt>X</tt> element will already have been
                   7208: translated.</p>
1.30      cvs      7209: 
                   7210: <p>The <tt>Get</tt> rule is the only way to obtain the translation of the
1.1       cvs      7211: associated elements.  In fact, the translator only traverses the primary tree
                   7212: of the document and thus does not translate the associated elements, except
1.18      cvs      7213: when the translation is explicitly required by a <tt>Get Referred Type</tt> or
                   7214: <tt>Get Type</tt> rule where <tt>Type</tt> is an associated element type.</p>
1.30      cvs      7215: 
1.18      cvs      7216: <blockquote class="example">
1.30      cvs      7217:   <p><strong>Example:</strong></p>
                   7218: 
                   7219:   <p>The structure schema defined figures as associated element which are
                   7220:   composed of some content and a caption.  Moreover, it is possible to make
                   7221:   references to figures, using elements of the <tt>RefFigure</tt> type:</p>
                   7222:   <pre>     ...
1.1       cvs      7223:      RefFigure = REFERENCE(Figure);
                   7224: ASSOC
1.6       cvs      7225:      Figure    = BEGIN
                   7226:                  Content = NATURE;
                   7227:                  Caption = Text;
                   7228:                  END;
1.18      cvs      7229:      ...</pre>
1.30      cvs      7230: 
                   7231:   <p>Suppose it would be useful to make a figure appear in the translated
                   7232:   document at the place in the text where the first reference to the figure is
                   7233:   made.  If some figures are not referenced, then they would appear at the end
                   7234:   of the document.  Also, each figure's caption should appear before the
                   7235:   content.  The following rules in the translation schema will produce this
                   7236:   result:</p>
                   7237:   <pre>Article :   BEGIN
1.1       cvs      7238:             ...
                   7239:             Get Figures After;
                   7240:             END;
                   7241: RefFigure : BEGIN
                   7242:             If FirstRef Get Referred Figure;
                   7243:             ...
                   7244:             END;
                   7245: Content :   BEGIN
                   7246:             Get Caption Before;
                   7247:             ...
1.18      cvs      7248:             END;</pre>
                   7249: </blockquote>
                   7250: </div>
                   7251: 
                   7252: <div class="subsection">
1.30      cvs      7253: <h3><a name="sectc5215">The <tt>Copy</tt> rule</a></h3>
1.18      cvs      7254: 
1.30      cvs      7255: <p>Like the <tt>Get</tt> rule, the <tt>Copy</tt> rule generates the
                   7256: translation of a specified element, but it acts even if the element has
                   7257: already been translated and it allows to copy it or to translate it later.
                   7258: Both rules have the same syntax.</p>
1.18      cvs      7259: <pre>              'Copy' [ RelPosition ] ElemID 
                   7260:                      [ ExtStruct ] [ Position ] ';'</pre>
                   7261: </div>
                   7262: 
                   7263: <div class="subsection">
1.30      cvs      7264: <h3><a name="sectc5216">The <tt>Use</tt> rule</a></h3>
1.18      cvs      7265: 
1.30      cvs      7266: <p>The <tt>Use</tt> rule specifies the translation schema to be applied to
1.1       cvs      7267: objects of a certain class that are part of the document.  This rule only
                   7268: appears in the rules for the root element of the document (the first type
1.18      cvs      7269: defined after the <tt>STRUCT</tt> keyword in the structure schema) or the
1.1       cvs      7270: rules of an element defined by an external structure (by another structure
1.18      cvs      7271: schema).  Also, the <tt>Use</tt> rule cannot be conditional.</p>
1.30      cvs      7272: 
                   7273: <p>If the rule is applied to an element defined by an external structure, the
1.18      cvs      7274: <tt>Use</tt> keyword is simply followed by the name of the translation schema
1.1       cvs      7275: to be used for element constructed  according to that external structure.  If
                   7276: the rule is applied to the document's root element, it is formed by the
1.18      cvs      7277: <tt>Use</tt> keyword followed by the translation schema's name, the
                   7278: <tt>For</tt> keyword and the name of the external structure to which the
                   7279: indicated translation schema should be applied.</p>
                   7280: <pre>               'Use' TrSchema [ 'For' ElemID ] ';'
                   7281:      TrSchema = NAME .</pre>
1.30      cvs      7282: 
                   7283: <p>If no <tt>Use</tt> rule defines the translation schema to be used for an
1.1       cvs      7284: external structure which appears in a document, the translator asks the user,
                   7285: during the translation process, which schema should be used. Thus, it is not
1.18      cvs      7286: necessary to give the translation schema a <tt>Use</tt> rule for every
1.1       cvs      7287: external structure used, especially when the choice of translation schemas is
1.18      cvs      7288: to be left to the user.</p>
1.30      cvs      7289: 
                   7290: <p>Notice: if the translator is launched by the editor (by the ``Save as''
1.18      cvs      7291: command), prompts are not displayed.</p>
1.30      cvs      7292: 
1.18      cvs      7293: <blockquote class="example">
1.30      cvs      7294:   <p><strong>Example:</strong></p>
                   7295: 
                   7296:   <p>The <tt>Article</tt> structure schema uses the <tt>Formula</tt> external
                   7297:   structure, defined by another structure schema, for mathematical
                   7298:   formulas:</p>
                   7299:   <pre>STRUCTURE Article;
1.1       cvs      7300:    ...
                   7301: STRUCT
                   7302:    Article = ...
                   7303:    ...
                   7304:    Formula_in_text  = Formula;
                   7305:    Isolated_formula = Formula;
                   7306:    ...
1.18      cvs      7307: END</pre>
1.30      cvs      7308: 
                   7309:   <p>Suppose that it would be useful to use the <tt>FormulaT</tt> translation
                   7310:   schema for the formulas of an article.  This can be expressed in two
                   7311:   different ways in the <tt>Article</tt> class translation schema, using the
                   7312:   rules:</p>
                   7313:   <pre>RULES
1.1       cvs      7314:     Article :
1.18      cvs      7315:        Use FormulaT for Formula;</pre>
1.30      cvs      7316: 
                   7317:   <p>or:</p>
                   7318:   <pre>RULES
1.1       cvs      7319:     ...
                   7320:     Formula :
1.18      cvs      7321:        Use FormulaT;</pre>
                   7322: </blockquote>
                   7323: </div>
                   7324: 
                   7325: <div class="subsection">
1.30      cvs      7326: <h3><a name="sectc5217">The <tt>Remove</tt> rule</a></h3>
1.18      cvs      7327: 
1.30      cvs      7328: <p>The <tt>Remove</tt> rule indicates that nothing should be generated, in the
1.1       cvs      7329: translated document, for the content of the element to which the rule applies.
                   7330: The content of that element is simply ignored by the translator.  This does
                   7331: not prevent the generation of text for the element itself, using the
1.18      cvs      7332: <tt>Create</tt> or <tt>Include</tt> rules, for example.</p>
1.30      cvs      7333: 
                   7334: <p>The <tt>Remove</tt> rule is simply written with the <tt>Remove</tt>
                   7335: keyword. It is terminated, like all rules, by a semicolon.</p>
1.18      cvs      7336: <pre>               'Remove' ';'</pre>
                   7337: </div>
                   7338: 
                   7339: <div class="subsection">
1.31      cvs      7340: <h3><a name="sectc5217a">The <tt>Ignore</tt> rule</a></h3>
                   7341: 
                   7342: <p>The <tt>Ignore</tt> rule indicates that nothing should be generated, in the
                   7343: translated document, for the element to which the rule applies. The whole
1.32      cvs      7344: element is simply ignored by the translator.</p>
1.31      cvs      7345: 
                   7346: <p>The <tt>Ignore</tt> rule is simply written with the <tt>Ignore</tt>
                   7347: keyword. It is terminated, like all rules, by a semicolon.</p>
                   7348: <pre>               'Ignore' ';'</pre>
                   7349: </div>
                   7350: 
                   7351: <div class="subsection">
1.30      cvs      7352: <h3><a name="sectc5218">The <tt>NoTranslation</tt> rule</a></h3>
1.18      cvs      7353: 
1.30      cvs      7354: <p>The <tt>NoTranslation</tt> rule indicates to the translator that it must
                   7355: not translate the content of the leaves of the element to which it applies. In
1.18      cvs      7356: contrast to the <tt>Remove</tt> rule, it does not suppress the content of the
1.1       cvs      7357: element, but it inhibits the translation of character strings, symbols, and
                   7358: graphical elements contained in the element.  These are retrieved so that
1.18      cvs      7359: after the translation of the document, the rules of the <a
                   7360: href="#sectc5225"><tt>TEXTTRANSLATE</tt>, <tt>SYMBTRANSLATE</tt> and
                   7361: <tt>GRAPHTRANSLATE</tt> sections</a> will not be applied to them.</p>
1.30      cvs      7362: 
                   7363: <p>The <tt>NoTranslation</tt> rule is written with the <tt>NoTranslation</tt>
1.18      cvs      7364: keyword followed by a semicolon.</p>
                   7365: <pre>               'NoTranslation' ';'</pre>
                   7366: </div>
                   7367: 
                   7368: <div class="subsection">
1.30      cvs      7369: <h3><a name="sectc5219">The <tt>NoLineBreak</tt> rule</a></h3>
1.18      cvs      7370: 
1.30      cvs      7371: <p>The <tt>NoLineBreak</tt> rule indicates to the translator that it must not
1.1       cvs      7372: generate additional line breaks in the output produced for the element to
1.18      cvs      7373: which it applies.  This is as if it was an <a href="#sectc522">instruction
                   7374: <tt>LINELENGTH 0;</tt></a> at the beginning of the translation schema, but
                   7375: only for the current element.</p>
1.30      cvs      7376: 
                   7377: <p>The <tt>NoLineBreak</tt> rule is written with the <tt>NoLineBreak</tt>
                   7378: keyword followed by a semicolon.</p>
1.18      cvs      7379: <pre>               'NoLineBreak' ';'</pre>
                   7380: </div>
1.1       cvs      7381: 
1.18      cvs      7382: <div class="subsection">
1.30      cvs      7383: <h3><a name="sectc5220">The <tt>ChangeMainFile</tt> rule</a></h3>
1.1       cvs      7384: 
1.30      cvs      7385: <p>When the translation program starts, it opens a main output file, whose
                   7386: name is given as a parameter of the translator.  All <a
1.18      cvs      7387: href="#sectc5210"><tt>Create</tt> rules</a> without explicit indication of the
                   7388: output file write sequentially in this file.  When a <tt>ChangeMainFile</tt>
                   7389: rule is executed, the main output file is closed and it is replaced by a new
                   7390: one, whose name is specified in the <tt>ChangeMainFile</tt> rule.  The
                   7391: <tt>Create</tt> rules without indication of the output file that are then
                   7392: executed write in this new file.  Several <tt>ChangeMainFile</tt> rules can be
                   7393: executed during the same translation, for dividing the main output into
                   7394: several files.</p>
1.30      cvs      7395: 
                   7396: <p>This rule is written with the <tt>ChangeMainFile</tt> keyword followed by
                   7397: the name of a variable that specifies the name of the new main file. The
                   7398: keyword <tt>Before</tt> or <tt>After</tt> can be placed at the end of the rule
                   7399: to specify whether the operation should be performed before or after
                   7400: translation of the rule's element (the default is before). This rule, like all
                   7401: translation rules, is terminated by a semicolon.</p>
1.18      cvs      7402: <pre>               'ChangeMainFile' VarID [ Position ] ';'</pre>
1.30      cvs      7403: 
1.18      cvs      7404: <blockquote class="example">
1.30      cvs      7405:   <p><strong>Example:</strong></p>
                   7406: 
                   7407:   <p>To generate the translation of each section in a different file, the
                   7408:   following rule can be associated with type <tt>Section</tt>.  That rule uses
                   7409:   the <a href="#varoutputfile"><tt>VarOutpuFile</tt> variable</a> defined
                   7410:   above.</p>
                   7411:   <pre>     Section:
1.18      cvs      7412:          ChangeMainFile VarOutpuFile Before;</pre>
1.30      cvs      7413: 
                   7414:   <p>If <tt>output.txt</tt> is the name of the output file specified when
                   7415:   starting the translation program, translated sections are written in files
                   7416:   <tt>output1.txt</tt>, <tt>output2.txt</tt>, etc.</p>
1.18      cvs      7417: </blockquote>
                   7418: </div>
1.1       cvs      7419: 
1.18      cvs      7420: <div class="subsection">
1.30      cvs      7421: <h3><a name="sectc5220a">The <tt>RemoveFile</tt> rule</a></h3>
1.14      cvs      7422: 
1.30      cvs      7423: <p>Files may be used for storing temporary data that are no longer needed when
1.18      cvs      7424: the translation of a document is complete.  These files may be removed by the
                   7425: <tt>RemoveFile</tt> rule.</p>
1.30      cvs      7426: 
                   7427: <p>This rule is written with the <tt>RemoveFile</tt> keyword followed by the
                   7428: name of a variable that specifies the name of the file to be removed.  The
                   7429: keyword <tt>Before</tt> or <tt>After</tt> can be placed at the end of the rule
                   7430: to specify whether the operation should be performed before or after
                   7431: translation of the rule's element (the default is before).  This rule, like
                   7432: all translation rules, is terminated by a semicolon.</p>
1.18      cvs      7433: <pre>               'RemoveFile' VarID [ Position ] ';'</pre>
                   7434: </div>
                   7435: 
                   7436: <div class="subsection">
1.30      cvs      7437: <h3><a name="sectc5221">The <tt>Set</tt> and <tt>Add</tt> rules</a></h3>
1.18      cvs      7438: 
1.30      cvs      7439: <p>The <tt>Set</tt> and <tt>Add</tt> rules are used for modifying the value of
1.18      cvs      7440: counters that have no <a href="#sectc524">counting function</a>.  Only this
                   7441: type of counter can be used in the <tt>Set</tt> and <tt>Add</tt> rules.</p>
1.30      cvs      7442: 
                   7443: <p>Both rules have the same syntax: after the keyword <tt>Set</tt> or
1.18      cvs      7444: <tt>Add</tt> appear the counter name and the value to assign to the counter
                   7445: (<tt>Set</tt> rule) or the value to be added to the counter (<tt>Add</tt>
                   7446: rule).  The keyword <tt>Before</tt> or <tt>After</tt> can follow that value to
1.1       cvs      7447: indicate when the rule must be applied: before or after the element's content
1.18      cvs      7448: is translated. By default, <tt>Before</tt> is assumed.  A semicolon terminates
                   7449: the rule.</p>
                   7450: <pre>               'Set' CounterID InitValue [ Position ] ';' /
                   7451:                'Add' CounterID Increment [ Position ] ';'</pre>
                   7452: </div>
                   7453: 
                   7454: <div class="subsection">
1.30      cvs      7455: <h3><a name="sectc5221a">The <tt>Indent</tt> rule</a></h3>
1.18      cvs      7456: 
1.30      cvs      7457: <p>The <tt>Indent</tt> rule is used to modify the value of text indentation in
1.18      cvs      7458: the output files.</p>
1.30      cvs      7459: 
                   7460: <p>Each time the translator creates a new line in an output file, it generates
                   7461: a variable number of space characters at the beginning of the new line.  By
1.25      cvs      7462: default, the number of these characters (the indentation value) is 0.  It can
                   7463: be changed with the <tt>Indent</tt> rule.</p>
1.30      cvs      7464: 
                   7465: <p>In its simple form, the rule begins with the <tt>Indent</tt> keyword,
1.25      cvs      7466: followed by the indentation sign (optional) and value and a keyword
1.30      cvs      7467: <tt>Before</tt> or <tt>After</tt> indicating that the indentation should be
                   7468: changed <a href="#sectc5222">before or after</a> the element's content is
                   7469: generated.  If the position is not indicated, the indentation is changed
1.25      cvs      7470: before the element's content is generated.  This rule, like all translation
                   7471: rules, is terminated by a semicolon.</p>
1.30      cvs      7472: 
                   7473: <p>The indentation value is indicated by an integer, which is the number of
                   7474: space characters to be generated at the beginning of each new line. A sign
1.18      cvs      7475: (<tt>+</tt> or <tt>-</tt>) can appear before the integer to indicate that the
                   7476: value is relative: the current value of indentation is incremented (if sign is
                   7477: <tt>+</tt>) or decremented (if sign is <tt>-</tt>) by the specified value.</p>
1.30      cvs      7478: 
                   7479: <p>Keyword <tt>Suspend</tt> or <tt>Resume</tt> can appear instead of the
1.25      cvs      7480: (possibly signed) identation value.  <tt>Suspend</tt> means that the new
1.30      cvs      7481: indentation value to be used is zero until another <tt>Indent</tt> rule is
                   7482: executed and changes the indentation value. <tt>Resume</tt> means that the
                   7483: indentation value that was used before the last <tt>Indent Suspend</tt> was
                   7484: executed becomes the new value.  Only one <tt>Suspend</tt> can be used before
                   7485: a <tt>Resume</tt>; <tt>Supend</tt>-<tt>Resume</tt> pairs can not be
                   7486: nested.</p>
                   7487: 
                   7488: <p>Like the <a href="#sectc5210"><tt>Create</tt> rule</a>, the <tt>Indent</tt>
1.18      cvs      7489: keyword can be followed by the <tt>IN</tt> keyword and by the name of a <a
                   7490: href="#sectc526">variable</a>.  This means that the rule must not change
1.10      cvs      7491: indentation in the main output file, but in the file whose name is specified
                   7492: by the variable (by default, indentation is changed in the main output
1.18      cvs      7493: file).</p>
1.25      cvs      7494: <pre>               'Indent' [ 'IN' VarID ] Indent [ Position ] ';' .
1.10      cvs      7495: 
1.25      cvs      7496: Indent        = 'Suspend' / 'Resume' / [ IndentSign ] IndentValue .
1.10      cvs      7497: IndentSign    = '+' / '-' .
1.18      cvs      7498: IndentValue   = NUMBER .</pre>
                   7499: </div>
1.10      cvs      7500: 
1.18      cvs      7501: <div class="subsection">
1.30      cvs      7502: <h3><a name="sectc5222">Rule application order</a></h3>
1.1       cvs      7503: 
1.30      cvs      7504: <p>The translator translates the elements which comprise the document in the
1.18      cvs      7505: order induced by the tree structure, except when the <tt>Get</tt> rule is used
1.1       cvs      7506: to change the order of translation.  For each element, the translator first
                   7507: applies the rules specified for the element's type that must be applied before
1.18      cvs      7508: translation of the element's content (rules ending with the <tt>Before</tt>
1.1       cvs      7509: keyword or which have no position keyword).  If several rules meet these
                   7510: criteria, the translator applies them in the order in where they appear in the
1.18      cvs      7511: translation schema.</p>
1.30      cvs      7512: 
                   7513: <p>It then applies all <a href="#sectc5223">rules for the attributes</a> which
1.1       cvs      7514: the element has and which must be applied before the translation of the
1.18      cvs      7515: element's content (rules ending with the <tt>Before</tt> keyword or which have
1.1       cvs      7516: no position keyword).  For one attribute value, the translator applies the
1.18      cvs      7517: rules in the order in which they are defined in the translation schema.</p>
1.30      cvs      7518: 
                   7519: <p>The same procedure is followed with translation rules for specific
1.18      cvs      7520: presentations.</p>
1.30      cvs      7521: 
1.31      cvs      7522: <p>Next, the element's content is translated, as long as a <tt>Remove</tt> or
                   7523: <code>Ignore</code> rule does not apply.</p>
1.30      cvs      7524: 
                   7525: <p>In the next step, the translator applies rules for the specific
                   7526: presentation of the element that are to be applied after translation of the
                   7527: content (rules which end with the <tt>After</tt> keyword).  The rules for each
                   7528: type of presentation rule or each value are applied in the order in which the
1.18      cvs      7529: translation appear in the schema.</p>
1.30      cvs      7530: 
                   7531: <p>Then, the same procedure is followed for translation rules for attributes
                   7532: of the element.</p>
                   7533: 
                   7534: <p>Finally, the translator applies rules for the element which must be applied
1.1       cvs      7535: after translation of the element's content.  These rules are applied in the
                   7536: order that they appear in the translation schema.  When the translation of an
                   7537: element is done, the translator procedes to translate the following
1.18      cvs      7538: element.</p>
1.30      cvs      7539: 
                   7540: <p>This order can be changed with the <tt>Attributes</tt> and
1.18      cvs      7541: <tt>Presentation</tt> options of the <a href="#sectc5210"><tt>Create</tt>
                   7542: rule</a>.</p>
                   7543: </div>
1.1       cvs      7544: 
1.18      cvs      7545: <div class="subsection">
1.30      cvs      7546: <h3><a name="sectc5223">Translation of logical attributes</a></h3>
1.1       cvs      7547: 
1.30      cvs      7548: <p>After the rules for the element types, the translation schema defines rules
1.18      cvs      7549: for attribute values.  This section begins with the <tt>ATTRIBUTES</tt>
1.1       cvs      7550: keyword and is composed of a sequence of rule blocks each preceded by an
1.18      cvs      7551: attribute name and an optional value or value range.</p>
1.30      cvs      7552: 
                   7553: <p>If the attribute's name appears alone before the rule block, the rule are
1.1       cvs      7554: applied to all element which have the attribute, no matter what value the
                   7555: attribute has.  In this case, the attribute name is followed by a colon before
1.18      cvs      7556: the beginning of the rule block.</p>
1.30      cvs      7557: 
                   7558: <p>The attribute's name can be followed by the name of an element type between
1.1       cvs      7559: parentheses.  This says, as in presentation schemas, that the rule block which
                   7560: follows applies not to the element which has the attribute, but to its
1.18      cvs      7561: descendants of the type indicated between the parentheses.</p>
1.30      cvs      7562: 
                   7563: <p>If values are given after the attribute name (or after the name of the
                   7564: element type), the rules are applied only when the attribute has the indicated
                   7565: values. The same attribute can appear several times, with different values and
1.1       cvs      7566: different translation rules.  Attribute values are indicated in the same way
1.18      cvs      7567: as in <a href="#sectc528">conditions</a> and are followed by a colon before
                   7568: the block of rules.</p>
1.30      cvs      7569: 
                   7570: <p>The rule block associated with an attribute is either a simple rule or a
1.18      cvs      7571: sequence of rules delimited by the <tt>BEGIN</tt> and <tt>END</tt> keywords.
                   7572: Note that rules associated with attribute values cannot be conditional.</p>
1.30      cvs      7573: 
                   7574: <p>Translation rules are not required for all attributes (or their values)
1.1       cvs      7575: defined in a structure schema.  Only those attributes for which a particular
                   7576: action must be performed by the translator must have such rules.  The rules
1.18      cvs      7577: that can be used are those described above, from <a
                   7578: href="#sectc5210"><tt>Create</tt></a> to <a
                   7579: href="#sectc5218"><tt>NoTranslation</tt></a>.</p>
1.30      cvs      7580: <pre>     AttrSeq       = TransAttr &lt; TransAttr &gt; .
1.1       cvs      7581:      TransAttr     = AttrID [ '(' ElemID ')' ] 
                   7582:                      [ RelatAttr ] ':' RuleSeq .
                   7583:      AttrID        = NAME .
1.18      cvs      7584:      ElemID        = NAME .</pre>
1.30      cvs      7585: 
1.18      cvs      7586: <blockquote class="example">
1.30      cvs      7587:   <p><strong>Example:</strong></p>
                   7588: 
                   7589:   <p>The structure defined the ``Language'' attribute which can take the
                   7590:   values ``French'' and ``English''.  To have the French parts of the original
                   7591:   document removed and prevent the translation of the leaves of the English
                   7592:   parts, the following rules would be used:</p>
                   7593:   <pre>ATTRIBUTES
1.1       cvs      7594:    Language=French :
                   7595:       Remove;
                   7596:    Language=English :
1.18      cvs      7597:       NoTranslation;</pre>
                   7598: </blockquote>
                   7599: </div>
1.1       cvs      7600: 
1.18      cvs      7601: <div class="subsection">
1.30      cvs      7602: <h3><a name="sectc5224">Translation of specific presentations</a></h3>
1.1       cvs      7603: 
1.30      cvs      7604: <p>After the rules for attributes, the translation schema defines rules for
                   7605: the specific presentation.  This section begins with the <tt>PRESENTATION</tt>
1.1       cvs      7606: keyword and is composed of a sequence of translation rule blocks each preceded
                   7607: by a presentation rule name, optionally accompanied by a part which depends on
1.18      cvs      7608: the particular presentation rule.</p>
1.30      cvs      7609: 
                   7610: <p>Each of these translation rule blocks is applied when the translator
                   7611: operates on an element which has a specific presentation rule of the type
                   7612: indicated at the head of the block.  Depending on the type of the specific
                   7613: presentation rule, it is possible to specify values of the presentation rule
                   7614: for which the translation rule block should be applied.</p>
                   7615: 
                   7616: <p>There are three categories of the presentation rules:</p>
                   7617: <ul>
                   7618:   <li>rules taking numeric values: <tt>Size</tt>, <tt>Indent</tt>,
                   7619:     <tt>LineSpacing</tt>, <tt>LineWeight</tt>,</li>
                   7620:   <li>rules whose values are taken from a predefined list (i.e. whose type is
                   7621:     an enumeration): <tt>Adjust</tt>, <tt>Justify</tt>, <tt>Hyphenate,/TT&gt;,
                   7622:     <tt>Style</tt>, <tt>Weight</tt>, <tt>Font</tt>, <tt>UnderLine</tt>,
                   7623:     <tt>Thickness</tt>, <tt>LineStyle</tt>,</tt></li>
                   7624:   <li>rules whose value is a name: <tt>FillPattern</tt>, <tt>Background</tt>,
                   7625:     <tt>Foreground</tt>.</li>
1.18      cvs      7626: </ul>
1.30      cvs      7627: 
                   7628: <p>For presentation rules of the first category, the values which provoke
1.1       cvs      7629: application of the translation rules are indicated in the same manner as for
1.18      cvs      7630: <a href="#relattr">numeric attributes</a>.  This can be either a unique value
1.1       cvs      7631: or range of values.  For a unique value, the value (an integer) is simply
                   7632: preceded by an equals sign.  Value ranges can be specified in one of three
1.18      cvs      7633: ways:</p>
                   7634: <ul>
1.30      cvs      7635:   <li>all values less than a given value (this value is preceded by a ``less
                   7636:     than'' sign '<tt>&lt;</tt>'),</li>
                   7637:   <li>all values greater than a given value (this value is preceded by a`
                   7638:     `greater than'' sign '<tt>&gt;</tt>'),</li>
                   7639:   <li>all values falling in an interval, bounds included.  The range of values
                   7640:     is then specified <tt>IN [</tt>Minimum<tt>..</tt>Maximum<tt>]</tt>, where
                   7641:     Minimum and Maximum are integers.</li>
1.18      cvs      7642: </ul>
1.30      cvs      7643: 
                   7644: <p>All numeric values can be negative, in which case the integer is preceded
                   7645: by a minus sign.  All values must be given in typographers points.</p>
                   7646: 
                   7647: <p>For presentation rules whose values are taken from a predefined list, the
1.1       cvs      7648: value which provokes application of the translation rules is simply indicated
1.18      cvs      7649: by the equals sign followed by the name of the value.</p>
1.30      cvs      7650: 
                   7651: <p>For presentation rules whose values are names, the value which provokes the
1.1       cvs      7652: application of translation rules is simply indicated by the equals sign
                   7653: followed by the name of the value.  The names of the fill patterns (the
1.18      cvs      7654: <tt>FillPattern</tt> rule) and of the colors (the <tt>Foreground</tt> and
                   7655: <tt>Background</tt> rules) used in Thot are the same as in the P language.</p>
1.30      cvs      7656: <pre>     PresSeq        = PresTrans &lt; PresTrans &gt; .
1.1       cvs      7657:      PresTrans      = PresRule ':' RuleSeq .
                   7658:      PresRule       = 'Size' [ PresRelation ] /
                   7659:                       'Indent' [ PresRelation ] /
                   7660:                       'LineSpacing' [ PresRelation ] /
                   7661:                       'Adjust' [ '=' AdjustVal ] /
                   7662:                       'Justify' [ '=' BoolVal ] /
                   7663:                       'Hyphenate' [ '=' BoolVal ] /
                   7664:                       'Style' [ '=' StyleVal ] /
1.24      cvs      7665:                       'Weight' [ '=' WeightVal ] /
1.1       cvs      7666:                       'Font' [ '=' FontVal ] /
                   7667:                       'UnderLine' [ '=' UnderLineVal ] /
                   7668:                       'Thickness' [ '=' ThicknessVal ] /
                   7669:                       'LineStyle' [ '=' LineStyleVal ] /
                   7670:                       'LineWeight' [ PresRelation ] /
                   7671:                       'FillPattern' [ '=' Pattern ] /
                   7672:                       'Background' [ '=' Color ] /
                   7673:                       'Foreground' [ '=' Color ] .
                   7674: 
                   7675:      PresRelation   = '=' PresValue /
1.30      cvs      7676:                       '&gt;' [ '-' ] PresMinimum /
1.1       cvs      7677:                       '&lt;' [ '-' ] PresMaximum /
                   7678:                       'IN' '[' [ '-' ] PresIntervalMin '..'
                   7679:                               [ '-' ] PresIntervalMax ']' .
                   7680:      AdjustVal      = 'Left' / 'Right' / 'VMiddle' / 
                   7681:                       'LeftWithDots' .
                   7682:      BoolVal        = 'Yes' / 'No' .
1.24      cvs      7683:      StyleVal       = 'Roman' / 'Italics' / 'Oblique' .
                   7684:      WeightVal      = 'Normal' / 'Bold' .
1.1       cvs      7685:      FontVal        = 'Times' / 'Helvetica' / 'Courier' .
                   7686:      UnderLineVal   = 'NoUnderline' / 'UnderLined' /
                   7687:                       'OverLined' / 'CrossedOut' .
                   7688:      ThicknessVal   = 'Thick' / 'Thin' .
1.6       cvs      7689:      LineStyleVal   = 'Solid' / 'Dashed' / 'Dotted' .
1.1       cvs      7690:      Pattern        = NAME .
                   7691:      Color          = NAME .
                   7692:      PresMinimum    = NUMBER .
                   7693:      PresMaximum    = NUMBER .
                   7694:      PresIntervalMin= NUMBER .
                   7695:      PresIntervalMax= NUMBER .
                   7696:      PresValue      = [ '-' ] PresVal .
1.18      cvs      7697:      PresVal        = NUMBER .</pre>
1.30      cvs      7698: 
                   7699: <p>The <a name="prestransl">translation rules associated with specific
1.18      cvs      7700: presentation rules</a> can use the value of the specific presentation rule
1.1       cvs      7701: that causes them to be applied.  This behavior is designated by the keyword
1.18      cvs      7702: <tt>Value</tt>. For numerically-valued presentation rules, the numeric value
1.1       cvs      7703: is produced.  For other presentation rules, the name of the value is
1.18      cvs      7704: produced.</p>
1.30      cvs      7705: 
                   7706: <p>It should be noted that modifications to the layout of the document's
                   7707: elements that are made using the combination of the control key and a mouse
                   7708: button will have no effect on the translation of the document.</p>
                   7709: 
                   7710: <blockquote class="example">
                   7711:   <p><strong>Example:</strong></p>
                   7712: 
                   7713:   <p>Suppose that it is desirable to use the same font sizes as in the
                   7714:   specific presentation, but the font size must be between 10 and 18
                   7715:   typographer's points. If font size is set in the translated document by the
                   7716:   string <tt>pointsize=n</tt> where <tt>n</tt> is the font size in
                   7717:   typographer's points then the following rules will suffice:</p>
                   7718:   <pre>PRESENTATION
1.1       cvs      7719:    Size &lt; 10 :
                   7720:         Create 'pointsize=10';
                   7721:    Size in [10..18] :
                   7722:         BEGIN
                   7723:         Create 'pointsize=';
                   7724:         Create Value;
                   7725:         END;
1.30      cvs      7726:    Size &gt; 18 :
1.18      cvs      7727:         Create 'pointsize=18';</pre>
                   7728: </blockquote>
                   7729: </div>
1.1       cvs      7730: 
1.18      cvs      7731: <div class="subsection">
1.30      cvs      7732: <h3><a name="sectc5225">Recoding of characters, symbols and graphics</a></h3>
1.1       cvs      7733: 
1.30      cvs      7734: <p>The coding of characters, graphical elements and symbols as defined in Thot
1.1       cvs      7735: does not necessarily correspond to what is required by an application to which
                   7736: a Thot document must be exported.  Because of this the translator can recode
                   7737: these terminal elements of the documents structure.  The last sections of a
                   7738: translation schema are intended for this purpose, each specifying the recoding
1.18      cvs      7739: rules for one type of terminal element.</p>
1.30      cvs      7740: 
                   7741: <p>The recoding rules for character strings are grouped by alphabets. There is
                   7742: a group of rules for each alphabet of the Thot document that must be
                   7743: translated. Each such group of rules begins with the <tt>TEXTTRANSLATE</tt>
                   7744: keyword, followed by the specification of the alphabet to translate and the
                   7745: recoding rules, between the <tt>BEGIN</tt> and <tt>END</tt> keywords unless
                   7746: there is only one recoding rule for the alphabet. The specification of the
                   7747: alphabet is not required: by default it is assumed to the Latin alphabet (the
                   7748: ISO Latin-1 character set).</p>
                   7749: 
                   7750: <p>Each recoding rule is formed by a source string between apostrophes and a
1.1       cvs      7751: target string, also between apostrophes, the two strings being separated by
1.30      cvs      7752: the arrow symbol (<tt>-&gt;</tt>), formed by the ``minus'' and ``greater
                   7753: than'' characters.  The rule is terminated by a semi-colon.</p>
1.18      cvs      7754: <pre>     TextTransSeq = [ Alphabet ] TransSeq .
1.1       cvs      7755:      Alphabet     = NAME .
1.30      cvs      7756:      TransSeq     ='BEGIN' &lt; Translation &gt; 'END' ';' /
1.1       cvs      7757:                     Translation .
1.30      cvs      7758:      Translation  = Source [ '-&gt;' Target ] ';' .
1.1       cvs      7759:      Source       = STRING .
1.18      cvs      7760:      Target       = STRING .</pre>
1.30      cvs      7761: 
                   7762: <p>One such rule signifies that when the source string appears in a text leaf
                   7763: of the document being translated, the translator must replace it, in the
1.1       cvs      7764: translated document, with the target string.  The source string and the target
                   7765: string can have different lengths and the target string can be empty.  In this
                   7766: last case, the translator simply suppresses every occurrence of the source
1.18      cvs      7767: string in the translated document.</p>
1.30      cvs      7768: 
                   7769: <p>For a given alphabet, the order of the rules is not important and has no
1.1       cvs      7770: significance because the T language compiler reorders the rules in ways that
                   7771: speed up the translator's work.  The total number of recoding rules is limited
1.18      cvs      7772: by the compiler as is the maximum length of the source and target strings.</p>
1.30      cvs      7773: 
                   7774: <p>The recoding rules for symbols and graphical elements are written in the
                   7775: same manner as the recoding rules for character strings.  They are preceded,
1.18      cvs      7776: respectively, by the <tt>SYMBTRANSLATE</tt> and <tt>GRAPHTRANSLATE</tt> and so
1.1       cvs      7777: not require a specification of the alphabet. Their source string is limited to
                   7778: one character, since, in Thot, each symbol and each graphical element is
                   7779: represented by a single character.  The symbol and graphical element codes are
1.18      cvs      7780: defined along with the <a href="#sect7">non-standard character codes</a>.</p>
1.30      cvs      7781: 
1.18      cvs      7782: <blockquote class="example">
1.30      cvs      7783:   <p><strong>Example:</strong></p>
                   7784: 
                   7785:   <p>In a translation schema producing documents destined for use with the
                   7786:   L<sup>A</sup>T<sub><big>E</big></sub>X formatter, the Latin characters``é''
                   7787:   (octal code 351 in Thot) and ``č'' (octal code 350 in Thot)  must be
                   7788:   converted to their representation in
                   7789:   L<sup>A</sup>T<sub><big>E</big></sub>X:</p>
                   7790:   <pre>TEXTTRANSLATE Latin
1.1       cvs      7791:      BEGIN
1.30      cvs      7792:      '\350' -&gt; '\`{e}';    { e grave }
                   7793:      '\351' -&gt; '\''{e}';   { e acute }
1.18      cvs      7794:      END;</pre>
                   7795: </blockquote>
                   7796: </div>
                   7797: </div>
                   7798: <hr>
                   7799: </div>
1.1       cvs      7800: 
1.18      cvs      7801: <div class="chapter">
1.30      cvs      7802: <h1><a name="sect6">Language grammars</a></h1>
1.1       cvs      7803: 
1.30      cvs      7804: <p>This chapter gives the complete grammars of the languages of Thot. The
1.1       cvs      7805: grammars were presented and described in the preceding chapters, which also
                   7806: specify the semantics of the languages.  This section gives only the
1.18      cvs      7807: syntax.</p>
1.1       cvs      7808: 
1.18      cvs      7809: <div class="section">
1.30      cvs      7810: <h2><a name="sectb61">The M meta-language</a></h2>
1.1       cvs      7811: 
1.30      cvs      7812: <p>The language grammars are all expressed in the same formalism, the M
1.18      cvs      7813: meta-language, which is defined in this section.</p>
                   7814: <pre>{ Any text between braces is a comment. }
1.30      cvs      7815: Grammar      = Rule &lt; Rule &gt; 'END' .
                   7816:                { The &lt; and &gt; signs indicate zero }
1.1       cvs      7817:                { or more repetitions. }
                   7818:                { END marks the end of the grammar. }
                   7819: Rule         = Ident '=' RightPart '.' .
                   7820:                { The period indicates the end of a rule }
                   7821: RightPart    = RtTerminal / RtIntermed .
                   7822:                { The slash indicates a choice }
                   7823: RtTerminal   ='NAME' / 'STRING' / 'NUMBER' .
                   7824:                { Right part of a terminal rule }
1.30      cvs      7825: RtIntermed   = Possibility &lt; '/' Possibility &gt; .
1.1       cvs      7826:                { Right part of an intermediate rule }
1.30      cvs      7827: Possibility  = ElemOpt &lt; ElemOpt &gt; .
                   7828: ElemOpt      = Element / '[' Element &lt; Element &gt; ']' /
                   7829:               '&lt;' Element &lt; Element &gt; '&gt;'  .
1.1       cvs      7830:                { Brackets delimit optional parts }
                   7831: Element      = Ident / KeyWord .
                   7832: Ident        = NAME .
                   7833:                { Identifier, sequence of characters
                   7834: KeyWord      = STRING .
                   7835:                { Character string delimited by apostrophes }
1.18      cvs      7836: END</pre>
                   7837: </div>
1.1       cvs      7838: 
1.18      cvs      7839: <div class="section">
1.30      cvs      7840: <h2><a name="sectb62">The S language</a></h2>
1.1       cvs      7841: 
1.30      cvs      7842: <p>The S language is used to write structure schemas, which contain the
                   7843: generic logical structures of document and object classes.  It is described
                   7844: here in the M meta-language.</p>
1.18      cvs      7845: <pre>StructSchema   = 'STRUCTURE' [ 'EXTENSION' ] ElemID ';'
1.1       cvs      7846:                  'DEFPRES' PresID ';'
                   7847:                [ 'ATTR' AttrSeq ]
                   7848:                [ 'STRUCT' RulesSeq ]
                   7849:                [ 'EXTENS' ExtensRuleSeq ]
                   7850:                [ 'ASSOC' RulesSeq ]
                   7851:                [ 'UNITS' RulesSeq ]
                   7852:                [ 'EXPORT' SkeletonSeq ]
                   7853:                [ 'EXCEPT' ExceptSeq ]
                   7854:                  'END' .
                   7855: 
                   7856: ElemID         = NAME .
                   7857: PresID         = NAME .
                   7858: 
1.30      cvs      7859: AttrSeq        = Attribute &lt; Attribute &gt; .
1.1       cvs      7860: Attribute      = AttrID '=' AttrType ';' .
                   7861: AttrType       = 'INTEGER' / 'TEXT' /
                   7862:                  'REFERENCE' '(' RefType ')' /
                   7863:                  ValueSeq .
                   7864: RefType        = 'ANY' /
                   7865:                  [ FirstSec ] ElemID [ ExtStruct ] .
1.30      cvs      7866: ValueSeq       = AttrVal &lt; ',' AttrVal &gt; .
1.1       cvs      7867: AttrID         = NAME .
                   7868: FirstSec       = 'First' / 'Second' .
                   7869: ExtStruct      = '(' ElemID ')' .
                   7870: AttrVal        = NAME .
                   7871: 
1.30      cvs      7872: RulesSeq       = Rule &lt; Rule &gt; .
1.1       cvs      7873: Rule           = ElemID [ LocAttrSeq ] '='
                   7874:                  DefWithAttr ';' .
                   7875: LocAttrSeq     = '(' 'ATTR' LocalAttr
1.30      cvs      7876:                       &lt; ';' LocalAttr &gt; ')' .
1.1       cvs      7877: LocalAttr      = [ '!' ] AttrID [ '=' AttrType ] .
                   7878: DefWithAttr    = Definition
                   7879:                  [ '+' '(' ExtensionSeq ')' ]
                   7880:                  [ '-' '(' RestrictSeq ')' ]
                   7881:                  [ 'WITH' FixedAttrSeq ] .
1.30      cvs      7882: ExtensionSeq   = ExtensionElem &lt; ',' ExtensionElem &gt; .
1.1       cvs      7883: ExtensionElem  = ElemID / 'TEXT' / 'GRAPHICS' /
                   7884:                  'SYMBOL' / 'PICTURE' .
1.30      cvs      7885: RestrictSeq    = RestrictElem &lt; ',' RestrictElem &gt; .
1.1       cvs      7886: RestrictElem   = ElemID / 'TEXT' / 'GRAPHICS' /
                   7887:                  'SYMBOL' / 'PICTURE' .
1.30      cvs      7888: FixedAttrSeq   = FixedAttr &lt; ',' FixedAttr &gt; .
1.1       cvs      7889: FixedAttr      = AttrID [ FixedOrModifVal ] .
                   7890: FixedOrModifVal= [ '?' ] '=' FixedValue .
                   7891: FixedValue     = [ '-' ] NumValue / TextValue / AttrVal .
                   7892: NumValue       = NUMBER .
                   7893: TextValue      = STRING .
                   7894: 
                   7895: Definition     = BaseType [ LocAttrSeq ] / Constr /
                   7896:                  Element .
                   7897: BaseType       = 'TEXT' / 'GRAPHICS' / 'SYMBOL' /
                   7898:                  'PICTURE' / 'UNIT' / 'NATURE' .
                   7899: Element        = ElemID [ ExtOrDef ] .
                   7900: ExtOrDef       = 'EXTERN' / 'INCLUDED' /
                   7901:                  [ LocAttrSeq ] '=' Definition .
                   7902: 
                   7903: Constr         = 'LIST' [ '[' min '..' max ']' ] 'OF'
                   7904:                         '(' DefWithAttr ')' /
                   7905:                  'BEGIN' DefOptSeq 'END' /
                   7906:                  'AGGREGATE' DefOptSeq 'END' /
                   7907:                  'CASE' 'OF' DefSeq 'END' /
                   7908:                  'REFERENCE' '(' RefType ')' /
                   7909:                  'PAIR' .
                   7910: 
                   7911: min            = Integer / '*' .
                   7912: max            = Integer / '*' .
                   7913: Integer        = NUMBER .
                   7914: 
1.30      cvs      7915: DefOptSeq      = DefOpt ';' &lt; DefOpt ';' &gt; .
1.1       cvs      7916: DefOpt         = [ '?' ] DefWithAttr .
                   7917: 
1.30      cvs      7918: DefSeq         = DefWithAttr ';' &lt; DefWithAttr ';' &gt; .
1.1       cvs      7919: 
1.30      cvs      7920: SkeletonSeq    = SkeletonElem &lt; ',' SkeletonElem &gt; ';' .
1.1       cvs      7921: SkeletonElem   = ElemID [ 'WITH' Contents ] .
                   7922: Contents       = 'Nothing' / ElemID [ ExtStruct ] .
                   7923: 
1.30      cvs      7924: ExceptSeq      = Except ';' &lt; Except ';' &gt; .
1.1       cvs      7925: Except         = [ 'EXTERN' ] [ FirstSec ] ExcTypeOrAttr ':'
                   7926:                  ExcValSeq .
                   7927: ExcTypeOrAttr  = ElemID / AttrID .
1.30      cvs      7928: ExcValSeq      = ExcValue &lt; ',' ExcValue &gt; .
1.1       cvs      7929: ExcValue       = 'NoCut' / 'NoCreate' /
                   7930:                  'NoHMove' / 'NoVMove' / 'NoMove' /
                   7931:                  'NoHResize' / 'NoVResize' / 'NoResize' /
1.18      cvs      7932:                  'MoveResize' /
1.1       cvs      7933:                  'NewWidth' / 'NewHeight' /
                   7934:                  'NewHPos' / 'NewVPos' /
                   7935:                  'Invisible' / 'NoSelect' /
                   7936:                  'Hidden' / 'ActiveRef' /
                   7937:                  'ImportLine' / 'ImportParagraph' /
1.9       cvs      7938:                  'NoPaginate' / 'ParagraphBreak' /
                   7939:                  'HighlightChildren' / 'ExtendedSelection' /
1.29      cvs      7940:                  'ReturnCreateNL' / 'ReturnCreateWithin' .
1.1       cvs      7941: 
1.30      cvs      7942: ExtensRuleSeq  = ExtensRule ';' &lt; ExtensRule ';' &gt; .
1.1       cvs      7943: ExtensRule     = RootOrElem [ LocAttrSeq ]
                   7944:                  [ '+' '(' ExtensionSeq ')' ]
                   7945:                  [ '-' '(' RestrictSeq ')' ]
                   7946:                  [ 'WITH' FixedAttrSeq ] .
                   7947: RootOrElem     = 'Root' / ElemID .
                   7948: 
1.18      cvs      7949: END</pre>
                   7950: </div>
1.1       cvs      7951: 
1.18      cvs      7952: <div class="section">
1.30      cvs      7953: <h2><a name="sectb63">The P language</a></h2>
1.1       cvs      7954: 
1.30      cvs      7955: <p>The P language is used to write presentation schemas, which define the
1.1       cvs      7956: graphical presentation rules to be applied to different classes of documents
1.18      cvs      7957: and objects.  It is described here in the M meta-language.</p>
                   7958: <pre>PresSchema      = 'PRESENTATION' ElemID ';'
1.1       cvs      7959:                 [ 'VIEWS' ViewSeq ]
                   7960:                 [ 'PRINT' PrintViewSeq ]
                   7961:                 [ 'COUNTERS' CounterSeq ]
                   7962:                 [ 'CONST' ConstSeq ]
                   7963:                 [ 'VAR' VarSeq ]
                   7964:                 [ 'DEFAULT' ViewRuleSeq ]
                   7965:                 [ 'BOXES' BoxSeq ]
                   7966:                 [ 'RULES' PresentSeq ]
                   7967:                 [ 'ATTRIBUTES' PresAttrSeq ]
                   7968:                 [ 'TRANSMIT' TransmitSeq ]
                   7969:                   'END' .
                   7970: 
                   7971: ElemID          = NAME .
                   7972: 
                   7973: ViewSeq         = ViewDeclaration
1.30      cvs      7974:                   &lt; ',' ViewDeclaration &gt; ';' .
1.1       cvs      7975: ViewDeclaration = ViewID [ 'EXPORT' ] .
                   7976: ViewID          = NAME .
                   7977: 
1.30      cvs      7978: PrintViewSeq    = PrintView &lt; ',' PrintView &gt; ';' .
1.1       cvs      7979: PrintView       = ViewID / ElemID .
                   7980: 
1.30      cvs      7981: CounterSeq      = Counter &lt; Counter &gt; .
1.1       cvs      7982: Counter         = CounterID ':' CounterFunc ';' .
                   7983: CounterID       = NAME .
                   7984: CounterFunc     = 'RANK' 'OF' TypeOrPage [ SLevelAsc ]
                   7985:                   [ 'INIT' AttrID ] [ 'REINIT' AttrID ] /
1.30      cvs      7986:                   SetFunction &lt; SetFunction &gt;
                   7987:                   AddFunction &lt; AddFunction &gt;
1.1       cvs      7988:                   [ 'INIT' AttrID ] /
1.16      cvs      7989:                   'RLEVEL' 'OF' ElemID .
1.1       cvs      7990: SLevelAsc       = [ '-' ] LevelAsc .
                   7991: LevelAsc        = NUMBER .
                   7992: SetFunction     = 'SET' CounterValue 'ON' TypeOrPage .
                   7993: AddFunction     = 'ADD' CounterValue 'ON' TypeOrPage .
                   7994: TypeOrPage      = 'Page' [ '(' ViewID ')' ] /
1.16      cvs      7995:                   [ '*' ] ElemID .
1.1       cvs      7996: CounterValue    = NUMBER .
                   7997: 
1.30      cvs      7998: ConstSeq        = Const &lt; Const &gt; .
1.1       cvs      7999: Const           = ConstID '=' ConstType ConstValue ';' .
                   8000: ConstID         = NAME .
                   8001: ConstType       = 'Text' [ Alphabet ] / 'Symbol' /
                   8002:                   'Graphics' / 'Picture' .
                   8003: ConstValue      = STRING .
                   8004: Alphabet        = NAME .
                   8005: 
1.30      cvs      8006: VarSeq          = Variable &lt; Variable &gt; .
1.1       cvs      8007: Variable        = VarID ':' FunctionSeq ';' .
                   8008: VarID           = NAME .
1.30      cvs      8009: FunctionSeq     = Function &lt; Function &gt; .
1.1       cvs      8010: Function        = 'DATE' / 'FDATE' /
                   8011:                   'DocName' / 'DirName' /
                   8012:                   'ElemName' / 'AttributeName' /
                   8013:                   ConstID / ConstType ConstValue /
                   8014:                   AttrID /
                   8015:                   'VALUE' '(' PageAttrCtr ','
                   8016:                   CounterStyle ')' .
                   8017: PageAttrCtr     = 'PageNumber' [ '(' ViewID ')' ] /
                   8018:                   [ MinMax ] CounterID / AttrID .
                   8019: CounterStyle    = 'Arabic' / 'LRoman' / 'URoman' /
                   8020:                   'Uppercase' / 'Lowercase' .
                   8021: MinMax          = 'MaxRangeVal' / 'MinRangeVal' .
                   8022: 
1.30      cvs      8023: BoxSeq          = Box &lt; Box &gt; .
1.1       cvs      8024: Box             = 'FORWARD' BoxID ';' /
                   8025:                   BoxID ':' ViewRuleSeq .
                   8026: BoxID           = NAME .
                   8027: 
1.30      cvs      8028: PresentSeq      = Present &lt; Present &gt; .
1.1       cvs      8029: Present         = [ '*' ] [ FirstSec ] ElemID ':'
                   8030:                   ViewRuleSeq .
                   8031: FirstSec        = 'First' / 'Second' .
                   8032: 
1.30      cvs      8033: PresAttrSeq     = PresAttr &lt; PresAttr &gt; .
1.1       cvs      8034: PresAttr        = AttrID [ '(' [ FirstSec ] ElemID ')' ] 
                   8035:                   [ AttrRelation ] ':' ViewRuleSeq .
                   8036: AttrID          = NAME .
                   8037: AttrRelation    = '=' AttrVal /
1.30      cvs      8038:                   '&gt;' [ '-' ] MinValue /
1.1       cvs      8039:                   '&lt;' [ '-' ] MaxValue /
                   8040:                   'IN' '[' [ '-' ] LowerBound '..' 
                   8041:                   [ '-' ] UpperBound ']' /
                   8042:                   'GREATER' AttrID /
                   8043:                   'EQUAL' AttrID /
                   8044:                   'LESS' AttrID .
                   8045: AttrVal         = [ '-' ] EqualNum / EqualText / AttrValue .
                   8046: MinValue        = NUMBER .
                   8047: MaxValue        = NUMBER .
                   8048: LowerBound      = NUMBER .
                   8049: UpperBound      = NUMBER.
                   8050: EqualNum        = NUMBER .
                   8051: EqualText       = STRING .
                   8052: AttrValue       = NAME .
                   8053: 
1.30      cvs      8054: ViewRuleSeq     = 'BEGIN' &lt; RulesAndCond &gt; &lt; ViewRules &gt;
1.1       cvs      8055:                   'END' ';' /
                   8056:                   ViewRules / CondRules / Rule .
                   8057: RulesAndCond    = CondRules / Rule .
                   8058: ViewRules       = 'IN' ViewID CondRuleSeq .
1.30      cvs      8059: CondRuleSeq     = 'BEGIN' &lt; RulesAndCond &gt; 'END' ';' /
1.1       cvs      8060:                   CondRules / Rule .
1.30      cvs      8061: CondRules       = CondRule &lt; CondRule &gt;
1.1       cvs      8062:                   [ 'Otherwise' RuleSeq ] .
                   8063: CondRule        = 'IF' ConditionSeq RuleSeq .
1.30      cvs      8064: RulesSeq        = 'BEGIN' Rule &lt; Rule &gt; 'END' ';' / Rule .
1.1       cvs      8065: 
1.30      cvs      8066: ConditionSeq    = Condition &lt; 'AND' Condition &gt; .
1.6       cvs      8067: Condition       = [ 'NOT' ] [ 'Target' ] ConditionElem .
                   8068: ConditionElem   = 'First' / 'Last' /
                   8069:                   [ 'Immediately' ] 'Within' [ NumParent ]
                   8070:                                      ElemID [ ExtStruct ] /
                   8071:                    ElemID /
                   8072:                   'Referred' / 'FirstRef' / 'LastRef' /
                   8073:                   'ExternalRef' / 'InternalRef' / 'CopyRef' /
                   8074:                   'AnyAttributes' / 'FirstAttr' / 'LastAttr' /
                   8075:                   'UserPage' / 'StartPage' / 'ComputedPage' /
1.33      cvs      8076:                   'Empty' / 'Root' /
1.6       cvs      8077:                   '(' [ MinMax ] CounterName CounterCond ')' /
                   8078:                   CondPage '(' CounterID ')' .
                   8079: NumParent       = [ GreaterLess ] NParent .
1.30      cvs      8080: GreaterLess     = '&gt;' / '&lt;' .
1.6       cvs      8081: NParent         = NUMBER.
1.30      cvs      8082: CounterCond     = '&lt;' MaxCtrVal / '&gt;' MinCtrVal /
1.6       cvs      8083:                   '=' EqCtrVal / 
                   8084:                   'IN' '[' ['-'] MinCtrBound '..' 
                   8085:                   ['-'] MaxCtrBound ']' .
                   8086: PageCond        = 'Even' / 'Odd' / 'One' .
                   8087: MaxCtrVal       = NUMBER .
                   8088: MinCtrVal       = NUMBER .
                   8089: EqCtrVal        = NUMBER .
                   8090: MaxCtrBound     = NUMBER .
                   8091: MinCtrBound     = NUMBER .
1.1       cvs      8092: 
1.34    ! cvs      8093: Rule            = Property ';' / PresFunc ';' .
        !          8094: Property        = 'VertRef' ':' HorizPosition /
1.1       cvs      8095:                   'HorizRef' ':' VertPosition /
                   8096:                   'VertPos' ':' VPos /
                   8097:                   'HorizPos' ':' HPos /
                   8098:                   'Height' ':' Extent /
                   8099:                   'Width' ':' Extent /
                   8100:                   'VertOverflow' ':' Boolean /
                   8101:                   'HorizOverflow' ':' Boolean /
1.26      cvs      8102:                   'MarginTop' ':' MarginWidth /
                   8103:                   'MarginRight' ':' MarginWidth /
                   8104:                   'MarginBottom' ':' MarginWidth /
                   8105:                   'MarginLeft' ':' MarginWidth /
                   8106:                   'PaddingTop' ':' PaddingWidth /
                   8107:                   'PaddingRight' ':' PaddingWidth /
                   8108:                   'PaddingBottom' ':' PaddingWidth /
                   8109:                   'PaddingLeft' ':' PaddingWidth /
                   8110:                   'BorderTopWidth' ':' BorderWidth /
                   8111:                   'BorderRightWidth' ':' BorderWidth /
                   8112:                   'BorderBottomWidth' ':' BorderWidth /
                   8113:                   'BorderLeftWidth' ':' BorderWidth /
                   8114:                   'BorderTopColor' ':' BorderColor /
                   8115:                   'BorderRightColor' ':' BorderColor /
                   8116:                   'BorderBottomColor' ':' BorderColor /
                   8117:                   'BorderLeftColor' ':' BorderColor /
                   8118:                   'BorderTopStyle' ':' BorderStyle /
                   8119:                   'BorderRightStyle' ':' BorderStyle /
                   8120:                   'BorderBottomStyle' ':' BorderStyle /
                   8121:                   'BorderLeftStyle' ':' BorderStyle .
1.1       cvs      8122:                   'LineSpacing' ':' DistOrInherit /
                   8123:                   'Indent' ':' DistOrInherit /
                   8124:                   'Adjust' ':' AlignOrInherit /
                   8125:                   'Justify' ':' BoolInherit /
                   8126:                   'Hyphenate' ':' BoolInherit /
                   8127:                   'PageBreak' ':' Boolean /
                   8128:                   'LineBreak' ':' Boolean /
                   8129:                   'InLine' ':' Boolean /
                   8130:                   'NoBreak1' ':' AbsDist /
                   8131:                   'NoBreak2' ':' AbsDist /
                   8132:                   'Gather' ':' Boolean /
                   8133:                   'Visibility' ':' NumberInherit /
                   8134:                   'Size'  ':' SizeInherit /
                   8135:                   'Font' ':' NameInherit /
                   8136:                   'Style' ':' StyleInherit /
1.23      cvs      8137:                   'Weight' ':' WeightInherit /
1.1       cvs      8138:                   'Underline' ':' UnderLineInherit /
                   8139:                   'Thickness' ':' ThicknessInherit /
                   8140:                   'Depth' ':' NumberInherit /
                   8141:                   'LineStyle' ':' LineStyleInherit /
                   8142:                   'LineWeight' ':' DistOrInherit /
                   8143:                   'FillPattern' ':' NameInherit /
1.30      cvs      8144:                   'Background' ':' Color /
                   8145:                   'Foreground' ':' Color /
1.1       cvs      8146:                   'Content' ':' VarConst .
                   8147: PresFunc        = Creation '(' BoxID ')' /
                   8148:                   'Line' /
                   8149:                   'NoLine' /
                   8150:                   'Page' '(' BoxID ')' /
1.13      cvs      8151:                   'Copy' '(' BoxTypeToCopy ')' /
                   8152:                   'ShowBox' /
1.18      cvs      8153:                   'BackgroundPicture' ':' FileName /
                   8154:                   'PictureMode' ':' PictMode .
1.1       cvs      8155: 
                   8156: BoxTypeToCopy   = BoxID [ ExtStruct ] /
                   8157:                    ElemID [ ExtStruct ] .
                   8158: ExtStruct       = '(' ElemID ')' .
                   8159: 
                   8160: Distance        = [ Sign ] AbsDist .
                   8161: Sign            = '+' / '-' .
                   8162: AbsDist         = IntegerOrAttr [ '.' DecimalPart ]
                   8163:                   [ Unit ] .
                   8164: IntegerOrAttr   = IntegerPart / AttrID .
                   8165: IntegerPart     = NUMBER .
                   8166: DecimalPart     = NUMBER .
                   8167: Unit            = 'em' / 'ex' / 'cm' / 'mm' / 'in' / 'pt' /
                   8168:                   'pc' / 'px' / '%' .
                   8169: 
                   8170: HPos            = 'nil' / VertAxis '=' HorizPosition 
                   8171:                   [ 'UserSpecified' ] .
                   8172: VPos            = 'nil' / HorizAxis '=' VertPosition 
                   8173:                   [ 'UserSpecified' ] .
                   8174: VertAxis        = 'Left' / 'VMiddle' / 'VRef' / 'Right' .
                   8175: HorizAxis       = 'Top' / 'HMiddle' / 'HRef' / 'Bottom' .
                   8176: 
1.6       cvs      8177: VertPosition    = Reference '.' HorizAxis [ Distance ] .
                   8178: HorizPosition   = Reference '.' VertAxis [ Distance ] .
                   8179: Reference       = 'Enclosing' [ BoxTypeNot ] /
                   8180:                   'Enclosed' [ BoxTypeNot ] /
                   8181:                   'Previous' [ BoxTypeNot ] /
                   8182:                   'Next' [ BoxTypeNot ] /
                   8183:                   'Referred' [ BoxTypeNot ] /
                   8184:                   'Creator' /
                   8185:                   'Root' /
                   8186:                   '*' /
                   8187:                   BoxOrType .
                   8188: BoxOrType       = BoxID /
                   8189:                   [ '*' ] [ FirstSec ] ElemID /
1.17      cvs      8190:                   'AnyElem' / 'AnyBox' /
                   8191:                   'ElemWithAttr' AttrID .
1.6       cvs      8192: BoxTypeNot      = [ 'NOT' ] BoxOrType .
                   8193: 
                   8194: Extent          = Reference '.' HeightWidth
                   8195:                   [ Relation ] [ 'Min' ] /
                   8196:                   AbsDist [ 'UserSpecified' ] [ 'Min' ] /
                   8197:                   HPos / VPos .
                   8198: HeightWidth     = 'Height' / 'Width' .
                   8199: Relation        = '*' ExtentAttr '%' / Distance .
                   8200: ExtentAttr      = ExtentVal / AttrID .
                   8201: ExtentVal       = NUMBER .
1.26      cvs      8202: 
                   8203: MarginWidth     = InheritParent / 'Auto' / Distance .
                   8204: PaddingWidth    = InheritParent / Distance .
                   8205: BorderWidth     = InheritParent / 'Thin' / 'Medium' / 'Thick' / Distance .
                   8206: BorderColor     = InheritParent / 'Transparent' / 'Foreground' /
                   8207:                   ColorName .
                   8208: BorderStyle     = InheritParent /
                   8209:                   'None' / 'Hidden' / 'Dotted' / 'Dashed' / 'Solid' /
                   8210:                   'Double' / 'Groove' / 'Ridge' / 'Inset' / 'Outset' .
1.27      cvs      8211: InheritParent   = 'Enclosing' '=' / 'Creator' '=' .
1.26      cvs      8212: ColorName       = NAME .
1.6       cvs      8213: 
                   8214: Inheritance     = Kinship  InheritedValue .
                   8215: Kinship         = 'Enclosing' / 'GrandFather'/ 'Enclosed' /
                   8216:                   'Previous' / 'Creator' .
                   8217: InheritedValue  = '+' PosIntAttr [ 'Max' maximumA ] /
                   8218:                   '-' NegIntAttr [ 'Min' minimumA ] /
                   8219:                   '=' .
                   8220: PosIntAttr      = PosInt / AttrID .
                   8221: PosInt          = NUMBER .
                   8222: NegIntAttr      = NegInt / AttrID .
                   8223: NegInt          = NUMBER .
                   8224: maximumA        = maximum / AttrID .
                   8225: maximum         = NUMBER .
                   8226: minimumA        = minimum / AttrID .
                   8227: minimum         = NUMBER .
                   8228: 
                   8229: AlignOrInherit  = Kinship '=' / Alignment .
                   8230: Alignment       = 'Left' / 'Right' / 'VMiddle' /
                   8231:                   'LeftWithDots' .
1.1       cvs      8232: 
1.6       cvs      8233: DistOrInherit   = Kinship InheritedDist / Distance .
                   8234: InheritedDist   = '=' / '+' AbsDist / '-' AbsDist .
1.1       cvs      8235: 
1.6       cvs      8236: BoolInherit     = Boolean / Kinship '=' .
                   8237: Boolean         = 'Yes' / 'No' .
1.1       cvs      8238: 
1.6       cvs      8239: NumberInherit   = Integer / AttrID / Inheritance .
                   8240: Integer         = NUMBER .
1.1       cvs      8241: 
                   8242: LineStyleInherit= Kinship '=' / 'Solid' / 'Dashed' /
                   8243:                   'Dotted' .
                   8244: 
1.6       cvs      8245: SizeInherit     = SizeAttr [ 'pt' ] / Kinship InheritedSize .
                   8246: InheritedSize   = '+' SizeAttr [ 'pt' ]
                   8247:                       [ 'Max' MaxSizeAttr ] /
                   8248:                   '-' SizeAttr [ 'pt' ]
                   8249:                       [ 'Min' MinSizeAttr ] /
1.22      cvs      8250:                   '*' PercentSizeAttr '%' /
1.6       cvs      8251:                   '=' .
                   8252: SizeAttr        = Size / AttrID .
                   8253: Size            = NUMBER .
                   8254: MaxSizeAttr     = MaxSize / AttrID .
                   8255: MaxSize         = NUMBER .
                   8256: MinSizeAttr     = MinSize / AttrID .
                   8257: MinSize         = NUMBER .
1.22      cvs      8258: PercentSizeAttr = PercentSize / AttrID .
                   8259: PercentSize     = NUMBER .
1.6       cvs      8260: 
                   8261: NameInherit     = Kinship '=' / FontName .
                   8262: FontName        = NAME .
1.30      cvs      8263: Color           = 'Transparent' / Kinship '=' / FontName .
1.6       cvs      8264: StyleInherit    = Kinship '=' /
1.23      cvs      8265:                   'Roman' / 'Italics' / 'Oblique' .
                   8266: WeightInherit   = Kinship '=' /
                   8267:                   'Normal' / 'Bold' .
1.1       cvs      8268: UnderLineInherit= Kinship '=' /
1.6       cvs      8269:                   'NoUnderline' / 'Underlined' / 
                   8270:                   'Overlined' / 'CrossedOut' .
1.1       cvs      8271: ThicknessInherit= Kinship '=' / 'Thick' / 'Thin' .
1.13      cvs      8272: 
                   8273: FileName =        STRING .
                   8274: PictMode =        'NormalSize' / 'Scale' /
                   8275:                   'RepeatXY' / 'RepeatX' / 'RepeatY' .
1.1       cvs      8276: 
1.6       cvs      8277: VarConst        = ConstID / ConstType ConstValue /
                   8278:                   VarID / '(' FunctionSeq ')' /
                   8279:                   ElemID .
                   8280: 
                   8281: Creation        = Create [ 'Repeated' ] .
                   8282: Create          = 'CreateFirst' / 'CreateLast' /
                   8283:                   'CreateBefore' / 'CreateAfter' /
                   8284:                   'CreateEnclosing' .
                   8285: 
1.30      cvs      8286: TransmitSeq     = Transmit &lt; Transmit &gt; .
1.6       cvs      8287: Transmit        = TypeOrCounter 'To' ExternAttr
                   8288:                   '(' ElemID ')' ';' .
                   8289: TypeOrCounter   = CounterID / ElemID .
                   8290: ExternAttr      = NAME .
1.1       cvs      8291: 
1.18      cvs      8292: END</pre>
                   8293: </div>
1.1       cvs      8294: 
1.18      cvs      8295: <div class="section">
                   8296: <h2><a name="sectb64">The T language</a></h2>
                   8297: <pre>TransSchema   = 'TRANSLATION' ElemID ';'
1.1       cvs      8298:               [ 'LINELENGTH' LineLength ';' ]
                   8299:               [ 'LINEEND' CHARACTER ';' ]
                   8300:               [ 'LINEENDINSERT' STRING ';' ]
                   8301:               [ 'BUFFERS' BufferSeq ]
                   8302:               [ 'COUNTERS' CounterSeq ]
                   8303:               [ 'CONST' ConstSeq ]
                   8304:               [ 'VAR' VariableSeq ]
                   8305:                 'RULES' ElemSeq
                   8306:               [ 'ATTRIBUTES' AttrSeq ]
                   8307:               [ 'PRESENTATION' PresSeq ]
1.30      cvs      8308:               &lt; 'TEXTTRANSLATE' TextTransSeq &gt;
1.1       cvs      8309:               [ 'SYMBTRANSLATE' TransSeq ]
                   8310:               [ 'GRAPHTRANSLATE' TransSeq ]
                   8311:                 'END' .
                   8312: 
                   8313: LineLength    = NUMBER .
                   8314: 
1.30      cvs      8315: BufferSeq     = Buffer &lt; Buffer &gt; .
1.1       cvs      8316: Buffer        = BufferID [ '(' 'Picture' ')' ] ';' .
                   8317: BufferID      = NAME .
                   8318: 
1.30      cvs      8319: CounterSeq    = Counter &lt; Counter &gt; .
1.1       cvs      8320: Counter       = CounterID [ ':' CounterFunc ] ';' .
                   8321: CounterID     = NAME .
                   8322: CounterFunc   = 'Rank' 'of' ElemID [ SLevelAsc ]
                   8323:                 [ 'Init' AttrID ] /
                   8324:                 'Rlevel' 'of' ElemID /
                   8325:                 'Set' InitValue 'On' ElemID
                   8326:                       'Add' Increment 'On' ElemID
                   8327:                       [ 'Init' AttrID ] .
                   8328: SLevelAsc     = [ '-' ] LevelAsc .
                   8329: LevelAsc      =  NUMBER .
                   8330: InitValue     = NUMBER .
                   8331: Increment     = NUMBER .
                   8332: ElemID        = NAME .
                   8333: AttrID        = NAME .
                   8334: 
1.30      cvs      8335: ConstSeq      = Const &lt; Const &gt; .
1.1       cvs      8336: Const         = ConstID '=' ConstValue ';' .
                   8337: ConstID       = NAME .
                   8338: ConstValue    = STRING .
                   8339: 
1.30      cvs      8340: VariableSeq   = Variable &lt; Variable &gt; .
                   8341: Variable      = VarID ':' Function &lt; Function &gt; ';' .
1.1       cvs      8342: VarID         = NAME .
                   8343: Function      = 'Value' '(' CounterID [ ':' Length ]
                   8344:                           [ ',' CounterStyle ]  ')' /
                   8345:                 'FileDir' / 'FileName' / 'Extension' /
                   8346:                 'DocumentName' / 'DocumentDir' /
                   8347:                 ConstID / CharString / 
                   8348:                 BufferID / AttrID .
                   8349: Length        = NUMBER .
                   8350: CounterStyle=   'Arabic' / 'LRoman' / 'URoman' /
                   8351:                 'Uppercase' / 'Lowercase' .
                   8352: CharString    = STRING .
                   8353: 
1.30      cvs      8354: ElemSeq       = TransType &lt; TransType &gt; .
1.1       cvs      8355: TransType     = [ FirstSec ] ElemID ':' RuleSeq .
                   8356: FirstSec      = 'First' / 'Second' .
1.30      cvs      8357: RuleSeq       = Rule / 'BEGIN' &lt; Rule &gt; 'END' ';' .
1.1       cvs      8358: Rule          = SimpleRule / ConditionBlock .
                   8359: ConditionBlock= 'IF' ConditionSeq SimpleRuleSeq .
1.30      cvs      8360: SimpleRuleSeq = 'BEGIN' &lt; SimpleRule &gt; 'END' ';' / 
1.1       cvs      8361:                 SimpleRule .
                   8362: 
                   8363: ConditionSeq  = Condition [ 'AND' Condition ] .
                   8364: Condition     = [ 'NOT' ] [ 'Target' ] Cond .
                   8365: Cond          = CondElem / CondAscend .
                   8366: CondElem      = 'FirstRef' / 'LastRef' /
                   8367:                 'ExternalRef' /
                   8368:                 'Alphabet' '=' Alphabet /
                   8369:                 'ComputedPage' / 'StartPage' / 
                   8370:                 'UserPage' / 'ReminderPage' /
                   8371:                 'Empty' /
1.18      cvs      8372:                 ElemID /
1.1       cvs      8373:                 'FirstAttr' / 'LastAttr' .
                   8374: CondAscend    = [ Ascend ] CondOnAscend .
                   8375: Ascend        = '*' / 'Parent' / 'Ancestor' LevelOrType .
                   8376: LevelOrType   = CondRelLevel / ElemID [ ExtStruct ] .
                   8377: CondRelLevel  = NUMBER .
                   8378: CondOnAscend  = 'First' / 'Last' /
                   8379:                 'Referred' / 
                   8380:                 [ 'Immediately' ] 'Within' [ NumParent ]
                   8381:                                   ElemID [ ExtStruct ] /
                   8382:                 'Attributes' /
                   8383:                 AttrID [ RelatAttr ] /
                   8384:                 'Presentation' /
1.34    ! cvs      8385:                 PresRule .
1.1       cvs      8386: NumParent     = [ GreaterLess ] NParent .
1.30      cvs      8387: GreaterLess   = '&gt;' / '&lt;' .
1.1       cvs      8388: NParent       = NUMBER.
                   8389: Alphabet      = NAME .
                   8390: RelatAttr     = '=' Value /
1.30      cvs      8391:                  '&gt;' [ '-' ] Minimum /
1.1       cvs      8392:                  '&lt;' [ '-' ] Maximum /
                   8393:                  'IN' '[' [ '-' ] MinInterval '..'
                   8394:                           [ '-' ] MaxInterval ']' .
                   8395: Value         = [ '-' ] IntegerVal / TextVal / AttrValue .
                   8396: Minimum       = NUMBER .
                   8397: Maximum       = NUMBER .
                   8398: MinInterval   = NUMBER .
                   8399: MaxInterval   = NUMBER .
                   8400: IntegerVal    = NUMBER .
                   8401: TextVal       = STRING .
                   8402: AttrValue     = NAME .
                   8403: 
                   8404: SimpleRule    = 'Create' [ 'IN' VarID ] Object
                   8405:                        [ Position ] ';' /
                   8406:                 'Write' Object [ Position ] ';' /
                   8407:                 'Read' BufferID [ Position ] ';' /
                   8408:                 'Include' File [ Position ] ';' /
1.6       cvs      8409:                 'Get'  [ RelPosition ] ElemID 
                   8410:                        [ ExtStruct ] 
                   8411:                        [ Position ] ';' /
1.1       cvs      8412:                 'Copy' [ RelPosition ] ElemID 
                   8413:                        [ ExtStruct ] 
                   8414:                        [ Position ] ';' /
                   8415:                 'Use' TrSchema [ 'For' ElemID ] ';' /
                   8416:                 'Remove' ';' /
1.31      cvs      8417:                 'Ignore' ';' /
1.1       cvs      8418:                 'NoTranslation' ';' /
                   8419:                 'NoLineBreak' ';' /
                   8420:                 'ChangeMainFile' VarID [ Position ] ';' /
1.14      cvs      8421:                 'RemoveFile' VarID [ Position ] ';' /
1.10      cvs      8422:                 'Set' CounterID InitValue [ Position ] ';' /
                   8423:                 'Add' CounterID Increment [ Position ] ';' /
1.25      cvs      8424:                 'Indent' [ 'IN' VarID ] Indent [ Position ] ';' .
1.10      cvs      8425: 
1.25      cvs      8426: Indent        = 'Suspend' / 'Resume' / [ IndentSign ] IndentValue .
1.10      cvs      8427: IndentSign    = '+' / '-' .
                   8428: IndentValue   = NUMBER .
1.1       cvs      8429: 
                   8430: Object        = ConstID / CharString /
                   8431:                 BufferID /
                   8432:                 VarID /
1.30      cvs      8433:                 '(' Function &lt; Function &gt; ')' /
1.21      cvs      8434:                  [ 'Translated' ] AttrID /
1.1       cvs      8435:                 'Value' /
                   8436:                 'Content' /
                   8437:                 'Attributes' /
                   8438:                 'Presentation' /
                   8439:                 'RefId' /
                   8440:                 'PairId' /
                   8441:                 'FileDir' / 'FileName' / 'Extension' /
                   8442:                 'DocumentName' / 'DocumentDir' /
                   8443:                 [ 'Referred' ] ReferredObject .
                   8444: Position      = 'After' / 'Before' .
                   8445: 
1.6       cvs      8446: ReferredObject= VarID /
                   8447:                 ElemID [ ExtStruct ] /
                   8448:                 'RefId' /
                   8449:                 'DocumentName' / 'DocumentDir' .                
1.1       cvs      8450: 
1.6       cvs      8451: File          = FileName / BufferID .
                   8452: FileName      = STRING .
1.1       cvs      8453: 
1.6       cvs      8454: RelPosition   = 'Included' / 'Referred' .
                   8455: ExtStruct     = '(' ElemID ')' .
1.1       cvs      8456: 
1.6       cvs      8457: TrSchema      = NAME .
                   8458: 
1.30      cvs      8459: AttrSeq       = TransAttr &lt; TransAttr &gt; .
1.6       cvs      8460: TransAttr     = AttrID [ '(' ElemID ')' ] 
                   8461:                 [ RelatAttr ] ':' RuleSeq .
                   8462: 
1.30      cvs      8463: PresSeq       = PresTrans &lt; PresTrans &gt; .
1.6       cvs      8464: PresTrans     = PresRule ':' RuleSeq .
                   8465: PresRule      = 'Size' [ PresRelation ] /
                   8466:                 'Indent' [ PresRelation ] /
                   8467:                 'LineSpacing' [ PresRelation ] /
                   8468:                 'Adjust' [ '=' AdjustVal ] /
                   8469:                 'Justify' [ '=' BoolVal ] /
                   8470:                 'Hyphenate' [ '=' BoolVal ] /
                   8471:                 'Style' [ '=' StyleVal ] /
1.24      cvs      8472:                 'Weight' [ '=' WeightVal ] /
1.6       cvs      8473:                 'Font' [ '=' FontVal ] /
                   8474:                 'UnderLine' [ '=' UnderLineVal ] /
                   8475:                 'Thickness' [ '=' ThicknessVal ] /
                   8476:                 'LineStyle' [ '=' LineStyleVal ] /
                   8477:                 'LineWeight' [ PresRelation ] /
                   8478:                 'FillPattern' [ '=' Pattern ] /
                   8479:                 'Background' [ '=' Color ] /
                   8480:                 'Foreground' [ '=' Color ] .
                   8481: 
                   8482: PresRelation  = '=' PresValue /
1.30      cvs      8483:                 '&gt;' [ '-' ] PresMinimum /
1.6       cvs      8484:                 '&lt;' [ '-' ] PresMaximum /
                   8485:                 'IN' '[' [ '-' ] PresIntervalMin '..'
                   8486:                          [ '-' ] PresIntervalMax ']' .
                   8487: AdjustVal     = 'Left' / 'Right' / 'VMiddle' / 
                   8488:                 'LeftWithDots' .
                   8489: BoolVal       = 'Yes' / 'No' .
1.24      cvs      8490: StyleVal      = 'Roman' / 'Italics' / 'Oblique' .
                   8491: WeightVal     = 'Normal' / 'Bold' .
1.6       cvs      8492: FontVal       = 'Times' / 'Helvetica' / 'Courier' .
                   8493: UnderLineVal  = 'NoUnderline' / 'UnderLined' /
                   8494:                 'OverLined' / 'CrossedOut' .
                   8495: ThicknessVal  = 'Thick' / 'Thin' .
                   8496: LineStyleVal  = 'Solid' / 'Dashed' / 'Dotted' .
                   8497: Pattern       = NAME .
                   8498: Color         = NAME .
                   8499: PresMinimum   = NUMBER .
                   8500: PresMaximum   = NUMBER .
1.1       cvs      8501: PresIntervalMin= NUMBER .
                   8502: PresIntervalMax= NUMBER .
1.6       cvs      8503: PresValue     = [ '-' ] PresVal .
                   8504: PresVal       = NUMBER .
1.1       cvs      8505: 
1.6       cvs      8506: TextTransSeq  = [ Alphabet ] TransSeq .
                   8507: Alphabet      = NAME .
1.30      cvs      8508: TransSeq      = 'BEGIN' &lt; Translation &gt; 'END' ';' /
1.6       cvs      8509:                 Translation .
1.30      cvs      8510: Translation   = Source [ '-&gt;' Target ] ';' .
1.6       cvs      8511: Source        = STRING .
1.18      cvs      8512: Target        = STRING .</pre>
                   8513: </div>
                   8514: <hr>
                   8515: </div>
1.1       cvs      8516: 
1.18      cvs      8517: <div class="chapter">
                   8518: <h1><a name="sect7">Character coding</a></h1>
1.1       cvs      8519: 
1.18      cvs      8520: <div class="section">
1.30      cvs      8521: <h2><a name="sectb71">Characters</a></h2>
1.1       cvs      8522: 
1.30      cvs      8523: <p>The characters of the Latin alphabet follow the encoding defined in the ISO
1.5       cvs      8524: 8859-1 (ISO Latin-1) standard.  The characters of the Greek alphabet follow
1.18      cvs      8525: the encoding defined by Adobe for its Symbol font (Adobe FontSpecific).</p>
1.30      cvs      8526: 
                   8527: <p>Characters whose octal code is greater than 0200 are written in the form of
1.1       cvs      8528: their octal code preceded by a backslash character (``\'').  For example, the
1.30      cvs      8529: French word 'Résumé' is written <tt>R\351sum\351</tt>.</p>
                   8530: 
                   8531: <p>To the ISO 8859-1 encoding four characters with the following codes have
                   8532: been added:<br>
1.18      cvs      8533: <tt>212</tt>: line break<br>
                   8534: <tt>240</tt>: sticky space<br>
                   8535: <tt>201</tt>: thin space<br>
                   8536: <tt>202</tt>: en space</p>
1.30      cvs      8537: 
                   8538: <p>The <tt>212</tt> character is a ``line break'' character which forces a
                   8539: line break.  The <tt>240</tt> character is a ``sticky space'', which cannot be
1.18      cvs      8540: replaced by a line break.</p>
                   8541: </div>
1.1       cvs      8542: 
1.18      cvs      8543: <div class="section">
1.30      cvs      8544: <h2><a name="sectb72">Symbols</a></h2>
1.1       cvs      8545: 
1.30      cvs      8546: <p>The table below gives the codes for the symbols of Thot.  Symbols can be
                   8547: used in presentation schemas constants and in transcoding rules of translation
1.18      cvs      8548: schemas.  Each symbol is represented by a single character.</p>
                   8549: <ul>
1.30      cvs      8550:   <li><tt>r</tt>: a radical</li>
                   8551:   <li><tt>i</tt>: a simple integral</li>
                   8552:   <li><tt>c</tt>: a curvilinear integral</li>
                   8553:   <li><tt>d</tt>: a double integral</li>
                   8554:   <li><tt>t</tt>: a triple integral</li>
                   8555:   <li><tt>S</tt>: the summation symbol</li>
                   8556:   <li><tt>P</tt>: the product symbol</li>
                   8557:   <li><tt>U</tt>: the union symbol</li>
                   8558:   <li><tt>I</tt>: the intersection symbol</li>
                   8559:   <li><tt>&gt;</tt>: a right arrow</li>
                   8560:   <li><tt>&lt;</tt>: a left arrow</li>
                   8561:   <li><tt>^</tt>:  an up arrow</li>
                   8562:   <li><tt>V</tt>: a down arrow</li>
                   8563:   <li><tt>(</tt>: an opening parenthesis</li>
                   8564:   <li><tt>)</tt>: a closing parenthesis</li>
                   8565:   <li><tt>{</tt>: an opening brace</li>
                   8566:   <li><tt>}</tt>: a closing brace</li>
                   8567:   <li><tt>[</tt>: an opening bracket</li>
                   8568:   <li><tt>]</tt>: a closing bracket</li>
1.18      cvs      8569: </ul>
                   8570: </div>
1.1       cvs      8571: 
1.18      cvs      8572: <div class="section">
1.30      cvs      8573: <h2><a name="sectb73">Graphical elements</a></h2>
1.1       cvs      8574: 
1.30      cvs      8575: <p>The table below gives the codes for the graphical elements of Thot. These
1.1       cvs      8576: elements can be used in presentation schemas constants and in transcoding
                   8577: rules of translation schemas.  Each graphical element is represented by a
1.18      cvs      8578: single character.</p>
                   8579: <ul>
1.30      cvs      8580:   <li>a: a circle</li>
                   8581:   <li><p><tt>A</tt>: an open curve with an arrow head at the end</p>
                   8582:   </li>
                   8583:   <li><tt>b</tt>: a horizontal line along the lower side of the box</li>
                   8584:   <li><tt>B</tt>: an open curve</li>
                   8585:   <li><tt>c</tt>: an ellipse inscribed in the box</li>
                   8586:   <li><tt>C</tt>: a rectangle with rounded corners</li>
                   8587:   <li><tt>D</tt>: an open curve with two arrow heads</li>
                   8588:   <li><tt>e</tt>: The northwest/southeast diagonal of the box with an
                   8589:     arrowhead at the bottom</li>
                   8590:   <li><tt>E</tt>: The southwest/northeast diagonal of the box with an
                   8591:     arrowhead at the top</li>
                   8592:   <li><tt>F</tt>: an open curve with an arrow head at start</li>
                   8593:   <li><tt>g</tt>: a line from the origin of the box to its opposite
                   8594:   corner</li>
                   8595:   <li><tt>h</tt>: a horizontal line as wide as the box and placed in its
                   8596:     middle</li>
                   8597:   <li><tt>l</tt>: a vertical line on the left side of the box</li>
                   8598:   <li><tt>L</tt>: a lozenge</li>
                   8599:   <li><tt>M</tt>: an open broken line with two arrow heads</li>
                   8600:   <li><tt>N</tt>: an open broken line with an arrow head at start</li>
                   8601:   <li><tt>o</tt>: The southwest/northeast diagonal of the box with an
                   8602:     arrowhead at the bottom</li>
                   8603:   <li><tt>O</tt>: The northwest/southeast diagonal of the box with an
                   8604:     arrowhead at the top</li>
                   8605:   <li><tt>p</tt>: a polygon</li>
                   8606:   <li><tt>P</tt>: a rectangle with round corners and a horizontal bar at the
                   8607:     top</li>
                   8608:   <li><tt>Q</tt>: an ellipse with a horizontal bar at the top</li>
                   8609:   <li><tt>r</tt>: a vertical line on the right side of the box</li>
                   8610:   <li><tt>R</tt>: a rectangle which is the shape of the box</li>
                   8611:   <li><tt>s</tt>: a closed curve</li>
                   8612:   <li><tt>S</tt>: an open broken line</li>
                   8613:   <li><tt>t</tt>: a horizontal line along the upper side of the box</li>
                   8614:   <li><tt>U</tt>: an open broken line with an arrow head at the end</li>
                   8615:   <li><tt>v</tt>: a vertical line as tall as the box and placed in its
                   8616:   middle</li>
                   8617:   <li><tt>V</tt>: a down arrow as tall as the box and in its middle</li>
                   8618:   <li>w: a segment (2 points)</li>
                   8619:   <li><tt>W</tt>: the upper right corner</li>
                   8620:   <li>x: a segment (2 points) with an arrow head at the end</li>
                   8621:   <li><tt>X</tt>: the lower right corner</li>
                   8622:   <li>y: a segment (2 points) with an arrow head at the end</li>
                   8623:   <li><tt>Y</tt>: the lower left corner</li>
                   8624:   <li>z: a segment (2 points) with an arrow head at the end</li>
                   8625:   <li><tt>Z</tt>: the upper left corner</li>
                   8626:   <li><tt>space</tt>: a transparent element</li>
                   8627:   <li><tt>^</tt>: an up arrow as tall as the box and in its middle</li>
                   8628:   <li><tt>&gt;</tt>: a right arrow as long as the box's width and in its
                   8629:     middle</li>
                   8630:   <li><tt>&gt;</tt>: a left arrow as long as the box's width and in its
                   8631:   middle</li>
                   8632:   <li><tt>/</tt>: The southwest/northeast diagonal of the box</li>
                   8633:   <li><tt>\</tt>: the northwest/southeast diagonal of the box</li>
1.18      cvs      8634: </ul>
                   8635: <hr>
                   8636: </div>
                   8637: </div>
                   8638: </body>
                   8639: </html>

Webmaster