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

1.18    ! cvs         1: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
        !             2: <html>
        !             3: <head>
        !             4: <title>
        !             5: The Languages of Thot</title>
        !             6: </head>
        !             7: <body>
        !             8: 
        !             9: <div class="frontmatter" align=center>
        !            10: 
        !            11: <h1>The Languages of Thot</h1>
        !            12: 
        !            13: <h3>Vincent Quint</h3>
        !            14: 
        !            15: <h4>Translated from French by Ethan Munson</h4>
        !            16: 
        !            17: <h4>Version of March, 1998</h4>
        !            18: <p>
        !            19: &copy; 1996 INRIA</p>
        !            20: <hr>
        !            21: </div>
        !            22: 
        !            23: <div class="tableofcontents">
        !            24: 
        !            25: <h2><a href="languages.toc.html">Contents</a></h2>
        !            26: <ul>
        !            27: <li>
        !            28: <big><a href="#sect2">The document model of Thot</a></big>
        !            29: <ul>
        !            30: <li>
        !            31: <strong><a href="#sectb21">The logical structure of documents</a></strong>
        !            32: <li>
        !            33: <strong><a href="#sectb22">Generic and specific structures</a></strong>
        !            34: <li>
        !            35: <strong><a href="#sectb23">Logical structure and physical
        !            36: structure</a></strong>
        !            37: <li>
        !            38: <strong><a href="#sectb24">Document structures and object
        !            39: structures</a></strong>
        !            40: </ul>
        !            41: <li>
        !            42: <big><a href="#sect3">The S language</a></big>
        !            43: <ul>
        !            44: <li>
        !            45: <strong><a href="#sectb31">Document meta-structure</a></strong>
        !            46: <ul>
        !            47: <li>
        !            48: <a href="#sectc311">The basic types</a>
        !            49: <li>
        !            50: <a href="#sectc312">Constructed elements</a>
        !            51: <li>
        !            52: <a href="#sectc313">Logical structure constructors</a>
        !            53: <ul>
        !            54: <li>
        !            55: <small><a href="#sectd3131">Aggregate and List</a></small>
        !            56: <li>
        !            57: <small><a href="#sectd3132">Choice, Schema, and Unit</a></small>
        !            58: <li>
        !            59: <small><a href="#sectd3133">Reference and Inclusion</a></small>
        !            60: <li>
        !            61: <small><a href="#sectd3134">Mark pairs</a></small>
        !            62: <li>
        !            63: <small><a href="#sectd3135">Restrictions and Extensions</a></small>
        !            64: <li>
        !            65: <small><a href="#sectd3136">Summary</a></small>
        !            66: </ul>
        !            67: <li>
        !            68: <a href="#sectc314">Associated Elements</a>
        !            69: <li>
        !            70: <a href="#sectc315">Attributes</a>
        !            71: <li>
        !            72: <a href="#sectc316">Discussion of the model</a>
        !            73: </ul>
        !            74: <li>
        !            75: <strong><a href="#sectb32">The definition language for generic
        !            76: structures</a></strong>
        !            77: <ul>
        !            78: <li>
        !            79: <a href="#sectc321">Writing Conventions</a>
        !            80: <li>
        !            81: <a href="#sectc322">Extension schemas</a>
        !            82: <li>
        !            83: <a href="#sectc323">The general organization of structure schemas</a>
        !            84: <li>
        !            85: <a href="#sectc324">The default presentation</a>
        !            86: <li>
        !            87: <a href="#sectc325">Global Attributes</a>
        !            88: <li>
        !            89: <a href="#sectc326">Parameters</a>
        !            90: <li>
        !            91: <a href="#sectc327">Structured elements</a>
        !            92: <li>
        !            93: <a href="#sectc328">Structure definitions</a>
        !            94: <ul>
        !            95: <li>
        !            96: <small><a href="#sectd3281">List</a></small>
        !            97: <li>
        !            98: <small><a href="#sectd3282">Aggregate</a></small>
        !            99: <li>
        !           100: <small><a href="#sectd3283">Choice</a></small>
        !           101: <li>
        !           102: <small><a href="#sectd3284">Reference</a></small>
        !           103: <li>
        !           104: <small><a href="#sectd3285">Mark pairs</a></small>
        !           105: </ul>
        !           106: <li>
        !           107: <a href="#sectc329">Imports</a>
        !           108: <li>
        !           109: <a href="#sectc3210">Extension rules</a>
        !           110: <li>
        !           111: <a href="#sectc3211">Associated elements</a>
        !           112: <li>
        !           113: <a href="#sectc3212">Units</a>
        !           114: <li>
        !           115: <a href="#sectc3213">Skeleton elements</a>
        !           116: <li>
        !           117: <a href="#sectc3214">Exceptions</a>
        !           118: </ul>
        !           119: <li>
        !           120: <strong><a href="#sectb33">Some examples</a></strong>
        !           121: <ul>
        !           122: <li>
        !           123: <a href="#sectc331">A class of documents: articles</a>
        !           124: <li>
        !           125: <a href="#sectc332">A class of objects: mathematical formulas</a>
        !           126: </ul>
        !           127: </ul>
        !           128: <li>
        !           129: <big><a href="#sect4">The P language</a></big>
        !           130: <ul>
        !           131: <li>
        !           132: <strong><a href="#sectb41">Document presentation</a></strong>
        !           133: <ul>
        !           134: <li>
        !           135: <a href="#sectc411">Two levels of presentation</a>
        !           136: <li>
        !           137: <a href="#sectc412">Boxes</a>
        !           138: <li>
        !           139: <a href="#sectc413">Views and visibility</a>
        !           140: <li>
        !           141: <a href="#sectc414">Pages</a>
        !           142: <li>
        !           143: <a href="#sectc415">Numbering</a>
        !           144: <li>
        !           145: <a href="#sectc416">Presentation parameters</a>
        !           146: </ul>
        !           147: <li>
        !           148: <strong><a href="#sectb42">Presentation description language</a></strong>
        !           149: <ul>
        !           150: <li>
        !           151: <a href="#sectc421">The organization of a presentation schema</a>
        !           152: <li>
        !           153: <a href="#sectc422">Views</a>
        !           154: <li>
        !           155: <a href="#sectc423">Print Views</a>
        !           156: <li>
        !           157: <a href="#sectc424">Counters</a>
        !           158: <li>
        !           159: <a href="#sectc425">Presentation constants</a>
        !           160: <li>
        !           161: <a href="#sectc426">Variables</a>
        !           162: <li>
        !           163: <a href="#sectc427">Default presentation rules</a>
        !           164: <li>
        !           165: <a href="#sectc428">Presentation and page layout boxes</a>
        !           166: <li>
        !           167: <a href="#sectc429">Presentation of structured elements</a>
        !           168: <li>
        !           169: <a href="#sectc4210">Logical attribute presentation</a>
        !           170: <li>
        !           171: <a href="#sectc4212">Value transmission rules</a>
        !           172: <li>
        !           173: <a href="#sectc4213">Presentation rules</a>
        !           174: <li>
        !           175: <a href="#sectc4214">Conditions applying to presentation rules</a>
        !           176: <ul>
        !           177: <li>
        !           178: <small><a href="#sectd42141">Conditions based on the logical position of the
        !           179: element</a></small>
        !           180: <li>
        !           181: <small><a href="#sectd42142">Conditions on references</a></small>
        !           182: <li>
        !           183: <small><a href="#sectd42143">Conditions on logical attributes</a></small>
        !           184: <li>
        !           185: <small><a href="#sectd42144">Conditions on page breaks</a></small>
        !           186: <li>
        !           187: <small><a href="#sectd42145">Conditions on the element's content</a></small>
        !           188: <li>
        !           189: <small><a href="#sectd42146">Conditions on counters</a></small>
        !           190: </ul>
        !           191: <li>
        !           192: <a href="#sectc4215">A presentation rule</a>
        !           193: <li>
        !           194: <a href="#sectc4216">Box axes</a>
        !           195: <li>
        !           196: <a href="#sectc4217">Distance units</a>
        !           197: <li>
        !           198: <a href="#sectc4218">Relative positions</a>
        !           199: <li>
        !           200: <a href="#sectc4219">Box extents</a>
        !           201: <ul>
        !           202: <li>
        !           203: <small><a href="#sectd42191">Fixed extents</a></small>
        !           204: <li>
        !           205: <small><a href="#sectd42192">Relative extents</a></small>
        !           206: <li>
        !           207: <small><a href="#sectd42193">Elastic extents</a></small>
        !           208: </ul>
        !           209: <li>
        !           210: <a href="#sectc4220">Overflow</a>
        !           211: <li>
        !           212: <a href="#sectc4221">Inheritance</a>
        !           213: <li>
        !           214: <a href="#sectc4222">Line breaking</a>
        !           215: <ul>
        !           216: <li>
        !           217: <small><a href="#sectd42221">Line spacing</a></small>
        !           218: <li>
        !           219: <small><a href="#sectd42222">First line indentation</a></small>
        !           220: <li>
        !           221: <small><a href="#sectd42223">Alignment</a></small>
        !           222: <li>
        !           223: <small><a href="#sectd42224">Justification</a></small>
        !           224: <li>
        !           225: <small><a href="#sectd42225">Hyphenation</a></small>
        !           226: <li>
        !           227: <small><a href="#sectd42226">Avoiding line breaking</a></small>
        !           228: </ul>
        !           229: <li>
        !           230: <a href="#sectc4223">Page breaking and line breaking conditions</a>
        !           231: <li>
        !           232: <a href="#sectc4224">Visibility</a>
        !           233: <li>
        !           234: <a href="#sectc4225">Character style parameters</a>
        !           235: <ul>
        !           236: <li>
        !           237: <small><a href="#sectd42251">Character size</a></small>
        !           238: <li>
        !           239: <small><a href="#sectd42252">Font and character style</a></small>
        !           240: <li>
        !           241: <small><a href="#sectd42253">Underlining</a></small>
        !           242: </ul>
        !           243: <li>
        !           244: <a href="#sectc4226">Stacking order</a>
        !           245: <li>
        !           246: <a href="#sectc4227">Line style</a>
        !           247: <li>
        !           248: <a href="#sectc4228">Line thickness</a>
        !           249: <li>
        !           250: <a href="#sectc4229">Fill pattern</a>
        !           251: <li>
        !           252: <a href="#sectc4230">Colors</a>
        !           253: <li>
        !           254: <a href="#sectc4230a">Background color and border</a>
        !           255: <li>
        !           256: <a href="#sectc4230b">Background pictures</a>
        !           257: <li>
        !           258: <a href="#sectc4231">Presentation box content</a>
        !           259: <li>
        !           260: <a href="#sectc4232">Presentation box creation</a>
        !           261: <li>
        !           262: <a href="#sectc4233">Page layout</a>
        !           263: <li>
        !           264: <a href="#sectc4234">Box copies</a>
        !           265: </ul>
        !           266: </ul>
        !           267: <li>
        !           268: <big><a href="#sect5">The T language</a></big>
        !           269: <ul>
        !           270: <li>
        !           271: <strong><a href="#sectb51">Document translation</a></strong>
        !           272: <ul>
        !           273: <li>
        !           274: <a href="#sectc511">Translation principles</a>
        !           275: <li>
        !           276: <a href="#sectc512">Translation procedure</a>
        !           277: </ul>
        !           278: <li>
        !           279: <strong><a href="#sectb52">Translation definition language</a></strong>
        !           280: <ul>
        !           281: <li>
        !           282: <a href="#sectc521">Organization of a translation schema</a>
        !           283: <li>
        !           284: <a href="#sectc522">Line length</a>
        !           285: <li>
        !           286: <a href="#sectc523">Buffers</a>
        !           287: <li>
        !           288: <a href="#sectc524">Counters</a>
        !           289: <li>
        !           290: <a href="#sectc525">Constants</a>
        !           291: <li>
        !           292: <a href="#sectc526">Variables</a>
        !           293: <li>
        !           294: <a href="#sectc527">Translating structure elements</a>
        !           295: <li>
        !           296: <a href="#sectc528">Conditional rules</a>
        !           297: <ul>
        !           298: <li>
        !           299: <small><a href="#sectd5281">Conditions based on the logical position of the
        !           300: element</a></small>
        !           301: <li>
        !           302: <small><a href="#sectd5282">Conditions on references</a></small>
        !           303: <li>
        !           304: <small><a href="#sectd5283">Conditions on the parameters</a></small>
        !           305: <li>
        !           306: <small><a href="#sectd5284">Conditions on the alphabets</a></small>
        !           307: <li>
        !           308: <small><a href="#sectd5285">Conditions on page breaks</a></small>
        !           309: <li>
        !           310: <small><a href="#sectd5286">Conditions on the element's content</a></small>
        !           311: <li>
        !           312: <small><a href="#sectd5287">Conditions on the presence of comments</a></small>
        !           313: <li>
        !           314: <small><a href="#sectd5288">Conditions on the presence of specific
        !           315: presentation rules</a></small>
        !           316: <li>
        !           317: <small><a href="#sectd5289">Conditions on the presence of logical
        !           318: attributes</a></small>
        !           319: <li>
        !           320: <small><a href="#sectd52810">Conditions on logical attributes</a></small>
        !           321: <li>
        !           322: <small><a href="#sectd52811">Conditions on specific presentation
        !           323: rules</a></small>
        !           324: </ul>
        !           325: <li>
        !           326: <a href="#sectc529">Translation rules</a>
        !           327: <li>
        !           328: <a href="#sectc5210">The <tt>Create</tt> rule</a>
        !           329: <li>
        !           330: <a href="#sectc5211">The <tt>Write</tt> rule</a>
        !           331: <li>
        !           332: <a href="#sectc5212">The <tt>Read</tt> rule</a>
        !           333: <li>
        !           334: <a href="#sectc5213">The <tt>Include</tt> rule</a>
        !           335: <li>
        !           336: <a href="#sectc5214">The <tt>Get</tt> rule</a>
        !           337: <li>
        !           338: <a href="#sectc5215">The <tt>Copy</tt> rule</a>
        !           339: <li>
        !           340: <a href="#sectc5216">The <tt>Use</tt> rule</a>
        !           341: <li>
        !           342: <a href="#sectc5217">The <tt>Remove</tt> rule</a>
        !           343: <li>
        !           344: <a href="#sectc5218">The <tt>NoTranslation</tt> rule</a>
        !           345: <li>
        !           346: <a href="#sectc5219">The <tt>NoLineBreak</tt> rule</a>
        !           347: <li>
        !           348: <a href="#sectc5220">The <tt>ChangeMainFile</tt> rule</a>
        !           349: <li>
        !           350: <a href="#sectc5220a">The <tt>RemoveFile</tt> rule</a>
        !           351: <li>
        !           352: <a href="#sectc5221">The <tt>Set</tt> and <tt>Add</tt> rules</a>
        !           353: <li>
        !           354: <a href="#sectc5221a">The <tt>Indent</tt> rule</a>
        !           355: <li>
        !           356: <a href="#sectc5222">Rule application order</a>
        !           357: <li>
        !           358: <a href="#sectc5223">Translation of logical attributes</a>
        !           359: <li>
        !           360: <a href="#sectc5224">Translation of specific presentations</a>
        !           361: <li>
        !           362: <a href="#sectc5225">Recoding of characters, symbols and graphics</a>
        !           363: </ul>
        !           364: </ul>
        !           365: <li>
        !           366: <big><a href="#sect6">Language grammars</a></big>
        !           367: <ul>
        !           368: <li>
        !           369: <strong><a href="#sectb61">The M meta-language</a></strong>
        !           370: <li>
        !           371: <strong><a href="#sectb62">The S language</a></strong>
        !           372: <li>
        !           373: <strong><a href="#sectb63">The P language</a></strong>
        !           374: <li>
        !           375: <strong><a href="#sectb64">The T language</a></strong>
        !           376: </ul>
        !           377: <li>
        !           378: <big><a href="#sect7">Character coding</a></big>
        !           379: <ul>
        !           380: <li>
        !           381: <strong><a href="#sectb71">Characters</a></strong>
        !           382: <li>
        !           383: <strong><a href="#sectb72">Symbols</a></strong>
        !           384: <li>
        !           385: <strong><a href="#sectb73">Graphical elements</a></strong>
        !           386: </ul>
        !           387: </ul>
        !           388: <hr>
        !           389: </div>
1.1       cvs       390: 
1.18    ! cvs       391: <div class="chapter">
1.1       cvs       392: 
1.18    ! cvs       393: <h1><a name="sect2">The document model of Thot</a></h1>
        !           394: <p>
1.1       cvs       395: All of the services which Thot provides to the user are based on the system's
                    396: internal document representation.  This representation is itself derived from
                    397: the document model which underlies Thot.  The model is presented here, prior
                    398: to the description of the languages which permit the generic specification of
1.18    ! cvs       399: documents.</p>
1.1       cvs       400: 
1.18    ! cvs       401: <div class="section">
1.1       cvs       402: 
1.18    ! cvs       403: <h2><a name="sectb21">The logical structure of documents</a></h2>
        !           404: <p>
1.1       cvs       405: The document model of Thot is primarily designed to allow the user to operate
1.5       cvs       406: on those entities which s/he has in mind when s/he works on a document. The
                    407: model makes no assumptions about the nature of these entities. It is
                    408: essentially these logical entities, such as paragraphs, sections, chapters,
                    409: notes, titles, and cross-references which give a document its logical
1.18    ! cvs       410: structure.</p>
        !           411: <p>
1.5       cvs       412: Because of this model, the author can divide the document into chapters,
1.1       cvs       413: giving each one a title.  The content of these chapters can be further divided
1.2       cvs       414: into sections, subsections, etc.  The text is organized into successive
                    415: paragraphs, according to the content. In the writing phase, the lines, pages,
                    416: margins, spacing, fonts, and character styles are not very important. In fact,
                    417: if the system requires documents to be written in these terms, it gets in the
                    418: way. So, Thot's model is primarily based on the logical aspect of documents.
1.18    ! cvs       419: The creation of a model of this type essentially requires the definition :</p>
        !           420: <ul>
        !           421: <li>
        !           422: of the entities which can appear in the documents,
        !           423: <li>
        !           424: and the relations between these entities.
        !           425: </ul>
        !           426: <p>
1.1       cvs       427: The choice of entities to include in the model can be subtle.  Some documents
                    428: require chapters, while others only need various levels of sections. Certain
                    429: documents contain appendices, others don't.  In different documents the same
                    430: logical entity may go by different names (e.g. ``Conclusion'' and
                    431: ``Summary'').  Certain entities which are absolutely necessary in some
                    432: documents, such as clauses in a contract or the address of the recipient in a
1.18    ! cvs       433: letter, are useless in most other cases.</p>
        !           434: <p>
1.1       cvs       435: The differences between documents result from more than just the entities that
                    436: appear in them, but also from the relationships between these entities and the
                    437: ways that they are linked.  In certain documents, notes are spread throughout
                    438: the document, for example at the bottom of the page containing the
                    439: cross-reference to them, while in other documents they are collected at the
                    440: end of each chapter or even at the end of the work.  As another example, the
                    441: introduction of some documents can contain many sections, while in other
                    442: documents, the introduction is restricted to be a short sequence of
1.18    ! cvs       443: paragraphs.</p>
        !           444: <p>
1.1       cvs       445: All of this makes it unlikely that a single model can describe any document at
                    446: a relatively high level.  It is obviously tempting to make up a list of widely
                    447: used entities, such as chapters, sections, paragraphs, and titles, and then
                    448: map all other entities onto the available choices.  In this way, an
                    449: introduction can be supported as a chapter and a contract clause supported as
                    450: a paragraph or section. However, in trying to widen the range of usage of
                    451: certain entities, their meaning can be lost and the power of the model
                    452: reduced.  In addition, while this widening partially solves the problem of
                    453: choosing entities, it does not solve the problem of their organization: when a
                    454: chapter must be composed of sections, how does one indicate that an
                    455: introduction has none when it is merely another chapter?  One solution is to
                    456: include introductions in the list of supported entities. But then, how does
                    457: one distinguish those introductions which are allowed to have sections from
                    458: those which are not.  Perhaps this could be done by defining two types of
                    459: introduction. Clearly, this approach risks an infinite expansion of the list
1.18    ! cvs       460: of widely used entities.</p>
        !           461: </div>
1.1       cvs       462: 
1.18    ! cvs       463: <div class="section">
1.1       cvs       464: 
1.18    ! cvs       465: <h2><a name="sectb22">Generic and specific structures</a></h2>
        !           466: <p>
1.1       cvs       467: Thus, it is apparently impossible to construct an exhaustive inventory of all
1.2       cvs       468: those entities which are necessary and sufficient to precisely describe any
                    469: document. It also seems impossible to specify all possible arrangements of
1.18    ! cvs       470: these entities in a document.  This is why Thot uses a <em>meta-model</em>
        !           471: instead, which permits the description of numerous <em>models</em>, each one
        !           472: describing a <em>class</em> of documents.</p>
        !           473: <p>
        !           474: A <em>class</em> is a set of documents having very similar structure. Thus,
1.1       cvs       475: the collection of research reports published by a laboratory constitutes a
                    476: class; the set of commercial proposals by the sales department of a company
                    477: constitutes another class; the set of articles published by a journal
                    478: constitutes a third class.  Clearly, it is not possible to enumerate every
                    479: possible document class.  It is also clear that new document classes must be
1.18    ! cvs       480: created to satisfy new needs and applications.</p>
        !           481: <p>
1.1       cvs       482: To give a more rigorous definition of classes, we must introduce the ideas of
1.18    ! cvs       483: <em>generic structure</em> and <em>specific structure</em>.  Each document has
        !           484: a <em>specific structure</em> which organizes the various parts which comprise
1.1       cvs       485: it.  We illustrate this with the help of a simple example comparing two
1.18    ! cvs       486: reports, A and B (<a href="#specstruct">see Figure</a>). The report A contains
1.1       cvs       487: an introduction followed by three chapters and a conclusion.  The first
                    488: chapter contains two sections, the second, three sections.  That is the
1.18    ! cvs       489: <em>specific</em> structure of document A. Similarly, the structure of
1.1       cvs       490: document B is: an introduction, two chapters, a conclusion; Chapter 1 has
                    491: three sections while Chapter 2 has four.  The specific structures of these two
1.18    ! cvs       492: documents are thus different.</p>
1.1       cvs       493: 
1.18    ! cvs       494: <div class="figure">
        !           495: <hr>
        !           496: <pre>        Report A                 Report B
1.1       cvs       497:              Introduction              Introduction
                    498:              Chapter 1                 Chapter 1
                    499:                   Section 1.1               Section 1.1
                    500:                   Section 1.2               Section 1.2
                    501:              Chapter 2                      Section 1.3
                    502:                   Section 2.1          Chapter 2
                    503:                   Section 2.2               Section 2.1
                    504:                   Section 2.3               Section 2.2
                    505:              Chapter 3                      Section 2.3
                    506:              Conclusion                     Section 2.4
1.18    ! cvs       507:                                        Conclusion</pre>
        !           508: <p align=center>
        !           509: <em><a name="specstruct">Two specific structures</a></em></p>
        !           510: <hr>
        !           511: </div>
        !           512: <p>
        !           513: The <em>generic structure</em> defines the ways in which specific structures
1.1       cvs       514: can be constructed.  It specifies how to generate specific structures.  The
                    515: reports A and B, though different, are constructed in accordance with the same
                    516: generic structure, which specifies that a report contains an introduction
                    517: followed by a variable number of chapters and a conclusion, with each chapter
1.18    ! cvs       518: containing a variable number of sections.</p>
        !           519: <p>
1.1       cvs       520: There is a one-to-one correspondence between a class and a generic structure:
                    521: all the documents of a class are constructed in accordance with the same
                    522: generic structure.  Hence the definition of the class: a class is a set of
                    523: documents whose specific structure is constructed in accordance with the same
1.18    ! cvs       524: generic structure.  A class is characterized by its generic structure.</p>
        !           525: <p>
1.1       cvs       526: Thus, a generic structure can be considered to be a model at the level which
                    527: interests us, but only for one class of documents.  When the definition is
                    528: limited to a single class of documents, it is possible to define a model which
                    529: does a good job of representing the documents of the class, including the
                    530: necessary entities and unencumbered by useless entities.  The description of
                    531: the organization of the documents in the class can then be sufficiently
1.18    ! cvs       532: precise.</p>
        !           533: </div>
1.1       cvs       534: 
1.18    ! cvs       535: <div class="section">
1.1       cvs       536: 
1.18    ! cvs       537: <h2><a name="sectb23">Logical structure and physical structure</a></h2>
        !           538: <p>
        !           539: Generic structures only describe the <em>logical</em> organization of
        !           540: documents, not their <em>physical</em> presentation on a screen or on sheets
1.1       cvs       541: of paper.  However, for a document to be displayed or printed, its graphic
1.18    ! cvs       542: presentation must be taken into account.</p>
        !           543: <p>
1.1       cvs       544: An examination of current printed documents shows that the details of
                    545: presentation essentially serve to bring out their logical structure. Outside
                    546: of some particular domains, notably advertising, the presentation is rarely
                    547: independent of the logical organization of the text.  Moreover, the art of
                    548: typography consists of enhancing the organization of the text being set,
                    549: without catching the eye of the reader with overly pronounced effects.  Thus,
                    550: italic and boldface type are used to emphasize words or expressions which have
                    551: greater significance than the rest of the text: keywords, new ideas,
                    552: citations, book titles, etc.  Other effects highlight the organization of the
                    553: text: vertical space, margin changes, page breaks, centering, eventually
                    554: combined with the changes in the shapes or weight of the characters. These
                    555: effects serve to indicate the transitions between paragraphs, sections, or
                    556: chapters: an object's level in the logical structure of the document is shown
1.18    ! cvs       557: by the markedness of the effects.</p>
        !           558: <p>
1.1       cvs       559: Since the model permits the description of all of the logical structure of the
                    560: document, the presentation can be derived from the model without being
                    561: submerged in the document itself.  It suffices to use the logical structure of
                    562: the document to make the desired changes in its presentation: changes in type
1.18    ! cvs       563: size, type style, spacing, margin, centering, etc.</p>
        !           564: <p>
1.1       cvs       565: Just as one cannot define a unique generic logical structure for all document
                    566: classes, one cannot define universal presentation rules which can be applied
                    567: to all document classes.  For certain types of documents the chapter titles
                    568: will be centered on the page and printed in large, bold type.  For other
                    569: documents, the same chapter titles will be printed in small, italic type and
1.18    ! cvs       570: aligned on the left margin.</p>
        !           571: <p>
1.1       cvs       572: Therefore, it is necessary to base the presentation specifications for
                    573: documents on their class.  Such a specification can be very fine-grained,
                    574: because the presentation is expressed in terms of the entities defined in the
                    575: generic logical structure of the class.  Thus, it is possible to specify a
                    576: different presentation for the chapter titles and the section titles, and
                    577: similarly to specify titles for the sections according to their level in the
                    578: section hierarchy.  The set of rules which specify the presentation of all the
1.18    ! cvs       579: elements defined in a generic logical structure is called a <em>generic
        !           580: presentation</em>.</p>
        !           581: <p>
1.1       cvs       582: There are several advantages derived from having a presentation linked to the
                    583: generic structure and described by a generic presentation. Homogeneity is the
                    584: first.  Since every document in a class corresponds to the same generic
                    585: logical structure, a homogenous presentation for different documents of the
                    586: same class can be assured by applying the same generic presentation to all
                    587: documents of the class.  Homogeneity of presentation can also be found among
1.2       cvs       588: the entities of a single document: every section heading will be presented  in
1.1       cvs       589: the same way, the first line of every paragraph of the same type will have the
1.18    ! cvs       590: same indentation, etc.</p>
        !           591: <p>
1.1       cvs       592: Another advantage of this approach to presentation is that it facilitates
                    593: changes to the graphical aspect of documents.  A change to the generic
                    594: presentation rules attached to each type of entity will alter the presentation
                    595: of the entire document, and will do so homogenously.  In this case, the
                    596: internal homogeneity of the class is no longer assured, but the way to control
                    597: it is simple.  It suffices to adopt a single generic presentation for the
1.18    ! cvs       598: entire class.</p>
        !           599: <p>
1.1       cvs       600: If the presentation of the class does not have to be homogenous, then the
                    601: appearance of the document can be adapted to the way it will be used or to the
                    602: device used to render it.  This quality is sufficient to allow the existence
1.18    ! cvs       603: of <a name="mulpres">many generic presentations</a> for the same document
1.1       cvs       604: class. By applying one or the other of these presentations to it, the document
                    605: can be seen under different graphical aspects.  It must be emphasized that
                    606: this type of modification of the presentation is not a change to the document
                    607: itself (in its specific logical structure or its content), but only in its
1.18    ! cvs       608: appearance at the time of editing or printing.</p>
        !           609: </div>
1.1       cvs       610: 
1.18    ! cvs       611: <div class="section">
1.1       cvs       612: 
1.18    ! cvs       613: <h2><a name="sectb24">Document structures and object structures</a></h2>
        !           614: <p>
1.1       cvs       615: So far, we have only discussed the global structure of documents and have not
                    616: considered the contents found in that structure.  We could limit ourselves to
                    617: purely textual contents by assuming that a title or a paragraph contains a
                    618: simple linear text.  But this model would be too restrictive.  In fact,
                    619: certain documents contain not only text, but also contain tables,  diagrams,
                    620: photographs, mathematical formulas, and program fragments.  The model must
1.18    ! cvs       621: permit the representation of such <em>objects</em>.</p>
        !           622: <p>
1.1       cvs       623: Just as with the whole of the document, the model takes into account the
                    624: logical structure of objects of this type.  Some are clearly structured,
                    625: others are less so.  Logical structure can be recognized in mathematical
                    626: formulas, in tables, and in certain types of diagrams.  On the other hand, it
                    627: is difficult to define the structure of a photograph or of some drawings.  But
                    628: in any case, it does not seem possible to define one unique structure which
                    629: can represent every one of these types of objects.  The approach taken in the
                    630: definition of meta-structure and document classes also applies to objects.
                    631: Object classes can be defined which put together objects of similar type,
1.18    ! cvs       632: constructed from the same generic logical structure.</p>
        !           633: <p>
1.1       cvs       634: Thus, a mathematical class can be defined and have a generic logical structure
                    635: associated with it.  But even if a single generic structure can represent a
                    636: sufficient variety of mathematical formulas, for other objects with less
                    637: rigorous structure, multiple classes must be defined.  As for documents, using
                    638: multiple classes assures that the model can describe the full range of objects
                    639: to be presented.  It also permits the system to support objects which were not
                    640: initially anticipated.  Moreover, this comment applies equally to mathematics:
                    641: different classes of formulas can be described depending on the domain of
1.18    ! cvs       642: mathematics being described.</p>
        !           643: <p>
1.1       cvs       644: Since objects have the same level of logical representation as documents, they
                    645: gain the same advantages.  In particular, it is possible to define the
                    646: presentation separately from the objects themselves and attach it to the
                    647: class.  Thus, as for documents, objects of the same type have a uniform
                    648: presentation and the presentation of every object in a given class can be
                    649: changed simply by changing the generic presentation of the class.  Another
                    650: advantage of using this document model is that the system does not bother the
                    651: user with the details of presentation, but rather allows the user to
1.18    ! cvs       652: concentrate on the logical aspect of the document and the objects.</p>
        !           653: <p>
1.1       cvs       654: It is clear that the documents in a class do not necessarily use the same
                    655: classes of objects: one technical report will contain tables while another
                    656: report will have no tables but will use mathematical formulas. The usable
1.2       cvs       657: object classes are not always mentioned in a limiting way in the generic
                    658: logical structure of documents.  Rather, they can be chosen freely from a
1.18    ! cvs       659: large set, independent of the document class.</p>
        !           660: <p>
1.1       cvs       661: Thus, the object classes will be made commonplace and usable in every
                    662: document. The notion of ``object'' can be enlarged to include not only
                    663: non-textual elements, but also certain types of textual elements which can
                    664: appear in practically every document, whatever their class.  Among these
1.2       cvs       665: textual elements, one can mention enumerations, descriptions, examples,
1.18    ! cvs       666: quotations, even paragraphs.</p>
        !           667: <p>
1.1       cvs       668: Thus, the document model is not a single, general model describing every type
                    669: of document in one place.  Rather, it is a meta-model which can be used to
                    670: describe many different models each of which represents either a class of
                    671: similar documents or a class of similar objects which every document can
1.18    ! cvs       672: include.</p>
        !           673: </div>
        !           674: <hr>
        !           675: </div>
1.1       cvs       676: 
1.18    ! cvs       677: <div class="chapter">
1.1       cvs       678: 
1.18    ! cvs       679: <h1><a name="sect3">The S language</a></h1>
1.1       cvs       680: 
1.18    ! cvs       681: <div class="section">
1.1       cvs       682: 
1.18    ! cvs       683: <h2><a name="sectb31">Document meta-structure</a></h2>
        !           684: <p>
1.1       cvs       685: Since the concept of meta-structure is well suited to the task of describing
                    686: documents at a high level of abstraction, this meta-structure must be
                    687: precisely defined.  Toward that end this section first presents the basic
                    688: elements from which documents and structured objects are composed and then
                    689: specifies the ways in which these basic elements are assembled into structures
1.18    ! cvs       690: representing complete documents and objects.</p>
1.1       cvs       691: 
1.18    ! cvs       692: <div class="subsection">
1.1       cvs       693: 
1.18    ! cvs       694: <h3><a name="sectc311">The basic types</a></h3>
        !           695: <p>
1.1       cvs       696: At the lowest level of a document's structure, the first atom considered is
                    697: the character.  However, since characters are seldom isolated, usually
                    698: appearing as part of a linear sequence, and in order to reduce the complexity
1.18    ! cvs       699: of the document structure, <em>character strings</em> are used as atoms and
1.1       cvs       700: consecutive characters belonging to the same structural element are grouped in
1.18    ! cvs       701: the same character string.</p>
        !           702: <p>
1.1       cvs       703: If the structure of a document is not refined to go down to  the level of
                    704: words or phrases, the contents of a simple paragraph can be considered to be a
                    705: single character string.  On the other hand, the title of a chapter, the title
                    706: of the first section of that chapter, and the text of the first paragraph of
                    707: that section constitute three different character strings, because they belong
1.18    ! cvs       708: to distinct structural elements.</p>
        !           709: <p>
1.1       cvs       710: If, instead, a very fine-grained representation for the structure of a
                    711: document is sought, character strings could be defined to contain only a
                    712: single word, or even just a single character.  This is the case, for example,
                    713: in programs,  for which one wants to retain a structure very close to the
1.2       cvs       714: syntax of the programming language.  In this case, an assignment statement
1.1       cvs       715: initializing a simple variable to zero would be composed of two structural
                    716: elements, the identifier of the variable (a short character string) and the
1.18    ! cvs       717: assigned value (a string of a single character, `0').</p>
        !           718: <p>
1.1       cvs       719: The character string is not the only atom necessary for representing those
                    720: documents that interest us.  It suffices for purely textual documents, but as
                    721: soon as the non-textual objects which we have considered arise, there must be
                    722: other atoms; the number of objects which are to be represented determines the
1.18    ! cvs       723: number of types of atoms that are necessary.</p>
        !           724: <p>
        !           725: Primitive <em>graphical elements</em> are used for tables and figures of
1.1       cvs       726: different types.  These elements are simple geometric shapes like horizontal
                    727: or vertical lines, which are sufficient for tables, or even oblique lines,
1.2       cvs       728: arrows, rectangles, circles, polygons, and curves for use in figures. From
                    729: these elements and character strings, graphical objects and tables can be
1.18    ! cvs       730: constructed.</p>
        !           731: <p>
1.1       cvs       732: Photographs, though having very little structure, must still appear in
1.18    ! cvs       733: documents.  They are supported by <em>picture</em> elements, which are
        !           734: represented as matrices of pixels.</p>
        !           735: <p>
1.1       cvs       736: Finally, mathematical notations require certain elements which are
1.18    ! cvs       737: simultaneously characters and graphical elements, the <em>symbols</em>. By way
1.2       cvs       738: of example, radicals, integration signs, or even large parentheses are
1.1       cvs       739: examples of this type of atom.  The size of each of these symbols is
                    740: determined by its environment, that is to say, by the expression to which it
1.18    ! cvs       741: is attached.</p>
        !           742: <p>
1.1       cvs       743: To summarize, the primitive elements which are used in the construction of
1.18    ! cvs       744: documents and structured objects are:</p>
        !           745: <ul>
        !           746: <li>
        !           747: character strings,
        !           748: <li>
        !           749: graphical elements,
        !           750: <li>
        !           751: pictures,
        !           752: <li>
        !           753: and mathematical symbols.
        !           754: </ul>
        !           755: </div>
1.1       cvs       756: 
1.18    ! cvs       757: <div class="subsection">
1.1       cvs       758: 
1.18    ! cvs       759: <h3><a name="sectc312">Constructed elements</a></h3>
        !           760: <p>
1.1       cvs       761: A document is evidently formed from primitive elements.  But the model of Thot
                    762: also proposes higher level elements.  Thus, in a document composed of several
                    763: chapters, each chapter is an element, and in the chapters each section is also
1.18    ! cvs       764: an element, and so on.  A document is thus an organized set of elements.</p>
        !           765: <p>
1.1       cvs       766: In a document there are different sorts of elements.  Each element has a
1.18    ! cvs       767: <em>type</em> which indicates the role of the element within the document as a
1.1       cvs       768: whole.  Thus, we have, for example, the chapter and section types.  The
                    769: document is made up of typed elements: elements of the type chapter and
                    770: elements of the type section, among others, but also character string elements
                    771: and graphical elements: the primitive elements are typed elements just as
                    772: well.  At the other extreme, the document itself is also considered to be a
1.18    ! cvs       773: typed element.</p>
        !           774: <p>
1.1       cvs       775: The important difference between the primitive elements and the other elements
                    776: of the document is that the primitive elements are atoms (they cannot be
1.18    ! cvs       777: decomposed), whereas the others, called <em>constructed elements</em>, are
1.1       cvs       778: composed of other elements, which can either be primitive elements or
                    779: constructed elements.  A constructed element of type chapter (or more simply,
                    780: ``a chapter'') is composed of sections, which are also constructed elements. A
                    781: paragraph, a constructed element, can be made up of character strings, which
1.18    ! cvs       782: are primitive elements, and of equations, which are constructed elements.</p>
        !           783: <p>
1.1       cvs       784: A document is also a constructed element.  This is an important point. In
                    785: particular, it allows a document to be treated as part of another document,
                    786: and conversely, permits a part of a document to be treated as a complete
                    787: document.  Thus, an article presented in a journal is treated by its author as
                    788: a document in itself, while the editor of the journal considers it to be part
                    789: of an issue.  A table or a figure appearing in a document can be extracted and
                    790: treated as a complete document, for example to prepare transparencies for a
1.18    ! cvs       791: conference.</p>
        !           792: <p>
1.1       cvs       793: These thoughts about types and constructed elements apply just as well to
                    794: objects as they do to documents.  A table is a constructed element made up of
                    795: other constructed elements, rows and columns.  A row is formed of cells, which
                    796: are also constructed elements which contain primitive elements (character
1.18    ! cvs       797: strings) and/or constructed elements like equations.</p>
        !           798: </div>
1.1       cvs       799: 
1.18    ! cvs       800: <div class="subsection">
1.1       cvs       801: 
1.18    ! cvs       802: <h3><a name="sectc313">Logical structure constructors</a></h3>
        !           803: <p>
1.1       cvs       804: Having defined the primitive elements and the constructed elements, it is now
                    805: time to define the types of organization which allow the building of
1.18    ! cvs       806: structures.  For this, we rely on the notion of the <em>constructor</em>.  A
1.1       cvs       807: constructor defines a way of assembling certain elements in a structure.  It
                    808: resides at the level of the meta-structure: it does not describe the existing
                    809: relations in a given structure, but rather defines  how elements are assembled
1.18    ! cvs       810: to build a structure that conforms to a model.</p>
        !           811: <p>
1.1       cvs       812: In defining the overall organization of documents, the first two constructors
1.18    ! cvs       813: considered are the aggregate and the list.</p>
1.1       cvs       814: 
1.18    ! cvs       815: <div class="subsubsection">
1.1       cvs       816: 
1.18    ! cvs       817: <h4><a name="sectd3131">Aggregate and List</a></h4>
        !           818: <p>
        !           819: The <em>aggregate</em> constructor is used to define constructed element types
1.1       cvs       820: which are collections of a given number of other elements. These collections
                    821: may or may not be ordered.  The elements may be either constructed or
                    822: primitive and are specified by their type.  A report (that is, a constructed
                    823: element of the report type) has an aggregate structure.  It is formed from a
                    824: title, an author's name, an introduction, a body, and a conclusion, making it
                    825: a collection of five element types.  This type of constructor is found in
1.18    ! cvs       826: practically every document, and generally at several levels in a document.</p>
        !           827: <p>
        !           828: The <em>list</em> constructor is used to define constructed elements which are
1.1       cvs       829: ordered sequences of elements (constructed or primitive) having the same type.
                    830: The minimum and maximum numbers of elements for the sequence can be specified
                    831: in the list constructor or the number of elements can be left unconstrained.
                    832: The body of a report is a list of chapters and is typically required to
                    833: contain a minimum of two chapters (is a chapter useful if it is the only one
                    834: in the report?) The chapter itself can contain a list of sections, each
1.2       cvs       835: section containing a list of paragraphs.  In the same way as the aggregate,
1.18    ! cvs       836: the list is a very frequently used constructor in every type of document.
1.2       cvs       837: However, these two constructors are not sufficient to describe every document
1.18    ! cvs       838: structure; thus other constructors supplement them.</p>
        !           839: </div>
1.1       cvs       840: 
1.18    ! cvs       841: <div class="subsubsection">
1.1       cvs       842: 
1.18    ! cvs       843: <h4><a name="sectd3132">Choice, Schema, and Unit</a></h4>
        !           844: <p>
        !           845: The <em>choice</em> constructor is used to define the structure of an element
1.1       cvs       846: type for which one alternative is chosen from several possibilities. Thus, a
                    847: paragraph can be either a simple text paragraph, or an enumeration, or a
1.18    ! cvs       848: citation.</p>
        !           849: <p>
1.1       cvs       850: The choice constructor indicates the complete list of possible options, which
                    851: can be too restrictive in certain cases, the paragraph being one such case.
1.18    ! cvs       852: Two constructors, <em>unit</em> and <em>schema</em>, address this
1.1       cvs       853: inconvenience.  They allow more freedom in the choice of an element type.  If
                    854: a paragraph is defined by a schema constructor, it is possible to put in the
                    855: place of a paragraph a table, an equation, a drawing or any other object
                    856: defined by another generic logical structure.  It is also possible to define a
                    857: paragraph as a sequence of units, which could be character strings, symbols,
1.2       cvs       858: or pictures.  The choice constructor alone defines a generic logical structure
1.1       cvs       859: that is relatively constrained; in contrast, using units and schemas, a very
1.18    ! cvs       860: open structure can be defined.</p>
        !           861: <p>
        !           862: The <em>schema</em> constructor represents an object defined by a generic
        !           863: logical structure chosen freely from among those available.</p>
        !           864: <p>
        !           865: The <em>unit</em> constructor represents an element whose type can be either a
1.1       cvs       866: primitive type or an element type defined as a unit in the generic logical
                    867: structure of the document, or in another generic logical structure used in the
                    868: document.  Such an element may be used in document objects constructed
1.18    ! cvs       869: according to other generic structures.</p>
        !           870: <p>
1.1       cvs       871: Thus, for example, if a cross-reference to a footnote is defined in the
                    872: generic logical structure ``Article'' as a unit, a table (an object defined by
                    873: another generic structure) can contain cross-references to footnotes, when
                    874: they appear in an article.  In another type of document, a table defined by
                    875: the same generic structure can contain other types of elements, depending on
                    876: the type of document into which the table is inserted.  All that is needed is
                    877: to declare, in the generic structure for tables, that the contents of cells
                    878: are units.  In this way, the generic structure of objects is divided up
                    879: between different types of documents which are able to adapt themselves to the
1.18    ! cvs       880: environment into which they are inserted.</p>
        !           881: </div>
1.1       cvs       882: 
1.18    ! cvs       883: <div class="subsubsection">
1.1       cvs       884: 
1.18    ! cvs       885: <h4><a name="sectd3133">Reference and Inclusion</a></h4>
        !           886: <p>
        !           887: The <em>reference</em> is used to define document elements that are
        !           888: cross-references to other elements, such as a section, a chapter, a
        !           889: bibliographic citation, or a figure.  The reference is bi-directional.  It can
        !           890: be used to access both the element being cross-referenced and each of the
        !           891: elements which make use of the cross-reference.</p>
        !           892: <p>
        !           893: References can be either <em>internal</em> or <em>external</em>.  That is,
1.1       cvs       894: they can designate elements which appear in the same document or in another
1.18    ! cvs       895: document.</p>
        !           896: <p>
        !           897: The <em><a name="inclusion">inclusion</a></em> constructor is a special type
1.1       cvs       898: of reference.  Like the reference, it is an internal or external bidirectional
                    899: link, but it is not a cross-reference.  This link represents the ``live''
                    900: inclusion of the designated element; it accesses the most recent version of
                    901: that element and not a ``dead'' copy, fixed in the state in which it was found
                    902: at the moment the copy was made.  As soon as an element is modified, all of
                    903: its inclusions are automatically brought up to date.  It must be noted that,
1.18    ! cvs       904: in addition to inclusion, Thot permits the creation of ``dead'' copies.</p>
        !           905: <p>
1.1       cvs       906: There are three types of inclusions: inclusions with full expansion,
                    907: inclusions with partial expansion, and inclusions without expansion. During
                    908: editing, inclusions without expansion are represented on the screen by the
                    909: name of the included document, in a special color, while inclusions with
                    910: expansion (full or partial) are represented by a copy (full or partial) of the
                    911: included element (also in a special color). The on-screen representation of a
1.18    ! cvs       912: partial inclusion is a <a href="#sectc3213">``skeleton''</a> image of the
        !           913: included document.</p>
        !           914: <p>
1.1       cvs       915: Inclusion with complete expansion can be used to include parts of the same
                    916: document or of other documents.  Thus, it can be either an internal or an
                    917: external link.  It can be used to include certain bibliographic entries of a
                    918: scientific article in another article, or to copy part of a mathematical
                    919: formula into another formula of the same document, thus assuring that both
1.18    ! cvs       920: copies will remain synchronized.</p>
        !           921: <p>
1.1       cvs       922: Inclusion without expansion or with partial expansion is used to include
                    923: complete documents.  It is always an external link.  It is used primarily to
                    924: divide very large documents into sub-documents that are easier to manipulate,
                    925: especially when there are many authors.  So, a book can include some chapters,
                    926: where each chapter is a different document which can be edited separately.
                    927: When viewing the book on the screen, it might be desirable to see only the
                    928: titles of the chapters and sections.  This can be achieved using inclusion
1.18    ! cvs       929: with partial expansion.</p>
        !           930: <p>
1.1       cvs       931: During printing, inclusions without expansion or with partial expansion can be
                    932: represented either as they were shown on the screen or by a complete (and
1.18    ! cvs       933: up-to-date) copy of the included element or document.</p>
        !           934: <p>
1.1       cvs       935: The inclusion constructor, whatever its type, respects the generic structure:
                    936: only those elements authorized by the generic structure can be included at a
1.18    ! cvs       937: given position in a document.</p>
        !           938: </div>
1.1       cvs       939: 
1.18    ! cvs       940: <div class="subsubsection">
1.1       cvs       941: 
1.18    ! cvs       942: <h4><a name="sectd3134">Mark pairs</a></h4>
        !           943: <p>
1.1       cvs       944: It is often useful to delimit certain parts of a document independently from
                    945: the logical structure.  For example, one might wish to attach some information
1.18    ! cvs       946: (in the form of an <a href="#sectc315">attribute</a>) or a particular
        !           947: treatment to a group of words or a set of consecutive paragraphs. <em>Mark
        !           948: pairs</em> are used to do this.</p>
        !           949: <p>
1.1       cvs       950: Mark pairs are elements which are always paired and are terminals in the
                    951: logical structure of the document.  Their position in the structure of the
                    952: document is defined in the generic structure.  It is important to note that
1.18    ! cvs       953: when the terminals of a mark pair are <em>extensions</em> (see the next
        !           954: section), they can be used quite freely.</p>
        !           955: </div>
1.1       cvs       956: 
1.18    ! cvs       957: <div class="subsubsection">
1.1       cvs       958: 
1.18    ! cvs       959: <h4><a name="sectd3135">Restrictions and Extensions</a></h4>
        !           960: <p>
1.1       cvs       961: The primitive types and the constructors presented so far permit the
                    962: definition of the logical structure of documents and objects in a rigorous
                    963: way.  But this definition can be very cumbersome in certain cases, notably
                    964: when trying to constrain or extend the authorized element types in a
1.18    ! cvs       965: particular context.  <em>Restrictions</em> and <em>extensions</em> are used to
        !           966: cope with these cases.</p>
        !           967: <p>
        !           968: A restriction associates with a particular element type <em>A</em>, a list of
        !           969: those element types which elements of type <em>A</em> may not contain, even if
        !           970: the definition of type <em>A</em> and those of its components authorize them
1.1       cvs       971: otherwise.  This simplifies the writing of generic logical structures and
                    972: allows limitations to be placed, when necessary, on the choices offered by the
1.18    ! cvs       973: schema and unit constructors.</p>
        !           974: <p>
1.1       cvs       975: Extensions are the inverse of restrictions.  They identify a list of element
1.18    ! cvs       976: types whose presence <em>is</em> permitted, even if its definition and those
        !           977: of its components do not authorize them otherwise.</p>
        !           978: </div>
        !           979: 
        !           980: <div class="subsubsection">
        !           981: 
        !           982: <h4><a name="sectd3136">Summary</a></h4>
        !           983: <p>
        !           984: Thus, four constructors are used to construct a document:</p>
        !           985: <ul>
        !           986: <li>
        !           987: the aggregate constructor (ordered or not),
        !           988: <li>
        !           989: the list constructor,
        !           990: <li>
        !           991: the choice constructor and its extensions, the unit and schema constructors,
        !           992: <li>
        !           993: the reference constructor and its variant, the inclusion.
        !           994: </ul>
        !           995: <p>
1.1       cvs       996: These constructors are also sufficient for objects.  Thus, these constructors
                    997: provide a homogenous meta-model which can describe both the organization of
                    998: the document as a whole and that of the various types of objects which it
                    999: contains.  After presenting the description language for generic structures,
                   1000: we will present several examples which illustrate the appropriateness of the
1.18    ! cvs      1001: model.</p>
        !          1002: <p>
1.1       cvs      1003: The first three constructors (aggregate, list and choice) lead to tree-like
                   1004: structures for documents and objects, the objects being simply the subtrees of
                   1005: the tree of a document (or even of other objects' subtrees).  The reference
                   1006: constructor introduces other, non-hierarchical, relations which augment those
                   1007: of the tree: when a paragraph makes reference to a chapter or a section, that
                   1008: relation leaves the purely tree-like structure.  Moreover,  external reference
                   1009: and inclusion constructors permit the establishment of links between different
1.18    ! cvs      1010: documents, thus creating a hypertext structure.</p>
        !          1011: </div>
        !          1012: </div>
1.1       cvs      1013: 
1.18    ! cvs      1014: <div class="subsection">
1.1       cvs      1015: 
1.18    ! cvs      1016: <h3><a name="sectc314">Associated Elements</a></h3>
        !          1017: <p>
1.1       cvs      1018: Thanks to the list, aggregate and choice constructors, the organization of the
                   1019: document is specified rigorously, using constructed and primitive elements.
                   1020: But a document is made up of more than just its elements; it clearly also
                   1021: contains links between them.  There exist elements whose position in the
                   1022: document's structure is not determinable.  This is notably the case for
                   1023: figures and notes.  A figure can be designated at many points in the same
                   1024: document and its place in the physical document can vary over the life of the
                   1025: document without any effect on the meaning or clarity of the document.  At one
                   1026: time, it can be placed at the end of the document along with all other
                   1027: figures.  At another time, it can appear at the top of the page which follows
                   1028: the first mention of the figure.  The figures can be dispersed throughout the
                   1029: document or can be grouped together.  The situation is similar for notes,
                   1030: which can be printed at the bottom of the page on which they are mentioned or
                   1031: assembled together at the end of the chapter or even the end of the work.  Of
                   1032: course, this brings up questions of the physical position of elements in
                   1033: documents that are broken into pages, but this reflects the structural
                   1034: instability of these elements.  They cannot be treated the same way as
                   1035: elements like paragraphs or sections, whose position in the structure is
1.18    ! cvs      1036: directly linked to the semantics of the document.</p>
        !          1037: <p>
1.1       cvs      1038: Those elements whose position in the structure of the document is not fixed,
                   1039: even though they are definitely part of the document, are called
1.18    ! cvs      1040: <em>associated elements</em>.  Associated elements are themselves structures,
1.1       cvs      1041: which is to say that their content can be organized logically by the
1.18    ! cvs      1042: constructors from primitive and constructed elements.</p>
        !          1043: <p>
1.1       cvs      1044: It can happen that the associated elements are totally disconnected from the
                   1045: structure of the document, as in a commentary or appraisal of the entire work.
                   1046: But more often, the associated elements are linked to the content of the
                   1047: document by references.  This is generally the case for notes and figures,
1.18    ! cvs      1048: among others.</p>
        !          1049: <p>
1.1       cvs      1050: Thus, associated elements introduce a new use for the reference constructor.
                   1051: It not only serves to create links between elements of the principal structure
                   1052: of the document, but also serves to link the associated elements to the
1.18    ! cvs      1053: primary structure.</p>
        !          1054: </div>
1.1       cvs      1055: 
1.18    ! cvs      1056: <div class="subsection">
1.1       cvs      1057: 
1.18    ! cvs      1058: <h3><a name="sectc315">Attributes</a></h3>
        !          1059: <p>
1.1       cvs      1060: There remain logical aspects of documents that are not entirely described by
                   1061: the structure.  Certain types of semantic information, which are not stated
                   1062: explicitly in the text, must also be taken into account.  In particular, such
                   1063: information is shown by typographic effects which do not correspond to a
                   1064: change between structural elements.  In fact, certain titles are set in bold
                   1065: or italic or are printed in a different typeface from the rest of the text in
                   1066: order to mark them as structurally distinct.  But these same effects
                   1067: frequently appear in the middle of continuous text (e.g. in the interior of a
                   1068: paragraph).  In this case, there is no change between structural elements; the
                   1069: effect serves to highlight a word, expression, or phrase.  The notion of an
1.18    ! cvs      1070: <em>attribute</em> is used to express this type of information.</p>
        !          1071: <p>
1.1       cvs      1072: An attribute is a piece of information attached to a structural element which
                   1073: augments the type of the element and clarifies its function in the document.
                   1074: Keywords, foreign language words, and titles of other works can all be
                   1075: represented by character strings with attached attributes.  Attributes may
                   1076: also be attached to constructed elements.  Thus, an attribute indicating the
                   1077: language can be attached to a single word or to a large part of a
1.18    ! cvs      1078: document.</p>
        !          1079: <p>
1.1       cvs      1080: In fact, an attribute can be any piece of information which is linked to a
                   1081: part of a document and which can be used by agents which work on the document.
                   1082: For example, the language in which the document is written determines the set
                   1083: of characters used by an editor or formatter.  It also determines the
                   1084: algorithm or hyphenation dictionary to be used.  The attribute ``keyword''
                   1085: facilitates the work of an information retrieval system.  The attribute
                   1086: ``index word'' allows a formatter to automatically construct an index at the
1.18    ! cvs      1087: end of the document.</p>
        !          1088: <p>
1.1       cvs      1089: As with the types of constructed elements, the attributes and the values they
                   1090: can take are defined separately in each generic logical structure, not in the
                   1091: meta-model, according to the needs of the document class or the nature of the
1.18    ! cvs      1092: object.</p>
        !          1093: <p>
1.1       cvs      1094: Many types of attributes are offered: numeric, textual, references, and
1.18    ! cvs      1095: enumerations:</p>
        !          1096: <ul>
        !          1097: <li>
        !          1098: <em>Numeric attributes</em> can take integer values (negative, positive, or
        !          1099: null).
        !          1100: <li>
        !          1101: <em>Textual attributes</em> have as their values character strings.
        !          1102: <li>
        !          1103: <em>Reference attributes</em> designate an element of the logical structure.
        !          1104: <li>
        !          1105: <em>Enumeration attributes</em> can take one value from a limited list of
1.1       cvs      1106: possible values, each value being a name.
1.18    ! cvs      1107: </ul>
        !          1108: <p>
        !          1109: In a generic structure, there is a distinction between <em>global
        !          1110: attributes</em> and <em>local attributes</em>.  A global attribute can be
1.1       cvs      1111: applied to every element type defined in the generic structure where it is
                   1112: specified.  In contrast, a local attribute can only be applied to certain
                   1113: types of elements, even only a single type.  The ``language'' attribute
                   1114: presented above is an example of a global attribute.  An example of a local
                   1115: attribute is the rank of an author (principal author of the document or
                   1116: secondary author): this attribute can only be applied sensibly to an element
1.18    ! cvs      1117: of the ``author'' type.</p>
        !          1118: <p>
1.1       cvs      1119: Attributes can be assigned to the elements which make up the document in many
                   1120: different ways.  The author can freely and dynamically place them on any part
1.18    ! cvs      1121: of the document in order to attach supplementary information of his/her
        !          1122: choice. However, attributes may only be assigned in accordance with the rules
        !          1123: of the generic structure; in particular, local attributes can only be assigned
        !          1124: to those element types for which they are defined.</p>
        !          1125: <p>
1.1       cvs      1126: In the generic structure, certain local attributes can be made mandatory for
1.2       cvs      1127: certain element types.  In this case, Thot automatically associates the
                   1128: attribute with the elements of this type and it requires the user to provide a
1.18    ! cvs      1129: value for this attribute.</p>
        !          1130: <p>
1.1       cvs      1131: Attributes can also be automatically assigned, with a given value, by every
                   1132: application processing the document in order to systematically add a piece of
                   1133: information to certain predefined elements of the document.  By way of
                   1134: example, in a report containing a French abstract and an English abstract,
                   1135: each of the two abstracts is defined as a sequence of paragraphs.  The first
                   1136: abstract has a value of ``French'' for the ``language'' attribute while the
1.18    ! cvs      1137: second abstract's ``language'' attribute has a value of ``English''.</p>
        !          1138: <p>
1.1       cvs      1139: In the case of mark pairs, attributes are logically associated with the pair
1.18    ! cvs      1140: as a whole, but are actually attached to the first mark.</p>
        !          1141: </div>
1.1       cvs      1142: 
1.18    ! cvs      1143: <div class="subsection">
1.1       cvs      1144: 
1.18    ! cvs      1145: <h3><a name="sectc316">Discussion of the model</a></h3>
        !          1146: <p>
1.1       cvs      1147: The notions of attribute, constructor, structured element, and associated
                   1148: element are used in the definition of generic logical structures of documents
                   1149: and objects.  The problem is to assemble them to form generic structures.  In
                   1150: fact, many types of elements and attributes can be found in a variety of
                   1151: generic structures.  Rather than redefine them for each structure in which
                   1152: they appear, it is best to share them between structures. The object classes
                   1153: already fill this sharing function.  If a mathematical class is defined, its
                   1154: formulas can be used in many different document classes, without redefining
                   1155: the structure of each class.  This problem arises not only for the objects
                   1156: considered here; it also arises for the commonplace textual elements found in
                   1157: many document classes.  This is the reason why the notion of object is so
                   1158: broad and why paragraphs and enumerations are also considered to be objects.
                   1159: These object classes not only permit the sharing of the structures of
1.18    ! cvs      1160: elements, but also of the attributes defined in the generic structures.</p>
        !          1161: <p>
1.1       cvs      1162: Structure, such as that presented here, can appear very rigid, and it is
                   1163: possible to imagine that a document editing system based on this model could
                   1164: prove very constraining to the user.  This is, in fact, a common criticism of
                   1165: syntax-directed editors.  This defect can be avoided with Thot, primarily for
1.18    ! cvs      1166: three reasons:</p>
        !          1167: <ul>
        !          1168: <li>
        !          1169: the generic structures are not fixed in the model itself,
        !          1170: <li>
        !          1171: the model takes the dynamics of documents into account,
        !          1172: <li>
        !          1173: the constructors offer great flexibility.
        !          1174: </ul>
        !          1175: <p>
1.1       cvs      1176: When the generic structure of a document is not predefined, but rather is
                   1177: constructed specifically for each document class, it can be carefully adapted
                   1178: to the current needs.  In cases where the generic structure is inadequate for
                   1179: a particular document of the class, it is always possible either to create a
                   1180: new class with a generic structure well suited to the new case or to extend
                   1181: the generic structure of the existing class to take into account the specifics
                   1182: of the document which poses the problem.  These two solutions can also be
1.18    ! cvs      1183: applied to objects whose structures prove to be poorly designed.</p>
        !          1184: <p>
1.1       cvs      1185: The model is sufficiently flexible to take into account all the phases of the
                   1186: life of the document.  When a generic structure specifies that a report must
                   1187: contain a title, an abstract, an introduction, at least two chapters, and a
1.18    ! cvs      1188: conclusion, this means only that a report, <em>upon completion</em>, will have
1.1       cvs      1189: to contain all of these elements.  When the author begins writing, none of
1.2       cvs      1190: these elements is present.  Thot uses this model.  Therefore, it tolerates
                   1191: documents which do not conform strictly to the generic structure of their
                   1192: class;  it also considers the generic logical structure to be a way of helping
1.18    ! cvs      1193: the user in the construction of a complex document.</p>
        !          1194: <p>
1.1       cvs      1195: In contrast, other applications may reject a document which does not conform
                   1196: strictly to its generic structure.  This is, for example, what is done by
                   1197: compilers which refuse to generate code for a program which is not
                   1198: syntactically correct.  This might also occur when using a document
1.18    ! cvs      1199: application for a report which does not have an abstract or title.</p>
        !          1200: <p>
1.1       cvs      1201: The constructors of the document model bring a great flexibility to the
                   1202: generic structures.  A choice constructor (and even more, a unit or schema
                   1203: constructor)  can represent several, very different elements. The list
                   1204: constructor permits the addition of more elements of the same type.  Used
                   1205: together, these two constructors permit any series of elements of different
                   1206: types.  Of course, this flexibility can be reduced wherever necessary since a
                   1207: generic structure can limit the choices or the number of elements in a
1.18    ! cvs      1208: list.</p>
        !          1209: <p>
1.1       cvs      1210: Another difficulty linked to the use of structure in the document model
                   1211: resides in the choice of the level of the structure.  The structure of a
                   1212: discussion could be extracted from the text itself via linguistic analysis.
                   1213: Some studies are exploring this approach, but the model of Thot excludes this
                   1214: type of structure.  It only takes into account the logical structure provided
1.18    ! cvs      1215: explicitly by the author.</p>
        !          1216: <p>
1.1       cvs      1217: However, the level of structure of the model is not imposed.  Each generic
                   1218: structure defines its own level of structure, adapted to the document class or
                   1219: object and to the ways in which it will be processed.  If it will only be
                   1220: edited and printed, a  relatively simple structure suffices.  If more
                   1221: specialized processing will be applied to it, the structure must represent the
                   1222: element types on which this processing must act.  By way of example, a simple
                   1223: structure is sufficient for printing formulas, but a more complex structure is
                   1224: required to perform symbolic or numeric calculations on the mathematical
1.18    ! cvs      1225: expressions.  The document model of Thot allows both types of structure.</p>
        !          1226: </div>
        !          1227: </div>
1.1       cvs      1228: 
1.18    ! cvs      1229: <div class="section">
1.1       cvs      1230: 
1.18    ! cvs      1231: <h2><a name="sectb32">The definition language for generic structures</a></h2>
        !          1232: <p>
1.1       cvs      1233: Generic structures, which form the basis of the document model of Thot, are
                   1234: specified using a special language.  This definition language, called S, is
1.18    ! cvs      1235: described in this section.</p>
        !          1236: <p>
1.1       cvs      1237: Each generic structure, which defines a class of documents or objects, is
1.2       cvs      1238: specified by a file, written in the S language, which is called a
1.18    ! cvs      1239: <em>structure schema</em>.  Structure schemas are compiled into tables, called
        !          1240: structure tables, which are used by Thot and which determine its behavior.</p>
1.1       cvs      1241: 
1.18    ! cvs      1242: <div class="subsection">
1.1       cvs      1243: 
1.18    ! cvs      1244: <h3><a name="sectc321">Writing Conventions</a></h3>
        !          1245: <p>
1.1       cvs      1246: The grammar of S, like those of the languages P and T presented later, is
                   1247: described using the meta-language M, derived from the Backus-Naur Form
1.18    ! cvs      1248: (BNF).</p>
        !          1249: <p>
1.1       cvs      1250: In this meta-language each rule of the grammar is composed of a grammar symbol
                   1251: followed by an equals sign (`=') and the right part of the rule.  The equals
                   1252: sign plays the same role as the traditional `::=' of BNF: it indicates that
1.18    ! cvs      1253: the right part defines the symbol of the left part.  In the right part,</p>
        !          1254: <dl>
        !          1255: <dt>concatenation</dt>
        !          1256: <dd>
        !          1257: is shown by the juxtaposition of symbols;
        !          1258: </dd>
        !          1259: <dt>character strings</dt>
        !          1260: <dd>
        !          1261: between apostrophes ' represent terminal symbols, that is, keywords in the
1.2       cvs      1262: language defined.  Keywords are written here in upper-case letters, but can be
                   1263: written in any combination of upper and lower-case letters.  For example, the
1.18    ! cvs      1264: keyword <tt>DEFPRES</tt> of S can also be written as <tt>defpres</tt> or
        !          1265: <tt>DefPres</tt>.
        !          1266: </dd>
        !          1267: <dt>material between brackets</dt>
        !          1268: <dd>
        !          1269: (`[' and `]') is optional;
        !          1270: </dd>
        !          1271: <dt>material between angle brackets</dt>
        !          1272: <dd>
        !          1273: (`&lt;' and `>') can be repeated many times or omitted;
        !          1274: </dd>
        !          1275: <dt>the slash</dt>
        !          1276: <dd>
        !          1277: (`/') indicates an alternative, a choice between the options separated by the
        !          1278: slash character;
        !          1279: </dd>
        !          1280: <dt>the period</dt>
        !          1281: <dd>
        !          1282: marks the end of a rule;
        !          1283: </dd>
        !          1284: <dt>text between braces</dt>
        !          1285: <dd>
        !          1286: (`{' and `}') is simply a comment.
        !          1287: </dd>
        !          1288: </dl>
        !          1289: <p>
1.1       cvs      1290: The M meta-language also uses the concepts of identifiers, strings, and
1.18    ! cvs      1291: integers:</p>
        !          1292: <dl>
        !          1293: <dt><tt>NAME</tt></dt>
        !          1294: <dd>
        !          1295: represents an identifier, a sequence of letters (upper or lower-case), digits,
        !          1296: and underline characters (`_'), beginning with a letter.  Also considered a
        !          1297: letter is the sequence of characters `<tt>\nnn</tt>' where the letter
        !          1298: <tt>n</tt> represents the ISO Latin-1 code of the letter in octal.  It is thus
        !          1299: possible to use accented letters in identifiers.  The maximum length of
        !          1300: identifiers is fixed by the compiler.  It is normally 31 characters.
        !          1301: <p>
1.1       cvs      1302: Unlike keywords, upper and lower-case letters are distinct in identifiers.
1.18    ! cvs      1303: Thus, <tt>Title</tt>, <tt>TITLE</tt>, and <tt>title</tt> are considered
        !          1304: different identifiers.</p>
        !          1305: </dd>
        !          1306: <dt><tt>STRING</tt></dt>
        !          1307: <dd>
        !          1308: represents a string.  This is a string of characters delimited by apostrophes.
        !          1309: If an apostrophe must appear in a string, it is doubled.  As with identifiers,
        !          1310: strings can contain characters represented by their octal code (after a
        !          1311: backslash).  As with apostrophes, if a backslash must appear in a string, it
        !          1312: is doubled.
        !          1313: </dd>
        !          1314: <dt><tt>NUMBER</tt></dt>
        !          1315: <dd>
        !          1316: represents a positive integer or zero (without a sign), or said another way, a
        !          1317: sequence of decimal digits.
        !          1318: </dd>
        !          1319: </dl>
        !          1320: <p>
        !          1321: The M language can be used to define itself as follows:</p>
        !          1322: <pre>{ Any text between braces is a comment. }
1.1       cvs      1323: Grammar      = Rule &lt; Rule > 'END' .
                   1324:                { The &lt; and > signs indicate zero }
                   1325:                { or more repetitions. }
                   1326:                { END marks the end of the grammar. }
                   1327: Rule         = Ident '=' RightPart '.' .
                   1328:                { The period indicates the end of a rule }
                   1329: RightPart    = RtTerminal / RtIntermed .
                   1330:                { The slash indicates a choice }
                   1331: RtTerminal   ='NAME' / 'STRING' / 'NUMBER' .
                   1332:                { Right part of a terminal rule }
                   1333: RtIntermed   = Possibility &lt; '/' Possibility > .
                   1334:                { Right part of an intermediate rule }
                   1335: Possibility  = ElemOpt &lt; ElemOpt > .
                   1336: ElemOpt      = Element / '[' Element &lt; Element > ']' /
                   1337:               '&lt;' Element &lt; Element > '>'  .
                   1338:                { Brackets delimit optional parts }
                   1339: Element      = Ident / KeyWord .
                   1340: Ident        = NAME .
                   1341:                { Identifier, sequence of characters }
                   1342: KeyWord      = STRING .
                   1343:                { Character string delimited by apostrophes }
1.18    ! cvs      1344: END</pre>
        !          1345: </div>
1.1       cvs      1346: 
1.18    ! cvs      1347: <div class="subsection">
1.1       cvs      1348: 
1.18    ! cvs      1349: <h3><a name="sectc322">Extension schemas</a></h3>
        !          1350: <p>
1.1       cvs      1351: A structure schema defines the generic logical structure of a class of
                   1352: documents or objects, independent of the operations which can be performed on
                   1353: the documents.  However, certain applications may require particular
                   1354: information to be represented by the structure for the documents that they
                   1355: operate on.  Thus a document version manager will need to indicate in the
                   1356: document the parts which belong to one version or another.  An indexing system
                   1357: will add highly-structured index tables as well as the links between these
1.18    ! cvs      1358: tables and the rest of the document.</p>
        !          1359: <p>
1.2       cvs      1360: Thus, many applications need to extend the generic structure of the documents
                   1361: on which they operate to introduce new attributes, associated elements or
1.1       cvs      1362: element types.  These additions are specific to each application and must be
                   1363: able to be applied to any generic structure: users will want to manage
                   1364: versions or construct indices for many types of documents.  Extension schemas
                   1365: fulfill this role: they define attributes, elements, associated elements,
                   1366: units, etc., but they can only be used jointly with a structure schema that
                   1367: they complete. Otherwise, structure schemas can always be used without these
1.18    ! cvs      1368: extensions when the corresponding applications are not available.</p>
        !          1369: </div>
1.1       cvs      1370: 
1.18    ! cvs      1371: <div class="subsection">
1.1       cvs      1372: 
1.18    ! cvs      1373: <h3><a name="sectc323">The general organization of structure schemas</a></h3>
        !          1374: <p>
        !          1375: Every structure schema begins with the keyword <tt>STRUCTURE</tt> and ends
        !          1376: with the keyword <tt>END</tt>.  The keyword <tt>STRUCTURE</tt> is followed by
        !          1377: the keyword <tt>EXTENSION</tt> in the case where the schema defines an
1.1       cvs      1378: extension, then by the name of the generic structure which the schema defines
                   1379: (the name of the document or object class).  The name of the structure is
1.18    ! cvs      1380: followed by a semicolon.</p>
        !          1381: <p>
1.1       cvs      1382: In the case of a complete schema (that is, a schema which is not an
                   1383: extension), the definition of the name of the structure is followed by the
                   1384: declarations of the default presentation schema, the global attributes, the
                   1385: parameters, the structure rules, the associated elements, the units, the
                   1386: skeleton elements and the exceptions.  Only the definition of the structure
                   1387: rules is required.  Each series of declarations begins with a keyword:
1.18    ! cvs      1388: <tt>DEFPRES</tt>, <tt>ATTR</tt>, <tt>PARAM</tt>, <tt>STRUCT</tt>,
        !          1389: <tt>ASSOC</tt>, <tt>UNITS</tt>, <tt>EXPORT</tt>, <tt>EXCEPT</tt>.</p>
        !          1390: <p>
1.1       cvs      1391: In the case of an extension schema, there are neither parameters nor skeleton
1.18    ! cvs      1392: elements and the <tt>STRUCT</tt> section is optional, while that section is
1.1       cvs      1393: required in a schema that is not an extension.  On the other hand, extension
1.18    ! cvs      1394: schemas can contain an <tt>EXTENS</tt> section, which must not appear in a
1.1       cvs      1395: schema which is not an extension; this section defines the complements to
                   1396: attach to the rules found in the schema to which the extension will be added.
1.18    ! cvs      1397: The sections <tt>ATTR</tt>, <tt>STRUCT</tt>, <tt>ASSOC</tt>, and
        !          1398: <tt>UNITS</tt> define new attributes, new elements, new associated elements,
        !          1399: and new units which add their definitions to the principal schema.</p>
        !          1400: <pre>     StructSchema ='STRUCTURE' ElemID ';'
1.1       cvs      1401:                    'DEFPRES' PresID ';'
                   1402:                  [ 'ATTR' AttrSeq ]
                   1403:                  [ 'PARAM' RulesSeq ]
                   1404:                    'STRUCT' RulesSeq
                   1405:                  [ 'ASSOC' RulesSeq ]
                   1406:                  [ 'UNITS' RulesSeq ]
                   1407:                  [ 'EXPORT' SkeletonSeq ]
                   1408:                  [ 'EXCEPT' ExceptSeq ]
                   1409:                    'END' .
1.18    ! cvs      1410:      ElemID       = NAME .</pre>
        !          1411: <p>
        !          1412: or</p>
        !          1413: <pre>     ExtensSchema ='STRUCTURE' 'EXTENSION' ElemID ';'
1.1       cvs      1414:                    'DEFPRES' PresID ';'
                   1415:                  [ 'ATTR' AttrSeq ]
                   1416:                  [ 'STRUCT' RulesSeq ]
                   1417:                  [ 'EXTENS' ExtensRuleSeq ]
                   1418:                  [ 'ASSOC' RulesSeq ]
                   1419:                  [ 'UNITS' RulesSeq ]
                   1420:                  [ 'EXCEPT' ExceptSeq ]
                   1421:                    'END' .
1.18    ! cvs      1422:      ElemID       = NAME .</pre>
        !          1423: </div>
1.1       cvs      1424: 
1.18    ! cvs      1425: <div class="subsection">
1.1       cvs      1426: 
1.18    ! cvs      1427: <h3><a name="sectc324">The default presentation</a></h3>
        !          1428: <p>
        !          1429: It was shown <a href="#mulpres">above</a> that many different presentations
1.1       cvs      1430: are possible for documents and objects of the same class.  The structure
1.18    ! cvs      1431: schema defines a preferred presentation for the class, called the <em>default
        !          1432: presentation</em>.  Like generic structures, presentations are described by
        !          1433: programs, called <em>presentation schemas</em>, which are written in a
        !          1434: specific language, P, presented <a href="#sectb42">later</a> in this document.
        !          1435: The name appearing after the keyword <tt>DEFPRES</tt> is the name of the
1.2       cvs      1436: default presentation schema.  When a new document is created, Thot will use
                   1437: this presentation schema by default, but the user remains free to choose
1.18    ! cvs      1438: another if s/he wishes.</p>
        !          1439: <pre>     PresID = NAME .</pre>
        !          1440: </div>
1.1       cvs      1441: 
1.18    ! cvs      1442: <div class="subsection">
1.1       cvs      1443: 
1.18    ! cvs      1444: <h3><a name="sectc325">Global Attributes</a></h3>
        !          1445: <p>
1.1       cvs      1446: If the generic structure includes global attributes of its own, they are
1.18    ! cvs      1447: declared after the keyword <tt>ATTR</tt>.  Each global attribute is defined by
1.1       cvs      1448: its name, followed by an equals sign and the definition of its type.  The
1.18    ! cvs      1449: declaration of a global attribute is terminated by a semi-colon.</p>
        !          1450: <p>
1.1       cvs      1451: For attributes of the numeric, textual, or reference types, the type is
1.18    ! cvs      1452: indicated by a keyword, <tt>INTEGER</tt>, <tt>TEXT</tt>, or <tt>REFERENCE</tt>
        !          1453: respectively.</p>
        !          1454: <p>
        !          1455: In the case of a reference attribute, the keyword <tt>REFERENCE</tt> is
1.1       cvs      1456: followed by the type of the referenced element in parentheses.  It can refer
1.18    ! cvs      1457: to any type at all, specified by using the keyword <tt>ANY</tt>, or to a
1.1       cvs      1458: specific type.  In the latter case, the element type designated by the
1.18    ! cvs      1459: reference can be defined either in the <a href="#sectc327"><tt>STRUCT</tt>
        !          1460: section</a> of the same structure schema or in the <tt>STRUCT</tt> section of
1.1       cvs      1461: another structure schema.  When the type is defined in another schema, the
                   1462: element type is followed by the name of the structure schema (within
                   1463: parentheses) in which it is defined.  The name of the designated element type
1.18    ! cvs      1464: can be preceded by the keyword <tt>First</tt> or <tt>Second</tt>, but only in
        !          1465: the case where the type is defined as <a href="#sectd3285">a pair</a>.  These
1.1       cvs      1466: keywords indicate whether the attribute must designate the first mark of the
                   1467: pair or the second.  If the reference refers to a pair and neither of these
1.18    ! cvs      1468: two keywords is present, then the first mark is used.</p>
        !          1469: <p>
1.1       cvs      1470: In the case of an enumeration attribute, the equals sign is followed by the
                   1471: list of names representing the possible values of the attribute, the names
                   1472: being separated from each other by commas.  An enumeration attribute has at
                   1473: least one possible value; the maximum number of values is defined by the
1.18    ! cvs      1474: compiler for the S language.</p>
        !          1475: <pre>     AttrSeq   = Attribute &lt; Attribute > .
1.1       cvs      1476:      Attribute = AttrID '=' AttrType  ';' .
                   1477:      AttrType  = 'INTEGER' / 'TEXT' /
                   1478:                  'REFERENCE' '(' RefType ')' /
                   1479:                  ValueSeq .
                   1480:      RefType   = 'ANY' / [ FirstSec ] ElemID [ ExtStruct ] .
                   1481:      FirstSec  = 'First' / 'Second' .
                   1482:      ExtStruct = '(' ElemID ')' .
                   1483:      ValueSeq  = AttrVal &lt; ',' AttrVal > .
                   1484:      AttrID    = NAME .
1.18    ! cvs      1485:      AttrVal   = NAME .</pre>
        !          1486: <p>
        !          1487: There is a predefined global text attribute, the <em>language</em>, which is
1.2       cvs      1488: automatically added to every Thot structure schema.  This attribute allows
                   1489: Thot to perform certain actions, such as hyphenation and spell-checking, which
                   1490: cannot be performed without knowing the language in which each part of the
                   1491: document is written.  This attribute can be used just like any explicitly
1.18    ! cvs      1492: declared attribute: the system acts as if every structure schema contains</p>
        !          1493: <pre>ATTR
        !          1494:    Language = TEXT;</pre>
        !          1495: <blockquote class="example">
        !          1496: <p>
        !          1497: <strong>Example:</strong></p>
        !          1498: <p>
1.2       cvs      1499: The following specification defines the global enumeration attribute
1.18    ! cvs      1500: WordType.</p>
        !          1501: <pre>ATTR
        !          1502:    WordType = Definition, IndexWord, DocumentTitle;</pre>
        !          1503: </blockquote>
        !          1504: </div>
1.1       cvs      1505: 
1.18    ! cvs      1506: <div class="subsection">
1.1       cvs      1507: 
1.18    ! cvs      1508: <h3><a name="sectc326">Parameters</a></h3>
        !          1509: <p>
1.1       cvs      1510: A parameter is a document element which can appear many times in the document,
                   1511: but always has the same value.  This value can only be modified in a
                   1512: controlled way by certain applications.  For example, in an advertising
                   1513: circular, the name of the recipient may appear in the address part and in the
                   1514: text of the circular.  If the recipient's name were a parameter, it might only
1.18    ! cvs      1515: be able to be changed by a ``mail-merge'' application.</p>
        !          1516: <p>
1.1       cvs      1517: Parameters are not needed for every document class, but if the schema includes
1.18    ! cvs      1518: parameters they are declared after the keyword <tt>PARAM</tt>. Each parameter
        !          1519: declaration is made in the same way as a <a href="#sectc327">structure element
        !          1520: declaration</a>.</p>
        !          1521: <p>
1.1       cvs      1522: During editing, Thot permits the insertion of parameters wherever the
                   1523: structure schema allows; it also permits the removal of parameters which are
                   1524: already in the document but does not allow the modification of the parameter's
1.2       cvs      1525: content in any way.  The content is generated automatically by Thot during the
                   1526: creation of the parameter, based on the value of the parameter in the
1.18    ! cvs      1527: document.</p>
        !          1528: </div>
1.1       cvs      1529: 
1.18    ! cvs      1530: <div class="subsection">
1.1       cvs      1531: 
1.18    ! cvs      1532: <h3><a name="sectc327">Structured elements</a></h3>
        !          1533: <p>
1.1       cvs      1534: The rules for defining structured elements are required, except in an
                   1535: extension schema: they constitute the core of a structure schema, since they
                   1536: define the structure of the different types of elements that occur in a
1.18    ! cvs      1537: document or object of the class defined by the schema.</p>
        !          1538: <p>
        !          1539: The first structure rule after the keyword <tt>STRUCT</tt> must define the
1.1       cvs      1540: structure of the class whose name appears in the first instruction
1.18    ! cvs      1541: (<tt>STRUCTURE</tt>) of the schema.  This is the root rule of the schema,
        !          1542: defining the root of the document tree or object tree.</p>
        !          1543: <p>
1.1       cvs      1544: The remaining rules may be placed in any order, since the language permits the
                   1545: definition of element types before or after their use, or even in the same
                   1546: instruction in which they are used.  This last case allows the definition of
1.18    ! cvs      1547: recursive structures.</p>
        !          1548: <p>
1.1       cvs      1549: Each rule is composed of a name (the name of the element type whose structure
1.18    ! cvs      1550: is being defined) followed by an equals sign and a structure definition.</p>
        !          1551: <p>
1.1       cvs      1552: If any local attributes are associated with the element type defined by the
1.2       cvs      1553: rule, they appear between parentheses after the type name and before the
1.18    ! cvs      1554: equals sign.  The parentheses contain, first, the keyword <tt>ATTR</tt>, then
1.2       cvs      1555: the list of local attributes, separated by commas.  Each local attribute is
                   1556: composed of the name of the attribute followed by an equals sign and the
1.18    ! cvs      1557: definition of the attribute's type, just as in the definition of <a
        !          1558: href="#sectc325">global attributes</a>.  The name of the attribute can be
1.2       cvs      1559: preceded by an exclamation point to indicate that the attribute must always be
                   1560: present for this element type.  The same attribute, identified by its name,
                   1561: can be defined  as a local attribute for multiple element types.  In this
                   1562: case, the equals sign and definition of the attribute type need only appear in
                   1563: the first occurrence of the attribute.  It should be noted that global
1.18    ! cvs      1564: attributes cannot also be defined as local attributes.</p>
        !          1565: <p>
        !          1566: If any <a href="#sectd3135">extensions</a> are defined for this element type,
        !          1567: a plus sign follows the structure definition and the names of the extension
        !          1568: element types appear between parentheses after the plus.  If there are
        !          1569: multiple extensions, they are separated by commas.  These types can either be
        !          1570: defined in the same schema, defined in other schemas, or they may be base
        !          1571: types identified by the keywords <tt>TEXT</tt>, <tt>GRAPHICS</tt>,
        !          1572: <tt>SYMBOL</tt>, or <tt>PICTURE</tt>.</p>
        !          1573: <p>
        !          1574: <a href="#sectd3135">Restrictions</a> are indicated in the same manner as
        !          1575: extensions, but they are introduced by a minus sign and they come after the
        !          1576: extensions, or if there are no extensions, after the structure definition.</p>
        !          1577: <p>
1.1       cvs      1578: If the values of attributes must be attached systematically to this element
1.18    ! cvs      1579: type, they are introduced by the keyword <tt>WITH</tt> and declared in the
1.1       cvs      1580: form of a list of fixed-value attributes.  When such definitions of fixed
1.18    ! cvs      1581: attribute values appear, they are always the last part of the rule.</p>
        !          1582: <p>
        !          1583: The rule is terminated by a semicolon.</p>
        !          1584: <pre>  RuleSeq       = Rule &lt; Rule > .
1.1       cvs      1585:   Rule          = ElemID [ LocAttrSeq ] '=' DefWithAttr ';'.
                   1586:   LocAttrSeq    = '(' 'ATTR' LocAttr &lt; ';' LocAttr > ')' .
                   1587:   LocAttr       = [ '!' ] AttrID [ '=' AttrType ] .
                   1588:   DefWithAttr   = Definition
                   1589:                   [ '+' '(' ExtensionSeq ')' ]
                   1590:                   [ '-' '(' RestrictSeq ')' ]
                   1591:                   [ 'WITH' FixedAttrSeq ] .
                   1592:   ExtensionSeq  = ExtensionElem &lt; ',' ExtensionElem > .
                   1593:   ExtensionElem = ElemID / 'TEXT' / 'GRAPHICS' /
                   1594:                   'SYMBOL' / 'PICTURE' .
                   1595:   RestrictSeq   = RestrictElem &lt; ',' RestrictElem > .
                   1596:   RestrictElem  = ElemID / 'TEXT' / 'GRAPHICS' /
1.18    ! cvs      1597:                   'SYMBOL' / 'PICTURE' .</pre>
        !          1598: <p>
1.1       cvs      1599: The list of fixed-value attributes is composed of a sequence of
                   1600: attribute-value pairs separated by commas.  Each pair contains the name of the
                   1601: attribute and the fixed value for this element type, the two being separated
                   1602: by an equals sign.  If the sign is preceded by a question mark the given value
                   1603: is only an initial value that may be modified later rather than a value fixed
                   1604: for all time.  Reference attributes are an exception to this norm.  They
                   1605: cannot be assigned a fixed value, but when the name of such an attribute
                   1606: appears this indicates that this element type must have a valid value for the
1.2       cvs      1607: attribute.  For the other attribute types, the fixed value is indicated by a
1.1       cvs      1608: signed integer (numeric attributes), a character string between apostrophes
1.18    ! cvs      1609: (textual attributes) or the name of a value (enumeration attributes).</p>
        !          1610: <p>
        !          1611: Fixed-value attributes can either be <a href="#sectc325">global</a> or local
1.1       cvs      1612: to the element type for which they are fixed, but they must be declared before
1.18    ! cvs      1613: they are used.</p>
        !          1614: <pre>    FixedAttrSeq    = FixedAttr &lt; ',' FixedAttr > .
1.1       cvs      1615:     FixedAttr       = AttrID [ FixedOrModifVal ] .
                   1616:     FixedOrModifVal = [ '?' ] '=' FixedValue .
                   1617:     FixedValue      = [ '-' ] NumValue / TextVal / AttrVal .
                   1618:     NumValue        = NUMBER .
1.18    ! cvs      1619:     TextVal         = STRING .</pre>
        !          1620: </div>
1.1       cvs      1621: 
1.18    ! cvs      1622: <div class="subsection">
1.1       cvs      1623: 
1.18    ! cvs      1624: <h3><a name="sectc328">Structure definitions</a></h3>
        !          1625: <p>
1.1       cvs      1626: The structure of an element type can be a simple base type or a constructed
1.18    ! cvs      1627: type.</p>
        !          1628: <p>
1.1       cvs      1629: For constructed types, it is frequently the case that similar structures
                   1630: appear in many places in a document.  For example the contents of the
                   1631: abstract, of the introduction, and of a section can have the same structure,
                   1632: that of a sequence of paragraphs.  In this case, a single, common structure
                   1633: can be defined (the paragraph sequence in this example), and the schema is
                   1634: written to indicate that each element type possesses this structure, as
1.18    ! cvs      1635: follows:</p>
        !          1636: <pre>     Abstract           = Paragraph_sequence;
1.1       cvs      1637:      Introduction       = Paragraph_sequence;
1.18    ! cvs      1638:      Section_contents   = Paragraph_sequence;</pre>
        !          1639: <p>
        !          1640: The equals sign means ``has the same structure as''.</p>
        !          1641: <p>
1.1       cvs      1642: If the element type defined is a simple base type, this is indicated by one of
1.18    ! cvs      1643: the keywords <tt>TEXT</tt>, <tt>GRAPHICS</tt>, <tt>SYMBOL</tt>, or
        !          1644: <tt>PICTURE</tt>.  If some local attributes must be associated with a base
1.1       cvs      1645: type, the keyword of the base type is followed by the declaration of the local
1.18    ! cvs      1646: attributes using the syntax <a href="#sectc327">presented above.</a></p>
        !          1647: <p>
1.1       cvs      1648: In the case of an open choice, the type is indicated by the keyword
1.18    ! cvs      1649: <tt>UNIT</tt> for units or the keyword <tt>NATURE</tt> for objects having a
        !          1650: structure defined by any other schema.</p>
        !          1651: <p>
        !          1652: A unit represents one of the two following categories:</p>
        !          1653: <ul>
        !          1654: <li>
        !          1655: a base type: text, graphical element, symbol, picture,
        !          1656: <li>
        !          1657: an element whose type is chosen from among the types defined as units in the
        !          1658: <tt>UNITS</tt> section of the document's structure schema.  It can also be
        !          1659: chosen from among the types defined as <a href="#sectd3132">units</a> in the
        !          1660: <a href="#sectc3212"><tt>UNITS</tt> section</a> of the structure schemas that
1.2       cvs      1661: defines the ancestors of the element to which the rule is applied.
1.18    ! cvs      1662: </ul>
        !          1663: <p>
1.2       cvs      1664: Before the creation of an element defined as a unit, Thot asks the user to
1.18    ! cvs      1665: choose between the categories of elements.</p>
        !          1666: <p>
1.1       cvs      1667: Thus, the contents of a paragraph can be specified as a sequence of units,
                   1668: which will permit the inclusion in the paragraphs of character strings,
                   1669: symbols, and various elements, such as cross-references, if these are defined
1.18    ! cvs      1670: as units.</p>
        !          1671: <p>
        !          1672: A schema object (keyword <tt>NATURE</tt>) represents an object defined by a
1.1       cvs      1673: structure schema freely chosen from among the available schemas; in the case
                   1674: the element type is defined by the first rule (the root rule) of the chosen
1.18    ! cvs      1675: schema.</p>
        !          1676: <p>
1.1       cvs      1677: If the element type defined is a constructed type, the list, aggregate,
                   1678: choice, and reference constructors are used.  In this case the definition
                   1679: begins with a keyword identifying the constructor.  This keyword is followed
1.18    ! cvs      1680: by a syntax specific to each constructor.</p>
        !          1681: <p>
1.1       cvs      1682: The local attribute definitions appear after the name of the element type
1.18    ! cvs      1683: being defined, if this element type has <a href="#sectc327">local
        !          1684: attributes</a>.</p>
        !          1685: <pre>   Definition = BaseType [ LocAttrSeq ] / Constr / Element .
1.1       cvs      1686:    BaseType   = 'TEXT' / 'GRAPHICS' / 'SYMBOL' / 'PICTURE' /
                   1687:                 'UNIT' / 'NATURE' .
                   1688:    Element    = ElemID [ ExtOrDef ] .
                   1689:    ExtOrDef   = 'EXTERN' / 'INCLUDED' / 
                   1690:                 [ LocAttrSeq ] '=' Definition .
                   1691:    Constr     = 'LIST' [ '[' min '..' max ']' ] 'OF'
                   1692:                        '(' DefWithAttr ')' /
                   1693:                 'BEGIN' DefOptSeq 'END' /
                   1694:                 'AGGREGATE' DefOptSeq 'END' /
                   1695:                 'CASE' 'OF' DefSeq 'END' /
                   1696:                 'REFERENCE' '(' RefType ')' /
1.18    ! cvs      1697:                 'PAIR' .</pre>
1.1       cvs      1698: 
1.18    ! cvs      1699: <div class="subsubsection">
1.1       cvs      1700: 
1.18    ! cvs      1701: <h4><a name="sectd3281">List</a></h4>
        !          1702: <p>
1.1       cvs      1703: The list constructor permits the definition of an element type composed of a
                   1704: list of elements, all of the same type.  A list definition begins with the
1.18    ! cvs      1705: <tt>LIST</tt> keyword followed by an optional range, the keyword <tt>OF</tt>,
1.1       cvs      1706: and the definition, between parentheses, of the element type which must
                   1707: compose the list.  The optional range is composed of the minimum and maximum
                   1708: number of elements for the list separated by two periods and enclosed by
                   1709: brackets.  If the range is not present, the number of list elements is
                   1710: unconstrained.  When only one of the two bounds of the range is unconstrained,
                   1711: it is represented by a star ('*') character.  Even when both bounds are
1.18    ! cvs      1712: unconstrained, they can be specified by <tt>[*..*]</tt>, but it is simpler not
        !          1713: to specify any bound.</p>
        !          1714: <pre>               'LIST' [ '[' min '..' max ']' ]
1.1       cvs      1715:                'OF' '(' DefWithAttr ')'
                   1716:      min     = Integer / '*' .
                   1717:      max     = Integer / '*' .
1.18    ! cvs      1718:      Integer = NUMBER .</pre>
        !          1719: <p>
1.2       cvs      1720: Before the document is edited, Thot creates the minimum number of elements for
                   1721: the list.  If no minimum was given, it creates a single element. If a maximum
                   1722: number of elements is given and that number is attained, the editor refuses to
1.18    ! cvs      1723: create new elements for the list.</p>
        !          1724: <blockquote class="example">
        !          1725: <p>
        !          1726: <strong>Example:</strong></p>
        !          1727: <p>
1.3       cvs      1728: The following two instructions define the body of a document as a sequence of
                   1729: at least two chapters and the contents of a section as a sequence of
1.18    ! cvs      1730: paragraphs.  A single paragraph can be the entire contents of a section.</p>
        !          1731: <pre>Body             = LIST [2..*] OF (Chapter);
        !          1732: Section_contents = LIST OF (Paragraph);</pre>
        !          1733: </blockquote>
        !          1734: </div>
1.1       cvs      1735: 
1.18    ! cvs      1736: <div class="subsubsection">
1.1       cvs      1737: 
1.18    ! cvs      1738: <h4><a name="sectd3282">Aggregate</a></h4>
        !          1739: <p>
1.1       cvs      1740: The aggregate constructor is used to define an element type as a collection of
                   1741: sub-elements, each having a fixed type.  The collection may be ordered or
                   1742: unordered.  The elements composing the collection are called
1.18    ! cvs      1743: <em>components</em>.  In the definition of an aggregate, a keyword indicates
        !          1744: whether or not the aggregate is ordered: <tt>BEGIN</tt> for an ordered
        !          1745: aggregate, <tt>AGGREGATE</tt> for an unordered aggregate. This keyword is
1.1       cvs      1746: followed by the list of component type definitions which is terminated by the
1.18    ! cvs      1747: <tt>END</tt> keyword.  The component type definitions are separated by
        !          1748: commas.</p>
        !          1749: <p>
1.1       cvs      1750: Before creating an aggregate, the Thot editor creates all the aggregate's
                   1751: components in the order they appear in the structure schema, even for
                   1752: unordered aggregates.  However, unlike ordered aggregates, the components of
                   1753: an unordered aggregate may be rearranged using operations of the Thot editor.
                   1754: The exceptions to the rule are any components whose name was preceded by a
                   1755: question mark character ('?').  These components, which are optional, can be
                   1756: created by explicit request, possibly at the time the aggregate is created,
1.18    ! cvs      1757: but they are not created automatically <em>prior</em> to the creation of the
        !          1758: aggregate.</p>
        !          1759: <pre>                 'BEGIN' DefOptSeq 'END'
1.1       cvs      1760:      DefOptSeq = DefOpt ';' &lt; DefOpt ';' > .
1.18    ! cvs      1761:      DefOpt    = [ '?' ] DefWithAttr .</pre>
        !          1762: <blockquote class="example">
        !          1763: <p>
        !          1764: <strong>Example:</strong></p>
        !          1765: <p>
1.3       cvs      1766: In a bilingual document, each paragraph has an English version and a French
                   1767: version.  In certain cases, the translator wants to add a marginal note, but
                   1768: this note is present in very few paragraphs.  Thus, it must not be created
                   1769: systematically for every paragraph.  A bilingual paragraph of this type is
1.18    ! cvs      1770: declared:</p>
        !          1771: <pre>Bilingual_paragraph = BEGIN
1.1       cvs      1772:                       French_paragraph  = TEXT;
                   1773:                       English_paragraph = TEXT;
                   1774:                       ? Note            = TEXT;
1.18    ! cvs      1775:                       END;</pre>
        !          1776: </blockquote>
        !          1777: </div>
1.1       cvs      1778: 
1.18    ! cvs      1779: <div class="subsubsection">
1.1       cvs      1780: 
1.18    ! cvs      1781: <h4><a name="sectd3283">Choice</a></h4>
        !          1782: <p>
1.1       cvs      1783: The choice constructor permits the definition of an element type which is
1.18    ! cvs      1784: chosen from among a set of possible types.  The keywords <tt>CASE</tt> and
        !          1785: <tt>OF</tt> are followed by a list of definitions of possible types, which are
        !          1786: separated by semicolons and terminated by the <tt>END</tt> keyword.</p>
        !          1787: <pre>               'CASE' 'OF' DefSeq 'END'
        !          1788:      DefSeq = DefWithAttr ';' &lt; DefWithAttr ';' > .</pre>
        !          1789: <p>
1.1       cvs      1790: Before the creation of an element defined as a choice, the Thot editor
                   1791: presents the list of possible types for the element to the user.  The user has
1.18    ! cvs      1792: only to select the element type that s/he wants to create from this list.</p>
        !          1793: <p>
1.1       cvs      1794: The order of the type declarations is important.  It determines the order of
                   1795: the list presented to the user before the creation of the element.  Also, when
                   1796: a Choice element is being created automatically, the first type in the list is
                   1797: used.  In fact, using the Thot editor, when an empty Choice element is
                   1798: selected, it is possible to select this element and to enter its text from
                   1799: keyboard. In this case, the editor uses the first element type which can
1.18    ! cvs      1800: contain an atom of the character string type.</p>
        !          1801: <p>
        !          1802: The two special cases of the choice constructor, the <a
        !          1803: href="#sectc328"><em>schema</em></a> and the <a
        !          1804: href="#sectc3212"><em>unit</em></a> are discussed elsewhere.</p>
        !          1805: <blockquote class="example">
        !          1806: <p>
        !          1807: <strong>Example:</strong></p>
        !          1808: <p>
1.3       cvs      1809: It is common in documents to treat a variety of objects as if they were
                   1810: ordinary paragraphs.  Thus, a ``Paragraph'' might actually be composed of a
                   1811: block of text (an ordinary paragraph), or a mathematical formula whose
                   1812: structure is defined by another structure schema named Math, or a table, also
                   1813: defined by another structure schema.  Here is a definition of such a
1.18    ! cvs      1814: paragraph:</p>
        !          1815: <pre>Paragraph = CASE OF
1.1       cvs      1816:               Simple_text = TEXT;
                   1817:               Formula     = Math;
                   1818:               Table_para  = Table;
1.18    ! cvs      1819:               END;</pre>
        !          1820: </blockquote>
        !          1821: </div>
1.1       cvs      1822: 
1.18    ! cvs      1823: <div class="subsubsection">
1.1       cvs      1824: 
1.18    ! cvs      1825: <h4><a name="sectd3284">Reference</a></h4>
        !          1826: <p>
1.1       cvs      1827: Like all elements in Thot, references are typed.  An element type defined as a
                   1828: reference is a cross-reference to an element of some other given type. The
1.18    ! cvs      1829: keyword <tt>REFERENCE</tt> is followed by the name of a type enclosed in
1.1       cvs      1830: parentheses.  When the type which is being cross-referenced is defined in
                   1831: another structure schema, the type name is itself followed by the name of the
1.18    ! cvs      1832: external structure schema in which it is defined.</p>
        !          1833: <p>
        !          1834: When the designated element type is a <a href="#sectd3285">mark pair</a>, it
        !          1835: can be preceded by a <tt>FIRST</tt> or <tt>SECOND</tt> keyword.  These
        !          1836: keywords indicate whether the reference points to the first or second mark of
        !          1837: the pair. If the reference points to a pair and neither of these two keywords
        !          1838: is present, the reference is considered to point to the first mark of the
        !          1839: pair.</p>
        !          1840: <p>
1.1       cvs      1841: There is an exception to the principle of typed references:  it is possible to
                   1842: define a reference which designates an element of any type, which can either
                   1843: be in the same document or another document. In this case, it suffices to put
1.18    ! cvs      1844: the keyword <tt>ANY</tt> in the parentheses which indicate the referenced
        !          1845: element type.</p>
        !          1846: <pre>             'REFERENCE' '(' RefType ')'
        !          1847:    RefType = 'ANY' / [ FirstSec ] ElemID [ ExtStruct ] .</pre>
        !          1848: <p>
        !          1849: When defining an inclusion, the <tt>REFERENCE</tt> keyword is not used.
1.1       cvs      1850: Inclusions with complete expansion are not declared as such in the structure
                   1851: schemas, since any element defined in a structure schema can be replaced by an
                   1852: element of the same type.  Instead, inclusions without expansion or with
                   1853: partial expansion must be declared explicitly whenever they will include a
                   1854: complete object ( and not a part of an object).  In this case, the object type
                   1855: to be included (that is, the name of its structure schema) is followed by a
1.18    ! cvs      1856: keyword: <tt>EXTERN</tt> for inclusion without expansion and <tt>INCLUDED</tt>
        !          1857: for partial expansion.</p>
        !          1858: <p>
1.1       cvs      1859: Before creating a cross-reference or an inclusion, the Thot editor asks the
                   1860: user to choose, from the document images displayed, the referenced or included
1.18    ! cvs      1861: element.</p>
        !          1862: <blockquote class="example">
        !          1863: <p>
        !          1864: <strong>Example:</strong></p>
        !          1865: <p>
1.3       cvs      1866: If the types Note and Section are defined in the Article structure schema, it
                   1867: is possible to define, in the same structure schema, a reference to a note and
1.18    ! cvs      1868: a reference to a section in this manner:</p>
        !          1869: <pre>Ref_note    = REFERENCE (Note);
        !          1870: Ref_section = REFERENCE (Section);</pre>
        !          1871: <p>
1.1       cvs      1872: It is also possible to define the generic structure of a collection of
                   1873: articles, which include (with partial expansion) objects of the Article class
                   1874: and which possess an introduction which may include cross-references to
                   1875: sections of the included articles.  In the Collection structure schema, the
1.18    ! cvs      1876: definitions are:</p>
        !          1877: <pre>Collection = BEGIN
1.6       cvs      1878:              Collection_title = TEXT;
                   1879:              Introduction = LIST OF (Elem = CASE OF
1.1       cvs      1880:                                            TEXT;
                   1881:                                            Ref_sect;
                   1882:                                            END);
1.6       cvs      1883:              Body = LIST OF (Article INCLUDED);
                   1884:              END;
1.18    ! cvs      1885: Ref_sect   = REFERENCE (Section (Article));</pre>
        !          1886: <p>
1.1       cvs      1887: Here we define a Folder document class which has a title and includes
1.18    ! cvs      1888: documents of different types, particularly Folders:</p>
        !          1889: <pre>Folder   = BEGIN
1.6       cvs      1890:            Folder_title    = TEXT;
                   1891:            Folder_contents = LIST OF (Document);
                   1892:            END;
1.1       cvs      1893: 
                   1894: Document = CASE OF
                   1895:               Article EXTERN;
                   1896:               Collection EXTERN;
                   1897:               Folder EXTERN;
1.18    ! cvs      1898:               END;</pre>
        !          1899: <p>
1.1       cvs      1900: Under this definition, Folder represents either an aggregate which contains a
                   1901: folder title and the list of included documents or an included folder.  To
                   1902: resolve this ambiguity, in the P language, the placement of a star character
1.18    ! cvs      1903: in front of the type name (here, Folder) indicates an included document.</p>
        !          1904: </blockquote>
        !          1905: </div>
1.1       cvs      1906: 
1.18    ! cvs      1907: <div class="subsubsection">
1.1       cvs      1908: 
1.18    ! cvs      1909: <h4><a name="sectd3285">Mark pairs</a></h4>
        !          1910: <p>
1.1       cvs      1911: Like other elements, mark pairs are typed.  The two marks of the pair have the
                   1912: same type, but there exist two predefined subtypes which apply to all mark
1.18    ! cvs      1913: pairs: the first mark of the pair (called <tt>First</tt> in the P and T
        !          1914: languages) and the second mark (called <tt>Second</tt>).</p>
        !          1915: <p>
        !          1916: In the S language, a mark pair is noted simply by the <tt>PAIR</tt>
        !          1917: keyword.</p>
        !          1918: <p>
1.1       cvs      1919: In the Thot editor, marks are always moved or destroyed together.  The two
                   1920: marks of a pair have the same identifier, unique within the document, which
1.18    ! cvs      1921: permits intertwining mark pairs without risk of ambiguity.</p>
        !          1922: </div>
        !          1923: </div>
1.1       cvs      1924: 
1.18    ! cvs      1925: <div class="subsection">
1.1       cvs      1926: 
1.18    ! cvs      1927: <h3><a name="sectc329">Imports</a></h3>
        !          1928: <p>
1.1       cvs      1929: Because of schema constructors, it is possible, before editing a document, to
                   1930: use classes defined by other structure schemas whenever they are needed. It is
                   1931: also possible to assign specific document classes to certain element types. In
                   1932: this case, these classes are simply designated by their name.  In fact, if a
                   1933: type name is not defined in the structure schema, it is assumed that it
1.18    ! cvs      1934: specifies a structure defined by another structure schema.</p>
        !          1935: <blockquote class="example">
        !          1936: <p>
        !          1937: <strong>Example:</strong></p>
        !          1938: <p>
1.3       cvs      1939: If the types Math and Table don't appear in the left part of a structure rule
                   1940: in the schema, the following two rules indicate that a formula has the
                   1941: structure of an object defined by the structure schema Math and that a table
1.18    ! cvs      1942: element has the structure of an object defined by the Table schema.</p>
        !          1943: <pre>Formula    = Math;
        !          1944: Table_elem = Table;</pre>
        !          1945: </blockquote>
        !          1946: </div>
        !          1947: 
        !          1948: <div class="subsection">
        !          1949: 
        !          1950: <h3><a name="sectc3210">Extension rules</a></h3>
        !          1951: <p>
        !          1952: The <tt>EXTENS</tt> section, which can only appear in an extension schema,
1.1       cvs      1953: defines complements to the rules in the primary schema (i.e. the structure
                   1954: schema to which the extension schema will be applied). More precisely, this
                   1955: section permits the addition to an existing type of local attributes,
1.18    ! cvs      1956: extensions, restrictions and fixed-value attributes.</p>
        !          1957: <p>
1.1       cvs      1958: These additions can be applied to the root rule of the primary schema,
1.18    ! cvs      1959: designated by the keyword <tt>Root</tt>, or to any other explicitly named
        !          1960: rule.</p>
        !          1961: <p>
1.1       cvs      1962: Extension rules are separated from each other by a semicolon and each
1.18    ! cvs      1963: extension rule has the same syntax as a <a href="#sectc327">structure
        !          1964: rule</a>, but the part which defines the constructor is absent.</p>
        !          1965: <pre>     ExtenRuleSeq = ExtensRule ';' &lt; ExtensRule ';' > .
1.6       cvs      1966:      ExtensRule   = RootOrElem [ LocAttrSeq ]
                   1967:                     [ '+' '(' ExtensionSeq ')' ]
                   1968:                     [ '-' '(' RestrictSeq ')' ]
                   1969:                     [ 'WITH' FixedAttrSeq ] .
1.18    ! cvs      1970:      RootOrElem   = 'Root' / ElemID .</pre>
        !          1971: </div>
1.1       cvs      1972: 
1.18    ! cvs      1973: <div class="subsection">
1.1       cvs      1974: 
1.18    ! cvs      1975: <h3><a name="sectc3211">Associated elements</a></h3>
        !          1976: <p>
1.1       cvs      1977: If associated elements are necessary, they must be declared in a specific
1.18    ! cvs      1978: section of the structure schema, introduced by the keyword <tt>ASSOC</tt>.
1.1       cvs      1979: Each associated element type is specified like any other structured element.
                   1980: However, these types must not appear in any other element types of the schema,
1.18    ! cvs      1981: except in <tt>REFERENCE</tt> rules.</p>
        !          1982: </div>
1.1       cvs      1983: 
1.18    ! cvs      1984: <div class="subsection">
1.1       cvs      1985: 
1.18    ! cvs      1986: <h3><a name="sectc3212">Units</a></h3>
        !          1987: <p>
        !          1988: The <tt>UNITS</tt> section of the structure schema contains the declarations
1.1       cvs      1989: of the element types which can be used in the external objects making up parts
                   1990: of the document or in objects of the class defined by the schema.  As with
                   1991: associated elements, these element types are defined just like other
                   1992: structured element types. They can be used in the other element types of the
1.18    ! cvs      1993: schema, but they can also be used in any other rule of the schema.</p>
        !          1994: <blockquote class="example">
        !          1995: <p>
        !          1996: <strong>Example:</strong></p>
        !          1997: <p>
        !          1998: If references to notes are declared as units:</p>
        !          1999: <pre>UNITS
        !          2000:    Ref_note = REFERENCE (Note);</pre>
        !          2001: <p>
1.3       cvs      2002: then it is possible to use references to notes in a cell of a table, even when
1.18    ! cvs      2003: <tt>Table</tt> is an external structure schema.  The <tt>Table</tt> schema
        !          2004: must declare a cell to be a sequence of units, which can then be base element
        !          2005: types (text, for example) or references to notes in the document.</p>
        !          2006: <pre>Cell = LIST OF (UNITS);</pre>
        !          2007: </blockquote>
        !          2008: </div>
1.1       cvs      2009: 
1.18    ! cvs      2010: <div class="subsection">
1.1       cvs      2011: 
1.18    ! cvs      2012: <h3><a name="sectc3213">Skeleton elements</a></h3>
        !          2013: <p>
1.1       cvs      2014: When editing a document which contains or must contain external references to
                   2015: several other documents, it may be necessary to load a large number of
                   2016: documents, simply to see the parts designated by the external references of
                   2017: the document while editing, or to access the source of included elements.  In
                   2018: this case, the external documents are not modified and it is only necessary to
                   2019: see the elements of these documents which could be referenced.  Because of
                   2020: this, the editor will suggest that the documents be loaded in ``skeleton''
                   2021: form.  This form contains only the elements of the document explicitly
1.18    ! cvs      2022: mentioned in the <tt>EXPORT</tt> section of their structure schema and, for
1.1       cvs      2023: these elements, only the part of the contents specified in that section. This
                   2024: form has the advantage of being very compact, thus requiring very few
                   2025: resources from the editor.  This is also the skeleton form which constitutes
1.18    ! cvs      2026: the expanded form of <a href="#inclusion">inclusions</a> with partial
        !          2027: expansion.</p>
        !          2028: <p>
        !          2029: Skeleton elements must be declared explicitly in the <tt>EXPORT</tt> section
1.1       cvs      2030: of the structure schema that defines them.  This section begins with the
1.18    ! cvs      2031: keyword <tt>EXPORT</tt> followed by a comma-separated list of the element
1.1       cvs      2032: types which must appear in the skeleton form and ending with a semicolon.
1.18    ! cvs      2033: These types must have been previously declared in the schema.</p>
        !          2034: <p>
1.1       cvs      2035: For each skeleton element type, the part of the contents which is loaded by
                   2036: the editor, and therefore displayable, can be specified by putting the keyword
1.18    ! cvs      2037: <tt>WITH</tt> and the name of the contained element type to be loaded after
1.1       cvs      2038: the name of the skeleton element type.  In this case only that named element,
                   2039: among all the elements contained in the exportable element type, will be
1.18    ! cvs      2040: loaded.  If the <tt>WITH</tt> is absent, the entire contents of the skeleton
1.1       cvs      2041: element will be loaded by the editor.  If instead, it is better that the
                   2042: skeleton form not load the contents of a particular element type, the keyword
1.18    ! cvs      2043: <tt>WITH</tt> must be followed by the word <tt>Nothing</tt>.</p>
        !          2044: <pre>                [ 'EXPORT' SkeletonSeq ]
1.1       cvs      2045: 
                   2046:      SkeletonSeq = SkelElem &lt; ',' SkelElem > ';' .
                   2047:      SkelElem    = ElemID [ 'WITH' Contents ] .
1.18    ! cvs      2048:      Contents    = 'Nothing' / ElemID [ ExtStruct ] .</pre>
        !          2049: <blockquote class="example">
        !          2050: <p>
        !          2051: <strong>Example:</strong></p>
        !          2052: <p>
1.3       cvs      2053: Suppose that, in documents of the article class, the element types
                   2054: Article_title, Figure, Section, Paragraph, and Biblio should appear in the
                   2055: skeleton form in order to make it easier to create external references to them
                   2056: from other documents.  When loading an article in its skeleton form, all of
                   2057: these element types will be loaded except for paragraphs, but only the article
1.18    ! cvs      2058: title will be loaded in its entirety.  For figures, the caption will be
        !          2059: loaded, while for sections, the title will be loaded, and for bibliographic
        !          2060: entries, only the title that they contain will be loaded.  Note that
1.3       cvs      2061: bibliographic elements are defined in another structure schema, RefBib.  To
                   2062: produce this result, the following declarations should be placed in the
1.18    ! cvs      2063: Article structure schema:</p>
        !          2064: <pre>EXPORT
1.1       cvs      2065:    Article_title,
1.5       cvs      2066:    Figure With Caption,
1.1       cvs      2067:    Section With Section_title,
                   2068:    Paragraph With Nothing,
1.18    ! cvs      2069:    Biblio With Biblio_title(RefBib);</pre>
        !          2070: </blockquote>
        !          2071: </div>
1.1       cvs      2072: 
1.18    ! cvs      2073: <div class="subsection">
1.1       cvs      2074: 
1.18    ! cvs      2075: <h3><a name="sectc3214">Exceptions</a></h3>
        !          2076: <p>
1.1       cvs      2077: The behavior of the Thot editor and the actions that it performs are
                   2078: determined by the structure schemas.  These actions are applied to all
                   2079: document and object types in accordance with their generic structure.  For
                   2080: certain object types, such as tables and graphics, these actions are not
                   2081: sufficient or are poorly adapted and some special actions must be added to or
                   2082: substituted for certain standard actions.  These special actions are called
1.18    ! cvs      2083: <em>exceptions</em>.</p>
        !          2084: <p>
1.1       cvs      2085: Exceptions only inhibit or modify certain standard actions, but they can be
1.18    ! cvs      2086: used freely in every structure schema.</p>
        !          2087: <p>
1.1       cvs      2088: Each structure schema can contain a section defining exceptions.  It begins
1.18    ! cvs      2089: with the keyword <tt>EXCEPT</tt> and is composed of a sequence of exception
1.1       cvs      2090: declarations, separated by semicolons.  Each declaration of an exception
                   2091: begins with the name of an element type or attribute followed by a colon. This
                   2092: indicates the element type or attribute to which the following exceptions
1.18    ! cvs      2093: apply.  When the given element type name is a <a href="#sectd3285">mark
        !          2094: pair</a>, and only in this case, the type name can be preceded by the keyword
        !          2095: <tt>First</tt> or <tt>Second</tt>, to indicate if the exceptions which follow
1.1       cvs      2096: are associated with the first mark of the pair or the second.  In the absence
1.18    ! cvs      2097: of this keyword, the first mark is used.</p>
        !          2098: <p>
        !          2099: When placed in an <a href="#sectc322">extension schema</a>, the keyword
        !          2100: <tt>EXTERN</tt> indicates that the type name which follows is found in the
1.1       cvs      2101: principal schema (the schema being extended by the extension schema).  The
1.18    ! cvs      2102: exceptions are indicated by a name.  They are separated by semicolons.</p>
        !          2103: <pre>                  [ 'EXCEPT' ExceptSeq ]
1.1       cvs      2104: 
                   2105:      ExceptSeq     = Except ';' &lt; Except ';' > .
                   2106:      Except        = [ 'EXTERN' ] [ FirstSec ] ExcTypeOrAttr
                   2107:                      ':' ExcValSeq .
                   2108:      ExcTypeOrAttr = ElemID / AttrID .
                   2109:      ExcValSeq     = ExcValue &lt; ',' ExcValue > .
                   2110:      ExcValue      ='NoCut' / 'NoCreate' /
                   2111:                     'NoHMove' / 'NoVMove' / 'NoMove' /
                   2112:                     'NoHResize' / 'NoVResize' / 'NoResize' /
1.18    ! cvs      2113:                     'MoveResize' /
1.1       cvs      2114:                     'NewWidth' / 'NewHeight' /
                   2115:                     'NewHPos' / 'NewVPos' /
                   2116:                     'Invisible' / 'NoSelect' /
                   2117:                     'Hidden' / 'ActiveRef' /
                   2118:                     'ImportLine' / 'ImportParagraph' /
                   2119:                     'NoPaginate' / 'ParagraphBreak' /
1.9       cvs      2120:                     'HighlightChildren' / 'ExtendedSelection' /
1.18    ! cvs      2121:                     'ReturnCreateNL' .</pre>
        !          2122: <p>
        !          2123: The following are the available exceptions:</p>
        !          2124: <dl>
        !          2125: <dt><tt>NoCut</tt></dt>
        !          2126: <dd>
        !          2127: This exception can only be applied to element types.  Elements of a type to
1.13      cvs      2128: which this exception is applied cannot be deleted by the editor.
1.18    ! cvs      2129: </dd>
        !          2130: <dt><tt>NoCreate</tt></dt>
        !          2131: <dd>
        !          2132: This exception can only be applied to element types.  Elements of a type to
1.2       cvs      2133: which this exception is applied cannot be created by ordinary commands for
                   2134: creating new elements.  These elements are usually created by special actions
1.13      cvs      2135: associated with other exceptions.
1.18    ! cvs      2136: </dd>
        !          2137: <dt><tt>NoHMove</tt></dt>
        !          2138: <dd>
        !          2139: This exception can only be applied to element types.  Elements of a type to
        !          2140: which this exception is applied cannot be moved horizontally with the mouse.
        !          2141: Their children elements cannot be moved either.
        !          2142: </dd>
        !          2143: <dt><tt>NoVMove</tt></dt>
        !          2144: <dd>
        !          2145: This exception can only be applied to element types.  Elements of a type to
        !          2146: which this exception is applied cannot be moved vertically with the mouse.
        !          2147: Their children elements cannot be moved either.
        !          2148: </dd>
        !          2149: <dt><tt>NoMove</tt></dt>
        !          2150: <dd>
        !          2151: This exception can only be applied to element types.  Elements of a type to
1.2       cvs      2152: which this exception is applied cannot be moved in any direction with the
1.13      cvs      2153: mouse.  Their children elements cannot be moved either.
1.18    ! cvs      2154: </dd>
        !          2155: <dt><tt>NoHResize</tt></dt>
        !          2156: <dd>
        !          2157: This exception can only be applied to element types.  Elements of a type to
        !          2158: which this exception is applied cannot be resized horizontally with the mouse.
        !          2159: Their children elements cannot be resized either.
        !          2160: </dd>
        !          2161: <dt><tt>NoVResize</tt></dt>
        !          2162: <dd>
        !          2163: This exception can only be applied to element types.  Elements of a type to
        !          2164: which this exception is applied cannot be resized vertically with the mouse.
        !          2165: Their children elements cannot be resized either.
        !          2166: </dd>
        !          2167: <dt><tt>NoResize</tt></dt>
        !          2168: <dd>
        !          2169: This exception can only be applied to element types.  Elements of a type to
1.2       cvs      2170: which this exception is applied cannot be resized in any direction with the
1.13      cvs      2171: mouse.  Their children elements cannot be resized either.
1.18    ! cvs      2172: </dd>
        !          2173: <dt><tt>MoveResize</tt></dt>
        !          2174: <dd>
        !          2175: This exception can only be applied to element types.  Elements of a type to
        !          2176: which this exception is applied can be moved and resized in any direction with
        !          2177: the mouse, even if one of their ancestor element has an exception that
1.13      cvs      2178: prevents moving or resizing.  Their children elements can also be resized or
                   2179: moved.
1.18    ! cvs      2180: </dd>
        !          2181: <dt><tt>NoSelect</tt></dt>
        !          2182: <dd>
        !          2183: This exception can only be applied to element types.  Elements of a type to
        !          2184: which this exception is applied cannot be selected directly with the mouse,
        !          2185: but they can be selected by other methods provided by the editor.
        !          2186: </dd>
        !          2187: <dt><tt>NewWidth</tt></dt>
        !          2188: <dd>
        !          2189: This exception can only be applied to numeric attributes.  If the width of an
        !          2190: element which has this attribute is modified with the mouse, the value of the
        !          2191: new width will be assigned to the attribute.
        !          2192: </dd>
        !          2193: <dt><tt>NewHeight</tt></dt>
        !          2194: <dd>
        !          2195: This exception can only be applied to numeric attributes.  If the height of an
        !          2196: element which has this attribute is modified with the mouse, the value of the
        !          2197: new height will be assigned to the attribute.
        !          2198: </dd>
        !          2199: <dt><tt>NewHPos</tt></dt>
        !          2200: <dd>
        !          2201: This exception can only be applied to numeric attributes.  If the horizontal
        !          2202: position of an element which has this attribute is modified with the mouse,
        !          2203: the value of the new horizontal position will be assigned to the attribute.
        !          2204: </dd>
        !          2205: <dt><tt>NewVPos</tt></dt>
        !          2206: <dd>
        !          2207: This exception can only be applied to numeric attributes.  If the vertical
        !          2208: position of an element which has this attribute is modified with the mouse,
        !          2209: the value of the new vertical position will be assigned to the attribute.
        !          2210: </dd>
        !          2211: <dt><tt>Invisible</tt></dt>
        !          2212: <dd>
        !          2213: This exception can only be applied to attributes, but can be applied to all
1.2       cvs      2214: attribute types.  It indicates that the attribute must not be seen by the user
                   2215: and that its value must not be changed directly.  This exception is usually
1.5       cvs      2216: used when another exception manipulates the value of an attribute.
1.18    ! cvs      2217: </dd>
        !          2218: <dt><tt>Hidden</tt></dt>
        !          2219: <dd>
        !          2220: This exception can only be applied to element types.  It indicates that
1.2       cvs      2221: elements of this type, although present in the document's structure, must not
1.18    ! cvs      2222: be shown to the user of the editor.  In particular, the creation menus must
        !          2223: not propose this type and the selection message must not pick it.
        !          2224: </dd>
        !          2225: <dt><tt>ActiveRef</tt></dt>
        !          2226: <dd>
        !          2227: This exception can only be applied to attributes of the reference type.  It
1.2       cvs      2228: indicates that when the user of the editor makes a double click on an element
                   2229: which possesses a reference attribute having this exception, the element
                   2230: designated by the reference attribute will be selected.
1.18    ! cvs      2231: </dd>
        !          2232: <dt><tt>ImportLine</tt></dt>
        !          2233: <dd>
        !          2234: This exception can only be applied to element types.  It indicates that
1.2       cvs      2235: elements of this type should receive the content of imported text files.  An
                   2236: element is created for each line of the imported file.  A structure schema
1.18    ! cvs      2237: cannot contain several exceptions <tt>ImportLine</tt> and, if it contains one,
        !          2238: it should not contain any exception <tt>ImportParagraph</tt>.
        !          2239: </dd>
        !          2240: <dt><tt>ImportParagraph</tt></dt>
        !          2241: <dd>
        !          2242: This exception can only be applied to element types.  It indicates that
1.2       cvs      2243: elements of this type should receive the content of imported text files.  An
                   2244: element is created for each paragraph of the imported file.  A paragraph is a
                   2245: sequence of lines without any empty line.  A structure schema cannot contain
1.18    ! cvs      2246: several exceptions <tt>ImportParagraph</tt> and, if it contains one, it should
        !          2247: not contain any exception <tt>ImportLine</tt>.
        !          2248: </dd>
        !          2249: <dt><tt>NoPaginate</tt></dt>
        !          2250: <dd>
        !          2251: This exception can only be applied to the root element, i.e. the name that
        !          2252: appear after the keyword <tt>STRUCTURE</tt> at the beginning of the structure
1.2       cvs      2253: schema.  It indicates that the editor should not allow the user to paginate
1.1       cvs      2254: documents of that type.
1.18    ! cvs      2255: </dd>
        !          2256: <dt><tt>ParagraphBreak</tt></dt>
        !          2257: <dd>
        !          2258: This exception can only be applied to element types.  When the caret is within
        !          2259: an element of a type to which this exception is applied, it is that element
        !          2260: that will be split when the user hits the Return key.
        !          2261: </dd>
        !          2262: <dt><tt>ReturnCreateNL</tt></dt>
        !          2263: <dd>
        !          2264: This exception can only be applied to element types.  When the caret is within
        !          2265: an element of a type to which this exception is applied, the Return key simply
        !          2266: inserts a New line character (code \212) at the current position. The Return
        !          2267: key does not create a new element; it does not split the current element
        !          2268: either.
        !          2269: </dd>
        !          2270: <dt><tt>HighlightChildren</tt></dt>
        !          2271: <dd>
        !          2272: This exception can only be applied to element types.  Elements of a type to
1.2       cvs      2273: which this exception is applied are not highlighted themselves when they are
                   2274: selected, but all their children are highlighted instead.
1.18    ! cvs      2275: </dd>
        !          2276: <dt><tt>ExtendedSelection</tt></dt>
        !          2277: <dd>
        !          2278: This exception can only be applied to element types.  The selection extension
        !          2279: command (middle button of the mouse) only add the clicked element (if it has
        !          2280: that exception) to the current selection, without selecting other elements
        !          2281: between the current selection and the clicked element.
        !          2282: </dd>
        !          2283: </dl>
        !          2284: <blockquote class="example">
        !          2285: <p>
        !          2286: <strong>Example:</strong></p>
        !          2287: <p>
1.3       cvs      2288: Consider a structure schema for object-style graphics which defines the
1.18    ! cvs      2289: Graphic_object element type with the associated Height and Weight numeric
        !          2290: attributes.  Suppose that we want documents of this class to have the
        !          2291: following qualities:</p>
        !          2292: <ul>
        !          2293: <li>
        !          2294: Whenever the width or height of an object is changed using the mouse, the new
        !          2295: values are stored in the object's Width and Height attributes.
        !          2296: <li>
        !          2297: The user should not be able to change the values of the Width and Height
1.5       cvs      2298: attributes via the Attributes menu of the Thot editor.
1.18    ! cvs      2299: </ul>
        !          2300: <p>
        !          2301: The following exceptions will produce this effect.</p>
        !          2302: <pre>STRUCT
1.1       cvs      2303: ...
1.5       cvs      2304:    Graphics_object (ATTR Height = Integer; Width = Integer)
1.1       cvs      2305:        = GRAPHICS with Height ?= 10, Width ?= 10;
                   2306: ...
                   2307: EXCEPT
                   2308:    Height: NewHeight, Invisible;
1.18    ! cvs      2309:    Width: NewWidth, Invisible;</pre>
        !          2310: </blockquote>
        !          2311: </div>
        !          2312: </div>
1.1       cvs      2313: 
1.18    ! cvs      2314: <div class="section">
1.1       cvs      2315: 
1.18    ! cvs      2316: <h2><a name="sectb33">Some examples</a></h2>
        !          2317: <p>
1.1       cvs      2318: In order to illustrate the principles of the document model and the syntax of
                   2319: the S language, this section presents two examples of structure schemas. One
1.18    ! cvs      2320: defines a class of documents, the other defines a class of objects.</p>
1.1       cvs      2321: 
1.18    ! cvs      2322: <div class="subsection">
1.1       cvs      2323: 
1.18    ! cvs      2324: <h3><a name="sectc331">A class of documents: articles</a></h3>
        !          2325: <p>
1.1       cvs      2326: This example shows a possible structure for articles published in a journal.
1.18    ! cvs      2327: Text between braces is comments.</p>
        !          2328: <pre>STRUCTURE Article;  { This schema defines the Article class }
1.1       cvs      2329: DEFPRES ArticleP;   { The default presentation schema is
                   2330:                       ArticleP }
                   2331: ATTR                { Global attribute definitions }
                   2332:    WordType = Definition, IndexWord, DocumentTitle;
                   2333:    { A single global attribute is defined, with three values }
                   2334: STRUCT              { Definition of the generic structure }
                   2335:    Article = BEGIN  { The Article class has an aggregate
                   2336:                       structure }
                   2337:              Title = BEGIN   { The title is an aggregate }
                   2338:                      French_title = 
                   2339:                          Text WITH Language='Fran\347ais';
                   2340:                      English_title =
                   2341:                          Text WITH Language='English';
                   2342:                      END;
                   2343:              Authors = 
                   2344:                LIST OF (Author
                   2345:                  (ATTR Author_type=principal,secondary)
                   2346:                  { The Author type has a local attribute }
                   2347:                  = BEGIN
                   2348:                    Author_name = Text;
                   2349:                    Info = Paragraphs ;
                   2350:                    { Paragraphs is defined later }
                   2351:                    Address    = Text;
                   2352:                    END
                   2353:                  );
                   2354:              Keywords = Text;
                   2355:              { The journal's editor introduces the article
                   2356:                with a short introduction, in French and
                   2357:                in English }
                   2358:              Introduction = 
                   2359:                  BEGIN
                   2360:                  French_intr  = Paragraphs WITH
                   2361:                                 Language='Fran\347ais';
                   2362:                  English_intr = Paragraphs WITH
                   2363:                                 Language='English';
                   2364:                  END;
                   2365:              Body = Sections; { Sections are defined later }
                   2366:                    { Appendixes are only created on demand }
                   2367:            ? Appendices = 
                   2368:                  LIST OF (Appendix =
                   2369:                           BEGIN
                   2370:                           Appendix_Title    = Text;
                   2371:                           Appendix_Contents = Paragraphs;
                   2372:                           END
                   2373:                          );
                   2374:              END;      { End of the Article aggregate }
                   2375: 
                   2376:     Sections = LIST [2..*] OF (
                   2377:                  Section = { At least 2 sections }
                   2378:                  BEGIN
                   2379:                  Section_title   = Text;
                   2380:                  Section_contents =
                   2381:                    BEGIN
                   2382:                    Paragraphs;
                   2383:                    Sections; { Sections at a lower level }
                   2384:                    END;
                   2385:                  END
                   2386:                  );
                   2387: 
                   2388:     Paragraphs = LIST OF (Paragraph = CASE OF
                   2389:                                Enumeration = 
                   2390:                                    LIST [2..*] OF
                   2391:                                        (Item = Paragraphs);
                   2392:                                Isolated_formula = Formula;
                   2393:                                LIST OF (UNIT);
                   2394:                                END
                   2395:                           );
                   2396: 
                   2397: ASSOC         { Associated elements definitions }
                   2398: 
                   2399:    Figure = BEGIN
1.5       cvs      2400:             Figure_caption  = Text;
1.1       cvs      2401:             Illustration   = NATURE;
                   2402:             END;
                   2403: 
                   2404:    Biblio_citation = CASE OF
                   2405:                         Ref_Article =
                   2406:                            BEGIN
                   2407:                            Authors_Bib   = Text;
                   2408:                            Article_Title = Text;
                   2409:                            Journal       = Text;
                   2410:                            Page_Numbers  = Text;
                   2411:                            Date          = Text;
                   2412:                            END;
                   2413:                         Ref_Livre =
                   2414:                            BEGIN
                   2415:                            Authors_Bib; { Defined above }
                   2416:                            Book_Title   = Text;
                   2417:                            Editor       = Text;
                   2418:                            Date;        { Defined above }
                   2419:                            END;
                   2420:                        END;
                   2421: 
                   2422:    Note =  Paragraphs - (Ref_note);
                   2423: 
                   2424: UNITS      { Elements which can be used in objects }
                   2425: 
                   2426:    Ref_note    = REFERENCE (Note);
                   2427:    Ref_biblio  = REFERENCE (Biblio_citation);
                   2428:    Ref_figure  = REFERENCE (Figure);
                   2429:    Ref_formula = REFERENCE (Isolated_formula);
                   2430: 
                   2431: EXPORT     { Skeleton elements }
                   2432: 
                   2433:    Title,
1.5       cvs      2434:    Figure with Figure_caption,
1.1       cvs      2435:    Section With Section_title;
                   2436: 
1.18    ! cvs      2437: END           { End of the structure schema }</pre>
        !          2438: <p>
1.1       cvs      2439: This schema is very complete since it defines both paragraphs and
                   2440: bibliographic citations.  These element types could just as well be defined in
1.18    ! cvs      2441: other structure schemas, as is the case with the <tt>Formula</tt> class.  All
1.1       cvs      2442: sorts of other elements can be inserted into an article, since a paragraph can
                   2443: contain any type of unit.  Similarly, figures can be any class of document or
1.18    ! cvs      2444: object that the user chooses.</p>
        !          2445: <p>
1.1       cvs      2446: Generally, an article doesn't contain appendices, but it is possible to add
                   2447: them on explicit request:  this is the effect of the question mark before the
1.18    ! cvs      2448: word Appendices.</p>
        !          2449: <p>
1.1       cvs      2450: The Figure, Biblio_citation and Note elements are associated elements. Thus,
1.18    ! cvs      2451: they are only used in <tt>REFERENCE</tt> statements.</p>
        !          2452: <p>
1.1       cvs      2453: Various types of cross-references can be put in paragraphs.  They can also be
                   2454: placed the objects which are part of the article, since the cross-references
1.18    ! cvs      2455: are defined as units (<tt>UNITS</tt>).</p>
        !          2456: <p>
1.1       cvs      2457: There is a single restriction to prevent the creation of Ref_note elements
1.18    ! cvs      2458: within notes.</p>
        !          2459: <p>
1.1       cvs      2460: It is worth noting that the S language permits the definition of recursive
                   2461: structures like sections: a section can contain other sections (which are thus
                   2462: at the next lower level of the document tree).  Paragraphs are also recursive
                   2463: elements, since a paragraph can contain an enumeration in which each element
1.18    ! cvs      2464: (<tt>Item</tt>) is composed of paragraphs.</p>
        !          2465: </div>
1.1       cvs      2466: 
1.18    ! cvs      2467: <div class="subsection">
1.1       cvs      2468: 
1.18    ! cvs      2469: <h3><a name="sectc332">A class of objects: mathematical formulas</a></h3>
        !          2470: <p>
        !          2471: The example below defines the <tt>Formula</tt> class which is used in Article
1.1       cvs      2472: documents.  This class represents mathematical formulas  with a rather simple
                   2473: structure, but sufficient to produce a correct rendition on the screen or
                   2474: printer.  To support more elaborate operations (formal or numeric
                   2475: calculations), a finer structure should be defined. This class doesn't use any
1.18    ! cvs      2476: other class and doesn't define any associated elements or units.</p>
        !          2477: <pre>STRUCTURE Formula;
1.1       cvs      2478: DEFPRES FormulaP;
                   2479: 
                   2480: ATTR
                   2481:    String_type = Function_name, Variable_name;
                   2482: 
                   2483: STRUCT
                   2484:    Formula      = Expression;
                   2485:    Expression   = LIST OF (Construction);
                   2486:    Construction = CASE OF
                   2487:                   TEXT;         { Simple character string }
                   2488:                   Index    = Expression;
                   2489:                   Exponent = Expression;
                   2490:                   Fraction =
                   2491:                         BEGIN
1.6       cvs      2492:                         Numerator   = Expression;
1.1       cvs      2493:                         Denominator = Expression;
                   2494:                         END;
                   2495:                   Root = 
                   2496:                         BEGIN
                   2497:                       ? Order = TEXT;
                   2498:                         Root_Contents = Expression;
                   2499:                         END;
                   2500:                   Integral =
                   2501:                         BEGIN
                   2502:                         Integration_Symbol = SYMBOL;
                   2503:                         Lower_Bound        = Expression;
                   2504:                         Upper_Bound        = Expression;
                   2505:                         END;
                   2506:                   Triple =
                   2507:                         BEGIN
                   2508:                         Princ_Expression = Expression;
                   2509:                         Lower_Expression = Expression;
                   2510:                         Upper_Expression = Expression;
                   2511:                         END;
                   2512:                   Column = LIST [2..*] OF 
                   2513:                               (Element = Expression);
                   2514:                   Parentheses_Block =
                   2515:                         BEGIN
                   2516:                         Opening  = SYMBOL;
                   2517:                         Contents = Expression;
                   2518:                         Closing  = SYMBOL;
                   2519:                         END;
                   2520:                   END;       { End of Choice Constructor }
1.18    ! cvs      2521: END                          { End of Structure Schema }</pre>
        !          2522: <p>
1.1       cvs      2523: This schema defines a single global attribute which allows functions and
                   2524: variables to be distinguished.  In the presentation schema, this attribute can
                   2525: be used to choose between roman (for functions) and italic characters (for
1.18    ! cvs      2526: variables).</p>
        !          2527: <p>
1.1       cvs      2528: A formula's structure is that of a mathematical expression, which is itself a
                   2529: sequence of mathematical constructions.  A mathematical construction can be
                   2530: either a simple character string, an index, an exponent, a fraction, a root,
                   2531: etc.  Each of these mathematical constructions has a sensible structure which
                   2532: generally includes one or more expressions, thus making the formula class's
1.18    ! cvs      2533: structure definition recursive.</p>
        !          2534: <p>
1.1       cvs      2535: In most cases, the roots which appear in the formulas are square roots and
                   2536: their order (2) is not specified.  This is why the Order component is marked
                   2537: optional by a question mark.  When explicitly requested, it is possible to add
1.18    ! cvs      2538: an order to a root, for example for cube roots (order = 3).</p>
        !          2539: <p>
1.1       cvs      2540: An integral is formed by an integration symbol, chosen by the user (simple
                   2541: integral, double, curvilinear, etc.), and two bounds.  A more fine-grained
                   2542: schema would add components for the integrand and the integration variable.
                   2543: Similarly, the Block_Parentheses construction leaves the choice of opening and
                   2544: closing symbols to the user.  They can be brackets, braces, parentheses,
1.18    ! cvs      2545: etc.</p>
        !          2546: </div>
        !          2547: </div>
        !          2548: <hr>
        !          2549: </div>
1.1       cvs      2550: 
1.18    ! cvs      2551: <div class="chapter">
1.1       cvs      2552: 
1.18    ! cvs      2553: <h1><a name="sect4">The P Language</a></h1>
1.1       cvs      2554: 
1.18    ! cvs      2555: <div class="section">
1.1       cvs      2556: 
1.18    ! cvs      2557: <h2><a name="sectb41">Document presentation</a></h2>
        !          2558: <p>
1.1       cvs      2559: Because of the model adopted for Thot, the presentation of documents is
                   2560: clearly separated from their structure and content.  After having presented
                   2561: the logical structure of documents, we now detail the principles implemented
1.18    ! cvs      2562: for their presentation.  The concept of <em>presentation</em> encompasses what
1.5       cvs      2563: is often called the page layout, the composition, or the document style.  It
1.18    ! cvs      2564: is the set of operations which display the document on the screen or print it
        !          2565: on paper.  Like logical structure, document presentation is defined
        !          2566: generically with the help of a language, called P.</p>
1.1       cvs      2567: 
1.18    ! cvs      2568: <div class="subsection">
1.1       cvs      2569: 
1.18    ! cvs      2570: <h3><a name="sectc411">Two levels of presentation</a></h3>
        !          2571: <p>
1.1       cvs      2572: The link between structure and presentation is clear: the logical organization
                   2573: of a document is used to carry out its presentation, since the purpose of the
                   2574: presentation is to make evident the organization of the document.  But the
                   2575: presentation is equally dependent on the device used to render the document.
                   2576: Certain presentation effects, notably changes of font or character set, cannot
                   2577: be performed on all printers or on all screens.  This is why Thot uses a
                   2578: two-level approach, where the presentation is first described in abstract
                   2579: terms, without taking into account each particular device, and then the
1.18    ! cvs      2580: presentation is realized within the constraints of a given device.</p>
        !          2581: <p>
1.1       cvs      2582: Thus, presentation is only described as a function of the structure of the
                   2583: documents and the image that would be produced on an idealized device.  For
                   2584: this reason, presentation descriptions do not refer to any device
1.18    ! cvs      2585: characteristics: they describe <em>abstract presentations</em> which can be
        !          2586: concretized on different devices.</p>
        !          2587: <p>
        !          2588: A presentation description also defines a <em>generic presentation</em>, since
1.1       cvs      2589: it describes the appearance of a class of documents or objects. This generic
                   2590: presentation must also be applied to document and object instances, each
                   2591: conforming to its generic logical structure, but with all the allowances that
                   2592: were called to mind above: missing elements, constructed elements with other
1.18    ! cvs      2593: logical structures, etc.</p>
        !          2594: <p>
1.1       cvs      2595: In order to preserve the homogeneity between documents and objects,
                   2596: presentation is described with a single set of tools which support the layout
                   2597: of a large document as well as the composition of objects like a graphical
                   2598: figure or mathematical formula.  This unity of presentation description tools
                   2599: contrasts with the traditional approach, which focuses more on documents than
                   2600: objects and thus is based on the usual typographic conventions, such as the
                   2601: placement of margins, indentations, vertical spaces, line lengths,
1.18    ! cvs      2602: justification, font changes, etc.</p>
        !          2603: </div>
1.1       cvs      2604: 
1.18    ! cvs      2605: <div class="subsection">
1.1       cvs      2606: 
1.18    ! cvs      2607: <h3><a name="sectc412">Boxes</a></h3>
        !          2608: <p>
1.1       cvs      2609: To assure the homogeneity of tools, all presentation in Thot, for documents as
                   2610: well as for the objects which they contain, is based on the notion of the
1.18    ! cvs      2611: <em>box</em>, such as was implemented in T<sub><big>E</big></sub>X.</p>
        !          2612: <p>
1.1       cvs      2613: Corresponding to each element of the document is a box,  which is the
                   2614: rectangle enclosing the element on the display device (screen or sheet of
1.18    ! cvs      2615: paper);  the outline of this rectangle is not visible, except when a <a
        !          2616: href="#sectc4230a"><tt>ShowBox</tt> rule</a> applies to the element. The sides
        !          2617: of the box are parallel to the sides of the screen or the sheet of paper.  By
        !          2618: way of example, a box is associated with a character string, a line of text, a
        !          2619: page, a paragraph, a title, a mathematical formula, or a table cell.</p>
        !          2620: <p>
1.1       cvs      2621: Whatever element it corresponds to, each box possesses four sides and four
1.18    ! cvs      2622: axes, which we designate as follows (<a href="#boxes">see figure</a>):</p>
        !          2623: <dl>
        !          2624: <dt><tt>Top</tt></dt>
        !          2625: <dd>
        !          2626: the upper side,
        !          2627: </dd>
        !          2628: <dt><tt>Bottom</tt></dt>
        !          2629: <dd>
        !          2630: the lower side,
        !          2631: </dd>
        !          2632: <dt><tt>Left</tt></dt>
        !          2633: <dd>
        !          2634: the left side,
        !          2635: </dd>
        !          2636: <dt><tt>Right</tt></dt>
        !          2637: <dd>
        !          2638: the right side,
        !          2639: </dd>
        !          2640: <dt><tt>VMiddle</tt></dt>
        !          2641: <dd>
        !          2642: the vertical axis passing through the center of the box,
        !          2643: </dd>
        !          2644: <dt><tt>HMiddle</tt></dt>
        !          2645: <dd>
        !          2646: the horizontal axis passing through the center of the box,
        !          2647: </dd>
        !          2648: <dt><tt>VRef</tt></dt>
        !          2649: <dd>
        !          2650: the vertical reference axis,
        !          2651: </dd>
        !          2652: <dt><tt>HRef</tt></dt>
        !          2653: <dd>
        !          2654: the horizontal reference axis.
        !          2655: </dd>
        !          2656: </dl>
        !          2657: 
        !          2658: <div class="figure">
        !          2659: <hr>
        !          2660: <pre>        Left   VRef  VMiddle        Right
1.1       cvs      2661:                  :      :
                   2662:     Top   -----------------------------
                   2663:           |      :      :             |
                   2664:           |      :      :             |
                   2665:           |      :      :             |
                   2666:           |      :      :             |
                   2667:           |      :      :             |
                   2668: HMiddle ..|...........................|..
                   2669:           |      :      :             |
                   2670:           |      :      :             |
                   2671:    HRef ..|...........................|..
                   2672:           |      :      :             |
                   2673:           |      :      :             |
                   2674:   Bottom  -----------------------------
1.18    ! cvs      2675:                  :      :</pre>
        !          2676: <p align=center>
        !          2677: <em><a name="boxes">The sides and axes of boxes</a><em></em></em></p>
        !          2678: <hr>
        !          2679: </div>
        !          2680: <p>
1.1       cvs      2681: The principal role of boxes is to set the extent and position of the images of
                   2682: the different elements of a document with respect to each other on the
                   2683: reproduction device.  This is done by defining relations between the boxes of
                   2684: different elements which give relative extents and positions to these
1.18    ! cvs      2685: boxes.</p>
        !          2686: <p>
        !          2687: There are three types of boxes:</p>
        !          2688: <ul>
        !          2689: <li>
        !          2690: boxes corresponding to structural elements of the document,
        !          2691: <li>
        !          2692: presentation boxes,
        !          2693: <li>
        !          2694: page layout boxes.
        !          2695: </ul>
        !          2696: <p>
        !          2697: <strong>Boxes corresponding to structural elements of the document</strong>
1.1       cvs      2698: are those which linked to each of the elements (base or structured) of the
                   2699: logical structure of the document.  Such a box contains all the contents of
1.18    ! cvs      2700: the element to which it corresponds (there is an exception: see <a
        !          2701: href="#sectc4220">rules <tt>VertOverflow</tt> and <tt>HorizOverflow</tt></a>).
        !          2702: These boxes form a tree-like structure, identical to that of the structural
        !          2703: elements to which they correspond.  This tree expresses the inclusion
        !          2704: relationships between the boxes: a box includes all the boxes of its subtree.
        !          2705: On the other hand, there are no predefined rules for the relative positions of
        !          2706: the included boxes.  If they are at the same level, they can overlap, be
        !          2707: contiguous, or be disjoint. The rules expressed in the generic presentation
        !          2708: specify their relative positions.</p>
        !          2709: <p>
        !          2710: <strong>Presentation boxes</strong> represent elements which are not found in
1.1       cvs      2711: the logical structure of the document but which are added to meet the needs of
                   2712: presentation.  These boxes are linked to the elements of the logical structure
                   2713: that are best suited to bringing them out. For example, they are used to add
                   2714: the character string ``Summary:'' before the summary in the presentation of a
                   2715: report or to represent the fraction bar in a formula, or also to make the
                   2716: title of a field in a form appear.  These elements have no role in the logical
                   2717: structure of the document: the presence of a Summary element in the document
                   2718: does not require the creation of another structural object to hold the word
                   2719: ``Summary''. Similarly, if a Fraction element contains both a Numerator
                   2720: element and a Denominator element, the fraction bar has no purpose
                   2721: structurally.  On the other hand, these elements of the presentation are
                   2722: important for the reader of the reproduced document or for the user of an
                   2723: editor.  This is why they must appear in the document's image.  It is the
                   2724: generic presentation which specifies the presentation boxes to add by
                   2725: indicating their content (a base element for which the value is specified) and
                   2726: the position that they must take in the tree of boxes.  During editing, these
1.18    ! cvs      2727: boxes cannot be modified by the user.</p>
        !          2728: <p>
        !          2729: <strong>Page layout boxes</strong> are boxes created implicitly by the page
1.1       cvs      2730: layout rules.  These rules indicate how the contents of a structured element
                   2731: must be broken into lines and pages.  In contrast to presentation boxes, these
                   2732: line and page boxes do not depend on the logical structure of the document,
1.18    ! cvs      2733: but rather on the physical constraints of the output devices: character size,
        !          2734: height and width of the window on the screen or of the sheet of paper.</p>
        !          2735: </div>
1.1       cvs      2736: 
1.18    ! cvs      2737: <div class="subsection">
1.1       cvs      2738: 
1.18    ! cvs      2739: <h3><a name="sectc413">Views and visibility</a></h3>
        !          2740: <p>
1.1       cvs      2741: One of the operations that one might wish to perform on a document is to view
                   2742: it is different ways.  For this reason, it is possible to define several
1.18    ! cvs      2743: <em>views</em> for the same document, or better yet, for all documents of the
1.1       cvs      2744: same class.  A view is not a different presentation of the document, but
                   2745: rather a filter which only allows the display of certain parts of the
                   2746: document.  For example, it might be desirable to see only the titles of
                   2747: chapters and sections in order to be able to move rapidly through the
                   2748: document.  Such a view could be called a ``table of contents''.  It might also
                   2749: be desirable to see only the mathematical formulas of a document in order to
                   2750: avoid being distracted by the non-mathematical aspects of the document.  A
1.18    ! cvs      2751: ``mathematics'' view could provide this service.</p>
        !          2752: <p>
1.1       cvs      2753: Views, like presentation, are based on the generic logical structure. Each
                   2754: document class, and each generic presentation, can be provided with views
                   2755: which are particularly useful for that class or presentation.  For each view,
1.18    ! cvs      2756: the <em>visibility</em> of elements is defined, indicated whether or not the
1.1       cvs      2757: elements must be presented to the user.  The visibility is calculated  as a
                   2758: function of the type of the elements or their hierarchical position in the
                   2759: structure of the document.  Thus, for a table of contents, all the ``Chapter
                   2760: Title'' and ``Section Title'' elements are made visible.  However, the
                   2761: hierarchical level could be used to make the section titles invisible below a
                   2762: certain threshold level.  By varying this threshold, the granularity of the
                   2763: view can be varied.  In the ``mathematics'' view, only Formula elements would
1.18    ! cvs      2764: be made visible, no matter what their hierarchical level.</p>
        !          2765: <p>
1.1       cvs      2766: Because views are especially useful for producing a synthetic image of the
                   2767: document, it is necessary to adapt the presentation of the elements to the
                   2768: view in which they appear.  For example, it is inappropriate to have a page
                   2769: break before every chapter title in the table of contents.  Thus, generic
                   2770: presentations take into account the possible views and permit each element
1.18    ! cvs      2771: type's presentation to vary according the view in which its image appears.</p>
        !          2772: <p>
        !          2773: <a name="views">Views</a> are also used, when editing documents, to display
1.1       cvs      2774: the associated elements.  So, in addition to the primary view of the document,
                   2775: there can be a ``notes'' view and a ``figures'' view which contain,
                   2776: respectively, the associated elements of the Note and Figure types. In this
                   2777: way, it is possible to see simultaneously the text which refers to these
                   2778: elements and the elements themselves, even if they will be separated when
1.18    ! cvs      2779: printed.</p>
        !          2780: </div>
1.1       cvs      2781: 
1.18    ! cvs      2782: <div class="subsection">
1.1       cvs      2783: 
1.18    ! cvs      2784: <h3><a name="sectc414">Pages</a></h3>
        !          2785: <p>
1.1       cvs      2786: Presentation schemas can be defined which display the document as a long
                   2787: scroll, without page breaks.  This type of schema is particularly well-suited
                   2788: to the initial phase of work on a document, where jumps from page to page
                   2789: would hinder composing and reading the document on a screen.  In this case,
                   2790: the associated elements (such as notes), which are normally displayed in the
                   2791: page footer, are presented in a separate window.  But, once the document is
                   2792: written, it may be desirable to display the document on the screen in the same
                   2793: manner in which it will be printed.  So, the presentation schema must define
1.18    ! cvs      2794: pages.</p>
        !          2795: <p>
1.1       cvs      2796: The P language permits the specification of the dimensions of pages as well as
                   2797: their composition.  It is possible to generate running titles, page numbers,
                   2798: zones at the bottom of the page for notes, etc.  The editor follows this model
                   2799: and inserts page break marks in the document which are used during printing,
1.18    ! cvs      2800: insuring that the pages on paper are the same as on the screen.</p>
        !          2801: <p>
1.1       cvs      2802: Once a document has been edited with a presentation schema defining pages, it
                   2803: contains page marks.  But it is always possible to edit the document using a
                   2804: schema without pages.  In this case, the page marks are simply ignored by the
                   2805: editor.  They are considered again as soon as a schema with pages is used.
1.18    ! cvs      2806: Thus, the user is free to choose between schemas with and without pages.</p>
        !          2807: <p>
1.1       cvs      2808: Thot treats the page break, rather than the page itself, as a box. This page
                   2809: break box contains all the elements of one page's footer, a rule marking the
                   2810: edge of this page, and all the elements of the next page's header.  The
                   2811: elements of the header and footer can be running titles, page number,
                   2812: associated elements (notes, for example), etc. All these elements, as well as
                   2813: their content and graphical appearance, are defined by the generic
1.18    ! cvs      2814: presentation.</p>
        !          2815: </div>
1.1       cvs      2816: 
1.18    ! cvs      2817: <div class="subsection">
1.1       cvs      2818: 
1.18    ! cvs      2819: <h3><a name="sectc415">Numbering</a></h3>
        !          2820: <p>
1.1       cvs      2821: Many elements are numbered in documents: pages, chapters, sections, formulas,
                   2822: theorems, notes, figures, bibliographic references, exercises, examples,
                   2823: lemmas, etc.  Because Thot has a notion of logical structure, all of these
                   2824: numbers (with the exception of pages) are redundant with information implicit
                   2825: in the logical structure of the document.  Such numbers are simply a way to
                   2826: make the structure of the document more visible.  So, they are part of the
                   2827: document's presentation and are calculated by the editor from the logical
                   2828: structure.  The structure does not contain numbers as such; it only defines
                   2829: relative structural positions between elements, which serve as ordering
1.18    ! cvs      2830: relations on these elements.</p>
        !          2831: <p>
1.1       cvs      2832: If the structure schema defines the body of a document as a sequence of at
1.18    ! cvs      2833: least two chapters:</p>
        !          2834: <pre>Body = LIST [2..*] OF Chapter;</pre>
        !          2835: <p>
        !          2836: the sequence defined by the list constructor is ordered and each chapter can
        !          2837: be assigned a number based on its rank in the Body list.  Therefore, all
        !          2838: elements contained in lists a the structure of a document can be numbered, but
        !          2839: they are not the only ones.  The tree structure induced by the aggregate,
        !          2840: list, and choice constructors (excluding references) defines a total order on
        !          2841: the elements of the document's primary structure.  So, it is possible to
        !          2842: define a numbering which uses this order, filtering elements according to
        !          2843: their type so that only certain element types are taken into account in the
        !          2844: numbering.  In this way, it possible to number all the theorems and lemmas of
        !          2845: a chapter in the same sequence of numbers, even when they are not part of the
        !          2846: same list constructor and appear at different levels of the document's tree.
        !          2847: By changing the filter, they can be numbered separately: one sequence of
        !          2848: numbers for theorems, another for the lemmas.</p>
        !          2849: <p>
1.1       cvs      2850: Associated elements pose a special problem, since they are not part of the
                   2851: document's primary structure, but are attached only by references, which
                   2852: violate the total order of the document.  Then, these associated elements are
                   2853: frequently numbered, precisely because the number is an effective way to
                   2854: visualize the reference.  In order to resolve this problem, Thot implicitly
                   2855: defines a list constructor for each type of associated element, gathering
                   2856: together (and ordering) these elements.  Thus, the associated elements can be
1.18    ! cvs      2857: numbered by type.</p>
        !          2858: <p>
1.1       cvs      2859: Since they are calculated from the document's logical structure and only for
                   2860: the needs of the presentation, numbers are presentation elements, described by
                   2861: presentation boxes, just like the fraction bar or the word ``Summary''.
                   2862: Nevertheless, numbers differ from these other boxes because their content
                   2863: varies from instance to instance, even though they are of the same type,
                   2864: whereas all fraction bars are horizontal lines and the same word ``Summary''
1.18    ! cvs      2865: appears at the head of every document's summary.</p>
        !          2866: </div>
1.1       cvs      2867: 
1.18    ! cvs      2868: <div class="subsection">
1.1       cvs      2869: 
1.18    ! cvs      2870: <h3><a name="sectc416">Presentation parameters</a></h3>
        !          2871: <p>
1.1       cvs      2872: The principal parameters which determine document presentation are the
1.18    ! cvs      2873: <em>positions</em> and <em>dimensions</em> of boxes, the <em>font</em>, the
        !          2874: <em>style</em>, the <em>size</em>, the <em>underlining</em> and the
        !          2875: <em>color</em> of their content.  From these parameters, and some others of
1.1       cvs      2876: less importance, it is possible to represent the usual typographic parameters
                   2877: for the textual parts of the document.  These same parameters can be used to
                   2878: describe the geometry of the non-textual elements, even though they are
1.18    ! cvs      2879: two-dimensional elements unlike the text, which is linear.</p>
        !          2880: <p>
1.1       cvs      2881: As we have already  seen, the positions of the boxes always respect the rule
                   2882: of enclosure: a box in the tree encloses all the boxes of the next lower level
                   2883: which are attached to it.  The positional parameters permit the specification
                   2884: of the position of each box in relation to the enclosing box or to its sibling
                   2885: boxes (boxes directly attached to the same enclosing box in the tree of
1.18    ! cvs      2886: boxes).</p>
        !          2887: <p>
1.1       cvs      2888: The presentation parameters also provide control over the dimensions of the
                   2889: boxes.  The dimensions of a box can depend either on its content or on its
                   2890: context (its sibling boxes and the enclosing box). Each dimension (height or
1.18    ! cvs      2891: width) can be defined independently of the other.</p>
        !          2892: <p>
1.1       cvs      2893: Because of the position and dimension parameters, it is possible to do the
                   2894: same things that are normally done in typography by changing margins, line
                   2895: lengths, and vertical or horizontal skips.  This approach can also align or
1.18    ! cvs      2896: center elements and groups of elements.</p>
        !          2897: <p>
1.1       cvs      2898: In contrast to the position and dimension parameters, the font, style, size,
                   2899: underlining, and color do not concern the box itself (the rectangle delimiting
                   2900: the element), but its content.  These parameters indicate the typographic
                   2901: attributes which must be applied to the text contained in the box, and by
1.18    ! cvs      2902: extension, to all base elements.</p>
        !          2903: <p>
1.1       cvs      2904: For text, the font parameter is used to change the family of characters
                   2905: (Times, Helvetica, Courier, etc.); the style is used to obtain italic or
                   2906: roman, bold or light characters;  the size determines the point size of the
                   2907: characters; underlining defines the type and thickness of the lines drawn
1.18    ! cvs      2908: above, below, or through the characters.</p>
        !          2909: <p>
1.1       cvs      2910: For graphics, the line style parameter can be either solid, dotted, or dashed;
                   2911: the line thickness parameter controls the width of the lines; the fill pattern
1.18    ! cvs      2912: parameter determines how closed geometric figures must be filled.</p>
        !          2913: <p>
1.1       cvs      2914: While some of the parameters which determine the appearance of a box's
                   2915: contents make sense only for one content type (text or graphic), other
                   2916: parameters apply to all content types: these are the color parameters. These
1.18    ! cvs      2917: indicate the color of lines and the background color.</p>
        !          2918: </div>
        !          2919: </div>
1.1       cvs      2920: 
1.18    ! cvs      2921: <div class="section">
1.1       cvs      2922: 
1.18    ! cvs      2923: <h2><a name="sectb42">Presentation description language</a></h2>
        !          2924: <p>
1.1       cvs      2925: A generic presentation defines the values of presentation parameters (or the
                   2926: way to calculate those values) for a generic structure, or more precisely, for
                   2927: all the element types and all the global and local attributes defined in that
                   2928: generic structure.  This definition of the presentation parameters is made
                   2929: with the P language.  A program written in this language, that is a generic
1.18    ! cvs      2930: presentation expressed in P, is call a <em>presentation schema</em>. This
        !          2931: section describes the syntax and semantics of the language, using the same <a
        !          2932: href="#sectc321">meta-language</a> as was used for the definition of the S
        !          2933: language.</p>
        !          2934: <p>
1.1       cvs      2935: Recall that it is possible to write many different presentation schemas for
                   2936: the same class of documents or objects.  This allows users to choose for a
                   2937: document the graphical appearance  which best suits their type of work or
1.18    ! cvs      2938: their personal taste.</p>
1.1       cvs      2939: 
1.18    ! cvs      2940: <div class="subsection">
1.1       cvs      2941: 
1.18    ! cvs      2942: <h3><a name="sectc421">The organization of a presentation schema</a></h3>
        !          2943: <p>
        !          2944: A presentation schema begins with the word <tt>PRESENTATION</tt> and ends with
        !          2945: the word <tt>END</tt>.  The word <tt>PRESENTATION</tt> is followed by the name
1.1       cvs      2946: of the generic structure to which the presentation will be applied.  This name
1.18    ! cvs      2947: must be the same as that which follows the keyword <tt>STRUCTURE</tt> in the
        !          2948: structure schema associated with the presentation schema.</p>
        !          2949: <p>
1.1       cvs      2950: After this declaration of the name of the structure, the following sections
1.18    ! cvs      2951: appear (in order):</p>
        !          2952: <ul>
        !          2953: <li>
        !          2954: Declarations of
        !          2955: <ul>
        !          2956: <li>
        !          2957: all views,
        !          2958: <li>
        !          2959: printed views,
        !          2960: <li>
        !          2961: counters,
        !          2962: <li>
        !          2963: presentation constants,
        !          2964: <li>
        !          2965: variables,
        !          2966: </ul>
        !          2967: <li>
        !          2968: default presentation rules,
        !          2969: <li>
        !          2970: presentation box and page layout box definitions,
        !          2971: <li>
        !          2972: presentation rules for structured elements,
        !          2973: <li>
        !          2974: presentation rules for attributes,
        !          2975: <li>
        !          2976: rules for transmitting values to attributes of included documents.
        !          2977: </ul>
        !          2978: <p>
1.1       cvs      2979: Each of these sections is introduced by a keyword which is followed by a
1.18    ! cvs      2980: sequence of declarations.  Every section is optional.</p>
        !          2981: <pre>     SchemaPres ='PRESENTATION' ElemID ';'
1.1       cvs      2982:                [ 'VIEWS' ViewSeq ]
                   2983:                [ 'PRINT' PrintViewSeq ]
                   2984:                [ 'COUNTERS' CounterSeq ]
                   2985:                [ 'CONST' ConstSeq ]
                   2986:                [ 'VAR' VarSeq ]
                   2987:                [ 'DEFAULT' ViewRuleSeq ]
                   2988:                [ 'BOXES' BoxSeq ]
                   2989:                [ 'RULES' PresentSeq ]
                   2990:                [ 'ATTRIBUTES' PresAttrSeq ]
                   2991:                [ 'TRANSMIT' TransmitSeq ]
                   2992:                  'END' .
1.18    ! cvs      2993:      ElemID     = NAME .</pre>
        !          2994: </div>
1.1       cvs      2995: 
1.18    ! cvs      2996: <div class="subsection">
1.1       cvs      2997: 
1.18    ! cvs      2998: <h3><a name="sectc422">Views</a></h3>
        !          2999: <p>
1.1       cvs      3000: Each of the possible views must be declared in the presentation schema.  As
1.18    ! cvs      3001: has <a href="#views">already been described</a>, the presentation rules for an
1.1       cvs      3002: element type can vary according to the view in which the element appears.  The
                   3003: name of the view is used to designate the view to which the presentation rules
1.18    ! cvs      3004: apply (see the <a href="#inkeyword"><tt>IN</tt> instruction</a>).  The
1.1       cvs      3005: definition of the view's contents are dispersed throughout the presentation
                   3006: rules attached to the different element types and attributes.  The
1.18    ! cvs      3007: <tt>VIEWS</tt> section is simply a sequence of view names separated by commas
        !          3008: and terminated by a semi-colon.</p>
        !          3009: <p>
1.1       cvs      3010: One of the view names (and only one) can be followed by the keyword
1.18    ! cvs      3011: <tt>EXPORT</tt>.  This keyword identifies the view which presents the members
        !          3012: of the document class in <a href="#sectc3213">skeleton form</a>.  The
        !          3013: graphical appearance  and the content of this view is defined just as with
        !          3014: other views, but it is useless to specify presentation rules concerning this
        !          3015: view for the elements which are not loaded in the skeleton form.</p>
        !          3016: <p>
1.1       cvs      3017: It is not necessary to declare any views; in this case there is a single
                   3018: unnamed view.  If many views are declared, the first view listed is considered
                   3019: the principal view.  The principal view is the one to which all rules that are
1.18    ! cvs      3020: not preceded by an indication of a view will apply (see the <a
        !          3021: href="#inkeyword">instruction <tt>IN</tt></a>).</p>
        !          3022: <p>
1.1       cvs      3023: The principal view is the the one which the editor presents on the screen when
                   3024: the user asks to create or edit a document.  Thus, it makes sense to put the
                   3025: most frequently used view at the head of the list.  But if the structure
1.18    ! cvs      3026: schema contains <a href="#sectc3213">skeleton elements</a> and is loaded in
        !          3027: its skeleton form, the view whose name is followed by the keyword
        !          3028: <tt>EXPORT</tt> will be opened and no other views can be opened.</p>
        !          3029: <pre>                      'VIEWS' ViewSeq
1.1       cvs      3030:      ViewSeq         = ViewDeclaration
1.6       cvs      3031:                        &lt; ',' ViewDeclaration > ';' .
1.1       cvs      3032:      ViewDeclaration = ViewID [ 'EXPORT' ] .
1.18    ! cvs      3033:      ViewID          = NAME .</pre>
        !          3034: <blockquote class="example">
        !          3035: <p>
        !          3036: <strong>Example:</strong></p>
        !          3037: <p>
1.3       cvs      3038: When editing a report, it might be useful have views of the table of contents
1.18    ! cvs      3039: and of the mathematical formulas, in addition to the principal view which
        !          3040: shows the document in its entirety.  To achieve this, a presentation schema
        !          3041: for the Report class would have the following <tt>VIEWS</tt> section:</p>
        !          3042: <pre>VIEWS
        !          3043:      Full_text, Table_of_contents, Formulas;</pre>
        !          3044: <p>
1.1       cvs      3045: The contents of these views are specified in the presentation rules of the
1.18    ! cvs      3046: schema.</p>
        !          3047: </blockquote>
        !          3048: </div>
1.1       cvs      3049: 
1.18    ! cvs      3050: <div class="subsection">
1.1       cvs      3051: 
1.18    ! cvs      3052: <h3><a name="sectc423">Print Views</a></h3>
        !          3053: <p>
1.1       cvs      3054: When editing a document, each view is presented in a different window.  In
1.18    ! cvs      3055: addition to the views specified by the <tt>VIEWS</tt> instruction, the user
1.1       cvs      3056: can display the associated elements with one window for each type of
1.18    ! cvs      3057: associated element.</p>
        !          3058: <p>
1.1       cvs      3059: When printing a document, it is possible to print any number of views, chosen
                   3060: from among all the views which the editor can display (views in the strict
                   3061: sense or associated elements).  Print views, as well as the order in which
1.18    ! cvs      3062: they must be printed, are indicated by the <tt>PRINT</tt> instruction. It
        !          3063: appears after the <tt>VIEWS</tt> instruction and is formed of the keyword
        !          3064: <tt>PRINT</tt> followed by the ordered list of print view names.  The print
1.1       cvs      3065: view names are separated by commas and followed by a semi-colon.  A print view
1.18    ! cvs      3066: name is either a view name declared in the <tt>VIEWS</tt> instruction or the
1.1       cvs      3067: name of an associated element type (with an ``s'' added to the end).  The
1.18    ! cvs      3068: associated element must have been declared in the <tt>ASSOC</tt> section of
        !          3069: the structure schema.</p>
        !          3070: <pre>                    'PRINT' PrintViewSeq
1.1       cvs      3071:      PrintViewSeq = PrintView &lt; ',' PrintView > ';' .
1.18    ! cvs      3072:      PrintView    = ViewID / ElemID .</pre>
        !          3073: <p>
        !          3074: If the <tt>PRINT</tt> instruction is absent, the printing program will print
        !          3075: only the principal view (the first view specified by the <tt>VIEWS</tt>
        !          3076: instruction or the single, unnamed view when there is no <tt>VIEWS</tt>
        !          3077: instruction).</p>
        !          3078: <blockquote class="example">
        !          3079: <p>
        !          3080: <strong>Example:</strong></p>
        !          3081: <p>
1.3       cvs      3082: Consider a Report presentation using the view declarations from the preceding
                   3083: example.  Suppose we want to print the full text and table of contents views,
                   3084: but not the Formulas view, which is only useful when editing.  In addition,
                   3085: suppose that we also want to print the bibliographic citations, which are
1.18    ! cvs      3086: associated elements (of type <tt>Citation</tt>).  A sensible printing order
1.3       cvs      3087: would be to print the full text then the bibliography and finally the table of
                   3088: contents.  To obtain this result when printing, the presentation schema would
1.18    ! cvs      3089: say:</p>
        !          3090: <pre>PRINT
        !          3091:      Full_text, Citations, Table_of_contents;</pre>
        !          3092: </blockquote>
        !          3093: </div>
        !          3094: 
        !          3095: <div class="subsection">
        !          3096: 
        !          3097: <h3><a name="sectc424">Counters</a></h3>
        !          3098: <p>
        !          3099: A presentation has a <em>counter</em> for each type of number in the
1.1       cvs      3100: presentation.  All counters, and therefore all types of numbers, used in the
1.18    ! cvs      3101: schema must be declared after the <tt>COUNTERS</tt> keyword.</p>
        !          3102: <p>
1.1       cvs      3103: Each counter declaration is composed of a name identifying the counter
                   3104: followed by a colon and the counting function to be applied to the counter.
1.18    ! cvs      3105: The counter declaration ends with a semi-colon.</p>
        !          3106: <p>
1.1       cvs      3107: The counting function indicates how the counter values will be calculated.
1.16      cvs      3108: Three types of counting functions are available.  The first type is used to
                   3109: count the elements of a list or aggregate: it assigns to the counter the rank
1.18    ! cvs      3110: of the element in the list or aggregate.  More precisely, the function</p>
        !          3111: <pre>RANK OF ElemID [ LevelAsc ] [ INIT AttrID ]
        !          3112:         [ 'REINIT' AttrID ]</pre>
        !          3113: <p>
        !          3114: indicates that when an element creates, by a creation rule (see the <a
        !          3115: href="#sectc4232"><tt>Create</tt> instructions</a>), a presentation box
1.5       cvs      3116: containing  the counter value, this value is the rank of the creating element,
1.18    ! cvs      3117: if it is of type <tt>ElemID</tt>, otherwise the rank of the first element of
        !          3118: type <tt>ElemID</tt> which encloses the creating element in the logical
        !          3119: structure of the document.</p>
        !          3120: <p>
1.1       cvs      3121: The type name can be preceded by a star in the special case where the
1.18    ! cvs      3122: structure schema defines an element of whose <tt>ElemID</tt> is the same as
        !          3123: that of an <a href="#sectd3284">inclusion</a> without expansion or with
        !          3124: partial expansion.  To resolve this ambiguity, the <tt>ElemID</tt> alone
        !          3125: refers to the type defined in the structure schema while the <tt>ElemID</tt>
        !          3126: preceded by a star refers to the included type.</p>
        !          3127: <p>
        !          3128: The type name <tt>ElemID</tt> can be followed by an integer.  That number
1.1       cvs      3129: represents the relative level, among the ancestors of the creating element, of
1.18    ! cvs      3130: the element whose rank is asked.  If that relative level <i>n</i> is unsigned,
        !          3131: the <i>n</i><sup>th</sup> element of type <tt>ElemID</tt> encountered when
1.1       cvs      3132: travelling the logical structure from the root to the creating element is
1.16      cvs      3133: taken into account.  If the relative level is negative, the logical structure
                   3134: is travelled in the other direction, from the creating element to the
1.18    ! cvs      3135: root.</p>
        !          3136: <p>
        !          3137: The function can end with the keyword <tt>INIT</tt> followed by the name of a
1.1       cvs      3138: numeric attribute (and only a numeric attribute).  Then, the rank of the first
                   3139: element of the list or aggregate is considered to be the value of this
                   3140: attribute, rather than the default value of 1, and the rank of the other
                   3141: elements is shifted accordingly.  The attribute which determines the initial
1.18    ! cvs      3142: value is searched on the element itself and on its ancestors.</p>
        !          3143: <p>
        !          3144: The function can end with the keyword <tt>REINIT</tt> followed by the name of
1.1       cvs      3145: a numeric attribute (and only a numeric attribute).  Then, if an element to be
                   3146: counted has this attribute, the counter value for this element is the
                   3147: attribute value and the following elements are numbered starting from this
1.18    ! cvs      3148: value.</p>
        !          3149: <p>
        !          3150: When the <tt>RANK</tt> function is written</p>
        !          3151: <pre>RANK OF Page [ ViewID ] [ INIT AttrID ]</pre>
        !          3152: <p>
        !          3153: (<tt>Page</tt>is a keyword of the P language), the counter takes as its value
1.5       cvs      3154: the number of the page on which the element which creates the presentation box
                   3155: containing the number appears.  This is done as if the pages of the document
                   3156: form a list for each view.  The counter only takes into account the pages of
                   3157: the relevant view, that is the view displaying the presentation box whose
1.18    ! cvs      3158: contents take the value of the number.  However, if the keyword <tt>Page</tt>
1.5       cvs      3159: is followed by the name of a view (between parentheses), it is the pages of
                   3160: that view that are taken into account.  As in the preceding form, the
1.18    ! cvs      3161: <tt>RANK</tt> function applied to pages can end with the <tt>INIT</tt> keyword
1.5       cvs      3162: followed by the name of a numeric attribute which sets the value of the first
                   3163: page's number.  This attribute must be a local attribute of the document
1.18    ! cvs      3164: itself, and not of one of its components.</p>
        !          3165: <p>
1.1       cvs      3166: The second counting function is used to count the occurrences of a certain
1.18    ! cvs      3167: element type in a specified context.  The instruction</p>
        !          3168: <pre>SET n ON Type1 ADD m ON Type2 [ INIT AttrID ]</pre>
        !          3169: <p>
1.5       cvs      3170: says that when the document is traversed from beginning to end (in the order
1.18    ! cvs      3171: induced by the logical structure), the counter is assigned the value
        !          3172: <tt>n</tt> each time an element of type <tt>Type1</tt> is encountered, no
        !          3173: matter what the current value of the counter, and the value <tt>m</tt> is
        !          3174: added to the current value of the counter each time an element of type
        !          3175: <tt>Type2</tt> is encountered.</p>
        !          3176: <p>
        !          3177: As with the <tt>RANK</tt> function, the type names can be preceded by a star
        !          3178: to resolve the ambiguity of included elements.</p>
        !          3179: <p>
        !          3180: If the function ends with the keyword <tt>INIT</tt> followed by the name of an
1.1       cvs      3181: attribute and if the document possesses this attribute, the value of this
1.18    ! cvs      3182: attribute is used in place of <tt>n</tt>.  The attribute must be numeric.  It
        !          3183: is searched on the element itself and on its ancestors.</p>
        !          3184: <p>
        !          3185: This function can also be used with the <tt>Page</tt> keyword in the place of
        !          3186: <tt>Type1</tt> or <tt>Type2</tt>.  In the first case, the counter is
        !          3187: reinitialized on each page with the value <tt>n</tt>, while in the second
        !          3188: case, it is incremented by <tt>m</tt> on each page.  As with the preceding
        !          3189: counting function, the word <tt>Page</tt> can be followed by a name between
1.1       cvs      3190: parentheses.  In this case, the name specifies a view whose pages are taken
1.18    ! cvs      3191: into account.</p>
        !          3192: <p>
        !          3193: The definition of a counter can contain several <tt>SET</tt> functions and
        !          3194: several <tt>ADD</tt> functions, each with a different value.  The total number
        !          3195: of counting functions must not be greater than 6.</p>
        !          3196: <p>
1.1       cvs      3197: The third counting function is used to count the elements of a certain type
1.16      cvs      3198: encountered when travelling from the creating element to the root of the
                   3199: logical structure.  The creating element is included if it is of that type.
1.18    ! cvs      3200: That function is written</p>
        !          3201: <pre>RLEVEL OF Type</pre>
        !          3202: <p>
        !          3203: where <tt>Type</tt> represents the type of the elements to be counted.</p>
        !          3204: <p>
        !          3205: The formal definition of counter declarations is:</p>
        !          3206: <pre>                    'COUNTERS' CounterSeq
1.1       cvs      3207:      CounterSeq   = Counter &lt; Counter > .
                   3208:      Counter      = CounterID ':' CounterFunc ';' .
                   3209:      CounterID    = NAME .
                   3210:      CounterFunc  = 'RANK' 'OF' TypeOrPage [ SLevelAsc ]
1.16      cvs      3211:                     [ 'INIT' AttrID ] [ 'REINIT' AttrID ] /
1.1       cvs      3212:                     SetFunction &lt; SetFunction >
1.16      cvs      3213:                     AddFunction &lt; AddFunction >
                   3214:                     [ 'INIT' AttrID ] /
                   3215:                     'RLEVEL' 'OF' ElemID .
1.1       cvs      3216:      SLevelAsc    = [ '-' ] LevelAsc .
                   3217:      LevelAsc     =  NUMBER .
                   3218:      SetFunction  = 'SET' CounterValue 'ON' TypeOrPage .
                   3219:      AddFunction  = 'ADD' CounterValue 'ON' TypeOrPage .
                   3220:      TypeOrPage   = 'Page' [ '(' ViewID ')' ] / 
1.16      cvs      3221:                     [ '*' ] ElemID .
1.18    ! cvs      3222:      CounterValue = NUMBER .</pre>
        !          3223: <blockquote class="example">
        !          3224: <p>
        !          3225: <strong>Example:</strong></p>
        !          3226: <p>
1.3       cvs      3227: If the body of a chapter is defined as a sequence of sections in the structure
1.18    ! cvs      3228: schema:</p>
        !          3229: <pre>Chapter_body = LIST OF (Section = 
1.1       cvs      3230:                             BEGIN
                   3231:                             Section_Title = Text;
                   3232:                             Section_Body  = Paragraphs;
                   3233:                             END
1.18    ! cvs      3234:                          );</pre>
        !          3235: <p>
        !          3236: the section counter is declared:</p>
        !          3237: <pre>SectionCtr : RANK OF Section;</pre>
        !          3238: <p>
        !          3239: and the display of the section number before the section title is obtained by
        !          3240: a <a href="#sectc4232"><tt>CreateBefore</tt> rule</a> attached the
        !          3241: <tt>Section_Title</tt> type, which creates a presentation box whose content is
        !          3242: the value of the <tt>SectionCtr</tt> counter (see the <a
        !          3243: href="#sectc4231"><tt>Content</tt> instruction</a>).</p>
        !          3244: <p>
1.1       cvs      3245: In order to number the formulas separately within each chapter, the formula
1.18    ! cvs      3246: counter is declared:</p>
        !          3247: <pre>FormulaCtr : SET 0 ON Chapter ADD 1 ON Formula;</pre>
        !          3248: <p>
1.4       cvs      3249: and the display of the formula number in the right margin, alongside each
1.18    ! cvs      3250: formula, is obtained by a <tt>CreateAfter</tt> instruction attached to the
        !          3251: <tt>Formula</tt> type, which creates a presentation box whose content is the
        !          3252: value of the <tt>FormulaCtr</tt> counter.</p>
        !          3253: <p>
1.1       cvs      3254: To number the page chapter by chapter, with the first page of each chapter
1.18    ! cvs      3255: having the number 1, the counter definition would be</p>
        !          3256: <pre>ChapterPageCtr : SET 0 ON Chapter ADD 1 ON Page;</pre>
        !          3257: <p>
        !          3258: If there is also a chapter counter</p>
        !          3259: <pre>ChapterCtr : RANK OF Chapter;</pre>
        !          3260: <p>
        !          3261: the <a href="#sectc4231">content</a> of a presentation box created at the top
        !          3262: of each page could be defined as:</p>
        !          3263: <pre>Content : (VALUE(ChapterCtr, URoman) TEXT '-'
        !          3264:            VALUE(ChapterPageCtr, Arabic));</pre>
        !          3265: <p>
1.5       cvs      3266: Thus, the presentation box contains the number of the chapter in upper-case
1.18    ! cvs      3267: roman numerals followed by a hyphen and the number of the page within the
        !          3268: chapter in arabic numerals.</p>
        !          3269: </blockquote>
        !          3270: <blockquote class="example">
        !          3271: <p>
        !          3272: <strong>Example:</strong></p>
        !          3273: <p>
1.3       cvs      3274: To count tables and figures together in a document of the chapter type, a
1.18    ! cvs      3275: counter could be defined using:</p>
        !          3276: <pre>CommonCtr : SET 0 ON Chapter ADD 1 ON Table
        !          3277:             ADD 1 ON Figure;</pre>
        !          3278: </blockquote>
        !          3279: </div>
1.1       cvs      3280: 
1.18    ! cvs      3281: <div class="subsection">
1.1       cvs      3282: 
1.18    ! cvs      3283: <h3><a name="sectc425">Presentation constants</a></h3>
        !          3284: <p>
1.1       cvs      3285: Presentation constants are used in the definition of the content of
1.18    ! cvs      3286: presentation boxes.  This content is used in <a href="#sectc426">variable
        !          3287: definitions</a> and in the <a href="#sectc4231"><tt>Content</tt> rule</a>. The
1.1       cvs      3288: only presentation constants which can be used are character strings,
1.2       cvs      3289: mathematical symbols, graphical elements, and pictures, that is to say, base
1.18    ! cvs      3290: elements.</p>
        !          3291: <p>
1.1       cvs      3292: Constants can be defined directly in the variables or presentation boxes
1.18    ! cvs      3293: (<tt>Content</tt> rule) which use them.  But it is only necessary them to
1.1       cvs      3294: declare once, in the constant declaration section, even though they are used
                   3295: in many variables or boxes.  Thus, each declared constant has a name, which
                   3296: allows it to be designated whenever it is used, a type (one of the four base
                   3297: types) and a value (a character string or a single character for mathematical
1.18    ! cvs      3298: symbols and graphical elements).</p>
        !          3299: <p>
        !          3300: The constant declarations appear after the keyword <tt>CONST</tt>.  Each
1.1       cvs      3301: declaration is composed of the name of the constant, an equals sign, a keyword
1.18    ! cvs      3302: representing its type (<tt>Text</tt>, <tt>Symbol</tt>, <tt>Graphics</tt> or
        !          3303: <tt>Picture</tt>) and the string representing its value. A semi-colon
        !          3304: terminates each declaration.</p>
        !          3305: <p>
        !          3306: In the case of a character string, the keyword <tt>Text</tt> can be followed
        !          3307: by the name of an alphabet (for example, <tt>Greek</tt> or <tt>Latin</tt>) in
1.1       cvs      3308: which the constant's text should be expressed.  If the alphabet name is
                   3309: absent, the Latin alphabet is used.  When the alphabet name is present, only
                   3310: the first letter of the alphabet name is interpreted.  Thus, the words
1.18    ! cvs      3311: <tt>Greek</tt> and <tt>Grec</tt> designate the same alphabet.  In current
        !          3312: versions of Thot, only the Greek and Latin alphabets are available.</p>
        !          3313: <pre>                 'CONST' ConstSeq
1.1       cvs      3314:      ConstSeq   = Const &lt; Const > .
                   3315:      Const      = ConstID '=' ConstType ConstValue ';' .
                   3316:      ConstID    = NAME .
                   3317:      ConstType  ='Text' [ Alphabet ] / 'Symbol' /
                   3318:                  'Graphics' / 'Picture' .
                   3319:      ConstValue = STRING .
1.18    ! cvs      3320:      Alphabet   = NAME .</pre>
        !          3321: <p>
1.5       cvs      3322: For character strings in the Latin alphabet (ISO Latin-1 character set),
1.1       cvs      3323: characters having codes higher than 127 (decimal) are represented by their
1.18    ! cvs      3324: code in octal.</p>
        !          3325: <p>
1.1       cvs      3326: In the case of a symbol or graphical element, the value only contains a single
                   3327: character, between apostrophes, which indicates the form of the element which
                   3328: must be drawn in the box whose content is the constant.  The symbol or
                   3329: graphical element takes the dimensions of the box, which are determined by the
1.18    ! cvs      3330: <tt>Height</tt> and <tt>Width</tt> rules. See <a href="#sectb72">table of
        !          3331: codes</a> for the symbols and graphical elements.</p>
        !          3332: <blockquote class="example">
        !          3333: <p>
        !          3334: <strong>Example:</strong></p>
        !          3335: <p>
1.3       cvs      3336: The constants ``Summary:'' and fraction bar, which were described earlier, are
1.18    ! cvs      3337: declared:</p>
        !          3338: <pre>CONST
1.1       cvs      3339:      SummaryConst = Text 'Summary:';
1.18    ! cvs      3340:      Bar          = Graphics 'h';</pre>
        !          3341: </blockquote>
        !          3342: </div>
1.1       cvs      3343: 
1.18    ! cvs      3344: <div class="subsection">
1.1       cvs      3345: 
1.18    ! cvs      3346: <h3><a name="sectc426">Variables</a></h3>
        !          3347: <p>
1.1       cvs      3348: Variables permit the definition of computed content for presentation boxes. A
1.18    ! cvs      3349: variable is associated with a presentation box by a <tt>Content</tt> rule; but
        !          3350: before being used in a <tt>Content</tt> rule, a variable can be defined in the
        !          3351: <tt>VAR</tt> section.  It is also possible to define a variable at the time of
        !          3352: its use in a <tt>Content</tt> rule, as can be done with a constant.</p>
        !          3353: <p>
1.1       cvs      3354: A variable has a name and a value which is a character string resulting from
                   3355: the concatenation of the values of a sequence of functions.  Each variable
                   3356: declaration is composed of the variable name followed by a colon and the
                   3357: sequence of functions which produces its value, separated by spaces.  Each
1.18    ! cvs      3358: declaration is terminated by a semi-colon.</p>
        !          3359: <pre>                  'VAR' VarSeq
1.1       cvs      3360:      VarSeq      = Variable &lt; Variable > .
                   3361:      Variable    = VarID ':' FunctionSeq ';' .
                   3362:      VarID       = NAME .
1.18    ! cvs      3363:      FunctionSeq = Function &lt; Function > .</pre>
        !          3364: <p>
1.1       cvs      3365: Several functions are available.  The first two return, in the form of a
1.18    ! cvs      3366: character string, the current date.  <tt>DATE</tt> returns the date in
        !          3367: English, while <tt>FDATE</tt> returns the date in french.</p>
        !          3368: <p>
        !          3369: Two other functions, <tt>DocName</tt> and <tt>DirName</tt>, return the
        !          3370: document name and the directory where the document is stored.</p>
        !          3371: <p>
        !          3372: Function <tt>ElemName</tt> returns the type of the element which created the
        !          3373: presentation box whose contents are the variable.</p>
        !          3374: <p>
1.1       cvs      3375: Another function simply returns the value of a presentation constant. For any
1.18    ! cvs      3376: constant declared in the <tt>CONST</tt> section, it is sufficient to give the
1.1       cvs      3377: name of the constant.  Otherwise, the type and value of the constant must be
1.18    ! cvs      3378: given, using the same form as in a <a href="#sectc425">constant
        !          3379: declaration</a>. If the constant is not of type text, (types <tt>Symbol</tt>,
        !          3380: <tt>Graphics</tt> or <tt>Picture</tt>), it must be alone in the variable
        !          3381: definition; only constants of type <tt>Text</tt> can be mixed with other
        !          3382: functions.</p>
        !          3383: <p>
1.1       cvs      3384: It is also possible to obtain the value of an attribute, simply by mentioning
                   3385: the attribute's name.  The value of this function is the value of the
                   3386: attribute for the element which created the presentation box whose contents
                   3387: are the variable.  If the creating element does not have the indicated
                   3388: attribute, the value is an empty string.  In the case of a numeric attribute,
                   3389: the attribute is translated into a decimal number in arabic numerals.  If
1.18    ! cvs      3390: another form is desired, the <tt>VALUE</tt> function must be used.</p>
        !          3391: <p>
1.1       cvs      3392: The last available function returns, as a character string, the value of a
                   3393: counter, an attribute or a page number. This value can be presented in
1.18    ! cvs      3394: different styles.  The keyword <tt>VALUE</tt> is followed (between
1.1       cvs      3395: parentheses) by the name of the counter, the name of the attribute, or the
1.18    ! cvs      3396: keyword <tt>PageNumber</tt> and the desired style, the two parameters being
1.1       cvs      3397: separated by a comma.  The style is a keyword which indicates whether the
1.18    ! cvs      3398: value should be presented in arabic numerals (<tt>Arabic</tt>), lower-case
        !          3399: roman numerals (<tt>LRoman</tt>), or upper-case roman numerals
        !          3400: (<tt>URoman</tt>), or by an upper-case letter (<tt>Uppercase</tt>) or
        !          3401: lower-case letter (<tt>Lowercase</tt>).</p>
        !          3402: <p>
        !          3403: For a page counter, the keyword <tt>PageNumber</tt> can be followed, between
1.1       cvs      3404: parentheses, by the name of the view from which to obtain the page number.  By
1.18    ! cvs      3405: default, the first view declared in the <tt>VIEWS</tt> section is used.  The
1.1       cvs      3406: value obtained is the number of the page on which is found the element that is
1.18    ! cvs      3407: using the variable in a <tt>Content</tt> rule.</p>
        !          3408: <p>
1.1       cvs      3409: For an ordinary counter, the name of the counter can be preceded by the
1.18    ! cvs      3410: keyword <tt>MaxRangeVal</tt> or <tt>MinRangeVal</tt>.  These keywords mean
1.1       cvs      3411: that the value returned by the function is the maximum (minimum resp.) value
                   3412: taken by the counter in the whole document, not the value for the element
1.18    ! cvs      3413: concerned by the function.</p>
        !          3414: <pre>     Function     = 'DATE' / 'FDATE' /
1.1       cvs      3415:                     'DocName' / 'DirName' /
                   3416:                     'ElemName' / 'AttributeName' /
                   3417:                      ConstID / ConstType ConstValue /
                   3418:                      AttrID /
                   3419:                     'VALUE' '(' PageAttrCtr ','
                   3420:                                 CounterStyle ')' .
1.6       cvs      3421:      PageAttrCtr  = 'PageNumber' [ '(' ViewID ')' ] /
1.1       cvs      3422:                      [ MinMax ] CounterID / AttrID .
                   3423:      CounterStyle = 'Arabic' / 'LRoman' / 'URoman' /
                   3424:                     'Uppercase' / 'Lowercase' .
1.18    ! cvs      3425:      MinMax       = 'MaxRangeVal' / 'MinRangeVal' .</pre>
        !          3426: <blockquote class="example">
        !          3427: <p>
        !          3428: <strong>Example:</strong></p>
        !          3429: <p>
        !          3430: To make today's date appear at the top of the first page of a report, a <a
        !          3431: href="#sectc4232"><tt>CREATE</tt> rule</a> associated with the Report_Title
1.3       cvs      3432: element type generates a presentation box whose content (specified by the
1.18    ! cvs      3433: <tt>Content</tt> rule of that presentation box) is the variable:</p>
        !          3434: <pre>VAR
        !          3435:      Todays_date : TEXT 'Version of ' DATE;</pre>
        !          3436: <p>
1.1       cvs      3437: To produce, before each section title, the chapter number (in upper-case roman
                   3438: numerals) followed by the section number (in arabic numerals), two counters
1.18    ! cvs      3439: must be defined:</p>
        !          3440: <pre>COUNTERS
1.1       cvs      3441:      ChapterCtr : RANK OF Chapter;
1.18    ! cvs      3442:      SectionCtr : RANK OF Section;</pre>
        !          3443: <p>
1.4       cvs      3444: and the Section_Title element must create a presentation box whose content is
1.18    ! cvs      3445: the variable</p>
        !          3446: <pre>VAR
1.1       cvs      3447:      SectionNum : VALUE (ChapterCtr, URoman) TEXT '-'
1.18    ! cvs      3448:                   VALUE (SectionCtr, Arabic);</pre>
        !          3449: <p>
1.1       cvs      3450: In order to make the page number on which each section begins appear in the
                   3451: table of contents view next to the section title, each Section_Title element
                   3452: must create a presentation box, visible only in the table of contents view,
1.18    ! cvs      3453: whose content is the variable:</p>
        !          3454: <pre>VAR
1.1       cvs      3455:      TitlePageNume :
1.18    ! cvs      3456:            VALUE (PageNumber(Full_text), Arabic);</pre>
        !          3457: </blockquote>
        !          3458: </div>
1.1       cvs      3459: 
1.18    ! cvs      3460: <div class="subsection">
1.1       cvs      3461: 
1.18    ! cvs      3462: <h3><a name="sectc427">Default presentation rules</a></h3>
        !          3463: <p>
1.1       cvs      3464: In order to avoid having to specify, for each element type defined in the
                   3465: structure schema, values for every one of the numerous presentation
                   3466: parameters, the presentation schema allows the definition of a set of default
                   3467: presentation rules.  These rules apply to all the boxes of the elements
                   3468: defined in the structure schema and to the presentation boxes and page layout
                   3469: boxes defined in the presentation schema.  Only rules which differ from these
1.18    ! cvs      3470: default need to be specified in other sections of the presentation schema.</p>
        !          3471: <p>
1.1       cvs      3472: For the primary view, the default rules can define every presentation
1.18    ! cvs      3473: parameter, but not the <a href="#presfunct">presentation functions</a> or the
        !          3474: <a href="#sectc4223">linebreaking conditions</a> (the <tt>NoBreak1</tt>,
        !          3475: <tt>NoBreak2</tt>, and <tt>Gather</tt> rules).</p>
        !          3476: <p>
1.1       cvs      3477: In a presentation schema, the default presentation rules section is optional;
1.18    ! cvs      3478: in this case, the <tt>DEFAULT</tt> keyword is also absent and the following
        !          3479: rules are considered to be the default rules:</p>
        !          3480: <pre>   Visibility:    Enclosing =;
1.6       cvs      3481:    VertRef:       * . Left;
                   3482:    HorizRef:      Enclosed . HRef;
                   3483:    Height:        Enclosed . Height;
                   3484:    Width:         Enclosed . Width;
                   3485:    VertPos:       Top = Previous . Bottom;
                   3486:    HorizPos:      Left = Enclosing . Left;
                   3487:    VertOverflow:  No;
1.1       cvs      3488:    HorizOverflow: No;
1.6       cvs      3489:    Size:          Enclosing =;
                   3490:    Style:         Enclosing =;
                   3491:    Font:          Enclosing =;
                   3492:    Underline:     Enclosing =;
                   3493:    Thickness:     Enclosing =;
                   3494:    Indent:        Enclosing =;
                   3495:    LineSpacing:   Enclosing =;
                   3496:    Adjust:        Enclosing =;
                   3497:    Justify:       Enclosing =;
                   3498:    Hyphenate:     Enclosing =;
                   3499:    PageBreak:     Yes;
                   3500:    LineBreak:     Yes;
                   3501:    InLine:        Yes;
                   3502:    Depth:         0;
                   3503:    LineStyle:     Enclosing =;
                   3504:    LineWeight:    Enclosing =;
                   3505:    FillPattern:   Enclosing =;
                   3506:    Background:    Enclosing =;
1.18    ! cvs      3507:    Foreground:    Enclosing =;</pre>
        !          3508: <p>
1.1       cvs      3509: If other values are desired for the default rules, they must be defined
                   3510: explicitly in the default rules section.  In fact, it is only necessary to
                   3511: define those default rules which differ from the ones above, since the rules
1.18    ! cvs      3512: above will be used whenever a rule is not explicitly named.</p>
        !          3513: <p>
1.1       cvs      3514: Default rules for views other than the primary  view can also be specified.
                   3515: Otherwise, the default rules for the primary views are applied to the other
1.18    ! cvs      3516: views.</p>
        !          3517: <p>
        !          3518: Default rules are expressed in the same way as <a href="#sectc4215">explicit
        !          3519: rules for document elements</a>.</p>
        !          3520: </div>
1.1       cvs      3521: 
1.18    ! cvs      3522: <div class="subsection">
1.1       cvs      3523: 
1.18    ! cvs      3524: <h3><a name="sectc428">Presentation and page layout boxes</a></h3>
        !          3525: <p>
1.1       cvs      3526: The presentation process uses elements which are not part of the logical
                   3527: structure of the document, such as pages (which are the page layout boxes) or
                   3528: alternatively, rules, numbers, or words introducing certain parts of the
                   3529: document, such as ``Summary'', ``Appendices'', ``Bibliography'', etc. (which
1.18    ! cvs      3530: are presentation boxes).</p>
        !          3531: <p>
        !          3532: After the word <tt>BOXES</tt>, each presentation or page layout box is defined
1.1       cvs      3533: by its name and a sequence of presentation rules which indicate how they must
                   3534: be displayed.  These rules are the same as those which define the boxes
                   3535: associated with element of the logical structure of the document, with a
1.18    ! cvs      3536: single exception, the <a href="#sectc4231"><tt>Content</tt> rule</a> which is
1.1       cvs      3537: used only to specify the content of presentation boxes.  The content of boxes
                   3538: associated with elements of the document structure is defined in each document
                   3539: or object and thus is not specified in the presentation schema, which applies
1.18    ! cvs      3540: to all documents or objects of a class.</p>
        !          3541: <p>
1.1       cvs      3542: Among the rules which define a presentation box, certain ones can refer to
                   3543: another presentation box (for example, in their positional rules).  If the
                   3544: designated box is defined after the box which designates it, a
1.18    ! cvs      3545: <tt>FORWARD</tt> instruction followed by the name of the designated box must
        !          3546: appear before the designation.</p>
        !          3547: <pre>             'BOXES' BoxSeq
1.1       cvs      3548:      BoxSeq = Box &lt; Box > .
                   3549:      Box    ='FORWARD' BoxID ';' /
                   3550:               BoxID ':' ViewRuleSeq .
1.18    ! cvs      3551:      BoxID  = NAME .</pre>
        !          3552: </div>
1.1       cvs      3553: 
1.18    ! cvs      3554: <div class="subsection">
1.1       cvs      3555: 
1.18    ! cvs      3556: <h3><a name="sectc429">Presentation of structured elements</a></h3>
        !          3557: <p>
        !          3558: After the words <tt>RULES</tt>, the presentation schema gives the presentation
1.1       cvs      3559: rules that apply to the elements whose types are defined in the structure
1.18    ! cvs      3560: schema.  Only those rules which differ from the <a
        !          3561: href="#sectc427">default</a> must be specified in the <tt>RULES</tt>
        !          3562: section.</p>
        !          3563: <p>
1.1       cvs      3564: The rule definitions for each element type are composed of the name of the
                   3565: element type (as specified in the structure schema) followed by a colon and
1.18    ! cvs      3566: the set of rules specific to that type.</p>
        !          3567: <p>
1.1       cvs      3568: The type name can be preceded by a star in the special case where the
1.18    ! cvs      3569: structure schema defines an <a href="#sectd3284">inclusion</a> without
1.1       cvs      3570: expansion (or with partial expansion) of a type with the same name as an
1.18    ! cvs      3571: element of defined in the structure schema.</p>
        !          3572: <p>
        !          3573: In the case where the element is a <a href="#sectd3285">mark pair</a>, but
        !          3574: only in this case, the type name can be preceded by the keywords
        !          3575: <tt>First</tt> or <tt>Second</tt>.  These keywords indicate whether the rules
        !          3576: that follow apply to the first or second mark of the pair.</p>
        !          3577: <pre>                 'RULES' PresentSeq
1.1       cvs      3578:      PresentSeq = Present &lt; Present > .
1.6       cvs      3579:      Present    = [ '*' ] [ FirstSec ] ElemID ':'
                   3580:                   ViewRuleSeq .
1.18    ! cvs      3581:      FirstSec   = 'First' / 'Second' .</pre>
        !          3582: <p>
1.1       cvs      3583: A presentation schema can define presentation rules for base elements, which
                   3584: are defined implicitly in the structure schemas.  In the English version of
                   3585: the presentation schema compiler, the base type names are the same as in the S
1.18    ! cvs      3586: language, but they are terminated by the <tt>_UNIT</tt> suffix:
        !          3587: <tt>TEXT_UNIT</tt>, <tt>PICTURE_UNIT</tt>, <tt>SYMBOL_UNIT</tt>,
        !          3588: <tt>GRAPHICS_UNIT</tt>.  The base type names are written in upper-case
        !          3589: letters.</p>
        !          3590: </div>
        !          3591: 
        !          3592: <div class="subsection">
        !          3593: 
        !          3594: <h3><a name="sectc4210">Logical attribute presentation</a></h3>
        !          3595: <p>
        !          3596: After the keyword <tt>ATTRIBUTES</tt>, all attributes which are to have some
1.1       cvs      3597: effect on the presentation of the element to which they are attached must be
                   3598: mentioned, along with the corresponding presentation rules.  This is true for
                   3599: both global attributes (which can be attached to all element types) and local
1.18    ! cvs      3600: attributes (which can only be attached to certain element types).</p>
        !          3601: <p>
1.1       cvs      3602: Also mentioned in this section are attributes which imply an effect on
                   3603: elements in the subtree of the element to which they are attached. The
                   3604: presentation of these descendants  can be modified as a function of the value
                   3605: of the attribute which they inherit, just as if it was attached to them
1.18    ! cvs      3606: directly.</p>
        !          3607: <p>
1.1       cvs      3608: The specification for each attribute includes the attribute's name, followed
                   3609: by an optional value specification and, after a colon, a set of rules.  The
1.18    ! cvs      3610: set of rules must contain at least one rule.</p>
        !          3611: <p>
1.1       cvs      3612: When there is no value specification, the rules are applied to all elements
                   3613: which carry the attribute, no matter what their value.  When the rules must
                   3614: only apply when the attribute has certain values, these values must be
1.18    ! cvs      3615: specified.  Thus, the same attribute can appear in the <tt>ATTRIBUTES</tt>
1.1       cvs      3616: section several times, with each appearance having a different value
                   3617: specification.  However, reference attributes never have a value specification
1.18    ! cvs      3618: and, as a result, can only appear once in the <tt>ATTRIBUTES</tt> section.</p>
        !          3619: <p>
1.1       cvs      3620: To specify that the presentation rules apply to some of the descendants of the
                   3621: element having the attribute, the name of the affected element type is given,
                   3622: between parentheses, after the attribute name.  This way, the presentation
                   3623: rules for the attribute will be applied to the element having the attribute,
                   3624: if it is of the given type, and to all of its descendants of the given type.
1.18    ! cvs      3625: In the case where this type is a <a href="#sectd3285">mark pair</a>, but only
        !          3626: in this case, the type name can be preceded by the keywords <tt>First</tt> or
        !          3627: <tt>Second</tt>.  These keywords indicate whether the rules that follow apply
1.1       cvs      3628: to the first or second mark of the pair. If the rule must apply to several
                   3629: different element types, the specification must be repeated for each element
1.18    ! cvs      3630: type.</p>
        !          3631: <p>
1.1       cvs      3632: The specification of values for which the presentation rules will be applied
1.18    ! cvs      3633: varies according to the type of the attribute:</p>
        !          3634: <dl>
        !          3635: <dt>numeric attribute</dt>
        !          3636: <dd>
        !          3637: If the rules are to apply for one value of the attribute, then the attribute
        !          3638: name is followed by an equals sign and this value.  If the rules are to apply
        !          3639: for all values less than (or greater than) a threshold value, non-inclusive,
        !          3640: the attribute name followed by a '&lt;' sign (or a '>' sign, respectively) and
        !          3641: the threshold value.  If the rules must apply to a range of values, the
        !          3642: attribute name is followed by the word '<tt>IN</tt>' and the two bounds of the
        !          3643: range, enclosed in brackets and separated by two periods ('<tt>..</tt>').  In
        !          3644: the case of ranges, the values of the bounds are included in the range.
        !          3645: <p>
1.1       cvs      3646: The threshold value in the comparisons can be the value of an attribute
                   3647: attached to an ancestor element.  In this case, the attribute name is given
1.18    ! cvs      3648: instead of a constant value.</p>
        !          3649: <p>
1.1       cvs      3650: It is also possible to write rules which apply only when a comparison between
                   3651: two different attributes of the element's ancestors is true. In this case, the
                   3652: first attribute name is followed by a comparison keyword and the name of the
1.18    ! cvs      3653: second attribute.  The comparison keywords are <tt>EQUAL</tt> (simple
        !          3654: equality), <tt>LESS</tt> (non-inclusive less than), and <tt>GREATER</tt>
        !          3655: (non-inclusive greater than).</p>
        !          3656: </dd>
        !          3657: <dt>text attribute</dt>
        !          3658: <dd>
        !          3659: If the rules are to apply for one value of the attribute, then the attribute
        !          3660: name is followed by an equals sign and this value.
        !          3661: </dd>
        !          3662: <dt>reference attribute</dt>
        !          3663: <dd>
        !          3664: There is never a value specification; the rules apply no matter what element
        !          3665: is designated by the attribute.
        !          3666: </dd>
        !          3667: <dt>enumerated attribute</dt>
        !          3668: <dd>
        !          3669: If the rules are to apply for one value of the attribute, then the attribute
        !          3670: name is followed by an equals sign and this value.
        !          3671: </dd>
        !          3672: </dl>
        !          3673: <p>
1.1       cvs      3674: The order in which the rules associated with a numeric attribute are defined
                   3675: is important.  When multiple sets of rules can be applied, the first set
1.18    ! cvs      3676: declared is the one used.</p>
        !          3677: <p>
1.1       cvs      3678: Rules for attributes have priority over both default rules and rules
                   3679: associated with element types.  The attribute rules apply to the element to
                   3680: which the attribute is attached.  It is the rules which apply to the
                   3681: surrounding elements (and especially to the descendants) which determine the
                   3682: effect of the attribute rules on the environment ( and especially on the
1.18    ! cvs      3683: terminal elements of the structure).</p>
        !          3684: <pre>                    'ATTRIBUTES' PresAttrSeq
1.1       cvs      3685:      PresAttrSeq  = PresAttr &lt; PresAttr > .
                   3686:      PresAttr     = AttrID [ '(' [ FirstSec ] ElemID ')' ]
                   3687:                     [ AttrRelation ] ':' ViewRuleSeq .
                   3688:      AttrID       = NAME .
                   3689:      AttrRelation ='=' AttrVal /
                   3690:                     '>' [ '-' ] MinValue /
                   3691:                     '&lt;' [ '-' ] MaxValue /
                   3692:                     'IN' '[' [ '-' ] LowerBound '..'
                   3693:                     [ '-' ] UpperBound ']' /
                   3694:                     'GREATER' AttrID /
                   3695:                     'EQUAL' AttrID /
                   3696:                     'LESS' AttrID .
                   3697:      AttrVal      = [ '-' ] EqualNum / EqualText /
                   3698:                     AttrValue .
                   3699:      MinValue     = NUMBER .
                   3700:      MaxValue     = NUMBER .
                   3701:      LowerBound   = NUMBER .
                   3702:      UpperBound   = NUMBER.
                   3703:      EqualNum     = NUMBER .
                   3704:      EqualText    = STRING .
1.18    ! cvs      3705:      AttrValue    = NAME .</pre>
        !          3706: <p>
1.1       cvs      3707: In presentation rules associated with a numeric attribute (and only in such
                   3708: rules), the attribute name can be used in place of a numeric value.  In this
                   3709: case, the value of the attribute is used in the application of the rule. Thus,
                   3710: the attribute can represent a relation between the size of two boxes, the
                   3711: height and width of a box, the height of an area where page breaks are
                   3712: prohibited, the distance between two boxes, the position of the reference axis
                   3713: of a box, the interline spacing,  the indentation of the first line, the
1.18    ! cvs      3714: visibility, the depth (z-order), or the character set.</p>
        !          3715: <p>
1.1       cvs      3716: The presentation rules associated with reference attributes, it is possible to
                   3717: use the element designated by the attribute as a reference box in a positional
1.18    ! cvs      3718: or extent rule.  This element is represented in the <a
        !          3719: href="#sectc4218">position</a> or <a href="#sectc4219">extent</a> rule by the
        !          3720: keyword <tt>Referred</tt>.</p>
        !          3721: <blockquote class="example">
        !          3722: <p>
        !          3723: <strong>Example:</strong></p>
        !          3724: <p>
1.3       cvs      3725: In all structure schemas, there is a global Language attribute defined as
1.18    ! cvs      3726: follows:</p>
        !          3727: <pre>ATTR
        !          3728:      Language = TEXT;</pre>
        !          3729: <p>
        !          3730: The following rules would make French text be displayed in roman characters
        !          3731: and English text be displayed in italics:</p>
        !          3732: <pre>ATTRIBUTES
1.1       cvs      3733:      Language = 'French' :
1.6       cvs      3734:                 Style : Roman;
1.1       cvs      3735:      Language = 'English' :
1.18    ! cvs      3736:                 Style : Italics;</pre>
        !          3737: <p>
1.4       cvs      3738: Using these rules, when the user puts the Language attribute with the value
                   3739: 'English' on the summary of a document, every character string (terminal
1.18    ! cvs      3740: elements) contained in the summary are displayed in italics.  See the <a
        !          3741: href="#sectd42252"><tt>Style</tt> rule</a>.</p>
        !          3742: </blockquote>
        !          3743: <blockquote class="example">
        !          3744: <p>
        !          3745: <strong>Example:</strong></p>
        !          3746: <p>
1.3       cvs      3747: A numeric attribute representing the importance of the part of the document to
1.18    ! cvs      3748: which it is attached can be defined:</p>
        !          3749: <pre>ATTR
        !          3750:      Importance = INTEGER;</pre>
        !          3751: <p>
1.4       cvs      3752: In the presentation schema, the importance of an element is reflected in the
1.18    ! cvs      3753: choice of character size, using the following rules.</p>
        !          3754: <pre>ATTRIBUTES
1.1       cvs      3755:      Importance &lt; 2 :
                   3756:               Size : 1;
                   3757:      Importance IN [2..4] :
                   3758:               Size : Importance;
                   3759:      Importance = 10 :
                   3760:               Size : 5;
                   3761:      Importance > 4 :
1.18    ! cvs      3762:               Size : 4;</pre>
        !          3763: <p>
1.4       cvs      3764: Thus, the character size corresponds to the value of the Importance attribute;
1.18    ! cvs      3765: its value is</p>
        !          3766: <ul>
        !          3767: <li>
        !          3768: the value of the Importance attribute when the value is between 2 and 4
1.1       cvs      3769: (inclusive),
1.18    ! cvs      3770: <li>
        !          3771: 1, when the value of the Importance attribute is less than 2,
        !          3772: <li>
        !          3773: 4, when the value of the Importance attribute is greater than 4,
        !          3774: <li>
        !          3775: 5, when the value of the Importance attribute is 10.
        !          3776: </ul>
        !          3777: <p>
1.4       cvs      3778: The last case (value 5) must be defined before the case which handles all
                   3779: Importance values greater than 4, because the two rules are not disjoint and
                   3780: the first one defined will have priority.  Otherwise, when the Importance
1.18    ! cvs      3781: attribute has value 10, the font size will be 4.</p>
        !          3782: </blockquote>
        !          3783: <blockquote class="example">
        !          3784: <p>
        !          3785: <strong>Example:</strong></p>
        !          3786: <p>
1.3       cvs      3787: Suppose the structure defines a list element which can have an attribute
1.18    ! cvs      3788: defining the type of list (numbered or not):</p>
        !          3789: <pre>STRUCT
1.1       cvs      3790:     list (ATTR list_type = enumeration, dash)
1.18    ! cvs      3791:          = LIST OF (list_item = TEXT);</pre>
        !          3792: <p>
1.4       cvs      3793: Then, the presentation schema could use the attribute placed on the list
                   3794: element to put either a dash or a number before the each element of the
1.18    ! cvs      3795: list:</p>
        !          3796: <pre>ATTRIBUTES
1.1       cvs      3797:    list_type (list_item) = enumeration :
                   3798:         CreateBefore (NumberBox);
                   3799:    list_type (list_item) = dash :
1.18    ! cvs      3800:         CreateBefore (DashBox);</pre>
        !          3801: </blockquote>
        !          3802: <blockquote class="example">
        !          3803: <p>
        !          3804: <strong>Example:</strong></p>
        !          3805: <p>
1.3       cvs      3806: Suppose that two attributes are defined in the structure schema.  The first is
                   3807: a numeric global attribute called ``version''.  The other is a local attribute
1.18    ! cvs      3808: defined on the root of the document called ``Document_version'':</p>
        !          3809: <pre>STRUCTURE Document
1.1       cvs      3810: ATTR
                   3811:     version = INTEGER;
                   3812: STRUCT
                   3813:     Document (ATTR Document_version = INTEGER) =
                   3814:         BEGIN
                   3815:         SomeElement ;
                   3816:         ...
                   3817:         SomeOtherElement ;
                   3818:         END ;
1.18    ! cvs      3819: ...</pre>
        !          3820: <p>
        !          3821: These attributes can be used in the presentation schema to place change bars
        !          3822: in the margin next to elements whose version attribute has a value equal to
        !          3823: the Document_version attribute of the root and to place a star in margin of
1.4       cvs      3824: elements whose version attribute is less than the value of the root's
1.18    ! cvs      3825: Document_version attribute:</p>
        !          3826: <pre>ATTRIBUTES
1.1       cvs      3827:     version EQUAL Document_version :
                   3828:         CreateBefore (ChangeBarBox) ;
                   3829:     version LESS Document_version :
1.18    ! cvs      3830:         CreateBefore (StarBox) ;</pre>
        !          3831: </blockquote>
        !          3832: </div>
1.1       cvs      3833: 
1.18    ! cvs      3834: <div class="subsection">
1.1       cvs      3835: 
1.18    ! cvs      3836: <h3><a name="sectc4212">Value transmission rules</a></h3>
        !          3837: <p>
1.1       cvs      3838: The last section of a presentation schema, which is optional, serves to
                   3839: defines the way in which a document transmits certain values to its
1.18    ! cvs      3840: sub-documents.  A sub-document is an document <a
        !          3841: href="#inclusion">included</a> without expansion or with partial expansion.
1.1       cvs      3842: The primary document can transmit to its sub-documents the values of certain
                   3843: counters or the textual content of certain of its elements, as a function of
1.18    ! cvs      3844: their type.</p>
        !          3845: <p>
1.1       cvs      3846: The sub-documents receive these values in attributes which must be defined in
                   3847: their structure schema as local attributes of the root element.  The types of
                   3848: these attributes must correspond to the type of the value which they receive:
                   3849: numeric attributes for receiving the value of a counter, textual attributes
1.18    ! cvs      3850: for receiving the content of an element.</p>
        !          3851: <p>
1.1       cvs      3852: In the structure schema of the primary document, there appears at the end,
1.18    ! cvs      3853: after the <tt>TRANSMIT</tt> keyword, a sequence of transmission rules.  Each
1.1       cvs      3854: rule begins with the name of the counter to transmit or of the element type
                   3855: whose textual content will be transmitted.  This name is followed by the
1.18    ! cvs      3856: keyword <tt>To</tt> and the name of the attribute of the sub-document to which
1.1       cvs      3857: the value is transmitted.  The sub-document class is indicated between
                   3858: parentheses after the name of the attribute.  The transmission rule ends with
1.18    ! cvs      3859: a semicolon.</p>
        !          3860: <pre>     TransmitSeq   =  Transmit &lt; Transmit > .
1.1       cvs      3861:      Transmit      =  TypeOrCounter 'To' ExternAttr
                   3862:                       '(' ElemID ')' ';' .
                   3863:      TypeOrCounter =  CounterID / ElemID .
1.18    ! cvs      3864:      ExternAttr    =  NAME .</pre>
        !          3865: <blockquote class="example">
        !          3866: <p>
        !          3867: <strong>Example:</strong></p>
        !          3868: <p>
        !          3869: Consider a Book document class which includes instances of the Chapter
        !          3870: document class.  These classes might have the following schemas:</p>
        !          3871: <pre>STRUCTURE Book
1.1       cvs      3872: STRUCT
                   3873:    Book = BEGIN
                   3874:           Title = Text;
                   3875:           Body  = LIST OF (Chapter INCLUDED);
                   3876:           END;
                   3877:    ...
                   3878: 
                   3879: STRUCTURE Chapter
                   3880: STRUCT
                   3881:    Chapter (ATTR FirstPageNum = Integer;
                   3882:                  ChapterNum = Integer;
                   3883:                  CurrentTitle   = Text) =
1.6       cvs      3884:           BEGIN
                   3885:           ChapterTitle = Text;
                   3886:           ...
                   3887:           END;
1.18    ! cvs      3888:    ...</pre>
        !          3889: <p>
1.1       cvs      3890: Then the presentation schema for books could define chapter and page counters.
                   3891: The following transmission rules in the book presentation schema would
                   3892: transmit values for the three attributes defined at the root of each chapter
1.18    ! cvs      3893: sub-document.</p>
        !          3894: <pre>PRESENTATION Book;
1.1       cvs      3895: VIEWS
                   3896:    Full_text;
                   3897: COUNTERS
                   3898:    ChapterCtr: Rank of Chapter;
                   3899:    PageCtr: Rank of Page(Full_text);
                   3900: ...
                   3901: TRANSMIT
                   3902:    PageCtr TO FirstPageNum(Chapter);
                   3903:    ChapterCtr TO ChapterNum(Chapter);
                   3904:    Title TO CurrentTitle(Chapter);
1.18    ! cvs      3905: END</pre>
        !          3906: <p>
1.1       cvs      3907: Thus, each chapter included in a book can number its pages as a function of
                   3908: the number of pages preceding it in the book, can make the chapter's number
                   3909: appear before the number of each of its sections, or can place the title of
1.18    ! cvs      3910: the book at the top of each page.</p>
        !          3911: </blockquote>
        !          3912: </div>
1.1       cvs      3913: 
1.18    ! cvs      3914: <div class="subsection">
1.1       cvs      3915: 
1.18    ! cvs      3916: <h3><a name="sectc4213">Presentation rules</a></h3>
        !          3917: <p>
1.1       cvs      3918: Whether defining the appearance of a presentation or page layout box, an
                   3919: element type, or an attribute value, the set of presentation rules that apply
1.18    ! cvs      3920: is always defined in the same way.</p>
        !          3921: <p>
1.1       cvs      3922: Normally, a set of presentation rules is placed between the keywords
1.18    ! cvs      3923: <tt>BEGIN</tt> and <tt>END</tt>, the keyword <tt>END</tt> being followed by a
1.1       cvs      3924: semicolon.  The first section of this block defines the rules that apply to
1.18    ! cvs      3925: the primary view, if the <a href="#sectc427">default rules</a> are not
1.1       cvs      3926: completely suitable.  Next comes the rules which apply to specific other
                   3927: views, with a rule sequence for each view for which the default rules are not
                   3928: satisfactory.  If the default rules are suitable for the non-primary views,
                   3929: there will not be any specific rules for these views.  If there is only one
1.18    ! cvs      3930: rule which applies to all views then the keywords <tt>BEGIN</tt> and
        !          3931: <tt>END</tt> need not appear.</p>
        !          3932: <p>
1.1       cvs      3933: For each view, it is only necessary to specify those rules which differ from
                   3934: the default rules for the view, so that for certain views (or even all views),
1.18    ! cvs      3935: there may be no specific rules.</p>
        !          3936: <p>
        !          3937: The specific rules for a non-primary view are introduced by the <a
        !          3938: name="inkeyword"><tt>IN</tt> keyword</a>, followed by the view name.  The
        !          3939: rules for that view follow, delimited by the keywords <tt>BEGIN</tt> and
        !          3940: <tt>END</tt>, or without these two keywords when there is only one rule.</p>
        !          3941: <p>
        !          3942: <strong>Note:</strong> the view name which follows the <tt>IN</tt> keyword
1.1       cvs      3943: must not be the name of the primary view, since the rules for that view are
1.18    ! cvs      3944: found before the rules for the other views.</p>
        !          3945: <p>
1.1       cvs      3946: Within each block concerning a view, other blocks can appear, delimited by the
1.18    ! cvs      3947: same keywords <tt>BEGIN</tt> and <tt>END</tt>.  Each of these blocks gathers
1.1       cvs      3948: the presentation rules that apply, for a given view, only when a given
                   3949: condition is satisfied.  Each block is preceded by a condition introduced by
1.18    ! cvs      3950: the <tt>IF</tt> keyword.  If such a conditional block contains only one rule,
        !          3951: the keywords <tt>BEGIN</tt> and <tt>END</tt> can be omitted.</p>
        !          3952: <p>
1.1       cvs      3953: Although the syntax allows any presentation rule to appear in a conditional
1.18    ! cvs      3954: block, only <a href="#sectc4232">creation rules</a> are allowed after any
        !          3955: condition; other rules are allowed only after conditions <tt>Within</tt> and
1.1       cvs      3956: ElemID.  In addition, the following rules cannot be conditional:
1.18    ! cvs      3957: <tt>PageBreak, LineBreak, Inline, Gather</tt>.</p>
        !          3958: <p>
1.1       cvs      3959: For a given view, the rules that apply without any condition must appear
                   3960: before the first conditional block.  If some rules apply only when none of the
                   3961: specified condition holds, they are grouped in a block preceded by the keyword
1.18    ! cvs      3962: <tt>Otherwise</tt>, and that block must appear after the last conditionnal
        !          3963: block concerning the same view.</p>
        !          3964: <pre>     ViewRuleSeq  = 'BEGIN' &lt; RulesAndCond > &lt; ViewRules >
1.1       cvs      3965:                     'END' ';' /
                   3966:                     ViewRules / CondRules / Rule .
                   3967:      RulesAndCond = CondRules / Rule .
                   3968:      ViewRules    = 'IN' ViewID CondRuleSeq .
                   3969:      CondRuleSeq  = 'BEGIN' &lt; RulesAndCond > 'END' ';' /
                   3970:                     CondRules / Rule .
                   3971:      CondRules    = CondRule &lt; CondRule >
                   3972:                     [ 'Otherwise' RuleSeq ] .
                   3973:      CondRule     = 'IF' ConditionSeq RuleSeq .
                   3974:      RulesSeq     = 'BEGIN' Rule &lt; Rule > 'END' ';' /
1.18    ! cvs      3975:                     Rule .</pre>
        !          3976: <blockquote class="example">
        !          3977: <p>
        !          3978: <strong>Example:</strong></p>
        !          3979: <p>
1.3       cvs      3980: The following rules for a report's title make the title visible in the primary
                   3981: view and invisible in the table of contents and in the formula views (see the
1.18    ! cvs      3982: <a href="#sectc4224"><tt>Visibility</tt> rule</a>).</p>
        !          3983: <pre>Title : BEGIN
1.1       cvs      3984:         Visibility : 1;
                   3985:         ...    {Other rules for the primary view}
                   3986:         IN Table_of_contents
                   3987:            Visibility : 0;
                   3988:         IN Formulas
                   3989:            Visibility : 0;
1.18    ! cvs      3990:         END;</pre>
        !          3991: </blockquote>
        !          3992: </div>
1.1       cvs      3993: 
1.18    ! cvs      3994: <div class="subsection">
1.1       cvs      3995: 
1.18    ! cvs      3996: <h3><a name="sectc4214">Conditions applying to presentation rules</a></h3>
        !          3997: <p>
1.1       cvs      3998: Many conditions can be applied to presentation rules.  Conditions allow
                   3999: certain presentation rules to apply only in certain cases.  These conditions
                   4000: can be based on the structural position of the element.  They can be based on
                   4001: whether the element has references, and what type of references, whether the
                   4002: element has attributes, whether the element is empty or not.  They can also be
1.18    ! cvs      4003: based on the value of a counter.</p>
        !          4004: <p>
1.1       cvs      4005: It is possible to specify several conditions which must all be true for the
1.18    ! cvs      4006: rules to apply.</p>
        !          4007: <p>
        !          4008: A set of conditions is specified by the <tt>IF</tt> keyword.  This keyword is
        !          4009: followed by the sequence of conditions, separated by the <tt>AND</tt> keyword.
1.1       cvs      4010: Each condition is specified by a keyword which defines the condition type. In
                   4011: some cases, the keyword is followed by other data, which specify the condition
1.18    ! cvs      4012: more precisely.</p>
        !          4013: <p>
1.1       cvs      4014: An elementary condition can be negative; it is then preceded by the
1.18    ! cvs      4015: <tt>NOT</tt> keyword.</p>
        !          4016: <p>
1.1       cvs      4017: When the presentation rule(s) controlled by the condition apply to a reference
                   4018: element or a reference attribute, an elementary condition can also apply to
1.18    ! cvs      4019: element referred by this reference.  The <tt>Target</tt> keyword is used for
1.1       cvs      4020: that purpose.  It must appear before the keyword defining the condition
1.18    ! cvs      4021: type.</p>
        !          4022: <pre>     CondRule      ='IF' ConditionSeq RuleSeq .
1.1       cvs      4023:      ConditionSeq  = Condition &lt; 'AND' Condition > .
                   4024:      Condition     = [ 'NOT' ] [ 'Target' ] ConditionElem .
                   4025:      ConditionElem ='First' / 'Last' /
                   4026:                      [ 'Immediately' ] 'Within' [ NumParent ]
                   4027:                                        ElemID [ ExtStruct ] /
                   4028:                      ElemID /
                   4029:                     'Referred' / 'FirstRef' / 'LastRef' /
                   4030:                     'ExternalRef' / 'InternalRef' / 'CopyRef' /
                   4031:                     'AnyAttributes' / 'FirstAttr' / 'LastAttr' /
                   4032:                     'UserPage' / 'StartPage' / 'ComputedPage' /
                   4033:                     'Empty' /
                   4034:                     '(' [ MinMax ] CounterName CounterCond ')' /
                   4035:                      CondPage '(' CounterID ')' .
                   4036:      NumParent     = [ GreaterLess ] NParent .
1.6       cvs      4037:      GreaterLess   ='>' / '&lt;' .
1.1       cvs      4038:      NParent       = NUMBER.
1.6       cvs      4039:      ExtStruct     ='(' ElemID ')' .
1.1       cvs      4040:      CounterCond   ='&lt;' MaxCtrVal / '>' MinCtrVal /
                   4041:                     '=' EqCtrVal / 
                   4042:                     'IN' '[' ['-'] MinCtrBound '.' '.'
                   4043:                      ['-'] MaxCtrBound ']' .
                   4044:      PageCond      ='Even' / 'Odd' / 'One' .
                   4045:      MaxCtrVal     = NUMBER .
                   4046:      MinCtrVal     = NUMBER .
                   4047:      EqCtrVal      = NUMBER .
                   4048:      MaxCtrBound   = NUMBER .
1.18    ! cvs      4049:      MinCtrBound   = NUMBER .</pre>
1.1       cvs      4050: 
1.18    ! cvs      4051: <div class="subsubsection">
1.1       cvs      4052: 
1.18    ! cvs      4053: <h4><a name="sectd42141">Conditions based on the logical position of the
        !          4054: element</a></h4>
        !          4055: <p>
1.1       cvs      4056: The condition can be on the position of the element in the document's logical
                   4057: structure tree.  It is possible to test whether the element is the first
1.18    ! cvs      4058: (<tt>First</tt>) or last (<tt>Last</tt>) among its siblings or if it is not
        !          4059: the first (<tt>NOT First</tt>) or not the last (<tt>NOT Last</tt>). These
        !          4060: conditions can be associated only with <a href="#sectc4232">creation
        !          4061: rules</a>.</p>
        !          4062: <p>
1.1       cvs      4063: It is also possible to test if the element is contained in an element of a
1.18    ! cvs      4064: given type (<tt>Within</tt>) or if it is not (<tt>NOT Within</tt>). The type
        !          4065: is indicated after the keyword <tt>Within</tt>. If that element type is
1.1       cvs      4066: defined in a structure schema which is not the one which corresponds to the
                   4067: presentation schema, the type name of this element must be followed, between
1.18    ! cvs      4068: parentheses, by the name of the structure schema which defines it.</p>
        !          4069: <p>
        !          4070: If the keyword <tt>Within</tt> is preceded by <tt>Immediately</tt>, the
        !          4071: condition is satisfied only if the <em>parent</em> element has the type
        !          4072: indicated. If the word <tt>Immediately</tt> is missing, the condition is
        !          4073: satisfied if any <em>ancestor</em> has the type indicated.</p>
        !          4074: <p>
        !          4075: An integer <i>n</i> can appear between the keyword <tt>Within</tt> and the
1.1       cvs      4076: type.  It specifies the number of ancestors of the indicated type that must be
                   4077: present for the condition to be satisfied.  If the keyword
1.18    ! cvs      4078: <tt>Immediately</tt> is also present, the <i>n</i> immediate ancestors of the
        !          4079: element must have the indicated type.  The integer <i>n</i> must be positive
        !          4080: or zero.  It can be preceded by <tt>&lt;</tt> or <tt>></tt> to indicate a
1.1       cvs      4081: maximum or minimum number of ancestors.  If these symbols are missing, the
1.18    ! cvs      4082: condition is satisfied only if it exists exactly <i>n</i> ancestors.  When
        !          4083: this number is missing, it is equivalent to > 0.</p>
        !          4084: <p>
1.1       cvs      4085: If the condition applies to presentation rules associated with an attribute,
1.18    ! cvs      4086: in the <tt>ATTRIBUTES</tt> section of the presentation schema, the condition
1.1       cvs      4087: can be simply an element name. Presentation rules are then executed only if
1.18    ! cvs      4088: the attribute is attached to an element of that type. The keyword <tt>NOT</tt>
1.1       cvs      4089: before the element name indicates that the presentation rules must be executed
1.18    ! cvs      4090: only if the element is not of the type indicated.</p>
        !          4091: </div>
1.1       cvs      4092: 
1.18    ! cvs      4093: <div class="subsubsection">
1.1       cvs      4094: 
1.18    ! cvs      4095: <h4><a name="sectd42142">Conditions on references</a></h4>
        !          4096: <p>
1.1       cvs      4097: References may be taken into account in conditions, which can be based on the
                   4098: fact that the element, or one of its ancestors, is designated by a at least
1.18    ! cvs      4099: one reference (<tt>Referred</tt>) or by none (<tt>NOT Referred</tt>).</p>
        !          4100: <p>
1.1       cvs      4101: If the element or attribute to which the condition is attached is a reference,
                   4102: the condition can be based on the fact that it acts as the first reference to
1.18    ! cvs      4103: the designated element (<tt>FirstRef</tt>), or as the last (<tt>LastRef</tt>),
1.1       cvs      4104: or as a reference to an element located in another document
1.18    ! cvs      4105: (<tt>ExternalRef</tt>) or in the same document (<tt>InternalRef</tt>).</p>
        !          4106: <p>
        !          4107: The condition can also be based on the fact that the element is an <a
        !          4108: href="#inclusion">inclusion</a>.  This is noted (<tt>CopyRef</tt>).</p>
        !          4109: <p>
1.1       cvs      4110: Like all conditions, conditions on references can be inverted by the
1.18    ! cvs      4111: <tt>NOT</tt> keyword. These conditions can be associated only with <a
        !          4112: href="#sectc4232">creation rules</a>.</p>
        !          4113: </div>
1.1       cvs      4114: 
1.18    ! cvs      4115: <div class="subsubsection">
1.1       cvs      4116: 
1.18    ! cvs      4117: <h4><a name="sectd42143">Conditions on logical attributes</a></h4>
        !          4118: <p>
1.1       cvs      4119: The condition can be based on the presence or absence of attributes associated
                   4120: with the element, no matter what the attributes or their values. The
1.18    ! cvs      4121: <tt>AnyAttributes</tt> keyword expresses this condition.</p>
        !          4122: <p>
1.1       cvs      4123: If the condition appears in the presentation rules of an attribute, the
1.18    ! cvs      4124: <tt>FirstAttr</tt> and <tt>LastAttr</tt> keywords can be used to indicate that
1.1       cvs      4125: the rules must only be applied if this attribute is the first attribute for
                   4126: the element or if it is the last (respectively).  These conditions can also be
1.18    ! cvs      4127: inverted by the <tt>NOT</tt> keyword. These conditions can be associated only
        !          4128: with <a href="#sectc4232">creation rules</a>.</p>
        !          4129: <p>
1.1       cvs      4130: It is also possible to apply certain presentation rules only when the element
                   4131: being processed or one of its ancestors has a certain attribute, perhaps with
1.18    ! cvs      4132: a certain value.  This can be done in the <a
        !          4133: href="#sectc4210"><tt>ATTRIBUTES</tt> section</a>.</p>
        !          4134: </div>
1.1       cvs      4135: 
1.18    ! cvs      4136: <div class="subsubsection">
1.1       cvs      4137: 
1.18    ! cvs      4138: <h4><a name="sectd42144">Conditions on page breaks</a></h4>
        !          4139: <p>
1.1       cvs      4140: The page break base type (and only this type) can use the following
1.18    ! cvs      4141: conditions: <tt>ComputedPage</tt>, <tt>StartPage</tt>, and <tt>UserPage</tt>.
        !          4142: The <tt>ComputedPage</tt> condition indicates that the presentation rule(s)
1.1       cvs      4143: should apply if the page break was created automatically by Thot;  the
1.18    ! cvs      4144: <tt>StartPage</tt> condition is true if the page break is generated before the
        !          4145: element by the <tt>Page</tt> rule; and the <tt>UserPage</tt> condition applies
        !          4146: if the page break was inserted by the user.</p>
        !          4147: <p>
        !          4148: These conditions can be associated only with <a href="#sectc4232">creation
        !          4149: rules</a>.</p>
        !          4150: </div>
1.1       cvs      4151: 
1.18    ! cvs      4152: <div class="subsubsection">
1.1       cvs      4153: 
1.18    ! cvs      4154: <h4><a name="sectd42145">Conditions on the element's content</a></h4>
        !          4155: <p>
1.1       cvs      4156: The condition can be based on whether or not the element is empty.  An element
                   4157: which has no children or whose leaves are all empty is considered to be empty
1.18    ! cvs      4158: itself.  This condition is expressed by the <tt>Empty</tt> keyword, optionally
        !          4159: preceded by the <tt>NOT</tt> keyword. This condition can be associated only
        !          4160: with <a href="#sectc4232">creation rules</a>.</p>
        !          4161: </div>
1.1       cvs      4162: 
1.18    ! cvs      4163: <div class="subsubsection">
1.1       cvs      4164: 
1.18    ! cvs      4165: <h4><a name="sectd42146">Conditions on counters</a></h4>
        !          4166: <p>
1.1       cvs      4167: Presentation rules can apply when the counter's value is one, is even or odd,
                   4168: is equal, greater than or less than a given value or falls in a range of
                   4169: values.  This is particularly useful for creating header and footer boxes.
1.18    ! cvs      4170: These conditions can be associated only with <a href="#sectc4232">creation
        !          4171: rules</a>.</p>
        !          4172: <p>
1.1       cvs      4173: To compare the value of a counter to a given value, a comparison is given
                   4174: between parentheses. The comparison is composed of the counter name followed
                   4175: by an equals, greater than, or less than sign and the value to which the
                   4176: counter will be compared.  A test for whether or not a counter's value falls
                   4177: in a range also appears within parentheses.  In this case, the counter name is
1.18    ! cvs      4178: followed by the <tt>IN</tt> keyword and the range definition within brackets.
        !          4179: The <tt>Even</tt>, <tt>Odd</tt> and <tt>One</tt> are used to test a counter's
        !          4180: value and are followed by the counter name between parentheses.</p>
        !          4181: <p>
        !          4182: The list of possible conditions on counters is:</p>
        !          4183: <dl>
        !          4184: <dt><tt>Even (Counter)</tt></dt>
        !          4185: <dd>
        !          4186: the box is created only if the counter has an even value.
        !          4187: </dd>
        !          4188: <dt><tt>Odd (Counter)</tt></dt>
        !          4189: <dd>
        !          4190: the box is created only if the counter has an odd value.
        !          4191: </dd>
        !          4192: <dt><tt>One (Counter)</tt></dt>
        !          4193: <dd>
        !          4194: the box is created only the counter's value is 1.
        !          4195: </dd>
        !          4196: <dt><tt>NOT One (Counter)</tt></dt>
        !          4197: <dd>
        !          4198: the box is created, unless the counter's value is 1.
        !          4199: </dd>
        !          4200: <dt><tt>(Counter &lt; Value)</tt></dt>
        !          4201: <dd>
        !          4202: the box is created only if the counter's value is less than Value.
        !          4203: </dd>
        !          4204: <dt><tt>(Counter > Value)</tt></dt>
        !          4205: <dd>
        !          4206: the box is created only if the counter's value is greater than Value.
        !          4207: </dd>
        !          4208: <dt><tt>(Counter = Value)</tt></dt>
        !          4209: <dd>
        !          4210: the box is created only if the counter's value is equal to Value.
        !          4211: </dd>
        !          4212: <dt><tt>NOT (Counter = Value)</tt></dt>
        !          4213: <dd>
        !          4214: the is created only if the counter's value is different than Value.
        !          4215: </dd>
        !          4216: <dt><tt>(Counter IN [MinValue..MaxValue])</tt></dt>
        !          4217: <dd>
        !          4218: the box is created only if the counter's value falls in the range bounded by
        !          4219: MinValue and MaxValue (inclusive).
        !          4220: </dd>
        !          4221: <dt><tt>NOT (Counter IN [MinValue..MaxValue])</tt></dt>
        !          4222: <dd>
        !          4223: the box is created only if the value of the counter does not fall in the range
        !          4224: bounded by MinValue and MaxValue (inclusive).
        !          4225: </dd>
        !          4226: </dl>
        !          4227: <p>
        !          4228: <strong>Note:</strong> the <tt>NOT Even</tt> and <tt>NOT Odd</tt> conditions
        !          4229: are syntactically correct but can be expressed more simply by <tt>Odd</tt> and
        !          4230: <tt>Even</tt>, respectively.</p>
        !          4231: </div>
        !          4232: </div>
1.1       cvs      4233: 
1.18    ! cvs      4234: <div class="subsection">
1.1       cvs      4235: 
1.18    ! cvs      4236: <h3><a name="sectc4215">A presentation rule</a></h3>
        !          4237: <p>
1.1       cvs      4238: A presentation rule defines either a presentation parameter or presentation
1.18    ! cvs      4239: function.  The parameters are:</p>
        !          4240: <ul>
        !          4241: <li>
        !          4242: the position of the vertical and horizontal reference axes of the box,
        !          4243: <li>
        !          4244: the position of the box in relation to other boxes,
        !          4245: <li>
        !          4246: the height or width of the box, with overflow exceptions,
        !          4247: <li>
        !          4248: the characteristics of the lines contained in the box: linespacing,
1.1       cvs      4249: indentation of the first line, justification, hyphenation,
1.18    ! cvs      4250: <li>
        !          4251: the conditions for breaking the box across pages,
        !          4252: <li>
        !          4253: the characteristics of the characters contained in the box: size, font, style,
        !          4254: underlining,
        !          4255: <li>
        !          4256: the depth of the box among overlapping boxes (often called stacking order),
        !          4257: <li>
        !          4258: the characteristics of graphic elements contained in the box: style and
1.1       cvs      4259: thickness of lines, fill pattern for closed objects,
1.18    ! cvs      4260: <li>
        !          4261: the colors in text, graphics, pictures, and symbols contained in the box are
        !          4262: displayed or printed,
        !          4263: <li>
        !          4264: for presentation boxes only, the contents of the box.
        !          4265: </ul>
        !          4266: <p>
        !          4267: The <a name="presfunct">presentation functions</a> are:</p>
        !          4268: <ul>
        !          4269: <li>
        !          4270: the creation of a presentation box
        !          4271: <li>
        !          4272: the line-breaking or page-breaking style,
        !          4273: <li>
        !          4274: the copying of another box,
        !          4275: <li>
        !          4276: the display of the box background and border,
        !          4277: <li>
        !          4278: the display of a background picture and its aspect.
        !          4279: </ul>
        !          4280: <p>
1.1       cvs      4281: For each box and each view, every presentation parameter is defined once and
1.18    ! cvs      4282: only once, either explicitly or by the <a href="#sectc427">default rules</a>.
        !          4283: In contrast, presentation functions are not obligatory and can appear many
        !          4284: times for the same element.  for example an element can create many
        !          4285: presentation boxes.  Another element may not use any presentation
        !          4286: functions.</p>
        !          4287: <p>
1.1       cvs      4288: Each rule defining a presentation parameter begins with a keyword followed by
1.18    ! cvs      4289: a colon.  The keyword indicates the parameter which is the subject of the
        !          4290: rule. After the keyword and the colon, the remainder of the rule varies.  All
        !          4291: rules are terminated by a semicolon.</p>
        !          4292: <pre>     Rule      = PresParam ';' / PresFunc ';' .
1.6       cvs      4293:      PresParam ='VertRef' ':'       PositionHoriz /
                   4294:                 'HorizRef' ':'      PositionVert /
                   4295:                 'VertPos' ':'       VPos /
                   4296:                 'HorizPos' ':'      HPos /
                   4297:                 'Height' ':'        Dimension /
                   4298:                 'Width' ':'         Dimension /
                   4299:                 'VertOverflow' ':'  Boolean /
1.1       cvs      4300:                 'HorizOverflow' ':' Boolean /
1.6       cvs      4301:                 'LineSpacing' ':'   DistanceInherit /
                   4302:                 'Indent' ':'        DistanceInherit /
                   4303:                 'Adjust' ':'        AdjustInherit /
                   4304:                 'Justify' ':'       BoolInherit /
                   4305:                 'Hyphenate' ':'     BoolInherit /
                   4306:                 'PageBreak' ':'     Boolean /
                   4307:                 'LineBreak' ':'     Boolean /
                   4308:                 'InLine' ':'        Boolean /
                   4309:                 'NoBreak1' ':'      AbsDist /
                   4310:                 'NoBreak2' ':'      AbsDist /
                   4311:                 'Gather' ':'        Boolean /
                   4312:                 'Visibility' ':'    NumberInherit /
                   4313:                 'Size'  ':'         SizeInherit /
                   4314:                 'Font' ':'          NameInherit /
                   4315:                 'Style' ':'         StyleInherit /
                   4316:                 'Underline' ':'     UnderLineInherit /
                   4317:                 'Thickness' ':'     ThicknessInherit /
                   4318:                 'Depth' ':'         NumberInherit /
                   4319:                 'LineStyle' ':'     LineStyleInherit /
                   4320:                 'LineWeight' ':'    DistanceInherit /
                   4321:                 'FillPattern' ':'   NameInherit /
                   4322:                 'Background' ':'    NameInherit /
1.13      cvs      4323:                 'Foreground' ':'    NameInherit /
1.6       cvs      4324:                 'Content' ':'       VarConst .
1.1       cvs      4325:      PresFunc = Creation '(' BoxID ')' /
                   4326:                 'Line' /
                   4327:                 'NoLine' /
                   4328:                 'Page' '(' BoxID ')' /
1.13      cvs      4329:                 'Copy' '(' BoxTypeToCopy ')' /
                   4330:                 'ShowBox' /
1.18    ! cvs      4331:                 'BackgroundPicture' ':' FileName /
        !          4332:                 'PictureMode' ':'   PictMode /</pre>
        !          4333: </div>
        !          4334: 
        !          4335: <div class="subsection">
        !          4336: 
        !          4337: <h3><a name="sectc4216">Box axes</a></h3>
        !          4338: <p>
        !          4339: The position of the middle axes <tt>VMiddle</tt> and <tt>HMiddle</tt> in
1.1       cvs      4340: relation to their box is always calculated automatically as a function of the
                   4341: height and width of the box and is not specified by the presentation rules. In
                   4342: the presentation schema, these middle axes are used only to position their box
                   4343: with respect to another by specifying the distance between the middle axis and
1.18    ! cvs      4344: an axis or a side of another box (see the <a href="#sectc4218">relative
        !          4345: position</a>).</p>
        !          4346: <p>
1.1       cvs      4347: The reference axes of a box are also used to position their box in relation to
                   4348: another, but in contrast to the middle axes, the presentation schema must make
                   4349: their position explicit, either in relation to a side or the middle axis of
1.18    ! cvs      4350: the box itself, or in relation to an axis of an enclosed box.</p>
        !          4351: <p>
1.1       cvs      4352: Only boxes of base elements have predefined reference axes.  For character
                   4353: string boxes, the horizontal reference axis is the baseline of the characters
                   4354: (the line which passes immediately under the upper-case letters, ignoring the
                   4355: letter Q) and the vertical reference axis is at the left edge of the first
1.18    ! cvs      4356: character of the string.</p>
        !          4357: <p>
        !          4358: The positions of a box's reference axes are defined by the <tt>VertRef</tt>
        !          4359: and <tt>HorizRef</tt> rules which specify the <a href="#distance">distance</a>
1.1       cvs      4360: between the reference axis and an axis or parallel side of the same box or of
1.18    ! cvs      4361: an enclosed box.</p>
        !          4362: <pre>               'VertRef'  ':' PositionHoriz
        !          4363:                'HorizRef' ':' PositionVert</pre>
        !          4364: <blockquote class="example">
        !          4365: <p>
        !          4366: <strong>Example:</strong></p>
        !          4367: <p>
1.3       cvs      4368: If, in the structure schema for mathematical formulas, the fraction element is
1.18    ! cvs      4369: defined by</p>
        !          4370: <pre>Fraction = BEGIN
1.1       cvs      4371:            Numerator   = Expression;
                   4372:            Denominator = Expression;
1.18    ! cvs      4373:            END;</pre>
        !          4374: <p>
1.3       cvs      4375: then the horizontal reference axis of the fraction can be positioned on top of
1.18    ! cvs      4376: the denominator by the rule:</p>
        !          4377: <pre>Fraction :
1.1       cvs      4378:      BEGIN
                   4379:      HorizRef : Enclosed Denominator . Top;
                   4380:      ...
1.18    ! cvs      4381:      END;</pre>
        !          4382: <p>
        !          4383: To put the horizontal reference axis of a column at its middle:</p>
        !          4384: <pre>Column :
1.1       cvs      4385:      BEGIN
                   4386:      HorizRef : * . HMiddle;
                   4387:      ...
1.18    ! cvs      4388:      END;</pre>
        !          4389: </blockquote>
        !          4390: </div>
1.1       cvs      4391: 
1.18    ! cvs      4392: <div class="subsection">
1.1       cvs      4393: 
1.18    ! cvs      4394: <h3><a name="sectc4217">Distance units</a></h3>
        !          4395: <p>
1.1       cvs      4396: Some distances and dimensions appear in many rules of a presentation schema,
1.18    ! cvs      4397: especially in position rules (<tt>VertPos, HorizPos</tt>), in extent rules for
        !          4398: boxes (<tt>Height, Width</tt>), in rules defining lines (<tt>LineSpacing,
        !          4399: Indent</tt>), in rules controlling pagination (<tt>NoBreak1, NoBreak2</tt>)
        !          4400: and in rules specifying the thickness of strokes (<tt>LineWeight</tt>).</p>
        !          4401: <p>
        !          4402: In all these rules, the distance or extent can be expressed</p>
        !          4403: <ul>
        !          4404: <li>
        !          4405: either in relative units, which depend on the size of the characters in the
        !          4406: current font: height of the element's font or height of the letter 'x',
        !          4407: <li>
        !          4408: or in absolute units: centimeter, millimeter, inch, typographer's point, pica
        !          4409: or pixel.
        !          4410: </ul>
        !          4411: <p>
1.5       cvs      4412: Units can be chosen freely.  Thus, it is possible to use relative units in one
1.18    ! cvs      4413: rule, centimeters in the next rule, and typographer's points in another.</p>
        !          4414: <p>
1.1       cvs      4415: Absolute units are used to set rigid rules for the appearance of documents. In
                   4416: contrast, relative units allow changes of scale.  The editor lets the value of
                   4417: relative units be changed dynamically.  Such changes affect every box using
                   4418: relative units simultaneously and in the same proportion. Changing the value
                   4419: of the relative units affects the size of the characters and graphical
1.18    ! cvs      4420: elements, and the size of the boxes and the distances between them.</p>
        !          4421: <p>
        !          4422: A <a name="distance">distance</a> or extent is specified by a number, which
1.1       cvs      4423: may be followed by one or more spaces and a units keyword.  When there is no
                   4424: units keyword, the number specifies the number of relative units, where a
                   4425: relative unit is the height of a character in the current font (an em).  When
                   4426: the number is followed by a units keyword, the keyword indicates the type of
1.18    ! cvs      4427: absolute units:</p>
        !          4428: <ul>
        !          4429: <li>
        !          4430: <tt>em</tt>: height of the element's font,
        !          4431: <li>
        !          4432: <tt>ex</tt>: height of the letter 'x',
        !          4433: <li>
        !          4434: <tt>cm</tt>: centimeter,
        !          4435: <li>
        !          4436: <tt>mm</tt>: millimeter,
        !          4437: <li>
        !          4438: <tt>in</tt>: inch (1 in = 2.54 cm),
        !          4439: <li>
        !          4440: <tt>pt</tt>: point (1 pt = 1/72 in),
        !          4441: <li>
        !          4442: <tt>pc</tt>: pica (1 pc = 12 pt),
        !          4443: <li>
        !          4444: <tt>px</tt>: pixel.
        !          4445: </ul>
        !          4446: <p>
1.1       cvs      4447: Whatever the chosen unit, relative or absolute, the number is not necessarily
                   4448: an integer and may be expressed in fixed point notation (using the American
1.18    ! cvs      4449: convention of a period to express the decimal point).</p>
        !          4450: <p>
1.1       cvs      4451: If the distance appears in a presentation rule for a numeric attribute, the
                   4452: number can be replaced by the name of an attribute.  In this case, the value
                   4453: of the attribute is used.  Obviously, the attribute name cannot be followed by
                   4454: a decimal point and a fractional part, but it can be followed a units keyword.
1.18    ! cvs      4455: However, the choice of units is limited to em, ex, pt and px.</p>
        !          4456: <pre>     Distance      = [ Sign ] AbsDist .
1.1       cvs      4457:      Sign          ='+' / '-' .
                   4458:      AbsDist       = IntegerOrAttr [ '.' DecimalPart ]
                   4459:                      [ Unit ].
                   4460:      IntegerOrAttr = IntegerPart / AttrID .
                   4461:      IntegerPart   = NUMBER .
                   4462:      DecimalPart   = NUMBER .
                   4463:      Unit          ='em' / 'ex' / 'cm' / 'mm' / 'in' / 'pt' /
1.18    ! cvs      4464:                     'pc' / 'px' / '%' .</pre>
        !          4465: <blockquote class="example">
        !          4466: <p>
        !          4467: <strong>Example:</strong></p>
        !          4468: <p>
1.3       cvs      4469: The following rules specify that a box has a height of 10.5 centimeters and a
1.18    ! cvs      4470: width of 5.3 ems:</p>
        !          4471: <pre>Height : 10.5 cm;
        !          4472: Width  : 5.3;</pre>
        !          4473: </blockquote>
        !          4474: </div>
1.1       cvs      4475: 
1.18    ! cvs      4476: <div class="subsection">
1.1       cvs      4477: 
1.18    ! cvs      4478: <h3><a name="sectc4218">Relative positions</a></h3>
        !          4479: <p>
1.1       cvs      4480: The positioning of boxes uses the eight axes and sides, the sides generally
                   4481: being used to define the juxtapositioning (vertical or horizontal) of boxes,
                   4482: the middle axes being used to define centering, and the reference axes being
1.18    ! cvs      4483: used for alignment.</p>
        !          4484: <p>
        !          4485: Two rules allow a box to be placed relative to other boxes.  The
        !          4486: <tt>VertPos</tt> rule positions the box vertically.  The <tt>HorizPos</tt>
        !          4487: rule positions the box horizontally.  It is possible that a box's position
        !          4488: could be entirely determined by other boxes positioned relative to it. In this
        !          4489: case, the position is implicit and the word <tt>nil</tt> can be used to
        !          4490: specify that no position rule is needed.  Otherwise, an explicit rule must be
        !          4491: given by indicating the axis or side which defines the position of the box,
        !          4492: followed by an equals sign and the distance between between this axis or side
        !          4493: and a parallel axis or side of another box, called the reference box.  The box
        !          4494: for which the rule is written will be positioned relative to the reference
        !          4495: box.</p>
        !          4496: <pre>                 'VertPos' ':' VPos
1.6       cvs      4497:                  'HorizPos' ':' HPos
                   4498:      HPos      = 'nil' / VertAxis '=' HorizPosition
                   4499:                  [ 'UserSpecified' ].
                   4500:      VPos      = 'nil' / HorizAxis '=' VertPosition
                   4501:                  [ 'UserSpecified' ].
1.1       cvs      4502:      VertAxis  = 'Left' / 'VMiddle' / 'VRef' / 'Right' .
1.18    ! cvs      4503:      HorizAxis = 'Top' / 'HMiddle' / 'HRef' / 'Bottom' .</pre>
        !          4504: <p>
1.1       cvs      4505: The reference box is an adjacent box: enclosing, enclosed or adjacent. When a
                   4506: rule is associated with a reference type attribute (and only in this case), it
                   4507: can be a box of the element designated by the attribute.  The reference box
1.18    ! cvs      4508: can be either a presentation box previously defined in the <tt>BOXES</tt>
1.1       cvs      4509: section of the schema and created by a creation function, or the box
1.18    ! cvs      4510: associated with a structured element.</p>
        !          4511: <p>
1.1       cvs      4512: The structural position of the reference box (relative to the box for which
1.18    ! cvs      4513: the rule is being written) is indicated by a keyword: <tt>Enclosing</tt>,
        !          4514: <tt>Enclosed</tt>, or, for sibling boxes, <tt>Previous</tt> or <tt>Next</tt>.
1.1       cvs      4515: The reference attributes, or presentation boxes created by a reference
1.18    ! cvs      4516: attribute, the <tt>Referred</tt> keyword may be used to designate the element
        !          4517: which the reference points to.  The keyword <tt>Creator</tt> can be used in
1.1       cvs      4518: rules for presentation boxes to designate the box of the element which created
1.18    ! cvs      4519: the presentation box.  Finally, the <tt>Root</tt> keyword can be used to
        !          4520: designate the root of the document.</p>
        !          4521: <p>
        !          4522: When the keyword is ambiguous, it is followed by the name of an element type
        !          4523: or presentation box which resolves the ambiguity (the <tt>Creator</tt> and
        !          4524: <tt>Root</tt> keywords are never ambiguous).  If this name is not given, then
1.1       cvs      4525: the first box encountered is used as the reference box. It is also possible to
1.18    ! cvs      4526: use just the name of an element type or presentation box without an initial
        !          4527: keyword. In this case, a sibling having that name will be used.  If the name
        !          4528: is preceded by the keyword <tt>NOT</tt>, then the reference box will be the
        !          4529: first box whose type is not the named one.</p>
        !          4530: <p>
        !          4531: In place of the box or type name, the keywords <tt>AnyElem</tt>,
        !          4532: <tt>AnyBox</tt> and <tt>ElemWithAttr</tt> can be used, representing
1.17      cvs      4533: respectively, any structured element box, any presentation box, and the box
                   4534: corresponding to any structured element having a particular attribute,
                   4535: whatever its value; the name of this attribute must follow the keyword
1.18    ! cvs      4536: <tt>ElemWithAttr</tt>.</p>
        !          4537: <p>
1.17      cvs      4538: A type name may be preceded by a star in order to resolve the ambiguity in the
1.18    ! cvs      4539: special case where the structure schema defines an <a
        !          4540: href="#sectd3284">inclusion</a> without expansion (or with partial expansion)
        !          4541: of the same type as an element of the scheme.  For mark pairs (and only for <a
        !          4542: href="#sectd3285">mark pairs</a>) the type name <em>must</em> be preceded by
        !          4543: the <tt>First</tt> or <tt>Second</tt> keyword, which indicates which of the
        !          4544: two marks of the pair  should be used as the reference box.</p>
        !          4545: <p>
        !          4546: The star character ('<tt>*</tt>') used alone designates the box to which the
1.1       cvs      4547: rule applies (in this case, it is obviously useless to specify the type of the
1.18    ! cvs      4548: reference box).</p>
        !          4549: <p>
        !          4550: The keywords <tt>Enclosing</tt> and <tt>Enclosed</tt> can be used no matter
1.1       cvs      4551: what constructor defines the type to which the rule applies.  When applied to
1.18    ! cvs      4552: the element which represents the entire document, <tt>Enclosing</tt>
1.1       cvs      4553: designates the window or page in which the document's image is displayed for
                   4554: the view to which the rule applies.  A box or type name without a keyword is
                   4555: used for aggregate elements and designates another element of the same
                   4556: aggregate.  It can also be used to designate a presentation or page layout
1.18    ! cvs      4557: box.  The keywords <tt>Previous</tt> and <tt>Next</tt> are primarily used to
1.1       cvs      4558: denote list elements, but can also be used to denote elements of an
1.18    ! cvs      4559: aggregate.</p>
        !          4560: <p>
1.1       cvs      4561: In the position rule, the structural position relative to the reference box is
                   4562: followed, after a period, by the name of an axis or side.  The rule specifies
                   4563: its node's position as being some distance from this axis or side of the
                   4564: reference box.  If this distance is zero, then the distance does not appear in
                   4565: the rule.  Otherwise, it does appear as a positive or negative number (the
                   4566: sign is required for negative numbers). The sign takes into account the
                   4567: orientation of the coordinate axes: for top to bottom for the vertical axis
                   4568: and from left to right for the horizontal axis.  Thus, a negative distance in
                   4569: a vertical position indicates that the side or axis specified in the rule is
1.18    ! cvs      4570: above the side or axis of the reference box.</p>
        !          4571: <p>
        !          4572: The distance can be followed by the <tt>UserSpecified</tt> keyword (even if
        !          4573: the distance is nil and does not appear, the <tt>UserSpecified</tt> keyword
1.1       cvs      4574: can be used).  It indicates that when the element to which the rule applies is
                   4575: being created, the editor will ask the user to specify the distance himself,
                   4576: using the mouse.  In this case, the distance specified in the rule is a
                   4577: default distance which is suggested to the user but can be modified.  The
1.18    ! cvs      4578: <tt>UserSpecified</tt> keyword can be used either in the vertical position
        !          4579: rule, the horizontal position rule, or both.</p>
        !          4580: <pre>     VertPosition  = Reference '.' HorizAxis [ Distance ] .
1.1       cvs      4581:      HorizPosition = Reference '.' VertAxis [ Distance ] .
                   4582:      Reference     ='Enclosing' [ BoxTypeNot ] /
                   4583:                     'Enclosed' [ BoxTypeNot ] /
                   4584:                     'Previous' [ BoxTypeNot ] /
                   4585:                     'Next' [ BoxTypeNot ] /
                   4586:                     'Referred' [ BoxTypeNot ] /
                   4587:                     'Creator' /
                   4588:                     'Root' /
                   4589:                     '*' /
                   4590:                      BoxOrType .
                   4591:      BoxOrType     = BoxID /
                   4592:                      [ '*' ] [ FirstSec ] ElemID /
1.17      cvs      4593:                     'AnyElem' / 'AnyBox' /
                   4594:                     'ElemWithAttr' AttrID .
1.18    ! cvs      4595:      BoxTypeNot    = [ 'NOT' ] BoxOrType .</pre>
        !          4596: <blockquote class="example">
        !          4597: <p>
        !          4598: <strong>Example:</strong></p>
        !          4599: <p>
        !          4600: If a <a name="expos1">report</a> is defined by the following structure
        !          4601: schema:</p>
        !          4602: <pre>Report = BEGIN
1.6       cvs      4603:          Title  = Text;
                   4604:          Summary = Text;
                   4605:          Keywords = Text;
                   4606:          ...
1.18    ! cvs      4607:          END;</pre>
        !          4608: <p>
        !          4609: then the presentation schema could contain the rules:</p>
        !          4610: <pre>Report : BEGIN
1.6       cvs      4611:          VertPos  : Top = Enclosing . Top;
                   4612:          HorizPos : Left = Enclosing . Left;
                   4613:          ...
1.18    ! cvs      4614:          END;</pre>
        !          4615: <p>
        !          4616: These rules place the <a name="reportexample">report</a> in the upper left
        !          4617: corner of the enclosing box, which is the window in which the document is
        !          4618: being edited.</p>
        !          4619: <pre>Title :  BEGIN
1.6       cvs      4620:          VertPos  : Top = Enclosing . Top + 1;
                   4621:          HorizPos : VMiddle = Enclosing . VMiddle;
                   4622:          ...
1.18    ! cvs      4623:          END;</pre>
        !          4624: <p>
1.3       cvs      4625: The top of the title is one line (a line has the height of the characters of
                   4626: the title) from the top of the report, which is also the top of the editing
1.18    ! cvs      4627: window.  The title is centered horizontally in the window (see <a
        !          4628: href="#posdim">figure</a>).</p>
        !          4629: <pre>Summary : BEGIN
1.1       cvs      4630:           VertPos  : Top = Title . Bottom + 1.5;
                   4631:           HorizPos : Left = Enclosing . Left + 2 cm;
                   4632:           ...
1.18    ! cvs      4633:           END;</pre>
        !          4634: <p>
        !          4635: The top of the summary is place a line and a half below the bottom of the
        !          4636: title and is shifted two centimeters from the side of the window.</p>
        !          4637: </blockquote>
        !          4638: <blockquote class="example">
        !          4639: <p>
        !          4640: <strong>Example:</strong></p>
        !          4641: <p>
        !          4642: Suppose there is a <a name="expos2">Design</a> logical structure which
        !          4643: contains graphical elements:</p>
        !          4644: <pre>Design = LIST OF (ElemGraph = GRAPHICS);</pre>
        !          4645: <p>
1.3       cvs      4646: The following rules allow the user to freely choose the position of each
1.18    ! cvs      4647: element when it is created:</p>
        !          4648: <pre>ElemGraph =
1.1       cvs      4649:    BEGIN
                   4650:    VertPos : Top = Enclosing . Top + 1 cm UserSpecified;
                   4651:    HorizPos: Left = Enclosing . Left UserSpecified;
                   4652:    ...
1.18    ! cvs      4653:    END;</pre>
        !          4654: <p>
        !          4655: Thus, when a graphical element is created, its default placement is at the
        !          4656: left of the window and 1 cm from the top, but the user can move it
        !          4657: immediately, simply by moving the mouse.</p>
        !          4658: </blockquote>
        !          4659: </div>
1.1       cvs      4660: 
1.18    ! cvs      4661: <div class="subsection">
1.1       cvs      4662: 
1.18    ! cvs      4663: <h3><a name="sectc4219">Box extents</a></h3>
        !          4664: <p>
1.1       cvs      4665: The extents (height and width) of each box are defined by the two rules
1.18    ! cvs      4666: <tt>Height</tt> and <tt>Width</tt>.  There are three types of extents: fixed,
        !          4667: relative, and elastic.</p>
1.1       cvs      4668: 
1.18    ! cvs      4669: <div class="subsubsection">
1.1       cvs      4670: 
1.18    ! cvs      4671: <h4><a name="sectd42191">Fixed extents</a></h4>
        !          4672: <p>
1.1       cvs      4673: A fixed dimension sets the height or width of the box independently of all
1.18    ! cvs      4674: other boxes.  It is expressed in <a href="#sectc4217">distance units</a>.  The
        !          4675: extent can be followed by the <tt>UserSpecified</tt> keyword which indicates
1.1       cvs      4676: that when the element to which the rule applies is being created, the editor
                   4677: will ask the user to specify the extent himself, using the mouse.  In this
                   4678: case, the extent specified in the rule is a default extent which is suggested
1.18    ! cvs      4679: to the user but can be modified.  The <tt>UserSpecified</tt> keyword can be
        !          4680: used either in the <tt>Height</tt> rule, the <tt>Width</tt> rule, or both.</p>
        !          4681: <p>
        !          4682: A fixed extent rule can be ended by the <tt>Min</tt> keyword, which signifies
1.1       cvs      4683: that the indicated value is a minimum, and that, if the contents of the box
1.18    ! cvs      4684: require it, a larger extent is possible.</p>
        !          4685: <pre>                'Height' ':' Dimension
1.1       cvs      4686:                 'Width' ':' Dimension
                   4687:      Dimension = AbsDist [ 'UserSpecified' ]  [ 'Min' ] /
1.18    ! cvs      4688:                  ...</pre>
        !          4689: <blockquote class="example">
        !          4690: <p>
        !          4691: <strong>Example:</strong></p>
        !          4692: <p>
        !          4693: Continuing with the <a href="#expos2">previous example</a>, it is possible to
1.3       cvs      4694: allow the user to choose the size of each graphical element as it is
1.18    ! cvs      4695: created:</p>
        !          4696: <pre>ElemGraph : BEGIN
1.6       cvs      4697:             Width :  2 cm UserSpecified;
1.1       cvs      4698:             Height : 1 cm UserSpecified;
                   4699:             ...
1.18    ! cvs      4700:             END;</pre>
        !          4701: <p>
1.1       cvs      4702: Thus, when a graphical element is create, it is drawn by default with a width
                   4703: of 2 cm and a height of 1 cm, but the user is free to resize it immediately
1.18    ! cvs      4704: with the mouse.</p>
        !          4705: <pre>Summary :  BEGIN
1.1       cvs      4706:            Height : 5 cm Min;
                   4707:            ...
                   4708:            END;
                   4709: Keywords : BEGIN
                   4710:            VertPos : Top = Summary . Bottom;
                   4711:            ...
1.18    ! cvs      4712:            END;</pre>
        !          4713: </blockquote>
        !          4714: </div>
1.1       cvs      4715: 
1.18    ! cvs      4716: <div class="subsubsection">
1.1       cvs      4717: 
1.18    ! cvs      4718: <h4><a name="sectd42192">Relative extents</a></h4>
        !          4719: <p>
1.1       cvs      4720: A relative extent determines the extent as a function of the extent of another
                   4721: box, just as a relative position places a box in relation to another. The
                   4722: reference box in an extent rule is designated using the same syntax as is used
1.18    ! cvs      4723: in a relative position rule.  It is followed by a period and a <tt>Height</tt>
        !          4724: or <tt>Width</tt> keyword, depending on the extent being referred to.  Next
1.1       cvs      4725: comes the relation between the extent being defined and the extent of the
1.18    ! cvs      4726: reference box.  This relation can be either a percentage or a difference.</p>
        !          4727: <p>
1.1       cvs      4728: A percentage is indicated by a star (the multiplication symbol) followed by
                   4729: the numeric percentage value (which may be greater than or less than 100) and
                   4730: the percent (`%') character.  A difference is simply indicated by a signed
1.18    ! cvs      4731: difference.</p>
        !          4732: <p>
1.1       cvs      4733: If the rule appears in the presentation rules of a numeric attribute, the
                   4734: percentage value can be replaced by the name of the attribute. This attribute
1.18    ! cvs      4735: is then used as a percentage.  The attribute can also be used as part of a <a
        !          4736: href="#distance">difference</a>.</p>
        !          4737: <p>
1.1       cvs      4738: Just as with a fixed extent, a relative extent rule can end with the
1.18    ! cvs      4739: <tt>Min</tt> keyword, which signifies that the extent is a minimum and that,
        !          4740: if the contents of the box require it, a larger extent is possible.</p>
        !          4741: <p>
        !          4742: A special case of relative extent rules is:</p>
        !          4743: <pre>Height : Enclosed . Height;</pre>
        !          4744: <p>
        !          4745: or</p>
        !          4746: <pre>Width  : Enclosed . Width;</pre>
        !          4747: <p>
1.5       cvs      4748: which specifies that the box has a height (or width) such that it encloses all
1.18    ! cvs      4749: the boxes which it contains, excluding boxes having a rule <tt>VertOverflow:
        !          4750: Yes;</tt> or <tt>HorizOverflow: Yes;</tt>.</p>
        !          4751: <p>
        !          4752: <strong>Note:</strong> character strings (type <tt>TEXT_UNIT</tt>) generally
1.1       cvs      4753: must use the sum of the widths of the characters which compose them as their
1.18    ! cvs      4754: width, which is expressed by the rule:</p>
        !          4755: <pre>TEXT_UNIT :
        !          4756:      Width : Enclosed . Width;</pre>
        !          4757: <p>
        !          4758: If this rule is not the default <tt>Width</tt> rule, it must be given
        !          4759: explicitly in the <tt>RULES</tt> section which defines the presentation rules
        !          4760: of the logical elements.</p>
        !          4761: <pre>                  'Height' ':' Extent
1.1       cvs      4762:                   'Width' ':' Extent
                   4763:      Extent      = Reference '.' HeightWidth [ Relation ]
                   4764:                    [ 'Min' ] / ...
                   4765:      HeightWidth ='Height' / 'Width' .
                   4766:      Relation    ='*' ExtentAttr '%' / Distance .
                   4767:      ExtentAttr  = ExtentVal / AttrID .
1.18    ! cvs      4768:      ExtentVal   = NUMBER .</pre>
        !          4769: <blockquote class="example">
        !          4770: <p>
        !          4771: <strong>Example:</strong></p>
        !          4772: <p>
        !          4773: Completing the <a href="#expos1">above example</a>, it is possible to specify
        !          4774: that the report takes its width from the editing window and its height from
        !          4775: the size of its contents (this can obviously be greater than that of the
        !          4776: window):</p>
        !          4777: <pre>Report :  BEGIN
1.1       cvs      4778:           Width : Enclosing . Width;
                   4779:           Height : Enclosed . Height;
                   4780:           ...
1.18    ! cvs      4781:           END;</pre>
        !          4782: <p>
1.3       cvs      4783: Then, the following rules make the title occupy 60% of the width of the report
                   4784: (which is that of the window) and is broken into centered lines of this width
1.18    ! cvs      4785: (see the <a href="#sectc4222"><tt>Line</tt> rule</a>).</p>
        !          4786: <pre>Title :   BEGIN
1.1       cvs      4787:           Width : Enclosing . Width * 60%;
                   4788:           Height : Enclosed . Height;
                   4789:           Line;
                   4790:           Adjust : VMiddle;
                   4791:           ...
1.18    ! cvs      4792:           END;</pre>
        !          4793: <p>
        !          4794: The summary occupy the entire width of the window, with the exception of a 2
        !          4795: cm margin reserved by the horizontal position rule:</p>
        !          4796: <pre>Summary : BEGIN
1.1       cvs      4797:           Width : Enclosing . Width - 2 cm;
                   4798:           Height : Enclosed . Height;
                   4799:           ...
1.18    ! cvs      4800:           END;</pre>
        !          4801: <p>
        !          4802: This set of rules, plus the <a href="#reportexample">position rules given
        !          4803: above</a>, produce the layout of boxes shown in the following<a
        !          4804: href="#posdim">figure</a>.</p>
        !          4805: 
        !          4806: <div class="figure">
        !          4807: <hr>
        !          4808: <pre>-------------------------------------------------------------
1.1       cvs      4809: | Window and Report           ^                             |
                   4810: |                             | 1 line                      |
                   4811: |                             v                             |
                   4812: |           -------------------------------------           |
                   4813: |           |                                   |           |
                   4814: :    20%    :               Title               :    20%    :
                   4815: :&lt;--------->:                                   :&lt;--------->:
                   4816: :           :                60%                :           :
                   4817: :           :&lt;--------------------------------->:           :
                   4818: |           |                                   |           |
                   4819: |           -------------------------------------           |
                   4820: |                             ^                             |
                   4821: |                             | 1.5 line                    |
                   4822: |                             |                             |
                   4823: |                             v                             |
                   4824: |        ---------------------------------------------------|
                   4825: |  2 cm  |                                                  |
                   4826: |&lt;------>|                    Summary                       |
1.18    ! cvs      4827: :        :                                                  :</pre>
        !          4828: <p align=center>
        !          4829: <em><a name="posdim">Box position and extent</a><em></em></em></p>
        !          4830: <hr>
        !          4831: </div>
        !          4832: </blockquote>
        !          4833: </div>
1.1       cvs      4834: 
1.18    ! cvs      4835: <div class="subsubsection">
1.1       cvs      4836: 
1.18    ! cvs      4837: <h4><a name="sectd42193">Elastic extents</a></h4>
        !          4838: <p>
1.1       cvs      4839: The last type of extent is the elastic extent.  Either one or both extents can
                   4840: be elastic.  A box has an elastic extent when two opposite sides are linked by
1.18    ! cvs      4841: distance constraints to two sides or axes of other boxes.</p>
        !          4842: <p>
1.1       cvs      4843: One of the sides of the elastic box is linked by a position rule
1.18    ! cvs      4844: (<tt>VertPos</tt> or <tt>HorizPos</tt>) to a neighboring box.  The other side
        !          4845: is link to another box by a <tt>Height</tt> or <tt>Width</tt> rule, which
1.1       cvs      4846: takes the same form as the position rule.  For the elastic box itself, the
                   4847: notions of sides (left or right, top or bottom) are fuzzy, since the movement
                   4848: of either one of the two reference boxes can, for example, make the left side
                   4849: of the elastic box move to the right of its right side.  This is not
                   4850: important.  The only requirement is that the two sides of the elastic box used
1.18    ! cvs      4851: in the position and extent rule are opposite sides of the box.</p>
        !          4852: <pre>             'Height' ':' Extent
1.6       cvs      4853:              'Width' ':' Extent
1.18    ! cvs      4854:      Extent = HPos / VPos / ...</pre>
        !          4855: <blockquote class="example">
        !          4856: <p>
        !          4857: <strong>Example:</strong></p>
        !          4858: <p>
1.3       cvs      4859: Suppose we want to draw an elastic arrow or line between the middle of the
                   4860: bottom side of box A and the upper left corner of box B.  To do this, we would
                   4861: define a graphics box whose upper left corner coincides with the middle of the
                   4862: bottom side of A (a position rule) and whose lower right corner coincides with
1.18    ! cvs      4863: with the upper left corner of B (dimension rules):</p>
        !          4864: <pre>LinkedBox :
1.1       cvs      4865:    BEGIN
1.6       cvs      4866:    VertPos  : Top = A .Bottom;
1.1       cvs      4867:    HorizPos : Left = A . VMiddle;
1.6       cvs      4868:    Height   : Bottom = B . Top;
                   4869:    Width    : Right = B . Left;
1.18    ! cvs      4870:    END;</pre>
        !          4871: </blockquote>
        !          4872: <blockquote class="example">
        !          4873: <p>
        !          4874: <strong>Example:</strong></p>
        !          4875: <p>
1.3       cvs      4876: The element SectionTitle creates a presentation box called SectionNum which
                   4877: contains the number of the section.  Suppose we want to align the SectionNum
                   4878: and SectionTitle horizontally, have the SectionNum take its width from its
                   4879: contents (the section number), have the SectionTitle box begin 0.5 cm to the
                   4880: right of the SectionNum box and end at the right edge of its enclosing box.
1.18    ! cvs      4881: This would make the SectionTitle box elastic, since its width is defined by
        !          4882: the position of its left and right sides.  The following rules produce this
        !          4883: effect:</p>
        !          4884: <pre>SectionNum :
1.1       cvs      4885:    BEGIN
                   4886:    HorizPos : Left = Enclosing . Left;
                   4887:    Width : Enclosed . Width;
                   4888:    ...
                   4889:    END;
                   4890: 
                   4891: SectionTitle :
                   4892:    BEGIN
                   4893:    HorizPos : Left = SectionNum . Right + 0.5 cm;
                   4894:    Width : Right = Enclosing . Right;
                   4895:    ...
1.18    ! cvs      4896:    END;</pre>
        !          4897: </blockquote>
        !          4898: </div>
        !          4899: </div>
1.1       cvs      4900: 
1.18    ! cvs      4901: <div class="subsection">
1.1       cvs      4902: 
1.18    ! cvs      4903: <h3><a name="sectc4220">Overflow</a></h3>
        !          4904: <p>
1.1       cvs      4905: A boxes corresponding to a structural element normally contain all boxes
                   4906: corresponding to the elements of its subtree.  However, in some cases, it
                   4907: could be necessary to allow a box to jut out from its parent box. Two
                   4908: presentation rules indicate that such an overflow is allowed, one for
1.18    ! cvs      4909: horizontal overflow, one for vertical overflow.</p>
        !          4910: <p>
1.1       cvs      4911: Each of these rules is expressed by a keyword followed by a colon and the
1.18    ! cvs      4912: keyword <tt>Yes</tt> or <tt>No</tt>.</p>
        !          4913: <pre>               'VertOverflow' ':' Boolean /
1.1       cvs      4914:                'HorizOverflow' ':' Boolean .
1.18    ! cvs      4915:      Boolean = 'Yes' / 'No' .</pre>
        !          4916: </div>
1.1       cvs      4917: 
1.18    ! cvs      4918: <div class="subsection">
1.1       cvs      4919: 
1.18    ! cvs      4920: <h3><a name="sectc4221">Inheritance</a></h3>
        !          4921: <p>
1.1       cvs      4922: A presentation parameter can be defined by reference to the same parameter of
                   4923: another box in the tree of boxes.  These structural links are expressed by
                   4924: kinship.  The reference box can be that of the element immediately above in
1.18    ! cvs      4925: the structure (<tt>Enclosing</tt>), two levels above (<tt>GrandFather</tt>),
        !          4926: immediately below (<tt>Enclosed</tt>) or immediately before
        !          4927: (<tt>Previous</tt>).  In the case of a presentation box, and only in that
1.1       cvs      4928: case, the reference box may be the element which created the presentation box
1.18    ! cvs      4929: (<tt>Creator</tt>).</p>
        !          4930: <p>
1.1       cvs      4931: Kinship is expressed in terms of the logical structure of the document and not
                   4932: in terms of the tree of boxes.  The presentation box cannot transmit any of
                   4933: their parameters by inheritance; only structured element boxes can do so. As
                   4934: an example, consider an element B which follows an element A in the logical
                   4935: structure.  The element B creates a presentation box P in front of itself,
1.18    ! cvs      4936: using the <tt>CreateBefore</tt> rule (see the <a href="#sectc4232">creation
        !          4937: rules</a>).  If element B's box inherits its character style using the
        !          4938: <tt>Previous</tt> kinship operation, it gets its character style from A's box,
1.1       cvs      4939: not from P's box.  Inheritance works differently for positions and extents,
1.18    ! cvs      4940: which can refer to presentation boxes.</p>
        !          4941: <p>
1.1       cvs      4942: The inherited parameter value can be the same as that of the reference box.
                   4943: This is indicated by an equals sign.  However, for numeric parameters, a
                   4944: different value can be obtained by adding or subtracting a number from the
                   4945: reference box's parameter value.  Addition is indicated by a plus sign before
                   4946: the number, while subtraction is specified with a minus sign.  The value of a
                   4947: parameter can also be given a maximum (if the sign is a plus) or minimum (if
1.18    ! cvs      4948: the sign is a minus).</p>
        !          4949: <p>
1.1       cvs      4950: If the rule is being applied to a numeric attribute, the number to add or
                   4951: subtract can be replaced by the attribute name.  The value of a maximum or
                   4952: minimum may also be replaced by an attribute name.  In these cases, the value
1.18    ! cvs      4953: of the attribute is used.</p>
        !          4954: <pre>  Inheritance    = Kinship  InheritedValue .
1.6       cvs      4955:   Kinship        ='Enclosing' / 'GrandFather' / 'Enclosed' /
                   4956:                   'Previous' / 'Creator' .
1.1       cvs      4957:   InheritedValue ='+' PosIntAttr [ 'Max' maximumA ] /
1.6       cvs      4958:                   '-' NegIntAttr [ 'Min' minimumA ] /
                   4959:                   '=' .
                   4960:   PosIntAttr     = PosInt / AttrID .
                   4961:   PosInt         = NUMBER .
                   4962:   NegIntAttr     = NegInt / AttrID .
                   4963:   NegInt         = NUMBER .
                   4964:   maximumA       = maximum / AttrID .
                   4965:   maximum        = NUMBER .
                   4966:   minimumA       = minimum / AttrID .
1.18    ! cvs      4967:   minimum        = NUMBER .</pre>
        !          4968: <p>
1.1       cvs      4969: The parameters which can be obtained by inheritance are justification,
                   4970: hyphenation, interline spacing, character font (font family), font style, font
                   4971: size, visibility, indentation, underlining, alignment of text, stacking order
                   4972: of objects, the style and thickness of lines, fill pattern and the colors of
1.18    ! cvs      4973: lines and characters.</p>
        !          4974: </div>
1.1       cvs      4975: 
1.18    ! cvs      4976: <div class="subsection">
1.1       cvs      4977: 
1.18    ! cvs      4978: <h3><a name="sectc4222">Line breaking</a></h3>
        !          4979: <p>
        !          4980: The <tt>Line</tt> rule specifies that the contents of the box should be broken
1.1       cvs      4981: into lines: the boxes included in the box to which this rule is attached are
                   4982: displayed one after the other, from left to right, with their horizontal
                   4983: reference axes aligned so that they form a series of lines.  The length of
1.18    ! cvs      4984: these lines is equal to the width of the box to which the <tt>Line</tt> rule
        !          4985: is attached.</p>
        !          4986: <p>
1.1       cvs      4987: When an included box overflows the current line, it is either carried forward
1.18    ! cvs      4988: to the next line, cur, or left the way it is.  The <a
        !          4989: href="#sectc4223"><tt>LineBreak</tt> rule</a> is used to allow or prevent the
1.1       cvs      4990: breaking of included boxes.  If the included box is not breakable but is
                   4991: longer than the space remaining on the line, it is left as is.  When a
                   4992: character string box is breakable, the line is broken between words or, if
1.18    ! cvs      4993: necessary, by <a href="#sectd42225">hyphenating a word</a>.  When a compound
        !          4994: box is breakable, the box is transparent in regard to line breaking. The boxes
        !          4995: included in the compound box are treated just like included boxes which have
        !          4996: the <tt>LineBreak</tt> rule.  Thus, it is possible to traverse a complete
        !          4997: subtree of boxes to line break the text leaves of a complex structure.</p>
        !          4998: <p>
1.1       cvs      4999: The relative position rules of the included boxes are ignored, since the boxes
1.18    ! cvs      5000: will be placed according to the line breaking rules.</p>
        !          5001: <p>
        !          5002: The <tt>Line</tt> rule does not have a parameter.  The characteristics of the
        !          5003: lines that will be constructed are determined by the <tt>LineSpacing</tt>,
        !          5004: <tt>Indent</tt>, <tt>Adjust</tt>, <tt>Justify</tt>, and <tt>Hyphenate</tt>
        !          5005: rules.  Moreover, the <a href="#insectd42226"><tt>Inline</tt> rule</a> permits
        !          5006: the exclusion of certain elements from the line breaking process.</p>
        !          5007: <p>
        !          5008: When the <tt>Line</tt> rule appears in the rules sequence of a non-primary
        !          5009: view, it applies only to that view, but when the <tt>Line</tt> rule appears in
1.1       cvs      5010: the rules sequence of the primary view, it also applies to the other views by
1.18    ! cvs      5011: default, except for those views which explicitly invoke the <tt>NoLine</tt>
        !          5012: rule.  Thus, the <tt>NoLine</tt> rule can be used in a non-primary view to
        !          5013: override the primary view's <tt>Line</tt> rule.  The <tt>NoLine</tt> rule must
        !          5014: not be used with the primary view because the absence of the <tt>Line</tt>
        !          5015: rule has the same effect. Like the <tt>Line</tt> rule, the <tt>NoLine</tt>
        !          5016: rule does not take any parameters.</p>
        !          5017: <pre>              'Line'
        !          5018:               'NoLine'</pre>
        !          5019: 
        !          5020: <div class="subsubsection">
        !          5021: 
        !          5022: <h4><a name="sectd42221">Line spacing</a></h4>
        !          5023: <p>
        !          5024: The <tt>LineSpacing</tt> rule defines the line spacing to be used in the line
1.1       cvs      5025: breaking process.  The line spacing is the distance between the baselines
                   5026: (horizontal reference axis) of the successive lines produced by the
1.18    ! cvs      5027: <tt>Line</tt> rule.  The value of the line spacing can be specified as a
        !          5028: constant or by inheritance.  It is expressed in any of the available <a
        !          5029: href="#sectc4217">distance units</a>.</p>
        !          5030: <p>
1.1       cvs      5031: Inheritance allows the value to be obtained from a relative in the structure
                   5032: tree, either without change (an equals sign appears after the inheritance
                   5033: keyword), with a positive difference (a plus sign), or a negative difference
                   5034: (a minus sign).  When the rule uses a difference, the value of the difference
1.18    ! cvs      5035: follows the sign and is expressed as a <a href="#sectc4217">distance</a>.</p>
        !          5036: <pre>                     'LineSpacing' ':' DistOrInherit
1.6       cvs      5037:      DistOrInherit =  Kinship InheritedDist / Distance .
1.18    ! cvs      5038:      InheritedDist = '=' / '+' AbsDist / '-' AbsDist .</pre>
        !          5039: <p>
1.1       cvs      5040: When the line spacing value (or its difference from another element) is
                   5041: expressed in relative units, it changes with the size of the characters. Thus,
                   5042: when a larger font is chosen for a part of the document, the line spacing of
                   5043: that part expands proportionally.  In contrast, when the line spacing value is
                   5044: expressed in absolute units (centimeters, inches, typographer's points), it is
                   5045: independent of the characters, which permits the maintenance of a consistent
                   5046: line spacing, whatever the character font.  Either approach can be taken,
1.18    ! cvs      5047: depending on the desired effect.</p>
        !          5048: </div>
1.1       cvs      5049: 
1.18    ! cvs      5050: <div class="subsubsection">
1.1       cvs      5051: 
1.18    ! cvs      5052: <h4><a name="sectd42222">First line indentation</a></h4>
        !          5053: <p>
        !          5054: The <tt>Indent</tt> rule is used to specify the indentation of the first line
        !          5055: of the elements broken into lines by the <tt>Line</tt> function. The
1.1       cvs      5056: indentation determines how far the first line of the element is shifted with
                   5057: respect to the other lines of the same element.  It can be specified as a
                   5058: constant or by inheritance.  The constant value is a positive integer (shifted
                   5059: to the right; the sign is optional), a negative integer (shifted to the left)
1.18    ! cvs      5060: or zero (no shift).  All available <a href="#sectc4217">units</a> can be
        !          5061: used.</p>
        !          5062: <p>
1.1       cvs      5063: Indentation can be defined for any box, regardless of whether the box is line
                   5064: broken, and transmitted by inheritance to elements that are line broken. The
1.18    ! cvs      5065: size of the indentation is specified in the same manner as the <a
        !          5066: href="#sectd42221">line spacing</a>.</p>
        !          5067: <pre>              'Indent' ':' DistOrInherit</pre>
        !          5068: </div>
1.1       cvs      5069: 
1.18    ! cvs      5070: <div class="subsubsection">
1.1       cvs      5071: 
1.18    ! cvs      5072: <h4><a name="sectd42223">Alignment</a></h4>
        !          5073: <p>
1.1       cvs      5074: The alignment style of the lines constructed during line breaking is defined
1.18    ! cvs      5075: by the <tt>Adjust</tt> rule.  The alignment value can be a constant or
        !          5076: inherited.  A constant value is specified by a keyword:</p>
        !          5077: <ul>
        !          5078: <li>
        !          5079: <tt>Left</tt>: at the left edge,
        !          5080: <li>
        !          5081: <tt>Right</tt>: at the right edge,
        !          5082: <li>
        !          5083: <tt>VMiddle</tt>: centered
        !          5084: <li>
        !          5085: <tt>LeftWithDots</tt>: at the left edge with a dotted line filling out the
1.1       cvs      5086: last line up to the right edge of the line breaking box.
1.18    ! cvs      5087: </ul>
        !          5088: <p>
1.1       cvs      5089: An inherited value can only be the same as that of the reference box and is
1.18    ! cvs      5090: specified by a kinship keyword followed by an equals sign.</p>
        !          5091: <pre>                      'Adjust' ':' AlignOrInherit
1.1       cvs      5092:      AlignOrInherit = Kinship '=' / Alignment .
                   5093:      Alignment      = 'Left' / 'Right' / 'VMiddle' /
1.18    ! cvs      5094:                       'LeftWithDots' .</pre>
        !          5095: </div>
1.1       cvs      5096: 
1.18    ! cvs      5097: <div class="subsubsection">
1.1       cvs      5098: 
1.18    ! cvs      5099: <h4><a name="sectd42224">Justification</a></h4>
        !          5100: <p>
        !          5101: The <tt>Justify</tt> rule indicates whether the lines contained in the box and
        !          5102: produced by a <tt>Line</tt> rule should be extended horizontally to occupy the
1.1       cvs      5103: entire width of their enclosing box.  The first and last lines are treated
                   5104: specially: the position of the beginning of the first line is fixed by the
1.18    ! cvs      5105: <tt>Indent</tt> rule and last line is not extended.  The justification
1.1       cvs      5106: parameter defined by this rule takes a boolean value, which can be a constant
                   5107: or inherited.  A constant boolean value is expressed by either the
1.18    ! cvs      5108: <tt>Yes</tt> or the <tt>No</tt> keyword.  An inherited value can only be the
1.1       cvs      5109: same as that of the reference box and is specified by a kinship keyword
1.18    ! cvs      5110: followed by an equals sign.</p>
        !          5111: <pre>                  'Justify' ':' BoolInherit
1.1       cvs      5112:      BoolInherit = Boolean / Kinship '=' .
1.18    ! cvs      5113:      Boolean     ='Yes' / 'No' .</pre>
        !          5114: <p>
1.1       cvs      5115: When the lines are justified, the alignment parameter specified in the
1.18    ! cvs      5116: <tt>Adjust</tt> rule has no influence, other than on the last line produced.
1.1       cvs      5117: This occurs because, when the other are extended to the limits of the box, the
1.18    ! cvs      5118: alignment style is no longer perceptible.</p>
        !          5119: <blockquote class="example">
        !          5120: <p>
        !          5121: <strong>Example:</strong></p>
        !          5122: <p>
1.3       cvs      5123: An important use of inheritance is to vary the characteristics of lines for an
                   5124: element type (for example, Paragraph) according to the enclosing environment
                   5125: (for example, Summary or Section), and thus obtain different line breaking
                   5126: styles for the same elements when they appear in different environments.  The
1.18    ! cvs      5127: following rules specify that paragraphs inherit their alignment,
        !          5128: justification, and line spacing:</p>
        !          5129: <pre>Paragraph :
1.1       cvs      5130:    BEGIN
                   5131:    Justify : Enclosing = ;
                   5132:    LineSpacing : Enclosing = ;
                   5133:    Adjust : Enclosing =;
                   5134:    Line;
1.18    ! cvs      5135:    END;</pre>
        !          5136: <p>
1.5       cvs      5137: If the alignment, justification, and line spacing of the Section and Summary
1.18    ! cvs      5138: elements is fixed:</p>
        !          5139: <pre>Section :
1.1       cvs      5140:    BEGIN
                   5141:    Adjust : Left;
                   5142:    Justify : Yes;
                   5143:    LineSpacing : 1;
                   5144:    END;
                   5145: Summary :
                   5146:    BEGIN
                   5147:    Adjust : VMiddle;
                   5148:    Justify : No;
                   5149:    LineSpacing : 1.3;
1.18    ! cvs      5150:    END;</pre>
        !          5151: <p>
1.4       cvs      5152: then the paragraphs appearing in sections are justified with a simple line
                   5153: spacing while those appearing in summaries are centered and not justified and
                   5154: have a larger line spacing.  These are nevertheless the very same type of
1.18    ! cvs      5155: paragraph defined in the logical structure schema.</p>
        !          5156: </blockquote>
        !          5157: </div>
        !          5158: 
        !          5159: <div class="subsubsection">
        !          5160: 
        !          5161: <h4><a name="sectd42225">Hyphenation</a></h4>
        !          5162: <p>
        !          5163: The <tt>Hyphenate</tt> rule indicates whether or not words should be broken by
1.1       cvs      5164: hyphenation at the end of lines.  It affects the lines produced by the
1.18    ! cvs      5165: <tt>Line</tt> rule and contained in the box carrying the <tt>Hyphenate</tt>
        !          5166: rule.</p>
        !          5167: <p>
1.1       cvs      5168: The hyphenation parameter takes a boolean value, which can be either constant
                   5169: or inherited.  A constant boolean value is expressed by either the
1.18    ! cvs      5170: <tt>Yes</tt> or the <tt>No</tt> keyword.  An inherited value can only be the
1.1       cvs      5171: same as that of the reference box and is specified by a kinship keyword
1.18    ! cvs      5172: followed by an equals sign.</p>
        !          5173: <pre>                   'Hyphenate' ':' BoolInherit
1.1       cvs      5174:      BoolInherit = Boolean / Kinship '=' .
1.18    ! cvs      5175:      Boolean     = 'Yes' / 'No' .</pre>
        !          5176: </div>
        !          5177: 
        !          5178: <div class="subsubsection">
        !          5179: 
        !          5180: <h4><a name="sectd42226">Avoiding line breaking</a></h4>
        !          5181: <p>
        !          5182: The <tt>InLine</tt> rule is used to specify that a box that would otherwise
        !          5183: participate in line breaking asked for by the <tt>Line</tt> rule of an
1.1       cvs      5184: enclosing box, instead avoids the line breaking process and positions itself
1.18    ! cvs      5185: according to the <tt>HorizPos</tt> and <tt>VertPos</tt> rules that apply to
        !          5186: it.  When the <tt>InLine</tt> rule applies to a box which would not be line
        !          5187: broken, it has no effect.</p>
        !          5188: <p>
        !          5189: The rule is expressed by the <tt>InLine</tt> keyword followed by a colon and
        !          5190: the keyword <tt>Yes</tt>, if the box should participate in line breaking, or
        !          5191: the keyword <tt>No</tt>, if it should not.  This is the only form possible:
1.1       cvs      5192: this rule cannot be inherited.  Moreover, it can only appear in the rules of
                   5193: the primary view and applies to all views defined in the presentation
1.18    ! cvs      5194: schema.</p>
        !          5195: <pre>               'InLine' ':' Boolean .
        !          5196:      Boolean = 'Yes' / 'No' .</pre>
        !          5197: <blockquote class="example">
        !          5198: <p>
        !          5199: <strong>Example:</strong></p>
        !          5200: <p>
        !          5201: Suppose the structure schema defines a logical attribute called <tt>New</tt>
        !          5202: which is used to identify the passages in a document which were recently
        !          5203: modified.  It would be nice to have the presentation schema make a bar appear
        !          5204: in the left margin next to each passage having the <tt>New</tt> attribute.  A
        !          5205: new passage can be an entire element, such as a paragraph or section, or it
        !          5206: can be some words in the middle of a paragraph.  To produce the desired
        !          5207: effect, the <tt>New</tt> attribute is given a creation rule which generates a
        !          5208: <tt>VerticalBar</tt> presentation box.</p>
        !          5209: <p>
        !          5210: When the <tt>New</tt> attribute is attached to a character string which is
1.1       cvs      5211: inside a line broken element (inside a paragraph, for example), the bar is one
                   5212: of the elements which participates in line breaking and it is placed normally
                   5213: in the current line, at the end of the character string which has the
1.18    ! cvs      5214: attribute.  To avoid this, the <tt>InLine</tt> rule is used in the following
        !          5215: way:</p>
        !          5216: <pre>BOXES
1.1       cvs      5217:   VerticalBar:
                   5218:      BEGIN
                   5219:      Content: Graphics 'l';
                   5220:      HorizPos: Left = Root . Left;
                   5221:      VertPos: Top = Creator . Top;
                   5222:      Height: Bottom = Creator . Bottom;
                   5223:      Width: 1 pt;
                   5224:      InLine: No;
                   5225:      ...
                   5226:      END;
                   5227: ...
                   5228: ATTRIBUTES
                   5229:   Nouveau:
                   5230:      BEGIN
                   5231:      CreateAfter(VerticalBar);
1.18    ! cvs      5232:      END;</pre>
        !          5233: </blockquote>
        !          5234: </div>
        !          5235: </div>
1.1       cvs      5236: 
1.18    ! cvs      5237: <div class="subsection">
1.1       cvs      5238: 
1.18    ! cvs      5239: <h3><a name="sectc4223">Page breaking and line breaking conditions</a></h3>
        !          5240: <p>
1.1       cvs      5241: Pages are constructed by the editor in accordance with the model specified by
1.18    ! cvs      5242: a <a href="#sectc4233"><tt>Page</tt> rule</a>.  The page model describes only
        !          5243: the composition of the pages but does not give any rules for breaking
        !          5244: different element types across pages.  Now, it is possible that certain
        !          5245: elements must not be cut by page breaks, while others can be cut anywhere. The
        !          5246: <tt>PageBreak</tt>, <tt>NoBreak1</tt>, and <tt>NoBreak2</tt> rules are used to
        !          5247: specify the conditions under which each element type can be cut.</p>
        !          5248: <p>
        !          5249: The <tt>PageBreak</tt> rule is used to indicate whether or not the box can be
1.1       cvs      5250: cut during the construction of pages.  If cutting is authorized, the box can
                   5251: be cut, with one part appearing at the bottom of a page and the other part
                   5252: appearing at the top of the next page. The rule is formed by the
1.18    ! cvs      5253: <tt>PageBreak</tt> keyword followed by a colon and a constant boolean value
        !          5254: (<tt>Yes</tt> or <tt>No</tt>).  This is the only form possible: this rule
1.1       cvs      5255: cannot be inherited.  Moreover, it can only appear in the rules of the primary
1.18    ! cvs      5256: view and applies to all views defined in the presentation schema.</p>
        !          5257: <p>
1.1       cvs      5258: Whether objects can be cut by line breaks can be controlled in a similar way
1.18    ! cvs      5259: using the <tt>LineBreak</tt> rule.  This rule allows the specification of
1.1       cvs      5260: whether or not the box can be cut during the construction of lines.  If
                   5261: cutting is authorized, the box can be cut, with one part appearing at the end
                   5262: of a line and the other part appearing at the beginning of the next line.  The
1.18    ! cvs      5263: rule is formed by the <tt>LineBreak</tt> keyword followed by a colon and a
        !          5264: constant boolean value (<tt>Yes</tt> or <tt>No</tt>).  This is the only form
1.1       cvs      5265: possible: this rule cannot be inherited.  Moreover, it can only appear in the
                   5266: rules of the primary view and applies to all views defined in the presentation
1.18    ! cvs      5267: schema.</p>
        !          5268: <pre>               'PageBreak' ':' Boolean .
1.1       cvs      5269:                'LineBreak' ':' Boolean .
1.18    ! cvs      5270:      Boolean = 'Yes' / 'No' .</pre>
        !          5271: <p>
1.1       cvs      5272: When a box can be cut by a page break, it is possible that a page break will
                   5273: fall an inappropriate spot, creating, for example, a widow or orphan, or
                   5274: separating the title of a section from the first paragraph of the section. The
1.18    ! cvs      5275: <tt>NoBreak1</tt> and <tt>NoBreak2</tt> rules are used to avoid this. They
        !          5276: specify that the box of the element to which they apply cannot be cut within a
        !          5277: certain zone at the top (<tt>NoBreak1</tt> rule) or at the bottom
        !          5278: (<tt>NoBreak2</tt> rule).  These two rules specify the height of the zones in
        !          5279: which page breaks are prohibited.</p>
        !          5280: <p>
        !          5281: The <tt>NoBreak1</tt> and <tt>NoBreak2</tt> rules give the height of the zone
1.1       cvs      5282: in which page breaking is prohibited.  The height is given as a constant value
1.18    ! cvs      5283: using any of the <a href="#sectc4217">available units</a>, absolute or
        !          5284: relative.  The value may not be inherited.</p>
        !          5285: <pre>                   'NoBreak1' ':' AbsDist .
        !          5286:                    'NoBreak2' ':' AbsDist .</pre>
        !          5287: <blockquote class="example">
        !          5288: <p>
        !          5289: <strong>Example:</strong></p>
        !          5290: <p>
        !          5291: The following rules prevent widows and orphans in a paragraph:</p>
        !          5292: <pre>Paragraph :
1.1       cvs      5293:    BEGIN
                   5294:    NoBreak1 : 2;
                   5295:    NoBreak2 : 2;
1.18    ! cvs      5296:    END;</pre>
        !          5297: <p>
1.3       cvs      5298: This rule prevents a section title from becoming separated from the first
                   5299: paragraph of the section by prohibiting page breaks at the beginning of the
1.18    ! cvs      5300: section rule:</p>
        !          5301: <pre>Section :
        !          5302:    NoBreak1 : 1.5 cm;</pre>
        !          5303: <p>
        !          5304: Finally, this rule prevents a figure from being page broken in any way:</p>
        !          5305: <pre>Figure :
        !          5306:    PageBreak : No;</pre>
        !          5307: </blockquote>
        !          5308: <p>
1.1       cvs      5309: The Thot editor constructs the document images displayed on the screen
                   5310: dynamically.  As the user moves in the document or makes the document scroll
                   5311: in a window, the editor constructs the image to be displayed in little bits,
                   5312: filling the gaps which are produced in the course of these operations.  It
                   5313: stops filling in the image when an element reaches the edge of the window in
                   5314: which the gap appears.  If the appearance of the document is complex, it is
                   5315: possible that the image in incomplete, even though the edge of the window was
                   5316: reached.  For example, an element might need to be presented to the side of
                   5317: the last element displayed, but its image was not constructed.  The user will
                   5318: not know whether the element is really absent or if its image has simply not
1.18    ! cvs      5319: been constructed.</p>
        !          5320: <p>
        !          5321: The <tt>Gather</tt> rule is used to remedy this problem.  When the rule
        !          5322: <tt>Gather : Yes;</tt> is associated with an element type, the image of such
        !          5323: elements is constructed as a block by the editor: it is never split up.</p>
        !          5324: <p>
        !          5325: The <tt>Gather</tt> rule may not appear in the <a href="#sectc427">default
        !          5326: rules</a>.  Elements which do not have the <tt>Gather</tt> rule are considered
        !          5327: susceptible to being split up during display.  Thus, it is not necessary to
        !          5328: use the <tt>Gather : No;</tt> form. This rule must be used prudently and only
        !          5329: for those elements which truly need it.  If used incorrectly, it can
        !          5330: pointlessly increase the size of the image constructed by the editor and lead
        !          5331: to excessive memory consumption by the editor.</p>
        !          5332: <p>
        !          5333: Like the <tt>PageBreak</tt> and <tt>LineBreak</tt> rules, the <tt>Gather</tt>
1.1       cvs      5334: rule can only appear in rules of the primary view and applies to all views
1.18    ! cvs      5335: defined in the presentation schema.</p>
        !          5336: <pre>                   'Gather' ':' Boolean .</pre>
        !          5337: </div>
1.1       cvs      5338: 
1.18    ! cvs      5339: <div class="subsection">
1.1       cvs      5340: 
1.18    ! cvs      5341: <h3><a name="sectc4224">Visibility</a></h3>
        !          5342: <p>
1.1       cvs      5343: The visibility parameter is used to control which elements should or should
                   5344: not be displayed, based on context.  An element can have different
                   5345: visibilities in different views.  If an element's visibility is zero for a
                   5346: view, that element is not displayed in that view and does not occupy any space
1.18    ! cvs      5347: (its extents are zero).</p>
        !          5348: <p>
1.1       cvs      5349: Visibility takes non-negative integer values (positive or zero).  If values
                   5350: greater than 1 are used, they allow the user to choose a degree of visibility
                   5351: and, thus, to see only those boxes whose visibility parameter exceeds a
                   5352: certain threshold.  This gives the user control over the granularity of the
1.18    ! cvs      5353: displayed pictures.</p>
        !          5354: <p>
1.1       cvs      5355: The visibility parameter can be defined as a constant or by inheritance. If
                   5356: defined by inheritance, it cannot be based on the value of the next or
1.18    ! cvs      5357: previous box.  Visibility can only be inherited from above.</p>
        !          5358: <p>
1.1       cvs      5359: If it is a numeric attribute's presentation rule, the visibility can be
                   5360: specified by the attribute's name, in which case the value of the attribute is
1.18    ! cvs      5361: used.</p>
        !          5362: <pre>                   'Visibility' ':' NumberInherit
1.1       cvs      5363:      NumberInherit = Integer / AttrID / Inheritance .
1.18    ! cvs      5364:      Integer       = NUMBER .</pre>
        !          5365: <blockquote class="example">
        !          5366: <p>
        !          5367: <strong>Example:</strong></p>
        !          5368: <p>
        !          5369: Suppose that only <tt>Formula</tt> elements should be displayed in the
        !          5370: <tt>MathView</tt> view.  Then, the default rules should include:</p>
        !          5371: <pre>DEFAULT
        !          5372:      IN MathView Visibility:0;</pre>
        !          5373: <p>
        !          5374: which makes all elements invisible in the <tt>MathView</tt> view.  However,
        !          5375: the <tt>Formula</tt> element also has a <tt>Visibility</tt> rule:</p>
        !          5376: <pre>Formula :
        !          5377:      IN MathView Visibility:5;</pre>
        !          5378: <p>
        !          5379: which makes formulas, and only formulas, visible.</p>
        !          5380: </blockquote>
        !          5381: </div>
1.1       cvs      5382: 
1.18    ! cvs      5383: <div class="subsection">
1.1       cvs      5384: 
1.18    ! cvs      5385: <h3><a name="sectc4225">Character style parameters</a></h3>
        !          5386: <p>
1.1       cvs      5387: Four parameters are used to determine which characters are used to display
1.18    ! cvs      5388: text.  They are size, font, style, and underlining.</p>
1.1       cvs      5389: 
1.18    ! cvs      5390: <div class="subsubsection">
1.1       cvs      5391: 
1.18    ! cvs      5392: <h4><a name="sectd42251">Character size</a></h4>
        !          5393: <p>
1.1       cvs      5394: The size parameter has two effects.  First, it is used to specify the actual
1.18    ! cvs      5395: size and distance units for boxes defined in <a href="#sectc4217">relative
        !          5396: units</a>.  Second, it defines the size of the characters contained in the
        !          5397: box.</p>
        !          5398: <p>
1.1       cvs      5399: As a distance or length, the size can be expressed in abstract or absolute
                   5400: units.  It can also be inherited.  If it is not inherited, it is expressed
1.18    ! cvs      5401: simply as an integer followed by the <tt>pt</tt> keyword, which indicates that
        !          5402: the size is expressed in typographer's points. The absence of the <tt>pt</tt>
1.1       cvs      5403: keyword indicates that it is in abstract units in which the value 1 represents
                   5404: the smallest size while the value 16 is the largest size.  The relationship
                   5405: between these abstract sizes and the real character sizes is controlled by a
                   5406: table which can be modified statically or even dynamically during the
1.18    ! cvs      5407: execution of the Thot editor.</p>
        !          5408: <p>
1.1       cvs      5409: If it is a numeric attribute's presentation rule, the value of the size
                   5410: parameter can be specified by the attribute's name, in which case the value of
1.18    ! cvs      5411: the attribute is used.</p>
        !          5412: <p>
        !          5413: <strong>Note:</strong> the only unit available for  defining an absolute size
        !          5414: is the typographer's point.  Centimeters and inches may not be used.</p>
        !          5415: <p>
1.1       cvs      5416: If the size is inherited, the rule must specify the relative from which to
                   5417: inherit and any difference from that relative's value.  The difference can be
                   5418: expressed in either typographer's points or in abstract units.  The maximum or
                   5419: minimum size can also be specified, but without specifying the type of unit:
1.18    ! cvs      5420: it is the same as was specified for the difference.</p>
        !          5421: <p>
1.1       cvs      5422: In a numeric attribute's presentation rule, the difference in size can be
                   5423: indicated by the attribute's name, which means that the attribute's value
                   5424: should be used as the difference.  The attribute can also be used as the
1.18    ! cvs      5425: minimum or maximum size.</p>
        !          5426: <pre>                    'Size' ':' SizeInherit
1.1       cvs      5427:      SizeInherit   = SizeAttr [ 'pt' ] /
                   5428:                      Kinship InheritedSize .
                   5429:      InheritedSize ='+' SizeAttr [ 'pt' ]
                   5430:                      [ 'Max' MaxSizeAttr ] /
                   5431:                     '-' SizeAttr [ 'pt' ]
                   5432:                      [ 'Min' MinSizeAttr ] /
                   5433:                     '=' .
1.6       cvs      5434:      SizeAttr      = Size / AttrID .
                   5435:      Size          = NUMBER .
                   5436:      MaxSizeAttr   = MaxSize / AttrID .
                   5437:      MaxSize       = NUMBER .
                   5438:      MinSizeAttr   = MinSize / AttrID .
1.18    ! cvs      5439:      MinSize       = NUMBER .</pre>
        !          5440: <blockquote class="example">
        !          5441: <p>
        !          5442: <strong>Example:</strong></p>
        !          5443: <p>
        !          5444: The rule</p>
        !          5445: <pre>Size : Enclosing - 2 pt Min 7;</pre>
        !          5446: <p>
        !          5447: states that the character size is 2 points less than that of the enclosing
        !          5448: box, but that it may not be less than 7 points, whatever the enclosing box's
        !          5449: value.</p>
        !          5450: <p>
1.1       cvs      5451: The following rules make the text of a report be displayed with medium-sized
                   5452: characters (for example, size 5), while the title is displayed with larger
1.18    ! cvs      5453: characters and the summary is displayed with smaller characters:</p>
        !          5454: <pre>Report :
1.1       cvs      5455:      Size : 5;
                   5456: Title :
                   5457:      Size : Enclosing + 2;
                   5458: Summary :
1.18    ! cvs      5459:      Size : Enclosing - 1;</pre>
        !          5460: <p>
        !          5461: Thus, the character sizes in the entire document can be changed by changing
        !          5462: the size parameter of the Report element, while preserving the relationships
        !          5463: between the sizes of the different elements.</p>
        !          5464: </blockquote>
        !          5465: </div>
        !          5466: 
        !          5467: <div class="subsubsection">
        !          5468: 
        !          5469: <h4><a name="sectd42252">Font and character style</a></h4>
        !          5470: <p>
        !          5471: The <tt>Font</tt> rule determines the font family to be used to display the
        !          5472: characters contained in the box, while the <tt>Style</tt> rule determines
1.1       cvs      5473: their style.  Thot recognizes three character fonts (Times, Helvetica, and
                   5474: Courier) and six styles: Roman, Italics, Bold, BoldItalics, Oblique, and
1.18    ! cvs      5475: BoldOblique.</p>
        !          5476: <p>
1.1       cvs      5477: The font family and style can specified by a named constant or can be
                   5478: inherited.  For the name of the font family only the first character is
1.18    ! cvs      5479: used.</p>
        !          5480: <p>
1.1       cvs      5481: Only identical inheritance is allowed: the box takes the same font or style as
                   5482: the box from which it inherits.  This is indicated by an equals sign after the
1.18    ! cvs      5483: kinship specification.</p>
        !          5484: <blockquote class="example">
        !          5485: <p>
        !          5486: <strong>Example:</strong></p>
        !          5487: <p>
1.3       cvs      5488: To specify that the summary uses the font family of the rest of the document,
1.18    ! cvs      5489: but in the italic style, the following rules are used:</p>
        !          5490: <pre>Summary :
1.1       cvs      5491:    BEGIN
                   5492:    Font : Enclosing =;
                   5493:    Style : Italics;
1.18    ! cvs      5494:    END;</pre>
        !          5495: </blockquote>
        !          5496: </div>
        !          5497: 
        !          5498: <div class="subsubsection">
        !          5499: 
        !          5500: <h4><a name="sectd42253">Underlining</a></h4>
        !          5501: <p>
        !          5502: The <tt>Underline</tt> rule is used to specify if the characters contained in
1.1       cvs      5503: a box should have lines drawn on or near them.  There are four underlining
1.18    ! cvs      5504: styles: <tt>Underlined</tt>, <tt>Overlined</tt>, <tt>CrossedOut</tt>, and
        !          5505: <tt>NoUnderline</tt>.  The <tt>Thickness</tt> rule specifies the thickness of
        !          5506: the line, <tt>Thin</tt> or <tt>Thick</tt>.</p>
        !          5507: <p>
1.1       cvs      5508: As with font family and style, only identical inheritance is allowed: the box
                   5509: has the same underlining type as the box from which it inherits the value.
1.18    ! cvs      5510: This is indicated by an equals sign after the kinship specification.</p>
        !          5511: <pre>                   'Underline' ':' UnderLineInherit /
1.1       cvs      5512:                    'Thickness' ':' ThicknessInherit /
                   5513: 
                   5514: UnderLineInherit = Kinship '=' / 'NoUnderline' /
                   5515:                    'Underlined' / 
                   5516:                    'Overlined' / 'CrossedOut' .
1.18    ! cvs      5517: ThicknessInherit = Kinship '=' / 'Thick' / 'Thin' .</pre>
        !          5518: </div>
        !          5519: </div>
        !          5520: 
        !          5521: <div class="subsection">
        !          5522: 
        !          5523: <h3><a name="sectc4226">Stacking order</a></h3>
        !          5524: <p>
        !          5525: The <tt>Depth</tt> rule is used to define the stacking order of terminal boxes
1.1       cvs      5526: when multiple boxes at least partially overlap.  This rule defines how the
                   5527: depth parameter, which is zero or a positive integer, is calculated.  The
                   5528: depth parameter has a value for all boxes.  For terminal boxes in the
                   5529: structure and for presentation boxes, the depth value is used during display
                   5530: and printing: the boxes with the lowest value overlap those with higher
                   5531: depths.  For non-terminal boxes, the depth is not interpreted during display,
1.18    ! cvs      5532: but it is used to calculate the depth of terminal boxes by inheritance.</p>
        !          5533: <p>
        !          5534: Like most other rules, the depth rule is defined in the <a
        !          5535: href="#sectc427">default rules</a> of each presentation schema.  Thus, there
        !          5536: is always a depth value, even when it is not necessary because there is no
        !          5537: overlapping.  To avoid useless operations, a zero value can be given to the
        !          5538: depth parameter, which signifies that overlapping is never a problem.</p>
        !          5539: <p>
        !          5540: The depth rule has the same form as the <a href="#sectc4224">visibility
        !          5541: rule</a>. It can be defined by inheritance or by a constant numeric value.
        !          5542: When the rule is attached to a numeric attribute, it can take the value of
        !          5543: that attribute.</p>
        !          5544: <pre>                'Depth' ':' NumberInherit</pre>
        !          5545: <blockquote class="example">
        !          5546: <p>
        !          5547: <strong>Example:</strong></p>
        !          5548: <p>
1.3       cvs      5549: For a purely textual document, in which overlapping never poses a problem, a
1.18    ! cvs      5550: single default <tt>Depth</tt> rule in the presentation schema is
        !          5551: sufficient:</p>
        !          5552: <pre>DEFAULT
1.1       cvs      5553:     Depth : 0;
1.18    ! cvs      5554:     ...</pre>
        !          5555: <p>
1.1       cvs      5556: To make the text of examples appear on a light blue background, a presentation
1.18    ! cvs      5557: box is defined:</p>
        !          5558: <pre>BOXES
1.1       cvs      5559:    BlueBG :
                   5560:       BEGIN
                   5561:       Content : Graphics 'R';
                   5562:       Background : LightBlue3;
                   5563:       FillPattern: backgroundcolor;
                   5564:       Depth : 2;
                   5565:       ...
1.18    ! cvs      5566:       END;</pre>
        !          5567: <p>
        !          5568: and is created by the <tt>Example</tt> element, which has the rules:</p>
        !          5569: <pre>RULES
1.1       cvs      5570:    Example :
                   5571:       BEGIN
                   5572:       CreateFirst (BlueBG);
                   5573:       Depth : 1;
                   5574:       ...
1.18    ! cvs      5575:       END;</pre>
        !          5576: <p>
        !          5577: In this way, the text of an example (if it inherits its depth from its
        !          5578: ancestor) will be superimposed on a light blue background, and not the
        !          5579: reverse).</p>
        !          5580: </blockquote>
        !          5581: </div>
        !          5582: 
        !          5583: <div class="subsection">
        !          5584: 
        !          5585: <h3><a name="sectc4227">Line style</a></h3>
        !          5586: <p>
        !          5587: The <tt>LineStyle</tt> rule determines the style of line which should be used
        !          5588: to draw all the elements contained in the box and the box itself, if it has a
        !          5589: <a href="#sectc4230a"><tt>ShowBox</tt> rule</a>.  The line style can be
        !          5590: indicated by a name (<tt>Solid</tt>, <tt>Dashed</tt>, <tt>Dotted</tt>) or it
1.13      cvs      5591: can be inherited.  All elements of the graphic base type are affected by this
1.1       cvs      5592: rule, but it can be attached to any box and transmitted by inheritance to the
1.18    ! cvs      5593: graphic elements.  The border of elements having a <a
        !          5594: href="#sectc4230a"><tt>ShowBox</tt> rule</a> is drawn according to the line
        !          5595: style specified by this rule.</p>
        !          5596: <p>
1.1       cvs      5597: Only identical inheritance is allowed: the box takes the same line style as
                   5598: the box from which it inherits.  This is indicated by an equals sign after the
1.18    ! cvs      5599: kinship specification.</p>
        !          5600: <pre>                      'LineStyle' ':' LineStyleInherit
1.1       cvs      5601:      LineStyleInherit = Kinship '=' /
1.18    ! cvs      5602:                       'Solid' / 'Dashed' / 'Dotted' .</pre>
        !          5603: <blockquote class="example">
        !          5604: <p>
        !          5605: <strong>Example:</strong></p>
        !          5606: <p>
1.3       cvs      5607: To specify that, in Figures, the graphical parts should be drawn in solid
1.18    ! cvs      5608: lines, the Figure element is given a rule using the <tt>Solid</tt> name:</p>
        !          5609: <pre>Figure :
        !          5610:    LineStyle : Solid;</pre>
        !          5611: <p>
        !          5612: and the elements composing figures are given an inheritance rule:</p>
        !          5613: <pre>   LineStyle : Enclosing =;</pre>
        !          5614: </blockquote>
        !          5615: </div>
        !          5616: 
        !          5617: <div class="subsection">
        !          5618: 
        !          5619: <h3><a name="sectc4228">Line thickness</a></h3>
        !          5620: <p>
        !          5621: The <tt>LineWeight</tt> rule determines the thickness of the lines  of all
1.1       cvs      5622: graphical elements which appear in the box, no matter what their line style.
                   5623: Line thickness can be specified by a constant value or by inheritance.  A
                   5624: constant value is a positive number followed by an optional unit specification
1.18    ! cvs      5625: (which is absent when using relative units).  All available <a
        !          5626: href="#sectc4217">distance units</a> can be used.  Line thickness is expressed
        !          5627: in the same way as <a href="#sectd42221">line spacing</a>.</p>
        !          5628: <pre>                 'LineWeight' ':' DistOrInherit</pre>
        !          5629: <p>
        !          5630: All elements of the graphic base type are affected by this rule, but it can be
        !          5631: attached to any box and transmitted by inheritance to the graphic elements.
        !          5632: The border of element having a <a href="#sectc4230a"><tt>ShowBox</tt> rule</a>
        !          5633: is also drawn according to the thickness specified by this rule.</p>
        !          5634: <blockquote class="example">
        !          5635: <p>
        !          5636: <strong>Example:</strong></p>
        !          5637: <p>
        !          5638: To specify that, in Figures, the graphical parts should be drawn with lines
        !          5639: 0.3 pt thick, the Figure element is given this rule:</p>
        !          5640: <pre>Figure :
        !          5641:    LineWeight : 0.3 pt;</pre>
        !          5642: <p>
        !          5643: and the elements composing figures are given an inheritance rule:</p>
        !          5644: <pre>   LineWeight : Enclosing =;</pre>
        !          5645: </blockquote>
        !          5646: </div>
        !          5647: 
        !          5648: <div class="subsection">
        !          5649: 
        !          5650: <h3><a name="sectc4229">Fill pattern</a></h3>
        !          5651: <p>
        !          5652: The <tt>FillPattern</tt> rule determines the pattern used to fill closed
1.1       cvs      5653: graphical elements (circles, rectangles, etc.) which appear in the box.  This
1.18    ! cvs      5654: rule also specifies the pattern used to fill the box associated with elements
        !          5655: having a <a href="#sectc4230a"><tt>ShowBox</tt> rule</a><a>.  This pattern can
        !          5656: be indicated by a named constant or by inheritance.  The named constant
        !          5657: identifies one of the patterns available in Thot.  The names of the available
        !          5658: patterns are: nopattern, foregroundcolor, backgroundcolor, gray1, gray2,
        !          5659: gray3, gray4, gray5, gray6, gray7, horiz1, horiz2, horiz3, vert1, vert2,
        !          5660: vert3, left1, left2, left3, right1, right2, right3, square1, square2, square3,
        !          5661: lozenge, brick, tile, sea, basket.</a></p>
        !          5662: <p>
        !          5663: Like the other rules peculiar to graphics, <tt>LineStyle</tt> and
        !          5664: <tt>LineWeight</tt>, only elements of the graphic base type are affected by
        !          5665: the <tt>FillPattern</tt> rule, but the rule can be attached to any box and
1.1       cvs      5666: transmitted by inheritance to the graphic elements.  As with the other rules
1.18    ! cvs      5667: specific to graphics, only identical inheritance is allowed.</p>
        !          5668: <p>
        !          5669: The <tt>FillPattern</tt> rule can also be used to determine whether or not
1.12      cvs      5670: text characters, symbols and pictures should be colored.  For these element
                   5671: types (text, symbols, and pictures), the only valid values are
1.18    ! cvs      5672: <tt>nopattern</tt>, <tt>foregroundcolor</tt>, and <tt>backgroundcolor</tt>.
        !          5673: When <tt>FillPattern</tt> has the value <tt>backgroundcolor</tt>, text
        !          5674: characters, symbols, and bitmaps are given the color specified by the <a
        !          5675: href="#sectc4230"><tt>Background</tt> rule</a> which applies to these
        !          5676: elements.  When <tt>FillPattern</tt> has the value <tt>foregroundcolor</tt>,
        !          5677: these same elements are given the color specified by the <a
        !          5678: href="#sectc4230"><tt>Foreground</tt> rule</a> which applies to these
        !          5679: elements.  In all other case, text characters are not colored.</p>
        !          5680: <pre>                 'FillPattern' ':' NameInherit</pre>
        !          5681: <blockquote class="example">
        !          5682: <p>
        !          5683: <strong>Example:</strong></p>
        !          5684: <p>
1.3       cvs      5685: To specify that, in Figures, the closed graphical elements should be filled
                   5686: with a pattern resembling a brick wall, the Figure element is given this
1.18    ! cvs      5687: rule:</p>
        !          5688: <pre>Figure :
        !          5689:    FillPattern : brick;</pre>
        !          5690: <p>
        !          5691: and the elements composing figures are given an inheritance rule:</p>
        !          5692: <pre>   FillPattern : Enclosing =;</pre>
        !          5693: </blockquote>
        !          5694: </div>
        !          5695: 
        !          5696: <div class="subsection">
        !          5697: 
        !          5698: <h3><a name="sectc4230">Colors</a></h3>
        !          5699: <p>
        !          5700: The <tt>Foreground</tt> and <tt>Background</tt> rules determine the foreground
1.13      cvs      5701: and background colors of the base elements which appear in the box. They also
1.18    ! cvs      5702: control the color of boxes associated with elements having a <a
        !          5703: href="#sectc4230a"><tt>ShowBox</tt> rule</a>.  These colors can be specified
        !          5704: with a named constant or by inheritance.  The named constants specify one of
        !          5705: the available colors in Thot.  The available color names can be found in the
        !          5706: file <tt>thot.color</tt>.</p>
        !          5707: <p>
        !          5708: The color rules affect the same way all base elements and elements having a <a
        !          5709: href="#sectc4230a"><tt>ShowBox</tt> rule</a>, no matter what their type (text,
        !          5710: graphics, pictures, symbols).  The color rules can be associated with any box
        !          5711: and can be transmitted by inheritance to the base elements or the elements
        !          5712: having a <a href="#sectc4230a"><tt>ShowBox</tt> rule</a>.  Like the preceding
        !          5713: rules, only inheritance of the same value is allowed.</p>
        !          5714: <pre>                 'Foreground' ':' NameInherit
        !          5715:                  'Background' ':' NameInherit</pre>
        !          5716: <p>
        !          5717: <strong>Note:</strong> text colors only appear for text elements whose <a
        !          5718: href="#sectc4229">fill pattern</a> does not prevent the use of color.</p>
        !          5719: <blockquote class="example">
        !          5720: <p>
        !          5721: <strong>Example:</strong></p>
        !          5722: <p>
1.3       cvs      5723: To specify that, in Figures, everything must be drawn in blue on a background
1.18    ! cvs      5724: of yellow, the Figure element is given these rules:</p>
        !          5725: <pre>Figure :
1.1       cvs      5726:    BEGIN
                   5727:    Foreground : Blue;
                   5728:    Background : Yellow;
                   5729:    Fillpattern : backgroundcolor;
1.18    ! cvs      5730:    END;</pre>
        !          5731: <p>
        !          5732: and the elements composing figures are given inheritance rules:</p>
        !          5733: <pre>   Foreground : Enclosing =;
1.1       cvs      5734:    Background : Enclosing =;
1.18    ! cvs      5735:    FillPattern : Enclosing =;</pre>
        !          5736: </blockquote>
        !          5737: </div>
        !          5738: 
        !          5739: <div class="subsection">
        !          5740: 
        !          5741: <h3><a name="sectc4230a">Background color and border</a></h3>
        !          5742: <p>
        !          5743: Boxes associated with structural elements are normally not visible, but it is
        !          5744: possible to draw their border and/or to paint their area when it is needed.
        !          5745: This is achieved by associating the <tt>ShowBox</tt> rule with the concerned
1.13      cvs      5746: element.  This rule has no parameter and no value. It is simply written
1.18    ! cvs      5747: <tt>Showbox;</tt>. It is not inherited nor transmitted to any other element.
        !          5748: It applies only to the element with which it is associated.</p>
        !          5749: <pre>                 'ShowBox'</pre>
        !          5750: <p>
        !          5751: When an element has a <tt>ShowBox</tt> rule, the border is drawn only if the
        !          5752: <tt>LineWeight</tt> rule that applies to that element has a non-zero value
        !          5753: (this value can be inherited).  The color, style and thickness of the border
        !          5754: are defined by the <tt>Foreground</tt>, <tt>LineStyle</tt>, and
        !          5755: <tt>LineWeight</tt> rules that apply to the element.</p>
        !          5756: <p>
        !          5757: When an element has a <tt>ShowBox</tt> rule, the background of this element is
        !          5758: paint only if the value of the <tt>FillPattern</tt> rule that applies to that
        !          5759: element is not <tt>nopattern</tt>.  The pattern and color(s) of the background
        !          5760: are defined by the <tt>FillPattern</tt>, <tt>Background</tt>, and
        !          5761: <tt>Foreground</tt> rules that apply to the element.</p>
        !          5762: </div>
        !          5763: 
        !          5764: <div class="subsection">
        !          5765: 
        !          5766: <h3><a name="sectc4230b">Background pictures</a></h3>
        !          5767: <p>
        !          5768: The <tt>BackgroundPicture</tt> rule allows to display a picture as the
1.13      cvs      5769: background of an element.  It has a single parameter, the file name of the
1.18    ! cvs      5770: picture.  This is a string delimited by single quotes.  If the first character
        !          5771: in this string is '/', it is considered as an absolute path, otherwise the
        !          5772: file is searched for along the schema directory path.  This file may contain a
        !          5773: picture in any format accepted by Thot (xbm, xpm, gif, jpeg, png, etc.)</p>
        !          5774: <p>
        !          5775: The <tt>BackgroundPicture</tt> and <tt>PictureMode</tt> rules apply only to
1.13      cvs      5776: the element with which they are associated.  They are not inherited nor
1.18    ! cvs      5777: transmitted to children elements.</p>
        !          5778: <p>
1.13      cvs      5779: The background picture has not always the same size as the element's box.
                   5780: There are diffrent ways to fill the element box with the picture.  This is
1.18    ! cvs      5781: specified by the <tt>PictureMode</tt> rule, which should be associated to the
        !          5782: same element.  This rule may take one of the following values:</p>
        !          5783: <dl>
        !          5784: <dt><tt>NormalSize</tt></dt>
        !          5785: <dd>
        !          5786: The picture is centered in the box, and clipped if it is too large.
        !          5787: </dd>
        !          5788: <dt><tt>Scale</tt></dt>
        !          5789: <dd>
        !          5790: The picture is zoomed to fit the box size.
        !          5791: </dd>
        !          5792: <dt><tt>RepeatX</tt></dt>
        !          5793: <dd>
        !          5794: The picture is repeated horizontally to fit the box width.
        !          5795: </dd>
        !          5796: <dt><tt>RepeatY</tt></dt>
        !          5797: <dd>
        !          5798: The picture is repeated vertically to fit the box height.
        !          5799: </dd>
        !          5800: <dt><tt>RepeatXY</tt></dt>
        !          5801: <dd>
        !          5802: The picture is repeated both horizontally and vertically to fill the box.
        !          5803: </dd>
        !          5804: </dl>
        !          5805: <p>
        !          5806: If an element has a <tt>BackgroundPicture</tt> rule and no
        !          5807: <tt>PictureMode</tt> rule, the <tt>NormalSize</tt> value is assumed.</p>
        !          5808: <pre>                 'BackgroundPicture' ':' FileName /
1.13      cvs      5809:                  'PictureMode' ':' PictMode .
                   5810:  
                   5811:       FileName = STRING .
1.18    ! cvs      5812:       PictMode = 'NormalSize' / 'Scale' / 'RepeatXY' / 'RepeatX' / 'RepeatY' .</pre>
        !          5813: <p>
        !          5814: The <tt>BackgroundPicture</tt> and <tt>PictureMode</tt> rules apply only to
1.13      cvs      5815: the element with which they are associated.  They are not inherited nor
1.18    ! cvs      5816: transmitted to children elements.</p>
        !          5817: </div>
1.13      cvs      5818: 
1.18    ! cvs      5819: <div class="subsection">
1.1       cvs      5820: 
1.18    ! cvs      5821: <h3><a name="sectc4231">Presentation box content</a></h3>
        !          5822: <p>
        !          5823: The <tt>Content</tt> rule applies to presentation boxes.  It indicates the
1.1       cvs      5824: content given to a box.  This content is either a variable's value or a
1.18    ! cvs      5825: constant value.  In the special case of <a href="#sectc4233">header or footer
        !          5826: boxes</a>, the content can also be a structured element type.</p>
        !          5827: <p>
1.1       cvs      5828: If the content is a constant, it can be specified, as in a variable
1.18    ! cvs      5829: declaration, either by the name of a constant declared in the <tt>CONST</tt>
1.1       cvs      5830: section or by direct specification of the type and value of the box's
1.18    ! cvs      5831: content.</p>
        !          5832: <p>
1.1       cvs      5833: Similarly, if it is a variable, the name of a variable declared in
1.18    ! cvs      5834: <tt>VAR</tt> section can be given or the variable may be defined within
        !          5835: parentheses.  The content inside the parentheses has the same syntax as a <a
        !          5836: href="#sectc426">variable declaration</a>.</p>
        !          5837: <p>
1.1       cvs      5838: When the content is a structured element type, the name of the element type is
                   5839: given after the colon.  In this case,  the box's content is all elements of
                   5840: the named type which are designated by references which are part of the page
1.18    ! cvs      5841: on which the header or footer with this <tt>Content</tt> rule appears.  Only
        !          5842: associated elements can appear in a <tt>Content</tt> rule and the structure
1.1       cvs      5843: must provide references to these elements.  Moreover, the box whose content
                   5844: they are must be a header or footer box generated by a page box of the primary
1.18    ! cvs      5845: view.</p>
        !          5846: <pre>               'Content' ':' VarConst
1.1       cvs      5847:      VarConst = ConstID / ConstType ConstValue /
                   5848:                 VarID / '(' FunctionSeq ')' /
1.18    ! cvs      5849:                 ElemID .</pre>
        !          5850: <p>
        !          5851: A presentation box can have only one <tt>Content</tt> rule, which means that
1.1       cvs      5852: the content of a presentation box cannot vary from view to view. However, such
                   5853: an effect can be achieved by creating several presentation boxes, each with
1.18    ! cvs      5854: different content and visible in different views.</p>
        !          5855: <p>
        !          5856: The <tt>Content</tt> rule also applies to elements defined as references in
1.1       cvs      5857: the structure schema.  In this case, the content defined by the rule  must be
                   5858: a constant.  It is this content which appears on the screen or paper to
                   5859: represent references of the type to which the rule applies.  A reference can
1.18    ! cvs      5860: have a <tt>Content</tt> rule or a <a href="#sectc4234"><tt>Copy</tt> rule</a>
1.1       cvs      5861: for each view.  If neither of these rules appears, the reference is displayed
1.18    ! cvs      5862: as <tt>[*]</tt>, which is equivalent to the rule:</p>
        !          5863: <pre>     Content: Text '[*]';</pre>
        !          5864: <blockquote class="example">
        !          5865: <p>
        !          5866: <strong>Example:</strong></p>
        !          5867: <p>
1.3       cvs      5868: The content of the presentation box created to make the chapter number and
1.18    ! cvs      5869: section number appear before each section title can be defined by:</p>
        !          5870: <pre>BOXES
1.1       cvs      5871:      SectionNumBox :
                   5872:           BEGIN
                   5873:           Content : NumSection;
                   5874:           ...
1.18    ! cvs      5875:           END;</pre>
        !          5876: <p>
        !          5877: if the <tt>NumSection</tt> variable has been defined in the variable
        !          5878: definition section of the presentation schema.  Otherwise the <tt>Content</tt>
        !          5879: would be written:</p>
        !          5880: <pre>BOXES
1.1       cvs      5881:      SectionNumBox :
                   5882:           BEGIN
                   5883:           Content : (VALUE (ChapterCtr, Roman) TEXT '.'
                   5884:                      VALUE (SectionCtr, Arabic));
                   5885:           ...
1.18    ! cvs      5886:           END;</pre>
        !          5887: <p>
        !          5888: To specify that a page footer should contain all elements of the <tt>Note</tt>
        !          5889: type are referred to in the page, the following rule is written:</p>
        !          5890: <pre>BOXES
1.1       cvs      5891:      NotesFooterBox :
                   5892:           BEGIN
                   5893:           Content : Note;
                   5894:           ...
1.18    ! cvs      5895:           END;</pre>
        !          5896: <p>
        !          5897: <tt>Note</tt> is defined as an associated element in the structure schema and
        !          5898: NotesFooterBox is created by a page box of the primary view.</p>
        !          5899: </blockquote>
        !          5900: </div>
1.1       cvs      5901: 
1.18    ! cvs      5902: <div class="subsection">
1.1       cvs      5903: 
1.18    ! cvs      5904: <h3><a name="sectc4232">Presentation box creation</a></h3>
        !          5905: <p>
1.1       cvs      5906: A creation rule specifies that a presentation box should be created when an
1.18    ! cvs      5907: element of the type to which the rule is attached appears in the document.</p>
        !          5908: <p>
1.1       cvs      5909: A keyword specifies the position, relative to the creating box, at which the
1.18    ! cvs      5910: created box will be placed in the structure:</p>
        !          5911: <dl>
        !          5912: <dt><tt>CreateFirst</tt></dt>
        !          5913: <dd>
        !          5914: specifies that the box should be created as the first box of the next lower
1.2       cvs      5915: level, before any already existing boxes, and only if the beginning of the
1.1       cvs      5916: creating element is visible;
1.18    ! cvs      5917: </dd>
        !          5918: <dt><tt>CreateLast</tt></dt>
        !          5919: <dd>
        !          5920: specifies that the box should be created as the last box of the next lower
        !          5921: level, after any existing boxes, and only if the end of the creating element
        !          5922: is visible;
        !          5923: </dd>
        !          5924: <dt><tt>CreateBefore</tt></dt>
        !          5925: <dd>
        !          5926: specifies that the box should be created before the creating box, on the same
        !          5927: level as the creating box, and only if the beginning of the creating element
        !          5928: is visible;
        !          5929: </dd>
        !          5930: <dt><tt>CreateAfter</tt></dt>
        !          5931: <dd>
        !          5932: specifies that the box should be created after the creating box, on the same
        !          5933: level as the creating box, and only if the beginning of the creating element
        !          5934: is visible;
        !          5935: </dd>
        !          5936: <dt><tt>CreateEnclosing</tt></dt>
        !          5937: <dd>
        !          5938: specifies that the box should be created at the upper level relatively to the
        !          5939: creating box, and that it must contain that creating box and all presentation
        !          5940: boxes created by the same creating box.
        !          5941: </dd>
        !          5942: </dl>
        !          5943: <p>
        !          5944: This keyword can be followed by the <tt>Repeated</tt> keyword to indicate that
1.1       cvs      5945: the box must be created for each part of the creating element. These parts
                   5946: result from the division of the element by page breaks or column changes.  If
1.18    ! cvs      5947: the <tt>Repeated</tt> keyword is missing, the box is only created for the
        !          5948: first part of the creating element (<tt>CreateFirst</tt> and
        !          5949: <tt>CreateBefore</tt> rules) or for the last part (<tt>CreateLast</tt> and
        !          5950: <tt>CreateAfter</tt> rules).</p>
        !          5951: <p>
1.1       cvs      5952: The type of presentation to be created is specified at the end of the rule
1.18    ! cvs      5953: between parentheses.</p>
        !          5954: <p>
        !          5955: Creation rules cannot appear in the <a href="#sectc427">default presentation
        !          5956: rules</a>.  The boxes being created should have a <tt>Content</tt> rule which
        !          5957: indicates their <a href="#sectc4231">content</a>.</p>
        !          5958: <p>
1.1       cvs      5959: Creation rules can only appear in the block of rules for the primary view;
                   5960: creation is provoked by a document element for all views. However, for each
                   5961: view, the presentation box is only created if the creating element is itself a
                   5962: box in the view. Moreover, the visibility parameter of the presentation box
                   5963: can be adjusted to control the creation of the box on a view-by-view
1.18    ! cvs      5964: basis.</p>
        !          5965: <pre>                     Creation '(' BoxID ')'
1.1       cvs      5966:      Creation      = Create [ 'Repeated' ] .
                   5967:      Create        ='CreateFirst' / 'CreateLast' /
                   5968:                     'CreateBefore' / 'CreateAfter' /
1.18    ! cvs      5969:                     'CreateEnclosing' .</pre>
        !          5970: <blockquote class="example">
        !          5971: <p>
        !          5972: <strong>Example:</strong></p>
        !          5973: <p>
1.3       cvs      5974: Let us define an object type, called Table, which is composed of a sequence of
                   5975: columns, all having the same fixed width, where the columns are separated by
1.18    ! cvs      5976: vertical lines.  There is a line to the left of the first column and one to
        !          5977: the right of the last.  Each column has a variable number of cells, placed one
        !          5978: on top of the other and separated by horizontal lines.  There are no
        !          5979: horizontal lines above the first cell or below the last cell.  The text
        !          5980: contained in each cell is  broken into lines and these lines are centered
        !          5981: horizontally in the cell. The logical structure of this object is defined
        !          5982: by:</p>
        !          5983: <pre>Table   = LIST OF (Column);
        !          5984: Column  = LIST OF (Cell = Text);</pre>
        !          5985: 
        !          5986: <div class="figure">
        !          5987: <hr>
        !          5988: <pre>|                |                |               |
1.1       cvs      5989: |  xx xxxx xxxx  |x xxxx xxx xxxxx|  x xxx x xxx  |
                   5990: | xxx xxx xxxx x |   x xx x xxx   | xxxxx xxxx xx |
                   5991: |   xxxxx xxxx   |----------------|  xxx xxxxx x  |
                   5992: | xxxxx xxx xxxx | xxxx xx xx xxx |     xx xx     |
                   5993: | xxx xxxx x xxx |  xxxx x xxx x  |---------------|
                   5994: |----------------| xxx xxxx xxxxx |  xxxxx xxxxx  |
                   5995: | xxx xxx xxxxxx |----------------| xxx xxxx xxxx |
                   5996: |  xxxx xxxx xx  |  xxxx xx x xx  |  xxx xx x xx  |
                   5997: |----------------| xxx xxxxx xxxx | xxxx xxxx xxx |
                   5998: | xxxxx xxx xxxx |  xxxx xx x xx  |   xxxxx xxx   |
1.18    ! cvs      5999: |xxxx xx x xxxxxx| xxxx xx xxxxxx |  xxxxx xxxxx  |</pre>
        !          6000: <p align=center>
        !          6001: <em><a name="table">The design of a table</a></em></p>
        !          6002: <hr>
        !          6003: </div>
        !          6004: <p>
        !          6005: The presentation of the table should resemble the design of the above <a
        !          6006: href="#table">figure</a>.  It is defined by the following presentation schema
        !          6007: fragment:</p>
        !          6008: <pre>BOXES
1.1       cvs      6009:      VertLine : BEGIN
                   6010:                 Width : 0.3 cm;
                   6011:                 Height : Enclosing . Height;
                   6012:                 VertPos : Top = Enclosing . Top;
                   6013:                 HorizPos : Left = Previous . Right;
                   6014:                 Content : Graphics 'v';
                   6015:                 END;
                   6016: 
                   6017:      HorizLine: BEGIN
                   6018:                 Width : Enclosing . Width;
                   6019:                 Height : 0.3 cm;
                   6020:                 VertPos : Top = Previous . Bottom;
                   6021:                 HorizPos : Left = Enclosing . Left;
                   6022:                 Content : Graphics 'h';
                   6023:                 END;
                   6024: 
                   6025: RULES
1.6       cvs      6026:      Column   : BEGIN
                   6027:                 CreateBefore (VertLine);
                   6028:                 IF LAST CreateAfter (VertLine);
                   6029:                 Width : 2.8 cm;
                   6030:                 Height : Enclosed . Height;
                   6031:                 VertPos : Top = Enclosing . Top;
                   6032:                 HorizPos : Left = Previous . Right;
                   6033:                 END;
                   6034: 
                   6035:      Cell     : BEGIN
                   6036:                 IF NOT FIRST CreateBefore (HorizLine);
                   6037:                 Width : Enclosing . Width;
                   6038:                 Height : Enclosed . Height;
                   6039:                 VertPos : Top = Previous . Bottom;
                   6040:                 HorizPos : Left = Enclosing . Left;
                   6041:                 Line;
                   6042:                 Adjust : VMiddle;
1.18    ! cvs      6043:                 END;</pre>
        !          6044: <p>
1.1       cvs      6045: It is useful to note that the horizontal position rule of the first vertical
                   6046: line will not be applied, since there is no preceding box. In this case, the
1.18    ! cvs      6047: box is simply placed on the left side of the enclosing box.</p>
        !          6048: </blockquote>
        !          6049: </div>
        !          6050: 
        !          6051: <div class="subsection">
        !          6052: 
        !          6053: <h3><a name="sectc4233">Page layout</a></h3>
        !          6054: <p>
        !          6055: The page models specified in the <tt>Page</tt> rule are defined by boxes
        !          6056: declared in the <tt>BOXES</tt> section of the presentation schema.  Pages are
1.1       cvs      6057: not described as frames which will be filled by the document's text, but as
                   6058: element are inserted in the flow of the document and which mark the page
                   6059: breaks.  Each of these page break elements contains presentation boxes which
                   6060: represent the footer boxes of a page followed by header boxes of the next
                   6061: page.  The page box itself is the simple line which separates two pages on the
                   6062: screen.  Both the footer and header boxes placed themselves with respect to
                   6063: this page box, with the footer being placed above it and the header boxes
1.18    ! cvs      6064: being placed above it.</p>
        !          6065: <p>
1.1       cvs      6066: The boxes created by a page box are headers and footers and can only place
                   6067: themselves vertically with respect to the page box itself (which is in fact
                   6068: the separation between two pages).  Besides, it is their vertical position
                   6069: rule  which determines whether they are header or footer boxes.  Header and
                   6070: footer boxes must have an explicit vertical position rule (they must not use
1.18    ! cvs      6071: the default rule).</p>
        !          6072: <p>
1.1       cvs      6073: Footer boxes must have an absolute height or inherit the height of their
1.18    ! cvs      6074: contents:</p>
        !          6075: <pre>Height : Enclosed . Height;</pre>
        !          6076: <p>
1.1       cvs      6077: A page box must have height and width rules and these two rules must be
                   6078: specified with constant values, expressed in centimeters, inches, or
                   6079: typographer's points.  These two rules are interpreted in a special way for
                   6080: page boxes:  they determine the width of the page and the vertical distance
                   6081: between two page separators, which is the height of the page and its header
1.18    ! cvs      6082: and footer together.</p>
        !          6083: <p>
1.1       cvs      6084: A page box should also have vertical and horizontal position rules and these
                   6085: two rules should specify the position on the sheet of paper of the rectangle
                   6086: enclosing the page's contents.  These two rules must position the upper left
                   6087: corner of the enclosing rectangle in relation to the upper left corner of the
                   6088: sheet of paper, considered to be the enclosing element.  In both rules,
1.18    ! cvs      6089: distances must be expressed in fixed units: centimeters (<tt>cm</tt>), inches
        !          6090: (<tt>in</tt>), or typographer's points (<tt>pt</tt>).  Thus, rules similar to
        !          6091: the following should be found in the rules for a page box:</p>
        !          6092: <pre>BOXES
1.1       cvs      6093:    ThePage :
                   6094:       BEGIN
                   6095:       VertPos : Top = Enclosing . Top + 3 cm;
                   6096:       HorizPos : Left = Enclosing . Left + 2.5 cm;
                   6097:       Width : 16 cm;
                   6098:       Height : 22.5 cm;
1.18    ! cvs      6099:       END;</pre>
        !          6100: <p>
1.1       cvs      6101: When a document must be page broken, the page models to be constructed are
1.18    ! cvs      6102: defined in the <tt>BOXES</tt> section of the presentation schema by declaring
        !          6103: page boxes and header and footer boxes.  Also, the <tt>Page</tt> rule is used
1.1       cvs      6104: to specify to which parts of the document and to which views each model should
1.18    ! cvs      6105: be applied.</p>
        !          6106: <p>
        !          6107: The <tt>Page</tt> rule has only one parameter, given between parentheses after
        !          6108: the <tt>Page</tt> keyword.  This parameter is the name of the box which must
        !          6109: serve as the model for page construction.  When a <tt>Page</tt> rule is
1.1       cvs      6110: attached to an element type, each time such an element appears in a document,
                   6111: a page break takes place and the page model indicated in the rule is applied
                   6112: to all following pages, until reaching the next element which has a
1.18    ! cvs      6113: <tt>Page</tt> rule.</p>
        !          6114: <p>
        !          6115: The <tt>Page</tt> rule applies to only one view; if it appears in the primary
        !          6116: view's block of rules, a <tt>Page</tt> rule applies only to that view. Thus,
1.1       cvs      6117: different page models can be defined for the full document and for its table
                   6118: of contents, which is another view of the same document. Some views can be
                   6119: specified with pages, and other views of the same document can be specified
1.18    ! cvs      6120: without pages.</p>
        !          6121: <pre>                   'Page' '(' BoxID ')'</pre>
        !          6122: </div>
        !          6123: 
        !          6124: <div class="subsection">
        !          6125: 
        !          6126: <h3><a name="sectc4234">Box copies</a></h3>
        !          6127: <p>
        !          6128: The <tt>Copy</tt> rule can be used for an element which is defined as a
1.7       cvs      6129: reference in the structure schema.  In this case, the rule specifies, between
1.18    ! cvs      6130: parenthesis, the name of the box (declared in the <tt>BOXES</tt> section)
1.1       cvs      6131: which must be produced when this reference appears in the structure of a
                   6132: document.  The box produced is a copy (same contents, but possible different
                   6133: presentation) of the box type indicated by the parameter between parentheses,
                   6134: and which is in the element designated by the reference.  The name of a box
                   6135: can be replaced by type name. Then what is copied is the contents of the
1.18    ! cvs      6136: element of this type which is inside the referenced element.</p>
        !          6137: <p>
1.1       cvs      6138: Whether a box name or type name is given, it may be followed by the name of a
                   6139: structure schema between parentheses.  This signifies that the box or type is
                   6140: defined in the indicated structure schema and not in the structure schema with
1.18    ! cvs      6141: which the rule's presentation schema is associated.</p>
        !          6142: <p>
        !          6143: The <tt>Copy</tt> rule can also be applied to a presentation box.  If the
1.1       cvs      6144: presentation box was created by a reference attribute, the rule is applied as
                   6145: in the case of a reference element: the contents of the box having the
1.18    ! cvs      6146: <tt>Copy</tt> rule are based on the element designated by the reference
        !          6147: attribute.  For other presentation boxes, the <tt>Copy</tt> rule takes a type
1.1       cvs      6148: name parameter which can be followed, between parentheses, by the name of the
                   6149: structure schema in which the type is defined, if it is not defined in the
                   6150: same schema.  The contents of the box which has this rule are a copy of the
                   6151: element of this type which is in the element creating the presentation box, or
                   6152: by default, the box of this type which precedes the presentation box.  This
                   6153: last facility is used, for example, to define the running titles in headers or
1.18    ! cvs      6154: footers.</p>
        !          6155: <pre>                  'Copy' '(' BoxTypeToCopy ')' .
1.1       cvs      6156:   BoxTypeToCopy = BoxID [ ExtStruct ] /
1.6       cvs      6157:                   ElemID [ ExtStruct ] .
1.18    ! cvs      6158:   ExtStruct     = '(' ElemID ')' .</pre>
        !          6159: <p>
        !          6160: Like the creation rules, the <tt>Copy</tt> rule cannot appear in the <a
        !          6161: href="#sectc427">default presentation rules</a>.  Moreover, this rule can only
        !          6162: appear in the primary view's block of rules; the copy rule is applied to all
        !          6163: views.</p>
        !          6164: <blockquote class="example">
        !          6165: <p>
        !          6166: <strong>Example:</strong></p>
        !          6167: <p>
        !          6168: If the following definitions are in the structure schema:</p>
        !          6169: <pre>Body = LIST OF (Chapter =
1.1       cvs      6170:                      BEGIN
                   6171:                      ChapterTitle = Text;
                   6172:                      ChapterBody = SectionSeq;
                   6173:                      END);
1.18    ! cvs      6174: RefChapter = REFERENCE (Chapter);</pre>
        !          6175: <p>
        !          6176: then the following presentation rules (among many other rules in the
        !          6177: presentation schema) can be specified:</p>
        !          6178: <pre>COUNTERS
1.1       cvs      6179:    ChapterCtr : RANK OF Chapter;
                   6180: BOXES
                   6181:    ChapterNumber :
                   6182:       BEGIN
                   6183:       Content : (VALUE (ChapterCtr, URoman));
                   6184:       ...
                   6185:       END;
                   6186: RULES
                   6187:    Chapter :
                   6188:       BEGIN
                   6189:       CreateFirst (ChapterNumber);
                   6190:       ...
                   6191:       END;
                   6192:    RefChapter :
                   6193:       BEGIN
                   6194:       Copy (ChapterNumber);
                   6195:       ...
1.18    ! cvs      6196:       END;</pre>
        !          6197: <p>
1.4       cvs      6198: which makes the number of the chapter designated by the reference appear in
                   6199: uppercase roman numerals, in place of the reference to a chapter itself.
                   6200: Alternatively, the chapter title can be made to appear in place of the
1.18    ! cvs      6201: reference by writing this <tt>Copy</tt>rule:</p>
        !          6202: <pre>      Copy (ChapterTitle);</pre>
        !          6203: <p>
        !          6204: To define a header box, named <tt>RunningTitle</tt>, which contains the title
        !          6205: of the current chapter, the box's contents are defined in this way:</p>
        !          6206: <pre>BOXES
1.1       cvs      6207:    RunningTitle :
1.18    ! cvs      6208:       Copy (ChapterTitle);</pre>
        !          6209: </blockquote>
        !          6210: </div>
        !          6211: </div>
        !          6212: <hr>
        !          6213: </div>
1.1       cvs      6214: 
1.18    ! cvs      6215: <div class="chapter">
1.1       cvs      6216: 
1.18    ! cvs      6217: <h1><a name="sect5">The T language</a></h1>
1.1       cvs      6218: 
1.18    ! cvs      6219: <div class="section">
1.1       cvs      6220: 
1.18    ! cvs      6221: <h2><a name="sectb51">Document translation</a></h2>
        !          6222: <p>
1.1       cvs      6223: Because of its document model, Thot can produce documents in a high-level
1.18    ! cvs      6224: abstract form.  This form, called the <em>canonical form</em> is specific to
1.1       cvs      6225: Thot; it is well suited to the editor's manipulations, but it does not
                   6226: necessarily suit other operations which might be applied to documents. Because
                   6227: of this, the Thot editor offers the choice of saving documents in its own form
                   6228: (the canonical form) or a format defined by the user.  In the latter case, the
                   6229: Thot document is transformed by the translation program.  This facility can
                   6230: also be used to export documents from Thot to systems using other
1.18    ! cvs      6231: formalisms.</p>
1.1       cvs      6232: 
1.18    ! cvs      6233: <div class="subsection">
1.1       cvs      6234: 
1.18    ! cvs      6235: <h3><a name="sectc511">Translation principles</a></h3>
        !          6236: <p>
1.1       cvs      6237: Document translation allows the export of documents to other systems which do
                   6238: not accept Thot's canonical form.  Translation can be used to export document
1.18    ! cvs      6239: to source-based formatters like T<sub><big>E</big></sub>X,
        !          6240: L<sup>A</sup>T<sub><big>E</big></sub>X, and <tt>troff</tt>.  It can also be
1.1       cvs      6241: used to translate documents into interchange formats like SGML or HTML.  To
                   6242: allow the widest range of possible exports, Thot does not limit the choice of
                   6243: translations, but rather allows the user to define the formalisms into which
1.18    ! cvs      6244: documents can be translated.</p>
        !          6245: <p>
1.1       cvs      6246: For each document or object class, a set of translation rules can be defined,
                   6247: specifying how the canonical form should be transformed into a given
1.18    ! cvs      6248: formalism.  These translation rules are grouped into <em>translation
        !          6249: schemas</em>, each schema containing the rules necessary to translate a
1.1       cvs      6250: generic logical structure (document or object structure) into a particular
                   6251: formalism.  The same generic logical structure can have several different
                   6252: translation schemas, each defining translation rules for a different
1.18    ! cvs      6253: formalism.</p>
        !          6254: <p>
1.1       cvs      6255: Like presentation schemas, translation schemas are generic.  Thus, they apply
                   6256: to an entire object or document class and permit translation of all documents
1.18    ! cvs      6257: or objects of that class.</p>
        !          6258: </div>
1.1       cvs      6259: 
1.18    ! cvs      6260: <div class="subsection">
1.1       cvs      6261: 
1.18    ! cvs      6262: <h3><a name="sectc512">Translation procedure</a></h3>
        !          6263: <p>
1.1       cvs      6264: The translator works on the specific logical structure of the document being
                   6265: translated.  It traverses the primary tree of this logical structure in
                   6266: pre-order and, at each node encountered, it applies the corresponding
                   6267: translation rules defined in the translation schema. Translation can be
1.18    ! cvs      6268: associated:</p>
        !          6269: <ul>
        !          6270: <li>
        !          6271: with element types defined in the structure schema,
        !          6272: <li>
        !          6273: with global or local attributes defined in the structure schema,
        !          6274: <li>
        !          6275: with specific presentation rules,
        !          6276: <li>
        !          6277: with the content of the leaves of  the structure (characters, symbols and
1.1       cvs      6278: graphical elements)
1.18    ! cvs      6279: </ul>
        !          6280: <p>
1.1       cvs      6281: Thus, for each node, the translator applies all rules associated with the
                   6282: element type, all rules associated with each attribute (local or global)
                   6283: carried by the element, and if the element is a leaf of the tree, it also
1.10      cvs      6284: applies translation rules for characters, symbols, or graphical elements,
1.18    ! cvs      6285: depending on the type of the leaf.</p>
        !          6286: <p>
1.1       cvs      6287: Rules associated with the content of leaves are different from all other
                   6288: rules: they specify only how to translate character strings, symbols, and
                   6289: graphical elements.  All other rules, whether associated with element types,
                   6290: with specific presentation rules or with attributes, are treated similarly.
1.18    ! cvs      6291: These rules primarily allow:</p>
        !          6292: <ul>
        !          6293: <li>
        !          6294: generation of a text constant or variable before or after the contents of an
        !          6295: element,
        !          6296: <li>
        !          6297: modification of the order in which elements appear after translation,
        !          6298: <li>
        !          6299: removal of an element in the translated document,
        !          6300: <li>
        !          6301: and writing messages on the user's terminal during translation.
        !          6302: </ul>
        !          6303: </div>
        !          6304: </div>
1.1       cvs      6305: 
1.18    ! cvs      6306: <div class="section">
1.1       cvs      6307: 
1.18    ! cvs      6308: <h2><a name="sectb52">Translation definition language</a></h2>
        !          6309: <p>
1.1       cvs      6310: Translation schemas are written in a custom language, called T, which is
                   6311: described in the rest of this chapter.  The grammar of T is specified using
1.18    ! cvs      6312: the same <a href="#sectc321">meta-language</a> as was used for the S and P
1.1       cvs      6313: languages and the translation schemas are written using the same conventions
                   6314: as the structure and presentation schemas.  In particular, the keywords of the
                   6315: T language (the stings between apostrophes in the following syntax rules) can
                   6316: be written in any combination of upper-case and lower-case letters, but
                   6317: identifiers created by the programmer must always be written in the same
1.18    ! cvs      6318: way.</p>
1.1       cvs      6319: 
1.18    ! cvs      6320: <div class="subsection">
1.1       cvs      6321: 
1.18    ! cvs      6322: <h3><a name="sectc521">Organization of a translation schema</a></h3>
        !          6323: <p>
        !          6324: A translation schema is begun by the <tt>TRANSLATION</tt> keyword and is
        !          6325: terminated by the <tt>END</tt> keyword.  The <tt>TRANSLATION</tt> keyword is
1.1       cvs      6326: followed by the name of the generic structure for which a translation is being
                   6327: defined and a semicolon.  This name must be identical to the name which
1.18    ! cvs      6328: appears after the <tt>STRUCTURE</tt> keyword in the corresponding structure
        !          6329: schema.</p>
        !          6330: <p>
1.1       cvs      6331: After this declaration of the structure, the following material appears in
1.18    ! cvs      6332: order:</p>
        !          6333: <ul>
        !          6334: <li>
        !          6335: the length of lines produced by the translation,
        !          6336: <li>
        !          6337: the character delimiting the end of the line,
        !          6338: <li>
        !          6339: the character string which the translator will insert if it must line-break
        !          6340: the translated text,
        !          6341: <li>
        !          6342: declarations of
        !          6343: <ul>
        !          6344: <li>
        !          6345: buffers,
        !          6346: <li>
        !          6347: counters,
        !          6348: <li>
        !          6349: constants,
        !          6350: <li>
        !          6351: variables,
        !          6352: </ul>
        !          6353: <li>
        !          6354: translation rules associated with element types,
        !          6355: <li>
        !          6356: translation rules associated with attributes,
        !          6357: <li>
        !          6358: translation rules associated with specific presentation rules,
        !          6359: <li>
        !          6360: translation rules associated with characters strings, symbols and graphical
        !          6361: elements.
        !          6362: </ul>
        !          6363: <p>
1.1       cvs      6364: Each of these sections is introduced by a keyword followed by a sequence of
                   6365: declarations.  All of these sections are optional, expect for the translation
1.18    ! cvs      6366: rules associated with element types. Many <tt>TEXTTRANSLATE</tt> sections can
1.1       cvs      6367: appear, each defining the rules for translating character strings of a
1.18    ! cvs      6368: particular alphabet.</p>
        !          6369: <pre>     TransSchema ='TRANSLATION' ElemID ';'
1.1       cvs      6370:                 [ 'LINELENGTH' LineLength ';' ]
                   6371:                 [ 'LINEEND' CHARACTER ';' ]
                   6372:                 [ 'LINEENDINSERT' STRING ';' ]
                   6373:                 [ 'BUFFERS' BufferSeq ]
                   6374:                 [ 'COUNTERS' CounterSeq ]
                   6375:                 [ 'CONST' ConstSeq ]
                   6376:                 [ 'VAR' VariableSeq ]
                   6377:                   'RULES' ElemSeq
                   6378:                 [ 'ATTRIBUTES' AttrSeq ]
                   6379:                 [ 'PRESENTATION' PresSeq ]
                   6380:                 &lt; 'TEXTTRANSLATE' TextTransSeq >
                   6381:                 [ 'SYMBTRANSLATE' TransSeq ]
                   6382:                 [ 'GRAPHTRANSLATE' TransSeq ]
1.18    ! cvs      6383:                   'END' .</pre>
        !          6384: </div>
1.1       cvs      6385: 
1.18    ! cvs      6386: <div class="subsection">
1.1       cvs      6387: 
1.18    ! cvs      6388: <h3><a name="sectc522">Line length</a></h3>
        !          6389: <p>
        !          6390: If a <tt>LINELENGTH</tt> instruction is present after the structure
1.1       cvs      6391: declaration, the translator divides the text it produces into lines, each line
                   6392: having a length less than or equal to the integer which follows the
1.18    ! cvs      6393: <tt>LINELENGTH</tt> keyword.  This maximum line length is expressed as a
1.1       cvs      6394: number of characters.  The end of the line is marked by the character defined
1.18    ! cvs      6395: by the <tt>LINEEND</tt> instruction.  When the translator breaks the lines on
1.1       cvs      6396: a space character in generated text, this space will be replaced by the
1.18    ! cvs      6397: character string defined by the <tt>LINEENDINSERT</tt> instruction.</p>
        !          6398: <p>
        !          6399: If the <tt>LINEEND</tt> instruction is not defined then the linefeed character
1.1       cvs      6400: (octal code 12) is used as the default line end character. If the
1.18    ! cvs      6401: <tt>LINEENDINSERT</tt> instruction is not defined, the linefeed character is
        !          6402: inserted at the end of the produced lines.  If there is no <tt>LINELENGTH</tt>
1.1       cvs      6403: instruction, the translated text is not divided into lines.  Otherwise, if the
                   6404: translation rules generate line end marks, these marks remain in the
                   6405: translated text, but the length of the lines is not controlled by the
1.18    ! cvs      6406: translator.</p>
        !          6407: <pre>     LineLength = NUMBER .</pre>
        !          6408: <blockquote class="example">
        !          6409: <p>
        !          6410: <strong>Example:</strong></p>
        !          6411: <p>
        !          6412: To limit the lines produced by the translator to a length of 80 characters,
        !          6413: the following rule is written at the beginning of the translation schema.</p>
        !          6414: <pre>LineLength 80;</pre>
        !          6415: </blockquote>
        !          6416: </div>
1.1       cvs      6417: 
1.18    ! cvs      6418: <div class="subsection">
1.1       cvs      6419: 
1.18    ! cvs      6420: <h3><a name="sectc523">Buffers</a></h3>
        !          6421: <p>
1.1       cvs      6422: A buffer is a  unit of memory managed by the translator, which can either
1.18    ! cvs      6423: contain text read from the terminal during the translation (see the <a
        !          6424: href="#sectc5212"><tt>Read</tt> rule</a>), or the name of the last picture
1.1       cvs      6425: (bit-map) encountered by the translator in its traversal of the document.
1.2       cvs      6426: Remember the pictures are stored in files that are separate for the document
1.1       cvs      6427: files and that the canonical form contains only the names of the files in
1.18    ! cvs      6428: which the pictures are found.</p>
        !          6429: <p>
1.1       cvs      6430: Thus, there are two types of buffers:  buffers for reading from the terminal
1.18    ! cvs      6431: (filled by the <tt>Read</tt> rule) and the buffer of picture names (containing
1.2       cvs      6432: the name of the last picture encountered).  A translation schema can use
                   6433: either type, one or several read buffers and one (and only one) picture name
1.18    ! cvs      6434: buffer.</p>
        !          6435: <p>
        !          6436: If any buffers are used, the <tt>BUFFERS</tt> keyword must be present,
1.1       cvs      6437: followed by declarations of every buffer used in the translation schema.  Each
                   6438: buffer declaration  is composed only of the name of the buffer, chosen freely
1.2       cvs      6439: by the programmer.  The picture name buffer is identified by the
1.18    ! cvs      6440: <tt>Picture</tt> keyword, between parentheses, following the buffer name.  The
        !          6441: <tt>Picture</tt> keyword may only appear once.  Each buffer declaration is
        !          6442: terminated by a semicolon.</p>
        !          6443: <pre>     BufferSeq = Buffer &lt; Buffer > .
1.1       cvs      6444:      Buffer    = BufferID [ '(' 'Picture' ')' ] ';' .
1.18    ! cvs      6445:      BufferID  = NAME .</pre>
        !          6446: <blockquote class="example">
        !          6447: <p>
        !          6448: <strong>Example:</strong></p>
        !          6449: <p>
1.3       cvs      6450: The following buffer declarations create a picture name buffer named
1.18    ! cvs      6451: <tt>pictureName</tt> and a read buffer named <a
        !          6452: name="destname"><tt>DestName</tt></a>:</p>
        !          6453: <pre>BUFFERS
        !          6454:      pictureName (Picture); DestName;</pre>
        !          6455: </blockquote>
        !          6456: </div>
1.1       cvs      6457: 
1.18    ! cvs      6458: <div class="subsection">
1.1       cvs      6459: 
1.18    ! cvs      6460: <h3><a name="sectc524">Counters</a></h3>
        !          6461: <p>
1.1       cvs      6462: Certain translation rules generate text that varies according to the context
                   6463: of the element to which the rules apply.  Variable text is defined either in
1.18    ! cvs      6464: the <a href="#sectc526"><tt>VAR</tt> section</a> of the translation schema or
        !          6465: in the rule itself (see the <tt>Create</tt> and <tt>Write</tt> rules).  Both
1.1       cvs      6466: types of definition rely on counters for the calculation of variable
1.18    ! cvs      6467: material.</p>
        !          6468: <p>
1.1       cvs      6469: There are two types of counter: counters whose value is explicitely computed
1.18    ! cvs      6470: by applying <a href="#sectc5221"><tt>Set</tt> and <tt>Add</tt> rules</a>, and
1.1       cvs      6471: counters whose value is computed by a function associated with the counter.
                   6472: Those functions allow the same calculations as can be used in presentation
                   6473: schemas. As in a presentation schema, counters must be defined in the
1.18    ! cvs      6474: <tt>COUNTERS</tt> section of the translation schema before they are used.</p>
        !          6475: <p>
        !          6476: When counters are used in a translation schema, the <tt>COUNTERS</tt> keyword
1.1       cvs      6477: is followed by the declarations of every counter used.  Each declaration is
                   6478: composed of the counter's name possibly followed by a colon and the counting
                   6479: function to be used for the counter.  The declaration is terminated by a
1.18    ! cvs      6480: semi-colon. If the counter is explicitely computed by <tt>Set</tt> and
        !          6481: <tt>Add</tt> rules, no counting function is indicated. If a counting function
        !          6482: is indicated, <tt>Set</tt> and <tt>Add</tt> rules cannot be applied to that
        !          6483: counter.</p>
        !          6484: <p>
1.1       cvs      6485: The counting function indicates how the counter's value will be computed.
1.18    ! cvs      6486: Three functions are available: <tt>Rank</tt>, <tt>Rlevel</tt>, and
        !          6487: <tt>Set</tt>.</p>
        !          6488: <ul>
        !          6489: <li>
        !          6490: <tt>Rank of ElemID</tt> indicates that the counter's value is the rank of the
        !          6491: element of type <tt>ElemID</tt> which encloses the element for which the
1.2       cvs      6492: counter is being evaluated.  For the purposes of this function, an element of
1.18    ! cvs      6493: type <tt>ElemID</tt> is considered to enclose itself.  This function is
        !          6494: primarily used  when the element of type <tt>ElemID</tt> is part of an
1.2       cvs      6495: aggregate or list, in which case the counter's value is the element's rank in
1.18    ! cvs      6496: its list or aggregate.  Note that, unlike the <tt>Rank</tt> function for
        !          6497: presentation schemas, the <tt>Page</tt> keyword cannot be used in place of the
        !          6498: <tt>ElemID</tt>.
        !          6499: <p>
        !          6500: The type name <tt>ElemID</tt> can be followed by an integer.  That number
1.1       cvs      6501: represents the relative level, among the ancestors of the concerned element,
1.18    ! cvs      6502: of the element whose rank is asked.  If that relative level <i>n</i> is
        !          6503: unsigned, the <i>n<sup>th</sup></i> element of type <tt>ElemID</tt>
        !          6504: encountered when travelling the logical structure from the root to the
        !          6505: concerned element is taken into account.  If the relative level is negative,
        !          6506: the logical structure is travelled in the other direction, from the concerned
        !          6507: element to the root.</p>
        !          6508: <li>
        !          6509: <tt>Rlevel of ElemID</tt> indicates that the counter's values is the relative
        !          6510: level in the tree of the element for which the counter is being evaluated. The
        !          6511: counter counts the number of elements of type <tt>ElemID</tt> which are found
        !          6512: on the path between the root of the document's logical structure tree and the
        !          6513: element (inclusive).
        !          6514: <li>
        !          6515: <tt>Set n on Type1 Add m on Type2</tt> indicates that the counter's value is
        !          6516: calculated as follows:  in traversing the document from the beginning to the
        !          6517: element for which the counter is being evaluated, the counter is set to the
        !          6518: value <tt>n</tt> each time a <tt>Type1</tt> element is encountered and is
        !          6519: incremented by the amount <tt>m</tt> each time a <tt>Type2</tt> element is
        !          6520: encountered.  The initial value <tt>n</tt> and the increment <tt>m</tt> are
1.1       cvs      6521: integers.
1.18    ! cvs      6522: </ul>
        !          6523: <p>
        !          6524: As in a presentation schema, the <tt>Rank</tt> and <tt>Set</tt> functions can
1.1       cvs      6525: be modified by a numeric attribute which changes their initial value. This is
1.18    ! cvs      6526: indicated by the <tt>Init</tt> keyword followed by the numeric attribute's
        !          6527: name.  The <tt>Set</tt> function takes the value of the attribute instead of
        !          6528: the <tt>InitValue</tt> (<tt>n</tt>).  For the <tt>Rank</tt> function, the
1.1       cvs      6529: value of the attribute is considered to be the rank of the first element of
                   6530: the list (rather than the normal value of 1). Subsequent items in the list
                   6531: have their ranks shifted accordingly.  In both cases, the attribute must be
1.18    ! cvs      6532: numeric and must be a local attribute of the root of the document itself.</p>
        !          6533: <pre>     CounterSeq  = Counter &lt; Counter > .
1.1       cvs      6534:      Counter     = CounterID [ ':' CounterFunc ] ';' .
                   6535:      CounterID   = NAME .
                   6536:      CounterFunc = 'Rank' 'of' ElemID [ SLevelAsc ]
                   6537:                    [ 'Init' AttrID ] /
                   6538:                    'Rlevel' 'of' ElemID /
                   6539:                    'Set' InitValue 'On' ElemID
                   6540:                          'Add' Increment 'On' ElemID
                   6541:                          [ 'Init' AttrID ] .
                   6542:      SLevelAsc   = [ '-' ] LevelAsc .
                   6543:      LevelAsc    =  NUMBER .
                   6544:      InitValue   = NUMBER .
                   6545:      Increment   = NUMBER .
                   6546:      ElemID      = NAME .
1.18    ! cvs      6547:      AttrID      = NAME .</pre>
        !          6548: <blockquote class="example">
        !          6549: <p>
        !          6550: <strong>Example:</strong></p>
        !          6551: <p>
        !          6552: If the body of a chapter is defined in the structure schema by:</p>
        !          6553: <pre>Chapter_Body = LIST OF
1.1       cvs      6554:          (Section = BEGIN
                   6555:                     Section_Title = Text;
                   6556:                     Section_Body  = BEGIN
                   6557:                                     Paragraphs;
                   6558:                                     Section;
                   6559:                                     END;
                   6560:                     END
1.18    ! cvs      6561:          );</pre>
        !          6562: <p>
        !          6563: (sections are defined recursively), a counter can be defined giving the <a
        !          6564: name="sectnum">number of a section</a> within its level in the hierarchy:</p>
        !          6565: <pre>COUNTERS
        !          6566:    SectionNumber : Rank of Section;</pre>
        !          6567: <p>
        !          6568: A counter holding the hierarchic level of a section:</p>
        !          6569: <pre>   SectionLevel : Rlevel of Section;</pre>
        !          6570: <p>
        !          6571: A <a name="uniquenum">counter</a> which sequentially numbers all the
        !          6572: document's sections, whatever their hierarchic level:</p>
        !          6573: <pre>   UniqueSectNum : Set 0 on Document Add 1 on Section;</pre>
        !          6574: </blockquote>
        !          6575: </div>
1.1       cvs      6576: 
1.18    ! cvs      6577: <div class="subsection">
1.1       cvs      6578: 
1.18    ! cvs      6579: <h3><a name="sectc525">Constants</a></h3>
        !          6580: <p>
1.1       cvs      6581: A common feature of translation rules is the generation of constant text. This
1.18    ! cvs      6582: text can be defined in the rule that generates it (see for example the <a
        !          6583: href="#sectc5210"><tt>Create</tt></a> and <a
        !          6584: href="#sectc5211"><tt>Write</tt></a> rules); but it can also be defined once
        !          6585: in the constant declaration section and used many times in different rules.
        !          6586: The latter option is preferable when the same text is used in several rules or
        !          6587: several <a href="#sectc526">variables</a>.</p>
        !          6588: <p>
        !          6589: The <tt>CONST</tt> keyword begins the constant declaration section of the
1.1       cvs      6590: translation schema.  It must be omitted if no constants are declared. Each
                   6591: constant declaration is composed of the constant name, an equals sign, and the
                   6592: constant's value, which is a character string between apostrophes.  A constant
1.18    ! cvs      6593: declaration is terminated by a semicolon.</p>
        !          6594: <pre>     ConstSeq   = Const &lt; Const > .
1.1       cvs      6595:      Const      = ConstID '=' ConstValue ';' .
                   6596:      ConstID    = NAME .
1.18    ! cvs      6597:      ConstValue = STRING .</pre>
        !          6598: <blockquote class="example">
        !          6599: <p>
        !          6600: <strong><a name="levelexample">Example:</a></strong></p>
        !          6601: <p>
        !          6602: The following rule assigns the name <tt>TxtLevel</tt> to the character string
        !          6603: ``Level'':</p>
        !          6604: <pre>CONST
        !          6605:      TxtLevel = 'Level';</pre>
        !          6606: </blockquote>
        !          6607: </div>
1.1       cvs      6608: 
1.18    ! cvs      6609: <div class="subsection">
1.1       cvs      6610: 
1.18    ! cvs      6611: <h3><a name="sectc526">Variables</a></h3>
        !          6612: <p>
1.10      cvs      6613: Variables allow to define variable text which is generated by the
1.18    ! cvs      6614: <tt>Create</tt> and <tt>Write</tt> rules.  They are also used to define file
        !          6615: names which are used in the <tt>Create</tt>, <tt>ChangeMainFile</tt>,
        !          6616: <tt>RemoveFile</tt>, and <tt>Indent</tt> rules.  Variables can be defined
        !          6617: either in the <tt>VAR</tt> section of the translation schema or directly in
        !          6618: the rules which use them.  Variables that define file names must be declared
        !          6619: in the <tt>VAR</tt> section, and when the same variable is used several times
        !          6620: in the translation schema, it makes sense to define it globally in the
        !          6621: <tt>VAR</tt> section.  This section is only present if at least one variable
        !          6622: is defined globally.</p>
        !          6623: <p>
        !          6624: After the <tt>VAR</tt> keyword, each global variable is defined by its name, a
1.1       cvs      6625: colon separator and a sequence of functions (at least one function). Each
                   6626: variable definition is terminated by a semicolon. Functions determine the
                   6627: different parts which together give the value of the variable.  The value is
                   6628: obtained by concatenating the strings produced by each of the functions. Seven
                   6629: types of functions are available.  Each variable definition may use any number
1.18    ! cvs      6630: of functions of each type.</p>
        !          6631: <ul>
        !          6632: <li>
        !          6633: The function <tt>Value(Counter)</tt>returns a string representing the value
        !          6634: taken by the counter when it is evaluated for the element in whose rule the
        !          6635: variable is used.  The counter must have been declared in the
        !          6636: <tt>COUNTERS</tt> section of the translation schema.  When the counter is
1.2       cvs      6637: expressed in arabic numerals, the counter name can be followed by a colon and
                   6638: an integer indicating a minimum length (number of characters) for the string;
                   6639: if the counter's value is normally expressed with fewer characters than the
                   6640: required minimum, zeroes are added to the front of the string to achieve the
1.5       cvs      6641: minimum length.
1.18    ! cvs      6642: <p>
1.1       cvs      6643: By default, the counter value is written in arabic digits. If another
                   6644: representation of that value is needed, the counter name must be followed by a
1.18    ! cvs      6645: comma and one of the following keywords:</p>
        !          6646: <ul>
        !          6647: <li>
        !          6648: <tt>Arabic</tt>: arabic numerals (default value),
        !          6649: <li>
        !          6650: <tt>LRoman</tt>: lower-case roman numerals,
        !          6651: <li>
        !          6652: <tt>URoman</tt>: upper-case roman numerals,
        !          6653: <li>
        !          6654: <tt>Uppercase</tt>: upper-case letter,
        !          6655: <li>
        !          6656: <tt>Lowercase</tt>: lower-case letter.
        !          6657: </ul>
        !          6658: <li>
        !          6659: The function <tt>FileDir</tt>, without parameter, returns a string
1.2       cvs      6660: representing the name of the directory of the output file that has been given
                   6661: as a parameter to the translation program. The string includes a character '/'
                   6662: at the end.
1.18    ! cvs      6663: <li>
        !          6664: The function <tt>FileName</tt>, without parameter, returns a string
1.2       cvs      6665: representing the name of the output file that has been given as a parameter to
                   6666: the translation program. The file extension (the character string that
                   6667: terminate the file name, after a dot) is not part of that string.
1.18    ! cvs      6668: <li>
        !          6669: The function <tt>Extension</tt>, without parameter, returns a string
1.2       cvs      6670: representing the extension of the file name. That string is empty if the file
                   6671: name that has been given as a parameter to the translation program has no
                   6672: extension. If there is an extension, its first character is a dot.
1.18    ! cvs      6673: <li>
        !          6674: The function <tt>DocumentName</tt>, without parameter, returns a string
1.2       cvs      6675: representing the name of the document being translated.
1.18    ! cvs      6676: <li>
        !          6677: The function <tt>DocumentDir</tt>, without parameter, returns a string
1.2       cvs      6678: representing the directory containing the document being translated.
1.18    ! cvs      6679: <li>
        !          6680: The function formed by the name of a constant returns that constant's value.
        !          6681: <li>
        !          6682: The function formed by a character string between apostrophes returns that
1.1       cvs      6683: string.
1.18    ! cvs      6684: <li>
        !          6685: The function formed by the name of a buffer returns the contents of that
1.2       cvs      6686: buffer.  If the named buffer is the picture buffer, then the name of the last
                   6687: picture encountered is returned.  Otherwise, the buffer is a read buffer and
                   6688: the value returned is text previously read from the terminal.  If the buffer
1.18    ! cvs      6689: is empty (no picture has been encountered or the <tt>Read</tt> rule has not
1.2       cvs      6690: been executed for the buffer), then the empty string is returned.
1.18    ! cvs      6691: <li>
        !          6692: The function formed by an attribute name takes the value of the indicated
1.2       cvs      6693: attribute for the element to which the variable applies.  If the element does
                   6694: not have that attribute, then the element's ancestor are searched toward the
                   6695: root of the tree.  If one of the ancestors does have the attribute then its
                   6696: value is used.  If no ancestors have the attribute, then the value of the
1.1       cvs      6697: function is the empty string.
1.18    ! cvs      6698: </ul>
        !          6699: <pre>     VariableSeq = Variable &lt; Variable > .
1.1       cvs      6700:      Variable    = VarID ':' Function &lt; Function > ';' .
                   6701:      VarID       = NAME .
                   6702:      Function    ='Value' '(' CounterID [ ':' Length ]
                   6703:                             [ ',' CounterStyle ] ')' /
                   6704:                   'FileDir' / 'FileName' / 'Extension' /
                   6705:                   'DocumentName' / 'DocumentDir' /
                   6706:                    ConstID / CharString / 
                   6707:                    BufferID / AttrID .
                   6708:      Length      = NUMBER .
                   6709:      CounterStyle= 'Arabic' / 'LRoman' / 'URoman' /
                   6710:                    'Uppercase' / 'Lowercase' .
1.18    ! cvs      6711:      CharString  = STRING .</pre>
        !          6712: <blockquote class="example">
        !          6713: <p>
        !          6714: <strong>Example:</strong></p>
        !          6715: <p>
1.3       cvs      6716: To create, at the beginning of each section of the translated document, text
                   6717: composed of the string ``Section'' followed by the section number, the
1.18    ! cvs      6718: following <a name="varsectexample">variable definition</a> might be used:</p>
        !          6719: <pre>VAR
        !          6720:      SectionVar : 'Section' Value(SectionNumber);</pre>
        !          6721: <p>
        !          6722: (see the definition of <a href="#sectnum"><tt>SectionNumber</tt></a>).</p>
        !          6723: <p>
1.1       cvs      6724: The following variable definition can be used to create, at the beginning of
                   6725: each section, the text ``Level'' followed by the hierarchical level of the
1.18    ! cvs      6726: section. It used the constant defined above.</p>
        !          6727: <pre>     LevelVar : TxtLevel Value(SectionLevel);</pre>
        !          6728: <p>
        !          6729: (see the definitions of <a href="#sectnum"><tt>SectionLevel</tt></a> and of <a
        !          6730: href="#levelexample"><tt>TxtLevel</tt></a>).</p>
        !          6731: <p>
        !          6732: To generate the translation of each section in a different file (see <a
        !          6733: href="#sectc5220">rule <tt>ChangeMainFile</tt></a>), the name of these files
        !          6734: might be defined by the following variable:</p>
        !          6735: <pre>     VarOutpuFile : FileName Value(SectionNumber)
        !          6736:                     Extension;</pre>
        !          6737: <p>
        !          6738: If <tt>output.txt</tt> is the name of the <a name="varoutputfile">output
        !          6739: file</a> specified when starting the translation program, translated sections
        !          6740: are written in files <tt>output1.txt</tt>, <tt>output2.txt</tt>, etc.</p>
        !          6741: </blockquote>
        !          6742: </div>
        !          6743: 
        !          6744: <div class="subsection">
        !          6745: 
        !          6746: <h3><a name="sectc527">Translating structure elements</a></h3>
        !          6747: <p>
        !          6748: The <tt>RULES</tt> keyword introduces the translation rules which will be
1.1       cvs      6749: applied to the various structured element types.  Translation rules can be
                   6750: specified for each element type defined in the structure schema, including the
1.18    ! cvs      6751: base types defined implicitly, whose names are <tt>TEXT_UNIT</tt>,
        !          6752: <tt>PICTURE_UNIT</tt>, <tt>SYMBOL_UNIT</tt>, <tt>GRAPHIC_UNIT</tt> and
        !          6753: <tt>PAGE_UNIT</tt>.  But it is not necessary to specify rules for every
        !          6754: defined type.</p>
        !          6755: <p>
1.1       cvs      6756: If there are no translation rules for an element type, the elements that it
                   6757: contains (and which may have rules themselves) will still be translated, but
                   6758: the translator will produce nothing for the element itself.  To make the
1.18    ! cvs      6759: translator completely ignore the content of an element the <a
        !          6760: href="#sectc5217"><tt>Remove</tt> rule</a> must be used.</p>
        !          6761: <p>
1.1       cvs      6762: The translation rules for an element type defined in the structure schema are
                   6763: written using the name of the type followed by a colon and the list of
1.18    ! cvs      6764: applicable rules.  When the element  type is a <a href="#sectd3285">mark
        !          6765: pair</a>, but only in this case, the type name must be preceded by the
        !          6766: <tt>First</tt> or <tt>Second</tt> keyword.  This keyword indicates whether the
        !          6767: rules that follow apply to the first or second mark of the pair.</p>
        !          6768: <p>
1.1       cvs      6769: The list of rules can take several forms.  It may be a simple non-conditional
                   6770: rule.  It can also be formed by a condition followed by one or more simple
1.18    ! cvs      6771: rules.  Or it can be a block of rules beginning with the <tt>BEGIN</tt>
        !          6772: keyword and ending with the <tt>END</tt> keyword and a semicolon.  This block
1.1       cvs      6773: of rules can contain one or more simple rules and/or one or more conditions,
1.18    ! cvs      6774: each followed by one or more simple rules.</p>
        !          6775: <pre>     ElemSeq        = TransType &lt; TransType > .
1.1       cvs      6776:      TransType      = [ FirstSec ] ElemID ':' RuleSeq .
                   6777:      FirstSec       = 'First' / 'Second' .
                   6778:      RuleSeq        = Rule / 'BEGIN' &lt; Rule > 'END' ';' .
                   6779:      Rule           = SimpleRule / ConditionBlock .
                   6780:      ConditionBlock = 'IF' ConditionSeq SimpleRuleSeq .
                   6781:      SimpleRuleSeq  = 'BEGIN' &lt; SimpleRule > 'END' ';' / 
1.18    ! cvs      6782:                       SimpleRule .</pre>
        !          6783: </div>
1.1       cvs      6784: 
1.18    ! cvs      6785: <div class="subsection">
1.1       cvs      6786: 
1.18    ! cvs      6787: <h3><a name="sectc528">Conditional rules</a></h3>
        !          6788: <p>
1.1       cvs      6789: In a translation schema, the translation rules are either associated with
                   6790: element types or with attribute values or with a specific presentation.  They
                   6791: are applied by the translator each time an element of the corresponding type
                   6792: is encountered in the translated document or each time the attribute value is
                   6793: carried by an element or also, each time the specific translation is attached
                   6794: to an element.  This systematic application of the rules can be relaxed: it is
                   6795: possible to add a condition to one or more rules, so that these rules are only
1.18    ! cvs      6796: applied when the condition is true.</p>
        !          6797: <p>
        !          6798: A condition begins with the keyword <tt>IF</tt>, followed by a sequence of
1.1       cvs      6799: elementary conditions.  Elementary conditions are separated from each other by
1.18    ! cvs      6800: the <tt>AND</tt> keyword.  If there is only one elementary condition, this
1.1       cvs      6801: keyword is absent.  The rules are only applied if all the elementary
                   6802: conditions are true.  The elementary condition can be negative; it is then
1.18    ! cvs      6803: preceded by the <tt>NOT</tt> keyword.</p>
        !          6804: <p>
1.1       cvs      6805: When the translation rule(s) controlled by the condition apply to a reference
                   6806: element or a reference attribute, an elementary condition can also apply to
1.18    ! cvs      6807: element referred by this reference.  The <tt>Target</tt> keyword is used for
1.1       cvs      6808: that purpose.  It must appear before the keyword defining the condition
1.18    ! cvs      6809: type.</p>
        !          6810: <p>
1.1       cvs      6811: Depending on their type, some conditions may apply either to the element with
1.5       cvs      6812: which they are associated, or to one of its ancestor.  In the case of an
1.18    ! cvs      6813: ancestor, the key word <tt>Ancestor</tt> must be used, followed by</p>
        !          6814: <ul>
        !          6815: <li>
        !          6816: either an integer which represents the number of levels in the tree between
        !          6817: the element and the ancestor of interest,
        !          6818: <li>
        !          6819: or the type name of the ancestor of interest.  If that type is defined in a
        !          6820: separate structure schema, the name of that schema must follow between
1.1       cvs      6821: parentheses.
1.18    ! cvs      6822: </ul>
        !          6823: <p>
1.2       cvs      6824: There is a special case for the parent element, which can be simply written
1.18    ! cvs      6825: <tt>Parent</tt> instead of <tt>Ancestor 1</tt>.</p>
        !          6826: <p>
        !          6827: Only conditions <tt>First</tt>, <tt>Last</tt>, <tt>Referred</tt>,
        !          6828: <tt>Within</tt>, <tt>Attributes</tt>, <tt>Presentation</tt>, <tt>Comment</tt>
1.1       cvs      6829: and those concerning an attribute or a specific presentation can apply to an
1.18    ! cvs      6830: ancestor. Conditions <tt>Defined</tt>, <tt>FirstRef</tt>, <tt>LastRef</tt>,
        !          6831: <tt>ExternalRef</tt>, <tt>Alphabet</tt>, <tt>FirstAttr</tt>,
        !          6832: <tt>LastAttr</tt>, <tt>ComputedPage</tt>, <tt>StartPage</tt>,
        !          6833: <tt>UserPage</tt>, <tt>ReminderPage</tt>, <tt>Empty</tt> cannot be preceded by
        !          6834: keywords <tt>Parent</tt> or <tt>Ancestor</tt>.</p>
        !          6835: <p>
        !          6836: In condition <tt>Referred</tt> and in the condition that applies to a named
        !          6837: attribute, a symbol '<tt>*</tt>' can indicate that the condition is related
1.5       cvs      6838: only to the element itself. If this symbol is not present, not only the
1.18    ! cvs      6839: element is considered, but also its ancestor, at any level.</p>
        !          6840: <p>
1.1       cvs      6841: The form of an elementary condition varies according to the type of
1.18    ! cvs      6842: condition.</p>
1.1       cvs      6843: 
1.18    ! cvs      6844: <div class="subsubsection">
1.1       cvs      6845: 
1.18    ! cvs      6846: <h4><a name="sectd5281">Conditions based on the logical position of the
        !          6847: element</a></h4>
        !          6848: <p>
1.1       cvs      6849: The condition can be on the position of the element in the document's logical
                   6850: structure tree.  It is possible to test whether the element is the first
1.18    ! cvs      6851: (<tt>First</tt>) or last (<tt>Last</tt>) among its siblings or if it is not
        !          6852: the first (<tt>NOT First</tt>) or not the last (<tt>NOT Last</tt>).</p>
        !          6853: <p>
1.1       cvs      6854: It is also possible to test if the element is contained in an element of a
1.18    ! cvs      6855: given type (<tt>Within</tt>) or if it is not (<tt>NOT Within</tt>). If that
1.1       cvs      6856: element type is defined in a structure schema which is not the one which
                   6857: corresponds to the translation schema, the type name of this element must be
                   6858: followed, between parentheses, by the name of the structure schema which
1.18    ! cvs      6859: defines it.</p>
        !          6860: <p>
        !          6861: If the keyword <tt>Within</tt> is preceded by <tt>Immediately</tt>, the
        !          6862: condition is satisfied only if the <em>parent</em> element has the type
        !          6863: indicated. If the word <tt>Immediately</tt> is missing, the condition is
        !          6864: satisfied if any <em>ancestor</em> has the type indicated.</p>
        !          6865: <p>
        !          6866: An integer <i>n</i> can appear between the keyword <tt>Within</tt> and the
1.1       cvs      6867: type.  It specifies the number of ancestors of the indicated type that must be
                   6868: present for the condition to be satisfied.  If the keyword
1.18    ! cvs      6869: <tt>Immediately</tt> is also present, the <i>n</i> immediate ancestors of the
        !          6870: element must have the indicated type.  The integer <i>n</i> must be positive
        !          6871: or zero.  It can be preceded by <tt>&lt;</tt> or <tt>></tt> to indicate a
1.1       cvs      6872: maximum or minimum number of ancestors.  If these symbols are missing, the
1.18    ! cvs      6873: condition is satisfied only if it exists exactly <i>n</i> ancestors.  When
        !          6874: this number is missing, it is equivalent to > 0.</p>
        !          6875: <p>
1.11      cvs      6876: If the condition applies to translation rules associated with an attribute,
1.18    ! cvs      6877: i.e. if it is in the <tt>ATTRIBUTES</tt> section of the presentation schema,
1.11      cvs      6878: the condition can be simply an element name. Translation rules are then
1.18    ! cvs      6879: executed only if the attribute is attached to an element of that type. The
        !          6880: keyword <tt>NOT</tt> before the element name indicates that the translation
        !          6881: rules must be executed only if the element is not of the type indicated.</p>
        !          6882: </div>
1.1       cvs      6883: 
1.18    ! cvs      6884: <div class="subsubsection">
1.1       cvs      6885: 
1.18    ! cvs      6886: <h4><a name="sectd5282">Conditions on references</a></h4>
        !          6887: <p>
1.1       cvs      6888: References may be taken into account in conditions, which can be based on the
1.18    ! cvs      6889: fact that the element, or one of its ancestors (unless symbol <tt>*</tt> is
        !          6890: present), is designated by a at least one reference (<tt>Referred</tt>) or by
        !          6891: none (<tt>NOT Referred</tt>).  If the element or attribute to which the
1.1       cvs      6892: condition is attached is a reference, the condition can be based on the fact
                   6893: that it acts as the first reference to the designated element
1.18    ! cvs      6894: (<tt>FirstRef</tt>), or as the last (<tt>LastRef</tt>), or as a reference to
        !          6895: an element located in another document (<tt>ExternalRef</tt>).  Like all
        !          6896: conditions, conditions on references can be inverted by the <tt>NOT</tt>
        !          6897: keyword.</p>
        !          6898: </div>
        !          6899: 
        !          6900: <div class="subsubsection">
        !          6901: 
        !          6902: <h4><a name="sectd5283">Conditions on the parameters</a></h4>
        !          6903: <p>
        !          6904: Elements which are <a href="#sectc326">parameters</a> can be given a
        !          6905: particular condition which is based on whether or not the parameter is given a
        !          6906: value in the document (<tt>Defined</tt> or <tt>NOT Defined</tt>,
        !          6907: respectively).</p>
        !          6908: </div>
1.1       cvs      6909: 
1.18    ! cvs      6910: <div class="subsubsection">
1.1       cvs      6911: 
1.18    ! cvs      6912: <h4><a name="sectd5284">Conditions on the alphabets</a></h4>
        !          6913: <p>
1.1       cvs      6914: The character string base type (and only this type) can use the condition
1.18    ! cvs      6915: <tt>Alphabet = a</tt> which indicates that the translation rule(s) should only
1.1       cvs      6916: apply if the alphabet of the character string is the one whose name appears
1.18    ! cvs      6917: after the equals sign (or is not, if there is a preceding <tt>NOT</tt>
1.1       cvs      6918: keyword).  This condition cannot be applied to translation rules of an
1.18    ! cvs      6919: attribute.</p>
        !          6920: <p>
1.1       cvs      6921: In the current implementation of Thot, the available alphabets are the
1.18    ! cvs      6922: <tt>Latin</tt> alphabet and the <tt>Greek</tt> alphabet.</p>
        !          6923: </div>
1.1       cvs      6924: 
1.18    ! cvs      6925: <div class="subsubsection">
1.1       cvs      6926: 
1.18    ! cvs      6927: <h4><a name="sectd5285">Conditions on page breaks</a></h4>
        !          6928: <p>
1.1       cvs      6929: The page break base type (and only this type) can use the following
1.18    ! cvs      6930: conditions: <tt>ComputedPage</tt>, <tt>StartPage</tt>, <tt>UserPage</tt>, and
        !          6931: <tt>ReminderPage</tt>.  The <tt>ComputedPage</tt> condition indicates that the
1.1       cvs      6932: translation rule(s) should apply if the page break was created automatically
1.18    ! cvs      6933: by Thot;  the <tt>StartPage</tt> condition is true if the page break is
        !          6934: generated before the element by the <tt>Page</tt> rule of the P language; the
        !          6935: <tt>UserPage</tt> condition applies if the page break was inserted by the
        !          6936: user; and the <tt>ReminderPage</tt> is applied if the page break is a reminder
        !          6937: of page breaking.</p>
        !          6938: </div>
1.1       cvs      6939: 
1.18    ! cvs      6940: <div class="subsubsection">
1.1       cvs      6941: 
1.18    ! cvs      6942: <h4><a name="sectd5286">Conditions on the element's content</a></h4>
        !          6943: <p>
1.1       cvs      6944: The condition can be based on whether or not the element is empty.  An element
                   6945: which has no children or whose leaves are all empty is considered to be empty
1.18    ! cvs      6946: itself.  This condition is expressed by the <tt>Empty</tt> keyword, optionally
        !          6947: preceded by the <tt>NOT</tt> keyword.</p>
        !          6948: </div>
1.1       cvs      6949: 
1.18    ! cvs      6950: <div class="subsubsection">
1.1       cvs      6951: 
1.18    ! cvs      6952: <h4><a name="sectd5287">Conditions on the presence of comments</a></h4>
        !          6953: <p>
1.1       cvs      6954: The condition can be based on the presence or absence of comments associated
                   6955: with the translated element.  This condition is expressed by the keyword
1.18    ! cvs      6956: <tt>Comment</tt>, optionally preceded by the keyword <tt>NOT</tt>.</p>
        !          6957: </div>
1.1       cvs      6958: 
1.18    ! cvs      6959: <div class="subsubsection">
1.1       cvs      6960: 
1.18    ! cvs      6961: <h4><a name="sectd5288">Conditions on the presence of specific presentation
        !          6962: rules</a></h4>
        !          6963: <p>
1.1       cvs      6964: The condition can be based on the presence or absence of specific presentation
                   6965: rules associated with the translated element, whatever the rules, their value
                   6966: or their number.  This condition is expressed by the keyword
1.18    ! cvs      6967: <tt>Presentation</tt>, optionally preceded by the <tt>NOT</tt> keyword.</p>
        !          6968: </div>
1.1       cvs      6969: 
1.18    ! cvs      6970: <div class="subsubsection">
1.1       cvs      6971: 
1.18    ! cvs      6972: <h4><a name="sectd5289">Conditions on the presence of logical
        !          6973: attributes</a></h4>
        !          6974: <p>
1.1       cvs      6975: In the same way, the condition can be based on the presence or absence of
                   6976: attributes associated with the translated elements, no matter what the
1.18    ! cvs      6977: attributes or their values.  The <tt>Attributes</tt> keyword expresses this
        !          6978: condition.</p>
        !          6979: </div>
1.1       cvs      6980: 
1.18    ! cvs      6981: <div class="subsubsection">
1.1       cvs      6982: 
1.18    ! cvs      6983: <h4><a name="sectd52810">Conditions on logical attributes</a></h4>
        !          6984: <p>
1.1       cvs      6985: If the condition appears in the translation rules of an attribute, the
1.18    ! cvs      6986: <tt>FirstAttr</tt> and <tt>LastAttr</tt> keywords can be used to indicate that
1.1       cvs      6987: the rules must only be applied if this attribute is the first attribute for
                   6988: the translated element or if it is the last (respectively).  These conditions
1.18    ! cvs      6989: can also be inverted by the <tt>NOT</tt> keyword.</p>
        !          6990: <p>
1.1       cvs      6991: Another type of condition can only be applied to the translation rules when
1.18    ! cvs      6992: the element being processed (or one of its ancestors if symbol <tt>*</tt> is
1.1       cvs      6993: missing) has a certain attribute, perhaps with a certain value or, in
                   6994: contrast, when the element does not have this attribute with this value.  The
                   6995: condition is specified by writing the name of the attribute after the keyword
1.18    ! cvs      6996: <tt>IF</tt> or <tt>AND</tt>.  The <tt>NOT</tt> keyword can be used to invert
1.1       cvs      6997: the condition.  If the translation rules must be applied to any element which
                   6998: has this attribute (or does not have it, if the condition is inverted) no
                   6999: matter what the attribute's value, the condition is complete.  If, in
                   7000: contrast, the condition applies to one or more values of the attribute, these
                   7001: are indicated after the name of the attribute, except for reference attributes
1.18    ! cvs      7002: which do not have values.</p>
        !          7003: <p>
        !          7004: The representation of the values of an <a name="relattr">attribute</a> in a
1.1       cvs      7005: condition depends on the attribute's type.  For attributes with enumerated or
                   7006: textual types, the value (a name or character string between apostrophes,
                   7007: respectively) is simply preceded by an equals sign.  For numeric attributes,
                   7008: the condition can be based on a single value or on a range of values.  In the
                   7009: case of a unique value, this value (an integer) is simply preceded by an
1.18    ! cvs      7010: equals sign.  Conditions based on ranges of values have several forms:</p>
        !          7011: <ul>
        !          7012: <li>
        !          7013: all values less than a given value (the value is preceded by a ``less than''
        !          7014: sign).
        !          7015: <li>
        !          7016: all values greater than a given value (the value is preceded by a ``greater
1.1       cvs      7017: than'' sign).
1.18    ! cvs      7018: <li>
        !          7019: all values falling in an interval, bounds included.  The range of values is
        !          7020: then specified <tt>IN [</tt>Minimum <tt>..</tt>Maximum<tt>]</tt>, where
1.2       cvs      7021: Minimum and Maximum are integers.
1.18    ! cvs      7022: </ul>
        !          7023: <p>
1.2       cvs      7024: All numeric values may be negative.  The integer is simply preceded by a minus
1.18    ! cvs      7025: sign.</p>
        !          7026: <p>
        !          7027: Both local and global attributes can be used in conditions.</p>
        !          7028: </div>
1.1       cvs      7029: 
1.18    ! cvs      7030: <div class="subsubsection">
1.1       cvs      7031: 
1.18    ! cvs      7032: <h4><a name="sectd52811">Conditions on specific presentation rules</a></h4>
        !          7033: <p>
1.1       cvs      7034: It is possible to apply translation rules only when the element being
                   7035: processed has or does not have a specific presentation rule, possibly with a
                   7036: certain value.  The condition is specified by writing the name of the
1.18    ! cvs      7037: presentation rule after the keyword <tt>IF</tt> or <tt>AND</tt>.  The
        !          7038: <tt>NOT</tt> keyword can be used to invert the condition.  If the translation
1.1       cvs      7039: rules must be applied to any element which has this presentation rule (or does
                   7040: not have it, if the condition is inverted) no matter what the rule's value,
                   7041: the condition is complete.  If, in contrast, the condition applies to one or
                   7042: more values of the rule, these are indicated after the name of the
1.18    ! cvs      7043: attribute.</p>
        !          7044: <p>
1.1       cvs      7045: The representation of presentation rule values in a condition is similar to
                   7046: that for attribute values.  The representation of these values depend on the
                   7047: type of the presentation rule. There are three categories of presentation
1.18    ! cvs      7048: rules:</p>
        !          7049: <ul>
        !          7050: <li>
        !          7051: those taking numeric values (<tt>Size, Indent, LineSpacing, LineWeight</tt>),
        !          7052: <li>
        !          7053: those with values taken from a predefined list (<tt>Adjust, Justify,
        !          7054: Hyphenate, Style, Font, UnderLine, Thickness, LineStyle</tt>),
        !          7055: <li>
        !          7056: those whose value is a name (<tt>FillPattern, Background, Foreground</tt>).
        !          7057: </ul>
        !          7058: <p>
1.1       cvs      7059: For presentation rules which take numeric values, the condition can take a
                   7060: unique value or a range of values.  In the case of a unique value, this value
                   7061: (an integer) is simply preceded by an equals sign. Conditions based on ranges
1.18    ! cvs      7062: of values have several forms:</p>
        !          7063: <ul>
        !          7064: <li>
        !          7065: all values less than a given value (the value is preceded by a ``less than''
        !          7066: sign).
        !          7067: <li>
        !          7068: all values greater than a given value (the value is preceded by a ``greater
1.1       cvs      7069: than'' sign).
1.18    ! cvs      7070: <li>
        !          7071: all values falling in an interval, bounds included.  The range of values is
        !          7072: then specified <tt>IN [</tt>Minimum <tt>..</tt>Maximum<tt>]</tt>, where
1.2       cvs      7073: Minimum and Maximum are integers.
1.18    ! cvs      7074: </ul>
        !          7075: <p>
        !          7076: Values for the <tt>Indent</tt>rule may be negative.  The integer is then
1.2       cvs      7077: simply preceded by a minus sign and represents how far the first line starts
1.18    ! cvs      7078: to the left of the other lines.</p>
        !          7079: <p>
1.1       cvs      7080: For presentation rules whose values are taken from predefined lists, the value
                   7081: which satisfies the condition is indicated by an equals sign followed by the
1.18    ! cvs      7082: name of the value.</p>
        !          7083: <p>
1.1       cvs      7084: For presentation rule whose values are names, the value which satisfies the
                   7085: condition is indicated by the equals sign followed by the value's name. The
1.18    ! cvs      7086: names of fill patterns (the <tt>FillPattern</tt> rule) and of colors (the
        !          7087: <tt>Foreground</tt> and <tt>Background</tt> rules) known to Thot are the same
        !          7088: as in the P language.</p>
        !          7089: <p>
1.1       cvs      7090: The syntax of conditions based on the specific presentation is the same as the
1.18    ! cvs      7091: syntax used to express the <a href="#sectc5224">translation of specific
        !          7092: presentation rules</a>.</p>
        !          7093: <p>
1.1       cvs      7094: When a condition has only one rule, the condition is simply followed by that
                   7095: rule.  If it has several rules, they are placed after the condition between
1.18    ! cvs      7096: the keywords <tt>BEGIN</tt> and <tt>END</tt>.</p>
        !          7097: <pre>   ConditionSeq = Condition [ 'AND' Condition ] .
1.1       cvs      7098:    Condition    = [ 'NOT' ] [ 'Target' ] Cond .
                   7099:    Cond         = CondElem / CondAscend .
                   7100:    CondElem     ='FirstRef' / 'LastRef' /
                   7101:                  'ExternalRef' /
                   7102:                  'Defined' /
                   7103:                  'Alphabet' '=' Alphabet /
                   7104:                  'ComputedPage' / 'StartPage' / 
                   7105:                  'UserPage' / 'ReminderPage' /
                   7106:                  'Empty' /
1.11      cvs      7107:                   ElemID /
1.1       cvs      7108:                  'FirstAttr' / 'LastAttr' .
                   7109:    CondAscend   = [ Ascend ] CondOnAscend .
                   7110:    Ascend       = '*' / 'Parent' / 'Ancestor' LevelOrType .
                   7111:    LevelOrType  = CondRelLevel / ElemID [ ExtStruct ] .
                   7112:    CondRelLevel = NUMBER .
                   7113:    CondOnAscend ='First' / 'Last' /
                   7114:                  'Referred' / 
                   7115:                   [ 'Immediately' ] 'Within' [ NumParent ]
                   7116:                                     ElemID [ ExtStruct ] /
                   7117:                  'Attributes' /
                   7118:                   AttrID [ RelatAttr ] /
                   7119:                  'Presentation' /
                   7120:                   PresRule /
                   7121:                  'Comment' .                  
                   7122:    NumParent    = [ GreaterLess ] NParent .
                   7123:    GreaterLess  = '>' / '&lt;' .
                   7124:    NParent      = NUMBER.
                   7125:    ExtStruct    = '(' ElemID ')' .
                   7126:    Alphabet     = NAME .
                   7127:    RelatAttr    ='=' Value /
                   7128:                  '>' [ '-' ] Minimum /
                   7129:                  '&lt;' [ '-' ] Maximum /
                   7130:                  'IN' '[' [ '-' ] MinInterval '..'
                   7131:                           [ '-' ] MaxInterval ']' .
                   7132:    Value        = [ '-' ] IntegerVal / TextVal / AttrValue .
                   7133:    Minimum      = NUMBER .
                   7134:    Maximum      = NUMBER .
                   7135:    MinInterval  = NUMBER .
                   7136:    MaxInterval  = NUMBER .
                   7137:    IntegerVal   = NUMBER .
                   7138:    TextVal      = STRING .
1.18    ! cvs      7139:    AttrValue    = NAME .</pre>
        !          7140: <blockquote class="example">
        !          7141: <p>
        !          7142: <strong>Example:</strong></p>
        !          7143: <p>
1.3       cvs      7144: Suppose that after each element of type Section_Title it is useful to produce
1.18    ! cvs      7145: the text <tt>\label{SectX}</tt> where <tt>X</tt> represents the section
        !          7146: number, but only if the section is designated by one or more references in the
        !          7147: document.  The following conditional rule produces this effect:</p>
        !          7148: <pre>RULES
1.1       cvs      7149:   Section_Title :
                   7150:     IF Referred
1.18    ! cvs      7151:       Create ('\label{Sect' Value(UniqueSectNum) '}\12') After;</pre>
        !          7152: <p>
        !          7153: (the declaration of the <a href="#sectc5224"><tt>UniqueSectNum</tt>
        !          7154: counter</a> is given above).  The string <tt>\12</tt> represents a line
        !          7155: break.</p>
        !          7156: </blockquote>
        !          7157: <blockquote class="example">
        !          7158: <p>
        !          7159: <strong>Example:</strong></p>
        !          7160: <p>
1.3       cvs      7161: Suppose that for elements of the Elmnt type it would be useful to produce a
                   7162: character indicating the value of the numeric attribute Level associated with
                   7163: the element: an  ``A'' for all values of Level less than 3, a ``B'' for values
                   7164: between 3 and 10 and a ``C'' for values greater than 10.  This can be achieved
1.18    ! cvs      7165: by writing the following rules for the Elmnt type:</p>
        !          7166: <pre>RULES
1.1       cvs      7167:   Elmnt :
                   7168:     BEGIN
                   7169:     IF Level &lt; 3
                   7170:       Create 'A';
                   7171:     IF Level IN [3..10]
                   7172:       Create 'B';
                   7173:     IF Level > 10
                   7174:       Create 'C';
1.18    ! cvs      7175:     END;</pre>
        !          7176: </blockquote>
        !          7177: </div>
        !          7178: </div>
1.1       cvs      7179: 
1.18    ! cvs      7180: <div class="subsection">
1.1       cvs      7181: 
1.18    ! cvs      7182: <h3><a name="sectc529">Translation rules</a></h3>
        !          7183: <p>
1.14      cvs      7184: Fifteen types of translation rules can be associated with element types and
1.18    ! cvs      7185: attribute values.  They are the <tt>Create</tt>, <tt>Write</tt>,
        !          7186: <tt>Read</tt>, <tt>Include</tt>, <tt>Get</tt>, <tt>Copy</tt>, <tt>Use</tt>,
        !          7187: <tt>Remove</tt>, <tt>NoTranslation</tt>, <tt>NoLineBreak</tt>,
        !          7188: <tt>ChangeMainFile</tt>, <tt>RemoveFile</tt>, <tt>Set</tt>, <tt>Add</tt>,
        !          7189: <tt>Indent</tt>, rules.  Each rule has its own syntax, although they are all
        !          7190: based on very similar models.</p>
        !          7191: <pre>     SimpleRule = 'Create' [ 'IN' VarID ] Object
1.1       cvs      7192:                         [ Position ] ';' /
                   7193:                   'Write' Object [ Position ] ';' /
                   7194:                   'Read' BufferID [ Position ] ';' /
                   7195:                   'Include' File [ Position ] ';' /
                   7196:                   'Get' [ RelPosition ] ElemID 
                   7197:                         [ ExtStruct ] 
                   7198:                         [ Position ] ';' /
                   7199:                   'Copy' [ RelPosition ] ElemID 
                   7200:                         [ ExtStruct ] 
                   7201:                         [ Position ] ';' /
                   7202:                   'Use' TrSchema [ 'For' ElemID ] ';' /
                   7203:                   'Remove' ';' /
                   7204:                   'NoTranslation' ';' /
                   7205:                   'NoLineBreak' ';' /
                   7206:                   'ChangeMainFile' VarID [ Position ] ';' /
1.14      cvs      7207:                   'RemoveFile' VarID [ Position ] ';' /
1.10      cvs      7208:                   'Set' CounterID InitValue [ Position ] ';' /
                   7209:                   'Add' CounterID Increment [ Position ] ';' /
                   7210:                   'Indent' [ 'IN' VarID ] [ IndentSign ]
1.18    ! cvs      7211:                            IndentValue [ Position ] ';' .</pre>
        !          7212: </div>
        !          7213: 
        !          7214: <div class="subsection">
        !          7215: 
        !          7216: <h3><a name="sectc5210">The <tt>Create</tt> rule</a></h3>
        !          7217: <p>
        !          7218: The most frequently used rule is undoubtedly the <tt>Create</tt> rule, which
        !          7219: generates fixed or variable text (called an <em>object</em>) in the output
1.1       cvs      7220: file.  The generated text can be made to appear either before or after the
                   7221: content of the element to which the rule applies. The rule begins with the
1.18    ! cvs      7222: <tt>Create</tt> keyword, followed by a specifier for the object and a keyword
        !          7223: (<tt>Before</tt> or <tt>After</tt>) indicating the position of the generated
        !          7224: text (<a href="#sectc5222">before or after</a> the element's content).  If the
1.1       cvs      7225: position is not indicated, the object will be generated before the element's
                   7226: content.  This rule, like all translation rules, is terminated by a
1.18    ! cvs      7227: semicolon.</p>
        !          7228: <p>
        !          7229: The <tt>Create</tt> keyword can be followed by the <tt>IN</tt> keyword and by
1.1       cvs      7230: the name of a variable.  This means that the text generated by the rule must
                   7231: not be written in the main output file, but in the file whose name is
1.18    ! cvs      7232: specified by the variable.</p>
        !          7233: <p>
1.1       cvs      7234: This allows the translation program to generate text in different files during
1.14      cvs      7235: the same run. These files do not need to be explicitely declared or opened.
1.18    ! cvs      7236: They do not need to be closed either, but if they contain temporary data, they
        !          7237: can be removed (see the <a href="#sectc5220a"><tt>RemoveFile</tt> rule</a>).
        !          7238: As soon as the translation program executes a <tt>Create</tt> rule for a file
        !          7239: that is not yet open, it opens the file. These files are closed when the
        !          7240: translation is finished.</p>
        !          7241: <pre>               'Create' [ 'IN' VarID ] Object
1.1       cvs      7242:                         [ Position ] ';'
                   7243:      Object   = ConstID / CharString /
                   7244:                 BufferID /
                   7245:                 VarID /
                   7246:                '(' Function &lt; Function > ')' /
                   7247:                 AttrID /
                   7248:                'Value' /
                   7249:                'Content' /
                   7250:                'Comment' / 
                   7251:                'Attributes' /
                   7252:                'Presentation' /
                   7253:                'RefId' /
                   7254:                'PairId' /
                   7255:                'FileDir' /
                   7256:                'FileName' /
                   7257:                'Extension' /
                   7258:                'DocumentName' /
                   7259:                'DocumentDir' /
                   7260:                 [ 'Referred' ] ReferredObject .
                   7261:      Position ='After' / 'Before' .
                   7262: 
                   7263:      ReferredObject = VarID /
                   7264:                 ElemID [ ExtStruct ] /
                   7265:                'RefId' /
                   7266:                'DocumentName' /
1.18    ! cvs      7267:                'DocumentDir' .</pre>
        !          7268: <p>
        !          7269: The object to be generated can be:</p>
        !          7270: <ul>
        !          7271: <li>
        !          7272: a constant string, specified by its name if it is declared in the schema's
        !          7273: <tt>CONST</tt> section, or given directly as a value between apostrophes;
        !          7274: <li>
        !          7275: the contents of a buffer, designated by the name of the buffer;
        !          7276: <li>
        !          7277: a variable, designated by its name if it is declared in the translation
        !          7278: schema's <tt>VAR</tt> section, or given directly between parentheses.  The
        !          7279: text generated is the value of that variable evaluated for the element to
        !          7280: which the rule applies.
        !          7281: <li>
        !          7282: the value of an attribute, if the element being translated has this attribute.
        !          7283: The attribute is specified by its name;
        !          7284: <li>
        !          7285: the value of a specific presentation rule.  This object can only be generated
        !          7286: if the translation rule is for a <a href="#prestransl">specific presentation
        !          7287: rule</a>.  It is specified by the <tt>Value</tt> keyword;
        !          7288: <li>
        !          7289: the element's content.  That is, the content of the leaves of the subtree of
        !          7290: the translated element.  This is specified by the <tt>Content</tt> keyword;
        !          7291: <li>
        !          7292: the comment attached to the element.  When the element doesn't have a comment,
        !          7293: nothing is generated.  This is indicated by the <tt>Comment</tt> keyword;
        !          7294: <li>
        !          7295: the translation of all attributes of the element (which is primarily used to
        !          7296: apply the attribute translation rules <a href="#sectc5222">before</a> those of
        !          7297: the element type).  This is specified by the <tt>Attributes</tt> keyword.
        !          7298: <li>
        !          7299: the translation of all of the element's specific presentation rules (which is
        !          7300: primarily used to apply the translation rules for the specific presentation
        !          7301: rules <a href="#sectc5222">before</a> those of the element or its attributes).
        !          7302: This option is specified by the <tt>Presentation</tt> keyword;
        !          7303: <li>
        !          7304: The value of the reference's identifier.<br>
        !          7305: Thot associates a unique identifier with each element in a document.  This
        !          7306: identifier (called <em>reference's identifier</em> or <em>label</em>) is a
        !          7307: character string containing the letter `L' followed by digits.  Thot uses it
        !          7308: in references for identifying the referred element.<br>
        !          7309: The <tt>RefId</tt> keyword produces the reference's identifier of the element
        !          7310: to which the translation rule is applied, or the reference's identifier of its
        !          7311: first ancestor that is referred by a reference or that can be referred by a
        !          7312: reference.
        !          7313: <li>
        !          7314: the value of a mark pair's unique identifier.  This may only be used for <a
        !          7315: href="#sectd3285">mark pairs</a> and is indicated by the <tt>PairId</tt>
1.2       cvs      7316: keyword.
1.18    ! cvs      7317: <li>
        !          7318: the directory containing the file being generated (this string includes an
        !          7319: ending '/', if it is not empty).  This is indicated by the <tt>FileDir</tt>
1.2       cvs      7320: keyword.
1.18    ! cvs      7321: <li>
        !          7322: the name of the file being generated (only the name, without the directory and
        !          7323: without the extension). This is indicated by the <tt>FileName</tt> keyword.
        !          7324: <li>
        !          7325: the extension of the file being generated (this string starts with a dot, if
        !          7326: it is not empty).  This is indicated by the <tt>Extension</tt> keyword.
        !          7327: <li>
        !          7328: the name of the document being translated.  This is indicated by the
        !          7329: <tt>DocumentName</tt> keyword.
        !          7330: <li>
        !          7331: the directory containing the document being translated.  This is indicated by
        !          7332: the <tt>DocumentDir</tt> keyword.
        !          7333: </ul>
        !          7334: <p>
1.1       cvs      7335: When the rule applies to a reference (an element or an attribute defined as a
                   7336: reference in the structure schema), it can generate a text related to the
                   7337: element referred by that reference.  The rule name is then followed the
1.18    ! cvs      7338: <tt>Referred</tt> keyword and a specification of the object to be generated
        !          7339: for the referred element.  This specification can be:</p>
        !          7340: <ul>
        !          7341: <li>
        !          7342: the name of a variable.  The rule generates the value of that variable,
1.1       cvs      7343: computed for the referred element.
1.18    ! cvs      7344: <li>
        !          7345: an element type.  The rule generates the translation of the element of that
        !          7346: type, which is in the subtree of the referred element.  If this element is not
        !          7347: defined in the structure schema which corresponds to the translation schema
        !          7348: (that is, an object defined in another schema), the element's type name must
        !          7349: be followed by the name of its structure schema between parentheses.
        !          7350: <li>
        !          7351: the <tt>RefId</tt> keyword.  The rule generates the reference's identifier of
        !          7352: the referred element.
        !          7353: <li>
        !          7354: the <tt>DocumentName</tt> keyword.  The rule generates the name of the
1.1       cvs      7355: document to which the referred element belongs.
1.18    ! cvs      7356: <li>
        !          7357: the <tt>DocumentDir</tt> keyword.  The rule generates the name of the
1.1       cvs      7358: directory that contains the document of the referred element.
1.18    ! cvs      7359: </ul>
        !          7360: </div>
1.1       cvs      7361: 
1.18    ! cvs      7362: <div class="subsection">
1.1       cvs      7363: 
1.18    ! cvs      7364: <h3><a name="sectc5211">The <tt>Write</tt> rule</a></h3>
        !          7365: <p>
        !          7366: The <tt>Write</tt> has the same syntax as the <tt>Create</tt> rule.  It also
1.1       cvs      7367: produces the same effect, but the generated text is displayed on the user's
                   7368: terminal during the translation of the document, instead of being produced in
                   7369: the translated document.  This is useful for helping the user keep track of
                   7370: the progress of the translation and for prompting the user on the terminal for
1.18    ! cvs      7371: input required by the <tt>Read</tt> rule.</p>
        !          7372: <pre>               'Write' Object [ Position ] ';'</pre>
        !          7373: <p>
1.1       cvs      7374: Notice: if the translator is launched by the editor (by the ``Save as''
1.18    ! cvs      7375: command), messages produced by the <tt>Write</tt> rule are not displayed.</p>
        !          7376: <blockquote class="example">
        !          7377: <p>
        !          7378: <strong>Example:</strong></p>
        !          7379: <p>
1.3       cvs      7380: To make the translator display the number of each section being translated on
1.18    ! cvs      7381: the user's terminal, the following rule is specified for the <tt>Section</tt>
        !          7382: element type:</p>
        !          7383: <pre>Section : BEGIN
1.1       cvs      7384:           Write VarSection;
                   7385:           ...
1.18    ! cvs      7386:           END;</pre>
        !          7387: <p>
        !          7388: (see <a href="#varsectexample">above</a> for the definition of the
        !          7389: <tt>VarSection</tt> variable).</p>
        !          7390: <p>
1.1       cvs      7391: To display text on the terminal before issuing a read operation with the
1.18    ! cvs      7392: <tt>Read</tt> rule, the following rule is used:</p>
        !          7393: <pre>BEGIN
1.1       cvs      7394: Write 'Enter the name of the destination: ';
                   7395: ...
1.18    ! cvs      7396: END;</pre>
        !          7397: </blockquote>
        !          7398: </div>
        !          7399: 
        !          7400: <div class="subsection">
        !          7401: 
        !          7402: <h3><a name="sectc5212">The <tt>Read</tt> rule</a></h3>
        !          7403: <p>
        !          7404: The <tt>Read</tt> rule reads text from the terminal during the translation of
1.1       cvs      7405: the document and saves the text read in one of the buffers declared in the
1.18    ! cvs      7406: <tt>BUFFERS</tt> section of the schema.  The buffer to be used is indicated by
        !          7407: its name, after the <tt>READ</tt> keyword.  This name can be followed, as in
        !          7408: the <tt>Create</tt> and <tt>Write</tt> rules, by a keyword indicating if the
        !          7409: read operation must be performed <tt>Before</tt> or <tt>After</tt> the
1.1       cvs      7410: translation of the element's content.  If this keyword is absent, the read
                   7411: operation is done beforehand.  The text is read into the buffer and remains
1.5       cvs      7412: there until a rule using the same buffer - possibly the same rule - is
1.18    ! cvs      7413: applied.</p>
        !          7414: <pre>               'Read' BufferID [ Position ] ';'</pre>
        !          7415: <blockquote class="example">
        !          7416: <p>
        !          7417: <strong>Example:</strong></p>
        !          7418: <p>
1.3       cvs      7419: The following set of rules tells the user that the translator is waiting for
                   7420: the entry of some text, reads this text into a buffer and copies the text into
1.18    ! cvs      7421: the translated document.</p>
        !          7422: <pre>BEGIN
1.1       cvs      7423: Write 'Enter the name of the destination: ';
                   7424: Read DestName;
                   7425: Create DestName;
                   7426: ...
1.18    ! cvs      7427: END;</pre>
        !          7428: <p>
        !          7429: (see <a href="#destname">above</a> the definition of <tt>DestName</tt>).</p>
        !          7430: </blockquote>
        !          7431: </div>
        !          7432: 
        !          7433: <div class="subsection">
        !          7434: 
        !          7435: <h3><a name="sectc5213">The <tt>Include</tt> rule</a></h3>
        !          7436: <p>
        !          7437: The <tt>Include</tt> rule, like the <tt>Create</tt> rule, is used to produce
1.1       cvs      7438: text in the translated document.  It inserts constant text which is not
                   7439: defined in the translation schema, but is instead taken from a file.  The
1.18    ! cvs      7440: file's name  is specified after the <tt>Include</tt> keyword, either directly
1.1       cvs      7441: as a character string between apostrophes or as the name of one of the buffers
1.18    ! cvs      7442: declared in the <tt>BUFFERS</tt> section of the schema.  In the latter case,
1.1       cvs      7443: the buffer is assumed to contain the file's name.  This can be used when the
                   7444: included file's name is known only at the moment of translation.  This only
1.18    ! cvs      7445: requires that the <tt>Include</tt> rule is preceded by a <tt>Read</tt> rule
        !          7446: which puts the name of the file desired by the user into the buffer.</p>
        !          7447: <p>
1.1       cvs      7448: Like the other rules, it is possible to specify whether the inclusion will
                   7449: occur before or after the element's content, with the default being before.
                   7450: The file inclusion is only done at the moment of translation, not during the
                   7451: compilation of the translation schema. Thus, the file to be included need not
                   7452: exist during the compilation, but it must be accessible at the time of
                   7453: translation.  Its contents can also be modified between two translations, thus
                   7454: producing different results, even if neither the document or the translation
1.18    ! cvs      7455: schema are modified.</p>
        !          7456: <p>
1.1       cvs      7457: During translation, the file to be included is searched for along the schema
1.18    ! cvs      7458: directory path (indicated by the environment variable <tt>THOTSCH</tt>).  The
1.1       cvs      7459: file name is normally only composed of a simple name, without specification of
1.12      cvs      7460: a complete file path.  However, if the filename starts with a '/', it is
1.18    ! cvs      7461: considered as an absolute path.</p>
        !          7462: <pre>                'Include' File [ Position ] ';'
1.6       cvs      7463:      File     = FileName / BufferID .
1.18    ! cvs      7464:      FileName = STRING .</pre>
        !          7465: <blockquote class="example">
        !          7466: <p>
        !          7467: <strong>Example:</strong></p>
        !          7468: <p>
1.3       cvs      7469: Suppose that it is desirable to print documents of the Article class with a
                   7470: formatter which requires a number of declarations and definitions at the
1.18    ! cvs      7471: beginning of the file.  The <tt>Include</tt>rule can be used to achieve this.
1.3       cvs      7472: All the declarations and definitions a replaced in a file called
1.18    ! cvs      7473: <tt>DeclarArt</tt> and then the <tt>Article</tt> element type is given the
        !          7474: following rule:</p>
        !          7475: <pre>Article : BEGIN
1.1       cvs      7476:           Include 'DeclarArt' Before;
                   7477:           ...
1.18    ! cvs      7478:           END;</pre>
        !          7479: </blockquote>
        !          7480: </div>
        !          7481: 
        !          7482: <div class="subsection">
        !          7483: 
        !          7484: <h3><a name="sectc5214">The <tt>Get</tt> rule</a></h3>
        !          7485: <p>
        !          7486: The <tt>Get</tt> rule is used to change the order in which the elements appear
1.1       cvs      7487: in the translated document.  More precisely, it produces  the translation of a
                   7488: specified element before or after the translation of the content of the
1.18    ! cvs      7489: element to which the rule applies.  The <tt>Before</tt> and <tt>After</tt>
1.1       cvs      7490: keywords are placed at the end of the rule to specify whether the operation
                   7491: should be performed before or after translation of the rule's element (the
                   7492: default is before). The type of the element to be moved must be specified
1.18    ! cvs      7493: after the <tt>Get</tt> keyword, optionally preceded by a keyword indicating
        !          7494: where the element will be found in the logical structure of the document:</p>
        !          7495: <dl>
        !          7496: <dt><tt>Included</tt></dt>
        !          7497: <dd>
        !          7498: The element to be moved is the first element of the indicated type which is
1.1       cvs      7499: found inside the element to which the rule applies.
1.18    ! cvs      7500: </dd>
        !          7501: <dt><tt>Referred</tt></dt>
        !          7502: <dd>
        !          7503: This keyword can only be used if the rule applies to a reference element. The
        !          7504: element to be moved is either the element designated by the reference (if that
        !          7505: element is of the specified type), or the first element of the desired type
        !          7506: contained within the element designated by the reference.
        !          7507: </dd>
        !          7508: <dt>no keyword</dt>
        !          7509: <dd>
        !          7510: If the element to be moved is an associated element, defined in the <a
        !          7511: href="#sectc314"><tt>ASSOC</tt> section</a> of the structure schema, all
1.2       cvs      7512: associated elements of this type which have not been translated yet are then
                   7513: translated.  Certain elements may in fact have already been translated by a
1.18    ! cvs      7514: <tt>Get Referred</tt> rule.
        !          7515: <p>
1.1       cvs      7516: If the element to be moved is not an associated element, the translator takes
                   7517: the first element of the indicated type from among the siblings of the rule's
                   7518: element.  This is primarily used to change the order of the components of an
1.18    ! cvs      7519: aggregate.</p>
        !          7520: </dd>
        !          7521: </dl>
        !          7522: <p>
1.1       cvs      7523: If the element to be moved is defined in a structure schema which is not the
                   7524: one which corresponds to the translation schema (in the case of an included
                   7525: object with a different schema), the type name of this element must be
                   7526: followed, between parentheses, by the name of the structure schema which
1.18    ! cvs      7527: defines it.</p>
        !          7528: <pre>                   'Get' [ RelPosition ] ElemID 
1.6       cvs      7529:                          [ ExtStruct ]
                   7530:                          [ Position ] ';' /
                   7531:      RelPosition = 'Included' / 'Referred' .
1.18    ! cvs      7532:      ExtStruct   = '(' ElemID ')' .</pre>
        !          7533: <p>
        !          7534: The <tt>Get</tt> rule has no effect if the element which it is supposed to
1.1       cvs      7535: move has already been translated.  Thus, the element will not be duplicated.
                   7536: It is generally best to associate the rule with the first element which will
                   7537: be encountered by the translator in its traversal of the document.  Suppose an
1.18    ! cvs      7538: aggregate has two elements <tt>A</tt> and <tt>B</tt>, with <tt>A</tt>
1.1       cvs      7539: appearing first in the logical structure.  To permute these two elements, a
1.18    ! cvs      7540: <tt>Get B before</tt> rule should be associated with the <tt>A</tt> element
        !          7541: type, not the inverse.  Similarly, a rule of the form <tt>Get Included X
        !          7542: After</tt>, even though syntactically correct, makes no sense since, by the
1.1       cvs      7543: time it will be applied, after the translation of the contents of the element
1.18    ! cvs      7544: to which it is attached, the <tt>X</tt> element will already have been
        !          7545: translated.</p>
        !          7546: <p>
        !          7547: The <tt>Get</tt> rule is the only way to obtain the translation of the
1.1       cvs      7548: associated elements.  In fact, the translator only traverses the primary tree
                   7549: of the document and thus does not translate the associated elements, except
1.18    ! cvs      7550: when the translation is explicitly required by a <tt>Get Referred Type</tt> or
        !          7551: <tt>Get Type</tt> rule where <tt>Type</tt> is an associated element type.</p>
        !          7552: <blockquote class="example">
        !          7553: <p>
        !          7554: <strong>Example:</strong></p>
        !          7555: <p>
1.3       cvs      7556: The structure schema defined figures as associated element which are composed
                   7557: of some content and a caption.  Moreover, it is possible to make references to
1.18    ! cvs      7558: figures, using elements of the <tt>RefFigure</tt> type:</p>
        !          7559: <pre>     ...
1.1       cvs      7560:      RefFigure = REFERENCE(Figure);
                   7561: ASSOC
1.6       cvs      7562:      Figure    = BEGIN
                   7563:                  Content = NATURE;
                   7564:                  Caption = Text;
                   7565:                  END;
1.18    ! cvs      7566:      ...</pre>
        !          7567: <p>
1.3       cvs      7568: Suppose it would be useful to make a figure appear in the translated document
                   7569: at the place in the text where the first reference to the figure is made.  If
                   7570: some figures are not referenced, then they would appear at the end of the
                   7571: document.  Also, each figure's caption should appear before the content.  The
1.18    ! cvs      7572: following rules in the translation schema will produce this result:</p>
        !          7573: <pre>Article :   BEGIN
1.1       cvs      7574:             ...
                   7575:             Get Figures After;
                   7576:             END;
                   7577: RefFigure : BEGIN
                   7578:             If FirstRef Get Referred Figure;
                   7579:             ...
                   7580:             END;
                   7581: Content :   BEGIN
                   7582:             Get Caption Before;
                   7583:             ...
1.18    ! cvs      7584:             END;</pre>
        !          7585: </blockquote>
        !          7586: </div>
        !          7587: 
        !          7588: <div class="subsection">
        !          7589: 
        !          7590: <h3><a name="sectc5215">The <tt>Copy</tt> rule</a></h3>
        !          7591: <p>
        !          7592: Like the <tt>Get</tt> rule, the <tt>Copy</tt> rule generates the translation
1.1       cvs      7593: of a specified element, but it acts even if the element has already been
                   7594: translated and it allows to copy it or to translate it later. Both rules have
1.18    ! cvs      7595: the same syntax.</p>
        !          7596: <pre>              'Copy' [ RelPosition ] ElemID 
        !          7597:                      [ ExtStruct ] [ Position ] ';'</pre>
        !          7598: </div>
        !          7599: 
        !          7600: <div class="subsection">
        !          7601: 
        !          7602: <h3><a name="sectc5216">The <tt>Use</tt> rule</a></h3>
        !          7603: <p>
        !          7604: The <tt>Use</tt> rule specifies the translation schema to be applied to
1.1       cvs      7605: objects of a certain class that are part of the document.  This rule only
                   7606: appears in the rules for the root element of the document (the first type
1.18    ! cvs      7607: defined after the <tt>STRUCT</tt> keyword in the structure schema) or the
1.1       cvs      7608: rules of an element defined by an external structure (by another structure
1.18    ! cvs      7609: schema).  Also, the <tt>Use</tt> rule cannot be conditional.</p>
        !          7610: <p>
1.1       cvs      7611: If the rule is applied to an element defined by an external structure, the
1.18    ! cvs      7612: <tt>Use</tt> keyword is simply followed by the name of the translation schema
1.1       cvs      7613: to be used for element constructed  according to that external structure.  If
                   7614: the rule is applied to the document's root element, it is formed by the
1.18    ! cvs      7615: <tt>Use</tt> keyword followed by the translation schema's name, the
        !          7616: <tt>For</tt> keyword and the name of the external structure to which the
        !          7617: indicated translation schema should be applied.</p>
        !          7618: <pre>               'Use' TrSchema [ 'For' ElemID ] ';'
        !          7619:      TrSchema = NAME .</pre>
        !          7620: <p>
        !          7621: If no <tt>Use</tt> rule defines the translation schema to be used for an
1.1       cvs      7622: external structure which appears in a document, the translator asks the user,
                   7623: during the translation process, which schema should be used. Thus, it is not
1.18    ! cvs      7624: necessary to give the translation schema a <tt>Use</tt> rule for every
1.1       cvs      7625: external structure used, especially when the choice of translation schemas is
1.18    ! cvs      7626: to be left to the user.</p>
        !          7627: <p>
1.1       cvs      7628: Notice: if the translator is launched by the editor (by the ``Save as''
1.18    ! cvs      7629: command), prompts are not displayed.</p>
        !          7630: <blockquote class="example">
        !          7631: <p>
        !          7632: <strong>Example:</strong></p>
        !          7633: <p>
        !          7634: The <tt>Article</tt> structure schema uses the <tt>Formula</tt> external
        !          7635: structure, defined by another structure schema, for mathematical formulas:</p>
        !          7636: <pre>STRUCTURE Article;
1.1       cvs      7637:    ...
                   7638: STRUCT
                   7639:    Article = ...
                   7640:    ...
                   7641:    Formula_in_text  = Formula;
                   7642:    Isolated_formula = Formula;
                   7643:    ...
1.18    ! cvs      7644: END</pre>
        !          7645: <p>
        !          7646: Suppose that it would be useful to use the <tt>FormulaT</tt> translation
        !          7647: schema for the formulas of an article.  This can be expressed in two different
        !          7648: ways in the <tt>Article</tt> class translation schema, using the rules:</p>
        !          7649: <pre>RULES
1.1       cvs      7650:     Article :
1.18    ! cvs      7651:        Use FormulaT for Formula;</pre>
        !          7652: <p>
        !          7653: or:</p>
        !          7654: <pre>RULES
1.1       cvs      7655:     ...
                   7656:     Formula :
1.18    ! cvs      7657:        Use FormulaT;</pre>
        !          7658: </blockquote>
        !          7659: </div>
        !          7660: 
        !          7661: <div class="subsection">
        !          7662: 
        !          7663: <h3><a name="sectc5217">The <tt>Remove</tt> rule</a></h3>
        !          7664: <p>
        !          7665: The <tt>Remove</tt> rule indicates that nothing should be generated, in the
1.1       cvs      7666: translated document, for the content of the element to which the rule applies.
                   7667: The content of that element is simply ignored by the translator.  This does
                   7668: not prevent the generation of text for the element itself, using the
1.18    ! cvs      7669: <tt>Create</tt> or <tt>Include</tt> rules, for example.</p>
        !          7670: <p>
        !          7671: The <tt>Remove</tt> rule is simply written with the <tt>Remove</tt> keyword.
        !          7672: It is terminated, like all rules, by a semicolon.</p>
        !          7673: <pre>               'Remove' ';'</pre>
        !          7674: </div>
        !          7675: 
        !          7676: <div class="subsection">
        !          7677: 
        !          7678: <h3><a name="sectc5218">The <tt>NoTranslation</tt> rule</a></h3>
        !          7679: <p>
        !          7680: The <tt>NoTranslation</tt> rule indicates to the translator that it must not
1.1       cvs      7681: translate the content of the leaves of the element to which it applies. In
1.18    ! cvs      7682: contrast to the <tt>Remove</tt> rule, it does not suppress the content of the
1.1       cvs      7683: element, but it inhibits the translation of character strings, symbols, and
                   7684: graphical elements contained in the element.  These are retrieved so that
1.18    ! cvs      7685: after the translation of the document, the rules of the <a
        !          7686: href="#sectc5225"><tt>TEXTTRANSLATE</tt>, <tt>SYMBTRANSLATE</tt> and
        !          7687: <tt>GRAPHTRANSLATE</tt> sections</a> will not be applied to them.</p>
        !          7688: <p>
        !          7689: The <tt>NoTranslation</tt> rule is written with the <tt>NoTranslation</tt>
        !          7690: keyword followed by a semicolon.</p>
        !          7691: <pre>               'NoTranslation' ';'</pre>
        !          7692: </div>
        !          7693: 
        !          7694: <div class="subsection">
        !          7695: 
        !          7696: <h3><a name="sectc5219">The <tt>NoLineBreak</tt> rule</a></h3>
        !          7697: <p>
        !          7698: The <tt>NoLineBreak</tt> rule indicates to the translator that it must not
1.1       cvs      7699: generate additional line breaks in the output produced for the element to
1.18    ! cvs      7700: which it applies.  This is as if it was an <a href="#sectc522">instruction
        !          7701: <tt>LINELENGTH 0;</tt></a> at the beginning of the translation schema, but
        !          7702: only for the current element.</p>
        !          7703: <p>
        !          7704: The <tt>NoLineBreak</tt> rule is written with the <tt>NoLineBreak</tt> keyword
        !          7705: followed by a semicolon.</p>
        !          7706: <pre>               'NoLineBreak' ';'</pre>
        !          7707: </div>
1.1       cvs      7708: 
1.18    ! cvs      7709: <div class="subsection">
1.1       cvs      7710: 
1.18    ! cvs      7711: <h3><a name="sectc5220">The <tt>ChangeMainFile</tt> rule</a></h3>
        !          7712: <p>
1.1       cvs      7713: When the translation program starts, it opens a main output file, whose name
1.18    ! cvs      7714: is given as a parameter of the translator.  All <a
        !          7715: href="#sectc5210"><tt>Create</tt> rules</a> without explicit indication of the
        !          7716: output file write sequentially in this file.  When a <tt>ChangeMainFile</tt>
        !          7717: rule is executed, the main output file is closed and it is replaced by a new
        !          7718: one, whose name is specified in the <tt>ChangeMainFile</tt> rule.  The
        !          7719: <tt>Create</tt> rules without indication of the output file that are then
        !          7720: executed write in this new file.  Several <tt>ChangeMainFile</tt> rules can be
        !          7721: executed during the same translation, for dividing the main output into
        !          7722: several files.</p>
        !          7723: <p>
        !          7724: This rule is written with the <tt>ChangeMainFile</tt> keyword followed by the
1.14      cvs      7725: name of a variable that specifies the name of the new main file. The keyword
1.18    ! cvs      7726: <tt>Before</tt> or <tt>After</tt> can be placed at the end of the rule to
1.1       cvs      7727: specify whether the operation should be performed before or after translation
                   7728: of the rule's element (the default is before). This rule, like all translation
1.18    ! cvs      7729: rules, is terminated by a semicolon.</p>
        !          7730: <pre>               'ChangeMainFile' VarID [ Position ] ';'</pre>
        !          7731: <blockquote class="example">
        !          7732: <p>
        !          7733: <strong>Example:</strong></p>
        !          7734: <p>
1.3       cvs      7735: To generate the translation of each section in a different file, the following
1.18    ! cvs      7736: rule can be associated with type <tt>Section</tt>.  That rule uses the <a
        !          7737: href="#varoutputfile"><tt>VarOutpuFile</tt> variable</a> defined above.</p>
        !          7738: <pre>     Section:
        !          7739:          ChangeMainFile VarOutpuFile Before;</pre>
        !          7740: <p>
        !          7741: If <tt>output.txt</tt> is the name of the output file specified when starting
1.3       cvs      7742: the translation program, translated sections are written in files
1.18    ! cvs      7743: <tt>output1.txt</tt>, <tt>output2.txt</tt>, etc.</p>
        !          7744: </blockquote>
        !          7745: </div>
1.1       cvs      7746: 
1.18    ! cvs      7747: <div class="subsection">
1.14      cvs      7748: 
1.18    ! cvs      7749: <h3><a name="sectc5220a">The <tt>RemoveFile</tt> rule</a></h3>
        !          7750: <p>
1.14      cvs      7751: Files may be used for storing temporary data that are no longer needed when
1.18    ! cvs      7752: the translation of a document is complete.  These files may be removed by the
        !          7753: <tt>RemoveFile</tt> rule.</p>
        !          7754: <p>
        !          7755: This rule is written with the <tt>RemoveFile</tt> keyword followed by the name
        !          7756: of a variable that specifies the name of the file to be removed.  The keyword
        !          7757: <tt>Before</tt> or <tt>After</tt> can be placed at the end of the rule to
        !          7758: specify whether the operation should be performed before or after translation
        !          7759: of the rule's element (the default is before).  This rule, like all
        !          7760: translation rules, is terminated by a semicolon.</p>
        !          7761: <pre>               'RemoveFile' VarID [ Position ] ';'</pre>
        !          7762: </div>
        !          7763: 
        !          7764: <div class="subsection">
        !          7765: 
        !          7766: <h3><a name="sectc5221">The <tt>Set</tt> and <tt>Add</tt> rules</a></h3>
        !          7767: <p>
        !          7768: The <tt>Set</tt> and <tt>Add</tt> rules are used for modifying the value of
        !          7769: counters that have no <a href="#sectc524">counting function</a>.  Only this
        !          7770: type of counter can be used in the <tt>Set</tt> and <tt>Add</tt> rules.</p>
        !          7771: <p>
        !          7772: Both rules have the same syntax: after the keyword <tt>Set</tt> or
        !          7773: <tt>Add</tt> appear the counter name and the value to assign to the counter
        !          7774: (<tt>Set</tt> rule) or the value to be added to the counter (<tt>Add</tt>
        !          7775: rule).  The keyword <tt>Before</tt> or <tt>After</tt> can follow that value to
1.1       cvs      7776: indicate when the rule must be applied: before or after the element's content
1.18    ! cvs      7777: is translated. By default, <tt>Before</tt> is assumed.  A semicolon terminates
        !          7778: the rule.</p>
        !          7779: <pre>               'Set' CounterID InitValue [ Position ] ';' /
        !          7780:                'Add' CounterID Increment [ Position ] ';'</pre>
        !          7781: </div>
        !          7782: 
        !          7783: <div class="subsection">
        !          7784: 
        !          7785: <h3><a name="sectc5221a">The <tt>Indent</tt> rule</a></h3>
        !          7786: <p>
        !          7787: The <tt>Indent</tt> rule is used to modify the value of text indentation in
        !          7788: the output files.</p>
        !          7789: <p>
        !          7790: Each time the translator creates a new line in an output file, it generates a
        !          7791: variable number of space characters at the beginning of the new line.  By
1.10      cvs      7792: default, the number of these characters (the indentation) is 0.  It can be
1.18    ! cvs      7793: changed with the <tt>Indent</tt> rule.</p>
        !          7794: <p>
        !          7795: The rule begins with the <tt>Indent</tt> keyword, followed by the indentation
        !          7796: sign (optional) and value and a keyword <tt>Before</tt> or <tt>After</tt>
        !          7797: indicating that the indentation should be changed <a href="#sectc5222">before
        !          7798: or after</a> the element's content is generated.  If the position is not
1.10      cvs      7799: indicated, the indentation is changed before the element's content is
                   7800: generated.  This rule, like all translation rules, is terminated by a
1.18    ! cvs      7801: semicolon.</p>
        !          7802: <p>
        !          7803: The indentation value is indicated by an integer, which is the number of space
        !          7804: characters to be generated at the beginning of each new line. A sign
        !          7805: (<tt>+</tt> or <tt>-</tt>) can appear before the integer to indicate that the
        !          7806: value is relative: the current value of indentation is incremented (if sign is
        !          7807: <tt>+</tt>) or decremented (if sign is <tt>-</tt>) by the specified value.</p>
        !          7808: <p>
        !          7809: Like the <a href="#sectc5210"><tt>Create</tt> rule</a>, the <tt>Indent</tt>
        !          7810: keyword can be followed by the <tt>IN</tt> keyword and by the name of a <a
        !          7811: href="#sectc526">variable</a>.  This means that the rule must not change
1.10      cvs      7812: indentation in the main output file, but in the file whose name is specified
                   7813: by the variable (by default, indentation is changed in the main output
1.18    ! cvs      7814: file).</p>
        !          7815: <pre>               'Indent' [ 'IN' VarID ] [ IndentSign ]
1.10      cvs      7816:                         IndentValue [ Position ] ';' .
                   7817: 
                   7818: IndentSign    = '+' / '-' .
1.18    ! cvs      7819: IndentValue   = NUMBER .</pre>
        !          7820: </div>
1.10      cvs      7821: 
1.18    ! cvs      7822: <div class="subsection">
1.1       cvs      7823: 
1.18    ! cvs      7824: <h3><a name="sectc5222">Rule application order</a></h3>
        !          7825: <p>
1.1       cvs      7826: The translator translates the elements which comprise the document in the
1.18    ! cvs      7827: order induced by the tree structure, except when the <tt>Get</tt> rule is used
1.1       cvs      7828: to change the order of translation.  For each element, the translator first
                   7829: applies the rules specified for the element's type that must be applied before
1.18    ! cvs      7830: translation of the element's content (rules ending with the <tt>Before</tt>
1.1       cvs      7831: keyword or which have no position keyword).  If several rules meet these
                   7832: criteria, the translator applies them in the order in where they appear in the
1.18    ! cvs      7833: translation schema.</p>
        !          7834: <p>
        !          7835: It then applies all <a href="#sectc5223">rules for the attributes</a> which
1.1       cvs      7836: the element has and which must be applied before the translation of the
1.18    ! cvs      7837: element's content (rules ending with the <tt>Before</tt> keyword or which have
1.1       cvs      7838: no position keyword).  For one attribute value, the translator applies the
1.18    ! cvs      7839: rules in the order in which they are defined in the translation schema.</p>
        !          7840: <p>
1.1       cvs      7841: The same procedure is followed with translation rules for specific
1.18    ! cvs      7842: presentations.</p>
        !          7843: <p>
        !          7844: Next, the element's content is translated, as long as a <tt>Remove</tt> rule
        !          7845: does not apply.</p>
        !          7846: <p>
1.1       cvs      7847: In the next step, the translator applies rules for the specific presentation
                   7848: of the element that are to be applied after translation of the content (rules
1.18    ! cvs      7849: which end with the <tt>After</tt> keyword).  The rules for each type of
1.1       cvs      7850: presentation rule or each value are applied in the order in which the
1.18    ! cvs      7851: translation appear in the schema.</p>
        !          7852: <p>
1.1       cvs      7853: Then, the same procedure is followed for translation rules for attributes of
1.18    ! cvs      7854: the element.</p>
        !          7855: <p>
1.1       cvs      7856: Finally, the translator applies rules for the element which must be applied
                   7857: after translation of the element's content.  These rules are applied in the
                   7858: order that they appear in the translation schema.  When the translation of an
                   7859: element is done, the translator procedes to translate the following
1.18    ! cvs      7860: element.</p>
        !          7861: <p>
        !          7862: This order can be changed with the <tt>Attributes</tt> and
        !          7863: <tt>Presentation</tt> options of the <a href="#sectc5210"><tt>Create</tt>
        !          7864: rule</a>.</p>
        !          7865: </div>
1.1       cvs      7866: 
1.18    ! cvs      7867: <div class="subsection">
1.1       cvs      7868: 
1.18    ! cvs      7869: <h3><a name="sectc5223">Translation of logical attributes</a></h3>
        !          7870: <p>
1.1       cvs      7871: After the rules for the element types, the translation schema defines rules
1.18    ! cvs      7872: for attribute values.  This section begins with the <tt>ATTRIBUTES</tt>
1.1       cvs      7873: keyword and is composed of a sequence of rule blocks each preceded by an
1.18    ! cvs      7874: attribute name and an optional value or value range.</p>
        !          7875: <p>
1.1       cvs      7876: If the attribute's name appears alone before the rule block, the rule are
                   7877: applied to all element which have the attribute, no matter what value the
                   7878: attribute has.  In this case, the attribute name is followed by a colon before
1.18    ! cvs      7879: the beginning of the rule block.</p>
        !          7880: <p>
1.1       cvs      7881: The attribute's name can be followed by the name of an element type between
                   7882: parentheses.  This says, as in presentation schemas, that the rule block which
                   7883: follows applies not to the element which has the attribute, but to its
1.18    ! cvs      7884: descendants of the type indicated between the parentheses.</p>
        !          7885: <p>
1.1       cvs      7886: If values are given after the attribute name (or after the name of the element
                   7887: type), the rules are applied only when the attribute has the indicated values.
                   7888: The same attribute can appear several times, with different values and
                   7889: different translation rules.  Attribute values are indicated in the same way
1.18    ! cvs      7890: as in <a href="#sectc528">conditions</a> and are followed by a colon before
        !          7891: the block of rules.</p>
        !          7892: <p>
1.1       cvs      7893: The rule block associated with an attribute is either a simple rule or a
1.18    ! cvs      7894: sequence of rules delimited by the <tt>BEGIN</tt> and <tt>END</tt> keywords.
        !          7895: Note that rules associated with attribute values cannot be conditional.</p>
        !          7896: <p>
1.1       cvs      7897: Translation rules are not required for all attributes (or their values)
                   7898: defined in a structure schema.  Only those attributes for which a particular
                   7899: action must be performed by the translator must have such rules.  The rules
1.18    ! cvs      7900: that can be used are those described above, from <a
        !          7901: href="#sectc5210"><tt>Create</tt></a> to <a
        !          7902: href="#sectc5218"><tt>NoTranslation</tt></a>.</p>
        !          7903: <pre>     AttrSeq       = TransAttr &lt; TransAttr > .
1.1       cvs      7904:      TransAttr     = AttrID [ '(' ElemID ')' ] 
                   7905:                      [ RelatAttr ] ':' RuleSeq .
                   7906:      AttrID        = NAME .
1.18    ! cvs      7907:      ElemID        = NAME .</pre>
        !          7908: <blockquote class="example">
        !          7909: <p>
        !          7910: <strong>Example:</strong></p>
        !          7911: <p>
1.3       cvs      7912: The structure defined the ``Language'' attribute which can take the values
                   7913: ``French'' and ``English''.  To have the French parts of the original document
                   7914: removed and prevent the translation of the leaves of the English parts, the
1.18    ! cvs      7915: following rules would be used:</p>
        !          7916: <pre>ATTRIBUTES
1.1       cvs      7917:    Language=French :
                   7918:       Remove;
                   7919:    Language=English :
1.18    ! cvs      7920:       NoTranslation;</pre>
        !          7921: </blockquote>
        !          7922: </div>
1.1       cvs      7923: 
1.18    ! cvs      7924: <div class="subsection">
1.1       cvs      7925: 
1.18    ! cvs      7926: <h3><a name="sectc5224">Translation of specific presentations</a></h3>
        !          7927: <p>
1.1       cvs      7928: After the rules for attributes, the translation schema defines rules for the
1.18    ! cvs      7929: specific presentation.  This section begins with the <tt>PRESENTATION</tt>
1.1       cvs      7930: keyword and is composed of a sequence of translation rule blocks each preceded
                   7931: by a presentation rule name, optionally accompanied by a part which depends on
1.18    ! cvs      7932: the particular presentation rule.</p>
        !          7933: <p>
1.1       cvs      7934: Each of these translation rule blocks is applied when the translator operates
                   7935: on an element which has a specific presentation rule of the type indicated at
                   7936: the head of the block.  Depending on the type of the specific presentation
                   7937: rule, it is possible to specify values of the presentation rule for which the
1.18    ! cvs      7938: translation rule block should be applied.</p>
        !          7939: <p>
        !          7940: There are three categories of the presentation rules:</p>
        !          7941: <ul>
        !          7942: <li>
        !          7943: rules taking numeric values: <tt>Size</tt>, <tt>Indent</tt>,
        !          7944: <tt>LineSpacing</tt>, <tt>LineWeight</tt>,
        !          7945: <li>
        !          7946: rules whose values are taken from a predefined list (i.e. whose type is an
        !          7947: enumeration): <tt>Adjust</tt>, <tt>Justify</tt>, <tt>Hyphenate,/TT>,
        !          7948: <tt>Style</tt>, <tt>Font</tt>, <tt>UnderLine</tt>, <tt>Thickness</tt>,
        !          7949: <tt>LineStyle</tt>,</tt>
        !          7950: <li>
        !          7951: rules whose value is a name: <tt>FillPattern</tt>, <tt>Background</tt>,
        !          7952: <tt>Foreground</tt>.
        !          7953: </ul>
        !          7954: <p>
1.1       cvs      7955: For presentation rules of the first category, the values which provoke
                   7956: application of the translation rules are indicated in the same manner as for
1.18    ! cvs      7957: <a href="#relattr">numeric attributes</a>.  This can be either a unique value
1.1       cvs      7958: or range of values.  For a unique value, the value (an integer) is simply
                   7959: preceded by an equals sign.  Value ranges can be specified in one of three
1.18    ! cvs      7960: ways:</p>
        !          7961: <ul>
        !          7962: <li>
        !          7963: all values less than a given value (this value is preceded by a ``less than''
        !          7964: sign '<tt>&lt;</tt>'),
        !          7965: <li>
        !          7966: all values greater than a given value (this value is preceded by a` `greater
        !          7967: than'' sign '<tt>></tt>'),
        !          7968: <li>
        !          7969: all values falling in an interval, bounds included.  The range of values is
        !          7970: then specified <tt>IN [</tt>Minimum<tt>..</tt>Maximum<tt>]</tt>, where Minimum
        !          7971: and Maximum are integers.
        !          7972: </ul>
        !          7973: <p>
1.2       cvs      7974: All numeric values can be negative, in which case the integer is preceded by a
1.18    ! cvs      7975: minus sign.  All values must be given in typographers points.</p>
        !          7976: <p>
1.1       cvs      7977: For presentation rules whose values are taken from a predefined list, the
                   7978: value which provokes application of the translation rules is simply indicated
1.18    ! cvs      7979: by the equals sign followed by the name of the value.</p>
        !          7980: <p>
1.1       cvs      7981: For presentation rules whose values are names, the value which provokes the
                   7982: application of translation rules is simply indicated by the equals sign
                   7983: followed by the name of the value.  The names of the fill patterns (the
1.18    ! cvs      7984: <tt>FillPattern</tt> rule) and of the colors (the <tt>Foreground</tt> and
        !          7985: <tt>Background</tt> rules) used in Thot are the same as in the P language.</p>
        !          7986: <pre>     PresSeq        = PresTrans &lt; PresTrans > .
1.1       cvs      7987:      PresTrans      = PresRule ':' RuleSeq .
                   7988:      PresRule       = 'Size' [ PresRelation ] /
                   7989:                       'Indent' [ PresRelation ] /
                   7990:                       'LineSpacing' [ PresRelation ] /
                   7991:                       'Adjust' [ '=' AdjustVal ] /
                   7992:                       'Justify' [ '=' BoolVal ] /
                   7993:                       'Hyphenate' [ '=' BoolVal ] /
                   7994:                       'Style' [ '=' StyleVal ] /
                   7995:                       'Font' [ '=' FontVal ] /
                   7996:                       'UnderLine' [ '=' UnderLineVal ] /
                   7997:                       'Thickness' [ '=' ThicknessVal ] /
                   7998:                       'LineStyle' [ '=' LineStyleVal ] /
                   7999:                       'LineWeight' [ PresRelation ] /
                   8000:                       'FillPattern' [ '=' Pattern ] /
                   8001:                       'Background' [ '=' Color ] /
                   8002:                       'Foreground' [ '=' Color ] .
                   8003: 
                   8004:      PresRelation   = '=' PresValue /
                   8005:                       '>' [ '-' ] PresMinimum /
                   8006:                       '&lt;' [ '-' ] PresMaximum /
                   8007:                       'IN' '[' [ '-' ] PresIntervalMin '..'
                   8008:                               [ '-' ] PresIntervalMax ']' .
                   8009:      AdjustVal      = 'Left' / 'Right' / 'VMiddle' / 
                   8010:                       'LeftWithDots' .
                   8011:      BoolVal        = 'Yes' / 'No' .
                   8012:      StyleVal       = 'Bold' / 'Italics' / 'Roman' /
                   8013:                       'BoldItalics' / 'Oblique' /
                   8014:                       'BoldOblique' .
                   8015:      FontVal        = 'Times' / 'Helvetica' / 'Courier' .
                   8016:      UnderLineVal   = 'NoUnderline' / 'UnderLined' /
                   8017:                       'OverLined' / 'CrossedOut' .
                   8018:      ThicknessVal   = 'Thick' / 'Thin' .
1.6       cvs      8019:      LineStyleVal   = 'Solid' / 'Dashed' / 'Dotted' .
1.1       cvs      8020:      Pattern        = NAME .
                   8021:      Color          = NAME .
                   8022:      PresMinimum    = NUMBER .
                   8023:      PresMaximum    = NUMBER .
                   8024:      PresIntervalMin= NUMBER .
                   8025:      PresIntervalMax= NUMBER .
                   8026:      PresValue      = [ '-' ] PresVal .
1.18    ! cvs      8027:      PresVal        = NUMBER .</pre>
        !          8028: <p>
        !          8029: The <a name="prestransl">translation rules associated with specific
        !          8030: presentation rules</a> can use the value of the specific presentation rule
1.1       cvs      8031: that causes them to be applied.  This behavior is designated by the keyword
1.18    ! cvs      8032: <tt>Value</tt>. For numerically-valued presentation rules, the numeric value
1.1       cvs      8033: is produced.  For other presentation rules, the name of the value is
1.18    ! cvs      8034: produced.</p>
        !          8035: <p>
1.1       cvs      8036: It should be noted that modifications to the layout of the document's elements
                   8037: that are made using the combination of the control key and a mouse button will
1.18    ! cvs      8038: have no effect on the translation of the document.</p>
        !          8039: <blockquote class="example">
        !          8040: <p>
        !          8041: <strong>Example:</strong></p>
        !          8042: <p>
1.3       cvs      8043: Suppose that it is desirable to use the same font sizes as in the specific
1.18    ! cvs      8044: presentation, but the font size must be between 10 and 18 typographer's
        !          8045: points. If font size is set in the translated document by the string
        !          8046: <tt>pointsize=n</tt> where <tt>n</tt> is the font size in typographer's points
        !          8047: then the following rules will suffice:</p>
        !          8048: <pre>PRESENTATION
1.1       cvs      8049:    Size &lt; 10 :
                   8050:         Create 'pointsize=10';
                   8051:    Size in [10..18] :
                   8052:         BEGIN
                   8053:         Create 'pointsize=';
                   8054:         Create Value;
                   8055:         END;
                   8056:    Size > 18 :
1.18    ! cvs      8057:         Create 'pointsize=18';</pre>
        !          8058: </blockquote>
        !          8059: </div>
1.1       cvs      8060: 
1.18    ! cvs      8061: <div class="subsection">
1.1       cvs      8062: 
1.18    ! cvs      8063: <h3><a name="sectc5225">Recoding of characters, symbols and graphics</a></h3>
        !          8064: <p>
1.1       cvs      8065: The coding of characters, graphical elements and symbols as defined in Thot
                   8066: does not necessarily correspond to what is required by an application to which
                   8067: a Thot document must be exported.  Because of this the translator can recode
                   8068: these terminal elements of the documents structure.  The last sections of a
                   8069: translation schema are intended for this purpose, each specifying the recoding
1.18    ! cvs      8070: rules for one type of terminal element.</p>
        !          8071: <p>
1.1       cvs      8072: The recoding rules for character strings are grouped by alphabets. There is a
                   8073: group of rules for each alphabet of the Thot document that must be translated.
1.18    ! cvs      8074: Each such group of rules begins with the <tt>TEXTTRANSLATE</tt> keyword,
1.1       cvs      8075: followed by the specification of the alphabet to translate and the recoding
1.18    ! cvs      8076: rules, between the <tt>BEGIN</tt> and <tt>END</tt> keywords unless there is
1.1       cvs      8077: only one recoding rule for the alphabet. The specification of the alphabet is
                   8078: not required: by default it is assumed to the Latin alphabet (the ISO Latin-1
1.18    ! cvs      8079: character set).</p>
        !          8080: <p>
1.1       cvs      8081: Each recoding rule is formed by a source string between apostrophes and a
                   8082: target string, also between apostrophes, the two strings being separated by
1.18    ! cvs      8083: the arrow symbol (<tt>-></tt>), formed by the ``minus'' and ``greater than''
        !          8084: characters.  The rule is terminated by a semi-colon.</p>
        !          8085: <pre>     TextTransSeq = [ Alphabet ] TransSeq .
1.1       cvs      8086:      Alphabet     = NAME .
                   8087:      TransSeq     ='BEGIN' &lt; Translation > 'END' ';' /
                   8088:                     Translation .
                   8089:      Translation  = Source [ '->' Target ] ';' .
                   8090:      Source       = STRING .
1.18    ! cvs      8091:      Target       = STRING .</pre>
        !          8092: <p>
1.1       cvs      8093: One such rule signifies that when the source string appears in a text leaf of
                   8094: the document being translated, the translator must replace it, in the
                   8095: translated document, with the target string.  The source string and the target
                   8096: string can have different lengths and the target string can be empty.  In this
                   8097: last case, the translator simply suppresses every occurrence of the source
1.18    ! cvs      8098: string in the translated document.</p>
        !          8099: <p>
1.1       cvs      8100: For a given alphabet, the order of the rules is not important and has no
                   8101: significance because the T language compiler reorders the rules in ways that
                   8102: speed up the translator's work.  The total number of recoding rules is limited
1.18    ! cvs      8103: by the compiler as is the maximum length of the source and target strings.</p>
        !          8104: <p>
1.1       cvs      8105: The recoding rules for symbols and graphical elements are written in the same
                   8106: manner as the recoding rules for character strings.  They are preceded,
1.18    ! cvs      8107: respectively, by the <tt>SYMBTRANSLATE</tt> and <tt>GRAPHTRANSLATE</tt> and so
1.1       cvs      8108: not require a specification of the alphabet. Their source string is limited to
                   8109: one character, since, in Thot, each symbol and each graphical element is
                   8110: represented by a single character.  The symbol and graphical element codes are
1.18    ! cvs      8111: defined along with the <a href="#sect7">non-standard character codes</a>.</p>
        !          8112: <blockquote class="example">
        !          8113: <p>
        !          8114: <strong>Example:</strong></p>
        !          8115: <p>
        !          8116: In a translation schema producing documents destined for use with the
        !          8117: L<sup>A</sup>T<sub><big>E</big></sub>X formatter, the Latin
1.1       cvs      8118: characters``&eacute;'' (octal code 351 in Thot) and ``&egrave;'' (octal code
1.18    ! cvs      8119: 350 in Thot)  must be converted to their representation in
        !          8120: L<sup>A</sup>T<sub><big>E</big></sub>X:</p>
        !          8121: <pre>TEXTTRANSLATE Latin
1.1       cvs      8122:      BEGIN
                   8123:      '\350' -> '\`{e}';    { e grave }
                   8124:      '\351' -> '\''{e}';   { e acute }
1.18    ! cvs      8125:      END;</pre>
        !          8126: </blockquote>
        !          8127: </div>
        !          8128: </div>
        !          8129: <hr>
        !          8130: </div>
1.1       cvs      8131: 
1.18    ! cvs      8132: <div class="chapter">
1.1       cvs      8133: 
1.18    ! cvs      8134: <h1><a name="sect6">Language grammars</a></h1>
        !          8135: <p>
1.1       cvs      8136: This chapter gives the complete grammars of the languages of Thot. The
                   8137: grammars were presented and described in the preceding chapters, which also
                   8138: specify the semantics of the languages.  This section gives only the
1.18    ! cvs      8139: syntax.</p>
1.1       cvs      8140: 
1.18    ! cvs      8141: <div class="section">
1.1       cvs      8142: 
1.18    ! cvs      8143: <h2><a name="sectb61">The M meta-language</a></h2>
        !          8144: <p>
1.1       cvs      8145: The language grammars are all expressed in the same formalism, the M
1.18    ! cvs      8146: meta-language, which is defined in this section.</p>
        !          8147: <pre>{ Any text between braces is a comment. }
1.1       cvs      8148: Grammar      = Rule &lt; Rule > 'END' .
                   8149:                { The &lt; and > signs indicate zero }
                   8150:                { or more repetitions. }
                   8151:                { END marks the end of the grammar. }
                   8152: Rule         = Ident '=' RightPart '.' .
                   8153:                { The period indicates the end of a rule }
                   8154: RightPart    = RtTerminal / RtIntermed .
                   8155:                { The slash indicates a choice }
                   8156: RtTerminal   ='NAME' / 'STRING' / 'NUMBER' .
                   8157:                { Right part of a terminal rule }
                   8158: RtIntermed   = Possibility &lt; '/' Possibility > .
                   8159:                { Right part of an intermediate rule }
                   8160: Possibility  = ElemOpt &lt; ElemOpt > .
                   8161: ElemOpt      = Element / '[' Element &lt; Element > ']' /
                   8162:               '&lt;' Element &lt; Element > '>'  .
                   8163:                { Brackets delimit optional parts }
                   8164: Element      = Ident / KeyWord .
                   8165: Ident        = NAME .
                   8166:                { Identifier, sequence of characters
                   8167: KeyWord      = STRING .
                   8168:                { Character string delimited by apostrophes }
1.18    ! cvs      8169: END</pre>
        !          8170: </div>
1.1       cvs      8171: 
1.18    ! cvs      8172: <div class="section">
1.1       cvs      8173: 
1.18    ! cvs      8174: <h2><a name="sectb62">The S language</a></h2>
        !          8175: <p>
1.1       cvs      8176: The S language is used to write structure schemas, which contain the generic
                   8177: logical structures of document and object classes.  It is described here in
1.18    ! cvs      8178: the M meta-language.</p>
        !          8179: <pre>StructSchema   = 'STRUCTURE' [ 'EXTENSION' ] ElemID ';'
1.1       cvs      8180:                  'DEFPRES' PresID ';'
                   8181:                [ 'ATTR' AttrSeq ]
                   8182:                [ 'PARAM' RulesSeq ]
                   8183:                [ 'STRUCT' RulesSeq ]
                   8184:                [ 'EXTENS' ExtensRuleSeq ]
                   8185:                [ 'ASSOC' RulesSeq ]
                   8186:                [ 'UNITS' RulesSeq ]
                   8187:                [ 'EXPORT' SkeletonSeq ]
                   8188:                [ 'EXCEPT' ExceptSeq ]
                   8189:                  'END' .
                   8190: 
                   8191: ElemID         = NAME .
                   8192: PresID         = NAME .
                   8193: 
                   8194: AttrSeq        = Attribute &lt; Attribute > .
                   8195: Attribute      = AttrID '=' AttrType ';' .
                   8196: AttrType       = 'INTEGER' / 'TEXT' /
                   8197:                  'REFERENCE' '(' RefType ')' /
                   8198:                  ValueSeq .
                   8199: RefType        = 'ANY' /
                   8200:                  [ FirstSec ] ElemID [ ExtStruct ] .
                   8201: ValueSeq       = AttrVal &lt; ',' AttrVal > .
                   8202: AttrID         = NAME .
                   8203: FirstSec       = 'First' / 'Second' .
                   8204: ExtStruct      = '(' ElemID ')' .
                   8205: AttrVal        = NAME .
                   8206: 
                   8207: RulesSeq       = Rule &lt; Rule > .
                   8208: Rule           = ElemID [ LocAttrSeq ] '='
                   8209:                  DefWithAttr ';' .
                   8210: LocAttrSeq     = '(' 'ATTR' LocalAttr
                   8211:                       &lt; ';' LocalAttr > ')' .
                   8212: LocalAttr      = [ '!' ] AttrID [ '=' AttrType ] .
                   8213: DefWithAttr    = Definition
                   8214:                  [ '+' '(' ExtensionSeq ')' ]
                   8215:                  [ '-' '(' RestrictSeq ')' ]
                   8216:                  [ 'WITH' FixedAttrSeq ] .
                   8217: ExtensionSeq   = ExtensionElem &lt; ',' ExtensionElem > .
                   8218: ExtensionElem  = ElemID / 'TEXT' / 'GRAPHICS' /
                   8219:                  'SYMBOL' / 'PICTURE' .
                   8220: RestrictSeq    = RestrictElem &lt; ',' RestrictElem > .
                   8221: RestrictElem   = ElemID / 'TEXT' / 'GRAPHICS' /
                   8222:                  'SYMBOL' / 'PICTURE' .
                   8223: FixedAttrSeq   = FixedAttr &lt; ',' FixedAttr > .
                   8224: FixedAttr      = AttrID [ FixedOrModifVal ] .
                   8225: FixedOrModifVal= [ '?' ] '=' FixedValue .
                   8226: FixedValue     = [ '-' ] NumValue / TextValue / AttrVal .
                   8227: NumValue       = NUMBER .
                   8228: TextValue      = STRING .
                   8229: 
                   8230: Definition     = BaseType [ LocAttrSeq ] / Constr /
                   8231:                  Element .
                   8232: BaseType       = 'TEXT' / 'GRAPHICS' / 'SYMBOL' /
                   8233:                  'PICTURE' / 'UNIT' / 'NATURE' .
                   8234: Element        = ElemID [ ExtOrDef ] .
                   8235: ExtOrDef       = 'EXTERN' / 'INCLUDED' /
                   8236:                  [ LocAttrSeq ] '=' Definition .
                   8237: 
                   8238: Constr         = 'LIST' [ '[' min '..' max ']' ] 'OF'
                   8239:                         '(' DefWithAttr ')' /
                   8240:                  'BEGIN' DefOptSeq 'END' /
                   8241:                  'AGGREGATE' DefOptSeq 'END' /
                   8242:                  'CASE' 'OF' DefSeq 'END' /
                   8243:                  'REFERENCE' '(' RefType ')' /
                   8244:                  'PAIR' .
                   8245: 
                   8246: min            = Integer / '*' .
                   8247: max            = Integer / '*' .
                   8248: Integer        = NUMBER .
                   8249: 
                   8250: DefOptSeq      = DefOpt ';' &lt; DefOpt ';' > .
                   8251: DefOpt         = [ '?' ] DefWithAttr .
                   8252: 
                   8253: DefSeq         = DefWithAttr ';' &lt; DefWithAttr ';' > .
                   8254: 
                   8255: SkeletonSeq    = SkeletonElem &lt; ',' SkeletonElem > ';' .
                   8256: SkeletonElem   = ElemID [ 'WITH' Contents ] .
                   8257: Contents       = 'Nothing' / ElemID [ ExtStruct ] .
                   8258: 
                   8259: ExceptSeq      = Except ';' &lt; Except ';' > .
                   8260: Except         = [ 'EXTERN' ] [ FirstSec ] ExcTypeOrAttr ':'
                   8261:                  ExcValSeq .
                   8262: ExcTypeOrAttr  = ElemID / AttrID .
                   8263: ExcValSeq      = ExcValue &lt; ',' ExcValue > .
                   8264: ExcValue       = 'NoCut' / 'NoCreate' /
                   8265:                  'NoHMove' / 'NoVMove' / 'NoMove' /
                   8266:                  'NoHResize' / 'NoVResize' / 'NoResize' /
1.18    ! cvs      8267:                  'MoveResize' /
1.1       cvs      8268:                  'NewWidth' / 'NewHeight' /
                   8269:                  'NewHPos' / 'NewVPos' /
                   8270:                  'Invisible' / 'NoSelect' /
                   8271:                  'Hidden' / 'ActiveRef' /
                   8272:                  'ImportLine' / 'ImportParagraph' /
1.9       cvs      8273:                  'NoPaginate' / 'ParagraphBreak' /
                   8274:                  'HighlightChildren' / 'ExtendedSelection' /
                   8275:                  'ReturnCreateNL' .
1.1       cvs      8276: 
                   8277: ExtensRuleSeq  = ExtensRule ';' &lt; ExtensRule ';' > .
                   8278: ExtensRule     = RootOrElem [ LocAttrSeq ]
                   8279:                  [ '+' '(' ExtensionSeq ')' ]
                   8280:                  [ '-' '(' RestrictSeq ')' ]
                   8281:                  [ 'WITH' FixedAttrSeq ] .
                   8282: RootOrElem     = 'Root' / ElemID .
                   8283: 
1.18    ! cvs      8284: END</pre>
        !          8285: </div>
1.1       cvs      8286: 
1.18    ! cvs      8287: <div class="section">
1.1       cvs      8288: 
1.18    ! cvs      8289: <h2><a name="sectb63">The P language</a></h2>
        !          8290: <p>
1.1       cvs      8291: The P language is used to write presentation schemas, which define the
                   8292: graphical presentation rules to be applied to different classes of documents
1.18    ! cvs      8293: and objects.  It is described here in the M meta-language.</p>
        !          8294: <pre>PresSchema      = 'PRESENTATION' ElemID ';'
1.1       cvs      8295:                 [ 'VIEWS' ViewSeq ]
                   8296:                 [ 'PRINT' PrintViewSeq ]
                   8297:                 [ 'COUNTERS' CounterSeq ]
                   8298:                 [ 'CONST' ConstSeq ]
                   8299:                 [ 'VAR' VarSeq ]
                   8300:                 [ 'DEFAULT' ViewRuleSeq ]
                   8301:                 [ 'BOXES' BoxSeq ]
                   8302:                 [ 'RULES' PresentSeq ]
                   8303:                 [ 'ATTRIBUTES' PresAttrSeq ]
                   8304:                 [ 'TRANSMIT' TransmitSeq ]
                   8305:                   'END' .
                   8306: 
                   8307: ElemID          = NAME .
                   8308: 
                   8309: ViewSeq         = ViewDeclaration
                   8310:                   &lt; ',' ViewDeclaration > ';' .
                   8311: ViewDeclaration = ViewID [ 'EXPORT' ] .
                   8312: ViewID          = NAME .
                   8313: 
                   8314: PrintViewSeq    = PrintView &lt; ',' PrintView > ';' .
                   8315: PrintView       = ViewID / ElemID .
                   8316: 
                   8317: CounterSeq      = Counter &lt; Counter > .
                   8318: Counter         = CounterID ':' CounterFunc ';' .
                   8319: CounterID       = NAME .
                   8320: CounterFunc     = 'RANK' 'OF' TypeOrPage [ SLevelAsc ]
                   8321:                   [ 'INIT' AttrID ] [ 'REINIT' AttrID ] /
                   8322:                   SetFunction &lt; SetFunction >
                   8323:                   AddFunction &lt; AddFunction >
                   8324:                   [ 'INIT' AttrID ] /
1.16      cvs      8325:                   'RLEVEL' 'OF' ElemID .
1.1       cvs      8326: SLevelAsc       = [ '-' ] LevelAsc .
                   8327: LevelAsc        = NUMBER .
                   8328: SetFunction     = 'SET' CounterValue 'ON' TypeOrPage .
                   8329: AddFunction     = 'ADD' CounterValue 'ON' TypeOrPage .
                   8330: TypeOrPage      = 'Page' [ '(' ViewID ')' ] /
1.16      cvs      8331:                   [ '*' ] ElemID .
1.1       cvs      8332: CounterValue    = NUMBER .
                   8333: 
                   8334: ConstSeq        = Const &lt; Const > .
                   8335: Const           = ConstID '=' ConstType ConstValue ';' .
                   8336: ConstID         = NAME .
                   8337: ConstType       = 'Text' [ Alphabet ] / 'Symbol' /
                   8338:                   'Graphics' / 'Picture' .
                   8339: ConstValue      = STRING .
                   8340: Alphabet        = NAME .
                   8341: 
                   8342: VarSeq          = Variable &lt; Variable > .
                   8343: Variable        = VarID ':' FunctionSeq ';' .
                   8344: VarID           = NAME .
                   8345: FunctionSeq     = Function &lt; Function > .
                   8346: Function        = 'DATE' / 'FDATE' /
                   8347:                   'DocName' / 'DirName' /
                   8348:                   'ElemName' / 'AttributeName' /
                   8349:                   ConstID / ConstType ConstValue /
                   8350:                   AttrID /
                   8351:                   'VALUE' '(' PageAttrCtr ','
                   8352:                   CounterStyle ')' .
                   8353: PageAttrCtr     = 'PageNumber' [ '(' ViewID ')' ] /
                   8354:                   [ MinMax ] CounterID / AttrID .
                   8355: CounterStyle    = 'Arabic' / 'LRoman' / 'URoman' /
                   8356:                   'Uppercase' / 'Lowercase' .
                   8357: MinMax          = 'MaxRangeVal' / 'MinRangeVal' .
                   8358: 
                   8359: BoxSeq          = Box &lt; Box > .
                   8360: Box             = 'FORWARD' BoxID ';' /
                   8361:                   BoxID ':' ViewRuleSeq .
                   8362: BoxID           = NAME .
                   8363: 
                   8364: PresentSeq      = Present &lt; Present > .
                   8365: Present         = [ '*' ] [ FirstSec ] ElemID ':'
                   8366:                   ViewRuleSeq .
                   8367: FirstSec        = 'First' / 'Second' .
                   8368: 
                   8369: PresAttrSeq     = PresAttr &lt; PresAttr > .
                   8370: PresAttr        = AttrID [ '(' [ FirstSec ] ElemID ')' ] 
                   8371:                   [ AttrRelation ] ':' ViewRuleSeq .
                   8372: AttrID          = NAME .
                   8373: AttrRelation    = '=' AttrVal /
                   8374:                   '>' [ '-' ] MinValue /
                   8375:                   '&lt;' [ '-' ] MaxValue /
                   8376:                   'IN' '[' [ '-' ] LowerBound '..' 
                   8377:                   [ '-' ] UpperBound ']' /
                   8378:                   'GREATER' AttrID /
                   8379:                   'EQUAL' AttrID /
                   8380:                   'LESS' AttrID .
                   8381: AttrVal         = [ '-' ] EqualNum / EqualText / AttrValue .
                   8382: MinValue        = NUMBER .
                   8383: MaxValue        = NUMBER .
                   8384: LowerBound      = NUMBER .
                   8385: UpperBound      = NUMBER.
                   8386: EqualNum        = NUMBER .
                   8387: EqualText       = STRING .
                   8388: AttrValue       = NAME .
                   8389: 
                   8390: ViewRuleSeq     = 'BEGIN' &lt; RulesAndCond > &lt; ViewRules >
                   8391:                   'END' ';' /
                   8392:                   ViewRules / CondRules / Rule .
                   8393: RulesAndCond    = CondRules / Rule .
                   8394: ViewRules       = 'IN' ViewID CondRuleSeq .
                   8395: CondRuleSeq     = 'BEGIN' &lt; RulesAndCond > 'END' ';' /
                   8396:                   CondRules / Rule .
                   8397: CondRules       = CondRule &lt; CondRule >
                   8398:                   [ 'Otherwise' RuleSeq ] .
                   8399: CondRule        = 'IF' ConditionSeq RuleSeq .
                   8400: RulesSeq        = 'BEGIN' Rule &lt; Rule > 'END' ';' / Rule .
                   8401: 
1.6       cvs      8402: ConditionSeq    = Condition &lt; 'AND' Condition > .
                   8403: Condition       = [ 'NOT' ] [ 'Target' ] ConditionElem .
                   8404: ConditionElem   = 'First' / 'Last' /
                   8405:                   [ 'Immediately' ] 'Within' [ NumParent ]
                   8406:                                      ElemID [ ExtStruct ] /
                   8407:                    ElemID /
                   8408:                   'Referred' / 'FirstRef' / 'LastRef' /
                   8409:                   'ExternalRef' / 'InternalRef' / 'CopyRef' /
                   8410:                   'AnyAttributes' / 'FirstAttr' / 'LastAttr' /
                   8411:                   'UserPage' / 'StartPage' / 'ComputedPage' /
                   8412:                   'Empty' /
                   8413:                   '(' [ MinMax ] CounterName CounterCond ')' /
                   8414:                   CondPage '(' CounterID ')' .
                   8415: NumParent       = [ GreaterLess ] NParent .
                   8416: GreaterLess     = '>' / '&lt;' .
                   8417: NParent         = NUMBER.
                   8418: CounterCond     = '&lt;' MaxCtrVal / '>' MinCtrVal /
                   8419:                   '=' EqCtrVal / 
                   8420:                   'IN' '[' ['-'] MinCtrBound '..' 
                   8421:                   ['-'] MaxCtrBound ']' .
                   8422: PageCond        = 'Even' / 'Odd' / 'One' .
                   8423: MaxCtrVal       = NUMBER .
                   8424: MinCtrVal       = NUMBER .
                   8425: EqCtrVal        = NUMBER .
                   8426: MaxCtrBound     = NUMBER .
                   8427: MinCtrBound     = NUMBER .
1.1       cvs      8428: 
                   8429: Rule            = PresParam ';' / PresFunc ';' .
                   8430: PresParam       = 'VertRef' ':' HorizPosition /
                   8431:                   'HorizRef' ':' VertPosition /
                   8432:                   'VertPos' ':' VPos /
                   8433:                   'HorizPos' ':' HPos /
                   8434:                   'Height' ':' Extent /
                   8435:                   'Width' ':' Extent /
                   8436:                   'VertOverflow' ':' Boolean /
                   8437:                   'HorizOverflow' ':' Boolean /
                   8438:                   'LineSpacing' ':' DistOrInherit /
                   8439:                   'Indent' ':' DistOrInherit /
                   8440:                   'Adjust' ':' AlignOrInherit /
                   8441:                   'Justify' ':' BoolInherit /
                   8442:                   'Hyphenate' ':' BoolInherit /
                   8443:                   'PageBreak' ':' Boolean /
                   8444:                   'LineBreak' ':' Boolean /
                   8445:                   'InLine' ':' Boolean /
                   8446:                   'NoBreak1' ':' AbsDist /
                   8447:                   'NoBreak2' ':' AbsDist /
                   8448:                   'Gather' ':' Boolean /
                   8449:                   'Visibility' ':' NumberInherit /
                   8450:                   'Size'  ':' SizeInherit /
                   8451:                   'Font' ':' NameInherit /
                   8452:                   'Style' ':' StyleInherit /
                   8453:                   'Underline' ':' UnderLineInherit /
                   8454:                   'Thickness' ':' ThicknessInherit /
                   8455:                   'Depth' ':' NumberInherit /
                   8456:                   'LineStyle' ':' LineStyleInherit /
                   8457:                   'LineWeight' ':' DistOrInherit /
                   8458:                   'FillPattern' ':' NameInherit /
                   8459:                   'Background' ':' NameInherit /
1.13      cvs      8460:                   'Foreground' ':' NameInherit /
1.1       cvs      8461:                   'Content' ':' VarConst .
                   8462: PresFunc        = Creation '(' BoxID ')' /
                   8463:                   'Line' /
                   8464:                   'NoLine' /
                   8465:                   'Page' '(' BoxID ')' /
1.13      cvs      8466:                   'Copy' '(' BoxTypeToCopy ')' /
                   8467:                   'ShowBox' /
1.18    ! cvs      8468:                   'BackgroundPicture' ':' FileName /
        !          8469:                   'PictureMode' ':' PictMode .
1.1       cvs      8470: 
                   8471: BoxTypeToCopy   = BoxID [ ExtStruct ] /
                   8472:                    ElemID [ ExtStruct ] .
                   8473: ExtStruct       = '(' ElemID ')' .
                   8474: 
                   8475: Distance        = [ Sign ] AbsDist .
                   8476: Sign            = '+' / '-' .
                   8477: AbsDist         = IntegerOrAttr [ '.' DecimalPart ]
                   8478:                   [ Unit ] .
                   8479: IntegerOrAttr   = IntegerPart / AttrID .
                   8480: IntegerPart     = NUMBER .
                   8481: DecimalPart     = NUMBER .
                   8482: Unit            = 'em' / 'ex' / 'cm' / 'mm' / 'in' / 'pt' /
                   8483:                   'pc' / 'px' / '%' .
                   8484: 
                   8485: HPos            = 'nil' / VertAxis '=' HorizPosition 
                   8486:                   [ 'UserSpecified' ] .
                   8487: VPos            = 'nil' / HorizAxis '=' VertPosition 
                   8488:                   [ 'UserSpecified' ] .
                   8489: VertAxis        = 'Left' / 'VMiddle' / 'VRef' / 'Right' .
                   8490: HorizAxis       = 'Top' / 'HMiddle' / 'HRef' / 'Bottom' .
                   8491: 
1.6       cvs      8492: VertPosition    = Reference '.' HorizAxis [ Distance ] .
                   8493: HorizPosition   = Reference '.' VertAxis [ Distance ] .
                   8494: Reference       = 'Enclosing' [ BoxTypeNot ] /
                   8495:                   'Enclosed' [ BoxTypeNot ] /
                   8496:                   'Previous' [ BoxTypeNot ] /
                   8497:                   'Next' [ BoxTypeNot ] /
                   8498:                   'Referred' [ BoxTypeNot ] /
                   8499:                   'Creator' /
                   8500:                   'Root' /
                   8501:                   '*' /
                   8502:                   BoxOrType .
                   8503: BoxOrType       = BoxID /
                   8504:                   [ '*' ] [ FirstSec ] ElemID /
1.17      cvs      8505:                   'AnyElem' / 'AnyBox' /
                   8506:                   'ElemWithAttr' AttrID .
1.6       cvs      8507: BoxTypeNot      = [ 'NOT' ] BoxOrType .
                   8508: 
                   8509: Extent          = Reference '.' HeightWidth
                   8510:                   [ Relation ] [ 'Min' ] /
                   8511:                   AbsDist [ 'UserSpecified' ] [ 'Min' ] /
                   8512:                   HPos / VPos .
                   8513: HeightWidth     = 'Height' / 'Width' .
                   8514: Relation        = '*' ExtentAttr '%' / Distance .
                   8515: ExtentAttr      = ExtentVal / AttrID .
                   8516: ExtentVal       = NUMBER .
                   8517: 
                   8518: Inheritance     = Kinship  InheritedValue .
                   8519: Kinship         = 'Enclosing' / 'GrandFather'/ 'Enclosed' /
                   8520:                   'Previous' / 'Creator' .
                   8521: InheritedValue  = '+' PosIntAttr [ 'Max' maximumA ] /
                   8522:                   '-' NegIntAttr [ 'Min' minimumA ] /
                   8523:                   '=' .
                   8524: PosIntAttr      = PosInt / AttrID .
                   8525: PosInt          = NUMBER .
                   8526: NegIntAttr      = NegInt / AttrID .
                   8527: NegInt          = NUMBER .
                   8528: maximumA        = maximum / AttrID .
                   8529: maximum         = NUMBER .
                   8530: minimumA        = minimum / AttrID .
                   8531: minimum         = NUMBER .
                   8532: 
                   8533: AlignOrInherit  = Kinship '=' / Alignment .
                   8534: Alignment       = 'Left' / 'Right' / 'VMiddle' /
                   8535:                   'LeftWithDots' .
1.1       cvs      8536: 
1.6       cvs      8537: DistOrInherit   = Kinship InheritedDist / Distance .
                   8538: InheritedDist   = '=' / '+' AbsDist / '-' AbsDist .
1.1       cvs      8539: 
1.6       cvs      8540: BoolInherit     = Boolean / Kinship '=' .
                   8541: Boolean         = 'Yes' / 'No' .
1.1       cvs      8542: 
1.6       cvs      8543: NumberInherit   = Integer / AttrID / Inheritance .
                   8544: Integer         = NUMBER .
1.1       cvs      8545: 
                   8546: LineStyleInherit= Kinship '=' / 'Solid' / 'Dashed' /
                   8547:                   'Dotted' .
                   8548: 
1.6       cvs      8549: SizeInherit     = SizeAttr [ 'pt' ] / Kinship InheritedSize .
                   8550: InheritedSize   = '+' SizeAttr [ 'pt' ]
                   8551:                       [ 'Max' MaxSizeAttr ] /
                   8552:                   '-' SizeAttr [ 'pt' ]
                   8553:                       [ 'Min' MinSizeAttr ] /
                   8554:                   '=' .
                   8555: SizeAttr        = Size / AttrID .
                   8556: Size            = NUMBER .
                   8557: MaxSizeAttr     = MaxSize / AttrID .
                   8558: MaxSize         = NUMBER .
                   8559: MinSizeAttr     = MinSize / AttrID .
                   8560: MinSize         = NUMBER .
                   8561: 
                   8562: NameInherit     = Kinship '=' / FontName .
                   8563: FontName        = NAME .
                   8564: StyleInherit    = Kinship '=' /
                   8565:                   'Roman' / 'Bold' / 'Italics' / 
                   8566:                   'BoldItalics' / 'Oblique' / 'BoldOblique' .
1.1       cvs      8567: UnderLineInherit= Kinship '=' /
1.6       cvs      8568:                   'NoUnderline' / 'Underlined' / 
                   8569:                   'Overlined' / 'CrossedOut' .
1.1       cvs      8570: ThicknessInherit= Kinship '=' / 'Thick' / 'Thin' .
1.13      cvs      8571: 
                   8572: FileName =        STRING .
                   8573: PictMode =        'NormalSize' / 'Scale' /
                   8574:                   'RepeatXY' / 'RepeatX' / 'RepeatY' .
1.1       cvs      8575: 
1.6       cvs      8576: VarConst        = ConstID / ConstType ConstValue /
                   8577:                   VarID / '(' FunctionSeq ')' /
                   8578:                   ElemID .
                   8579: 
                   8580: Creation        = Create [ 'Repeated' ] .
                   8581: Create          = 'CreateFirst' / 'CreateLast' /
                   8582:                   'CreateBefore' / 'CreateAfter' /
                   8583:                   'CreateEnclosing' .
                   8584: 
                   8585: TransmitSeq     = Transmit &lt; Transmit > .
                   8586: Transmit        = TypeOrCounter 'To' ExternAttr
                   8587:                   '(' ElemID ')' ';' .
                   8588: TypeOrCounter   = CounterID / ElemID .
                   8589: ExternAttr      = NAME .
1.1       cvs      8590: 
1.18    ! cvs      8591: END</pre>
        !          8592: </div>
1.1       cvs      8593: 
1.18    ! cvs      8594: <div class="section">
1.1       cvs      8595: 
1.18    ! cvs      8596: <h2><a name="sectb64">The T language</a></h2>
        !          8597: <pre>TransSchema   = 'TRANSLATION' ElemID ';'
1.1       cvs      8598:               [ 'LINELENGTH' LineLength ';' ]
                   8599:               [ 'LINEEND' CHARACTER ';' ]
                   8600:               [ 'LINEENDINSERT' STRING ';' ]
                   8601:               [ 'BUFFERS' BufferSeq ]
                   8602:               [ 'COUNTERS' CounterSeq ]
                   8603:               [ 'CONST' ConstSeq ]
                   8604:               [ 'VAR' VariableSeq ]
                   8605:                 'RULES' ElemSeq
                   8606:               [ 'ATTRIBUTES' AttrSeq ]
                   8607:               [ 'PRESENTATION' PresSeq ]
                   8608:               &lt; 'TEXTTRANSLATE' TextTransSeq >
                   8609:               [ 'SYMBTRANSLATE' TransSeq ]
                   8610:               [ 'GRAPHTRANSLATE' TransSeq ]
                   8611:                 'END' .
                   8612: 
                   8613: LineLength    = NUMBER .
                   8614: 
                   8615: BufferSeq     = Buffer &lt; Buffer > .
                   8616: Buffer        = BufferID [ '(' 'Picture' ')' ] ';' .
                   8617: BufferID      = NAME .
                   8618: 
                   8619: CounterSeq    = Counter &lt; Counter > .
                   8620: Counter       = CounterID [ ':' CounterFunc ] ';' .
                   8621: CounterID     = NAME .
                   8622: CounterFunc   = 'Rank' 'of' ElemID [ SLevelAsc ]
                   8623:                 [ 'Init' AttrID ] /
                   8624:                 'Rlevel' 'of' ElemID /
                   8625:                 'Set' InitValue 'On' ElemID
                   8626:                       'Add' Increment 'On' ElemID
                   8627:                       [ 'Init' AttrID ] .
                   8628: SLevelAsc     = [ '-' ] LevelAsc .
                   8629: LevelAsc      =  NUMBER .
                   8630: InitValue     = NUMBER .
                   8631: Increment     = NUMBER .
                   8632: ElemID        = NAME .
                   8633: AttrID        = NAME .
                   8634: 
                   8635: ConstSeq      = Const &lt; Const > .
                   8636: Const         = ConstID '=' ConstValue ';' .
                   8637: ConstID       = NAME .
                   8638: ConstValue    = STRING .
                   8639: 
                   8640: VariableSeq   = Variable &lt; Variable > .
                   8641: Variable      = VarID ':' Function &lt; Function > ';' .
                   8642: VarID         = NAME .
                   8643: Function      = 'Value' '(' CounterID [ ':' Length ]
                   8644:                           [ ',' CounterStyle ]  ')' /
                   8645:                 'FileDir' / 'FileName' / 'Extension' /
                   8646:                 'DocumentName' / 'DocumentDir' /
                   8647:                 ConstID / CharString / 
                   8648:                 BufferID / AttrID .
                   8649: Length        = NUMBER .
                   8650: CounterStyle=   'Arabic' / 'LRoman' / 'URoman' /
                   8651:                 'Uppercase' / 'Lowercase' .
                   8652: CharString    = STRING .
                   8653: 
                   8654: ElemSeq       = TransType &lt; TransType > .
                   8655: TransType     = [ FirstSec ] ElemID ':' RuleSeq .
                   8656: FirstSec      = 'First' / 'Second' .
                   8657: RuleSeq       = Rule / 'BEGIN' &lt; Rule > 'END' ';' .
                   8658: Rule          = SimpleRule / ConditionBlock .
                   8659: ConditionBlock= 'IF' ConditionSeq SimpleRuleSeq .
                   8660: SimpleRuleSeq = 'BEGIN' &lt; SimpleRule > 'END' ';' / 
                   8661:                 SimpleRule .
                   8662: 
                   8663: ConditionSeq  = Condition [ 'AND' Condition ] .
                   8664: Condition     = [ 'NOT' ] [ 'Target' ] Cond .
                   8665: Cond          = CondElem / CondAscend .
                   8666: CondElem      = 'FirstRef' / 'LastRef' /
                   8667:                 'ExternalRef' /
                   8668:                 'Defined' /
                   8669:                 'Alphabet' '=' Alphabet /
                   8670:                 'ComputedPage' / 'StartPage' / 
                   8671:                 'UserPage' / 'ReminderPage' /
                   8672:                 'Empty' /
1.18    ! cvs      8673:                 ElemID /
1.1       cvs      8674:                 'FirstAttr' / 'LastAttr' .
                   8675: CondAscend    = [ Ascend ] CondOnAscend .
                   8676: Ascend        = '*' / 'Parent' / 'Ancestor' LevelOrType .
                   8677: LevelOrType   = CondRelLevel / ElemID [ ExtStruct ] .
                   8678: CondRelLevel  = NUMBER .
                   8679: CondOnAscend  = 'First' / 'Last' /
                   8680:                 'Referred' / 
                   8681:                 [ 'Immediately' ] 'Within' [ NumParent ]
                   8682:                                   ElemID [ ExtStruct ] /
                   8683:                 'Attributes' /
                   8684:                 AttrID [ RelatAttr ] /
                   8685:                 'Presentation' /
                   8686:                 PresRule /
                   8687:                 'Comment' .                  
                   8688: NumParent     = [ GreaterLess ] NParent .
                   8689: GreaterLess   = '>' / '&lt;' .
                   8690: NParent       = NUMBER.
                   8691: Alphabet      = NAME .
                   8692: RelatAttr     = '=' Value /
                   8693:                  '>' [ '-' ] Minimum /
                   8694:                  '&lt;' [ '-' ] Maximum /
                   8695:                  'IN' '[' [ '-' ] MinInterval '..'
                   8696:                           [ '-' ] MaxInterval ']' .
                   8697: Value         = [ '-' ] IntegerVal / TextVal / AttrValue .
                   8698: Minimum       = NUMBER .
                   8699: Maximum       = NUMBER .
                   8700: MinInterval   = NUMBER .
                   8701: MaxInterval   = NUMBER .
                   8702: IntegerVal    = NUMBER .
                   8703: TextVal       = STRING .
                   8704: AttrValue     = NAME .
                   8705: 
                   8706: SimpleRule    = 'Create' [ 'IN' VarID ] Object
                   8707:                        [ Position ] ';' /
                   8708:                 'Write' Object [ Position ] ';' /
                   8709:                 'Read' BufferID [ Position ] ';' /
                   8710:                 'Include' File [ Position ] ';' /
1.6       cvs      8711:                 'Get'  [ RelPosition ] ElemID 
                   8712:                        [ ExtStruct ] 
                   8713:                        [ Position ] ';' /
1.1       cvs      8714:                 'Copy' [ RelPosition ] ElemID 
                   8715:                        [ ExtStruct ] 
                   8716:                        [ Position ] ';' /
                   8717:                 'Use' TrSchema [ 'For' ElemID ] ';' /
                   8718:                 'Remove' ';' /
                   8719:                 'NoTranslation' ';' /
                   8720:                 'NoLineBreak' ';' /
                   8721:                 'ChangeMainFile' VarID [ Position ] ';' /
1.14      cvs      8722:                 'RemoveFile' VarID [ Position ] ';' /
1.10      cvs      8723:                 'Set' CounterID InitValue [ Position ] ';' /
                   8724:                 'Add' CounterID Increment [ Position ] ';' /
                   8725:                 'Indent' [ 'IN' VarID ] [ IndentSign ]
                   8726:                          IndentValue [ Position ] ';' .
                   8727: 
                   8728: IndentSign    = '+' / '-' .
                   8729: IndentValue   = NUMBER .
1.1       cvs      8730: 
                   8731: Object        = ConstID / CharString /
                   8732:                 BufferID /
                   8733:                 VarID /
                   8734:                 '(' Function &lt; Function > ')' /
                   8735:                  AttrID /
                   8736:                 'Value' /
                   8737:                 'Content' /
                   8738:                 'Comment' / 
                   8739:                 'Attributes' /
                   8740:                 'Presentation' /
                   8741:                 'RefId' /
                   8742:                 'PairId' /
                   8743:                 'FileDir' / 'FileName' / 'Extension' /
                   8744:                 'DocumentName' / 'DocumentDir' /
                   8745:                 [ 'Referred' ] ReferredObject .
                   8746: Position      = 'After' / 'Before' .
                   8747: 
1.6       cvs      8748: ReferredObject= VarID /
                   8749:                 ElemID [ ExtStruct ] /
                   8750:                 'RefId' /
                   8751:                 'DocumentName' / 'DocumentDir' .                
1.1       cvs      8752: 
1.6       cvs      8753: File          = FileName / BufferID .
                   8754: FileName      = STRING .
1.1       cvs      8755: 
1.6       cvs      8756: RelPosition   = 'Included' / 'Referred' .
                   8757: ExtStruct     = '(' ElemID ')' .
1.1       cvs      8758: 
1.6       cvs      8759: TrSchema      = NAME .
                   8760: 
                   8761: AttrSeq       = TransAttr &lt; TransAttr > .
                   8762: TransAttr     = AttrID [ '(' ElemID ')' ] 
                   8763:                 [ RelatAttr ] ':' RuleSeq .
                   8764: 
                   8765: PresSeq       = PresTrans &lt; PresTrans > .
                   8766: PresTrans     = PresRule ':' RuleSeq .
                   8767: PresRule      = 'Size' [ PresRelation ] /
                   8768:                 'Indent' [ PresRelation ] /
                   8769:                 'LineSpacing' [ PresRelation ] /
                   8770:                 'Adjust' [ '=' AdjustVal ] /
                   8771:                 'Justify' [ '=' BoolVal ] /
                   8772:                 'Hyphenate' [ '=' BoolVal ] /
                   8773:                 'Style' [ '=' StyleVal ] /
                   8774:                 'Font' [ '=' FontVal ] /
                   8775:                 'UnderLine' [ '=' UnderLineVal ] /
                   8776:                 'Thickness' [ '=' ThicknessVal ] /
                   8777:                 'LineStyle' [ '=' LineStyleVal ] /
                   8778:                 'LineWeight' [ PresRelation ] /
                   8779:                 'FillPattern' [ '=' Pattern ] /
                   8780:                 'Background' [ '=' Color ] /
                   8781:                 'Foreground' [ '=' Color ] .
                   8782: 
                   8783: PresRelation  = '=' PresValue /
                   8784:                 '>' [ '-' ] PresMinimum /
                   8785:                 '&lt;' [ '-' ] PresMaximum /
                   8786:                 'IN' '[' [ '-' ] PresIntervalMin '..'
                   8787:                          [ '-' ] PresIntervalMax ']' .
                   8788: AdjustVal     = 'Left' / 'Right' / 'VMiddle' / 
                   8789:                 'LeftWithDots' .
                   8790: BoolVal       = 'Yes' / 'No' .
                   8791: StyleVal      = 'Bold' / 'Italics' / 'Roman' /
                   8792:                 'BoldItalics' / 'Oblique' /
                   8793:                 'BoldOblique' .
                   8794: FontVal       = 'Times' / 'Helvetica' / 'Courier' .
                   8795: UnderLineVal  = 'NoUnderline' / 'UnderLined' /
                   8796:                 'OverLined' / 'CrossedOut' .
                   8797: ThicknessVal  = 'Thick' / 'Thin' .
                   8798: LineStyleVal  = 'Solid' / 'Dashed' / 'Dotted' .
                   8799: Pattern       = NAME .
                   8800: Color         = NAME .
                   8801: PresMinimum   = NUMBER .
                   8802: PresMaximum   = NUMBER .
1.1       cvs      8803: PresIntervalMin= NUMBER .
                   8804: PresIntervalMax= NUMBER .
1.6       cvs      8805: PresValue     = [ '-' ] PresVal .
                   8806: PresVal       = NUMBER .
1.1       cvs      8807: 
1.6       cvs      8808: TextTransSeq  = [ Alphabet ] TransSeq .
                   8809: Alphabet      = NAME .
                   8810: TransSeq      = 'BEGIN' &lt; Translation > 'END' ';' /
                   8811:                 Translation .
                   8812: Translation   = Source [ '->' Target ] ';' .
                   8813: Source        = STRING .
1.18    ! cvs      8814: Target        = STRING .</pre>
        !          8815: </div>
        !          8816: <hr>
        !          8817: </div>
1.1       cvs      8818: 
1.18    ! cvs      8819: <div class="chapter">
1.1       cvs      8820: 
1.18    ! cvs      8821: <h1><a name="sect7">Character coding</a></h1>
1.1       cvs      8822: 
1.18    ! cvs      8823: <div class="section">
1.1       cvs      8824: 
1.18    ! cvs      8825: <h2><a name="sectb71">Characters</a></h2>
        !          8826: <p>
1.1       cvs      8827: The characters of the Latin alphabet follow the encoding defined in the ISO
1.5       cvs      8828: 8859-1 (ISO Latin-1) standard.  The characters of the Greek alphabet follow
1.18    ! cvs      8829: the encoding defined by Adobe for its Symbol font (Adobe FontSpecific).</p>
        !          8830: <p>
1.1       cvs      8831: Characters whose octal code is greater than 0200 are written in the form of
                   8832: their octal code preceded by a backslash character (``\'').  For example, the
1.18    ! cvs      8833: French word 'R&eacute;sum&eacute;' is written <tt>R\351sum\351</tt>.</p>
        !          8834: <p>
1.2       cvs      8835: To the ISO 8859-1 encoding four characters with the following codes have been
1.18    ! cvs      8836: added:<br>
        !          8837: <tt>212</tt>: line break<br>
        !          8838: <tt>240</tt>: sticky space<br>
        !          8839: <tt>201</tt>: thin space<br>
        !          8840: <tt>202</tt>: en space</p>
        !          8841: <p>
        !          8842: The <tt>212</tt> character is a ``line break'' character which forces a line
        !          8843: break.  The <tt>240</tt> character is a ``sticky space'', which cannot be
        !          8844: replaced by a line break.</p>
        !          8845: </div>
1.1       cvs      8846: 
1.18    ! cvs      8847: <div class="section">
1.1       cvs      8848: 
1.18    ! cvs      8849: <h2><a name="sectb72">Symbols</a></h2>
        !          8850: <p>
1.1       cvs      8851: The table below gives the codes for the symbols of Thot.  Symbols can be used
                   8852: in presentation schemas constants and in transcoding rules of translation
1.18    ! cvs      8853: schemas.  Each symbol is represented by a single character.</p>
        !          8854: <ul>
        !          8855: <li>
        !          8856: <tt>r</tt>: a radical
        !          8857: <li>
        !          8858: <tt>i</tt>: a simple integral
        !          8859: <li>
        !          8860: <tt>c</tt>: a curvilinear integral
        !          8861: <li>
        !          8862: <tt>d</tt>: a double integral
        !          8863: <li>
        !          8864: <tt>t</tt>: a triple integral
        !          8865: <li>
        !          8866: <tt>S</tt>: the summation symbol
        !          8867: <li>
        !          8868: <tt>P</tt>: the product symbol
        !          8869: <li>
        !          8870: <tt>U</tt>: the union symbol
        !          8871: <li>
        !          8872: <tt>I</tt>: the intersection symbol
        !          8873: <li>
        !          8874: <tt>></tt>: a right arrow
        !          8875: <li>
        !          8876: <tt>&lt;</tt>: a left arrow
        !          8877: <li>
        !          8878: <tt>^</tt>:  an up arrow
        !          8879: <li>
        !          8880: <tt>V</tt>: a down arrow
        !          8881: <li>
        !          8882: <tt>(</tt>: an opening parenthesis
        !          8883: <li>
        !          8884: <tt>)</tt>: a closing parenthesis
        !          8885: <li>
        !          8886: <tt>{</tt>: an opening brace
        !          8887: <li>
        !          8888: <tt>}</tt>: a closing brace
        !          8889: <li>
        !          8890: <tt>[</tt>: an opening bracket
        !          8891: <li>
        !          8892: <tt>]</tt>: a closing bracket
        !          8893: </ul>
        !          8894: </div>
1.1       cvs      8895: 
1.18    ! cvs      8896: <div class="section">
1.1       cvs      8897: 
1.18    ! cvs      8898: <h2><a name="sectb73">Graphical elements</a></h2>
        !          8899: <p>
1.1       cvs      8900: The table below gives the codes for the graphical elements of Thot. These
                   8901: elements can be used in presentation schemas constants and in transcoding
                   8902: rules of translation schemas.  Each graphical element is represented by a
1.18    ! cvs      8903: single character.</p>
        !          8904: <ul>
        !          8905: <li>
        !          8906: a: a circle
        !          8907: <li><p>
        !          8908: <tt>A</tt>: an open curve with an arrow head at the end</p>
        !          8909: <li>
        !          8910: <tt>b</tt>: a horizontal line along the lower side of the box
        !          8911: <li>
        !          8912: <tt>B</tt>: an open curve
        !          8913: <li>
        !          8914: <tt>c</tt>: an ellipse inscribed in the box
        !          8915: <li>
        !          8916: <tt>C</tt>: a rectangle with rounded corners
        !          8917: <li>
        !          8918: <tt>D</tt>: an open curve with two arrow heads
        !          8919: <li>
        !          8920: <tt>e</tt>: The northwest/southeast diagonal of the box with an arrowhead at
        !          8921: the bottom
        !          8922: <li>
        !          8923: <tt>E</tt>: The southwest/northeast diagonal of the box with an arrowhead at
        !          8924: the top
        !          8925: <li>
        !          8926: <tt>F</tt>: an open curve with an arrow head at start
        !          8927: <li>
        !          8928: <tt>h</tt>: a horizontal line as wide as the box and placed in its middle
        !          8929: <li>
        !          8930: <tt>l</tt>: a vertical line on the left side of the box
        !          8931: <li>
        !          8932: <tt>L</tt>: a lozenge
        !          8933: <li>
        !          8934: <tt>M</tt>: an open broken line with two arrow heads
        !          8935: <li>
        !          8936: <tt>N</tt>: an open broken line with an arrow head at start
        !          8937: <li>
        !          8938: <tt>o</tt>: The southwest/northeast diagonal of the box with an arrowhead at
        !          8939: the bottom
        !          8940: <li>
        !          8941: <tt>O</tt>: The northwest/southeast diagonal of the box with an arrowhead at
        !          8942: the top
        !          8943: <li>
        !          8944: <tt>p</tt>: a polygon
        !          8945: <li>
        !          8946: <tt>P</tt>: a rectangle with round corners and a horizontal bar at the top
        !          8947: <li>
        !          8948: <tt>Q</tt>: an ellipse with a horizontal bar at the top
        !          8949: <li>
        !          8950: <tt>r</tt>: a vertical line on the right side of the box
        !          8951: <li>
        !          8952: <tt>R</tt>: a rectangle which is the shape of the box
        !          8953: <li>
        !          8954: <tt>s</tt>: a closed curve
        !          8955: <li>
        !          8956: <tt>S</tt>: an open broken line
        !          8957: <li>
        !          8958: <tt>t</tt>: a horizontal line along the upper side of the box
        !          8959: <li>
        !          8960: <tt>U</tt>: an open broken line with an arrow head at the end
        !          8961: <li>
        !          8962: <tt>v</tt>: a vertical line as tall as the box and placed in its middle
        !          8963: <li>
        !          8964: <tt>V</tt>: a down arrow as tall as the box and in its middle
        !          8965: <li>
        !          8966: w: a segment (2 points)
        !          8967: <li>
        !          8968: <tt>W</tt>: the upper right corner
        !          8969: <li>
        !          8970: x: a segment (2 points) with an arrow head at the end
        !          8971: <li>
        !          8972: <tt>X</tt>: the lower right corner
        !          8973: <li>
        !          8974: y: a segment (2 points) with an arrow head at the end
        !          8975: <li>
        !          8976: <tt>Y</tt>: the lower left corner
        !          8977: <li>
        !          8978: z: a segment (2 points) with an arrow head at the end
        !          8979: <li>
        !          8980: <tt>Z</tt>: the upper left corner
        !          8981: <li>
        !          8982: <tt>space</tt>: a transparent element
        !          8983: <li>
        !          8984: <tt>^</tt>: an up arrow as tall as the box and in its middle
        !          8985: <li>
        !          8986: <tt>></tt>: a right arrow as long as the box's width and in its middle
        !          8987: <li>
        !          8988: <tt>></tt>: a left arrow as long as the box's width and in its middle
        !          8989: <li>
        !          8990: <tt>/</tt>: The southwest/northeast diagonal of the box
        !          8991: <li>
        !          8992: <tt>\</tt>: the northwest/southeast diagonal of the box
        !          8993: </ul>
        !          8994: <hr>
        !          8995: </div>
        !          8996: </div>
        !          8997: </body>
        !          8998: </html>

Webmaster