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

1.21      cvs         1: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
                      2:    "http://www.w3.org/TR/REC-html40/loose.dtd">
1.18      cvs         3: <html>
                      4: <head>
1.21      cvs         5: <title>The Languages of Thot</title>
1.18      cvs         6: </head>
                      7: <body>
                      8: 
1.19      cvs         9: <div class="frontmatter" align="center">
1.18      cvs        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: 
1.25    ! cvs        17: <h4>Version of August 23, 1999</h4>
1.18      cvs        18: <p>
                     19: &copy; 1996 INRIA</p>
                     20: <hr>
1.19      cvs        21: 
1.18      cvs        22: </div>
                     23: 
                     24: <div class="tableofcontents">
                     25: 
                     26: <h2><a href="languages.toc.html">Contents</a></h2>
                     27: <ul>
                     28: <li>
                     29: <big><a href="#sect2">The document model of Thot</a></big>
                     30: <ul>
                     31: <li>
                     32: <strong><a href="#sectb21">The logical structure of documents</a></strong>
1.19      cvs        33: </li>
1.18      cvs        34: <li>
                     35: <strong><a href="#sectb22">Generic and specific structures</a></strong>
1.19      cvs        36: </li>
1.18      cvs        37: <li>
                     38: <strong><a href="#sectb23">Logical structure and physical
                     39: structure</a></strong>
1.19      cvs        40: </li>
1.18      cvs        41: <li>
                     42: <strong><a href="#sectb24">Document structures and object
                     43: structures</a></strong>
1.19      cvs        44: </li>
1.18      cvs        45: </ul>
1.19      cvs        46: </li>
1.18      cvs        47: <li>
                     48: <big><a href="#sect3">The S language</a></big>
                     49: <ul>
                     50: <li>
                     51: <strong><a href="#sectb31">Document meta-structure</a></strong>
                     52: <ul>
                     53: <li>
                     54: <a href="#sectc311">The basic types</a>
1.19      cvs        55: </li>
1.18      cvs        56: <li>
                     57: <a href="#sectc312">Constructed elements</a>
1.19      cvs        58: </li>
1.18      cvs        59: <li>
                     60: <a href="#sectc313">Logical structure constructors</a>
                     61: <ul>
                     62: <li>
                     63: <small><a href="#sectd3131">Aggregate and List</a></small>
1.19      cvs        64: </li>
1.18      cvs        65: <li>
                     66: <small><a href="#sectd3132">Choice, Schema, and Unit</a></small>
1.19      cvs        67: </li>
1.18      cvs        68: <li>
                     69: <small><a href="#sectd3133">Reference and Inclusion</a></small>
1.19      cvs        70: </li>
1.18      cvs        71: <li>
                     72: <small><a href="#sectd3134">Mark pairs</a></small>
1.19      cvs        73: </li>
1.18      cvs        74: <li>
                     75: <small><a href="#sectd3135">Restrictions and Extensions</a></small>
1.19      cvs        76: </li>
1.18      cvs        77: <li>
                     78: <small><a href="#sectd3136">Summary</a></small>
1.19      cvs        79: </li>
1.18      cvs        80: </ul>
1.19      cvs        81: </li>
1.18      cvs        82: <li>
                     83: <a href="#sectc314">Associated Elements</a>
1.19      cvs        84: </li>
1.18      cvs        85: <li>
                     86: <a href="#sectc315">Attributes</a>
1.19      cvs        87: </li>
1.18      cvs        88: <li>
                     89: <a href="#sectc316">Discussion of the model</a>
1.19      cvs        90: </li>
1.18      cvs        91: </ul>
1.19      cvs        92: </li>
1.18      cvs        93: <li>
                     94: <strong><a href="#sectb32">The definition language for generic
                     95: structures</a></strong>
                     96: <ul>
                     97: <li>
                     98: <a href="#sectc321">Writing Conventions</a>
1.19      cvs        99: </li>
1.18      cvs       100: <li>
                    101: <a href="#sectc322">Extension schemas</a>
1.19      cvs       102: </li>
1.18      cvs       103: <li>
                    104: <a href="#sectc323">The general organization of structure schemas</a>
1.19      cvs       105: </li>
1.18      cvs       106: <li>
                    107: <a href="#sectc324">The default presentation</a>
1.19      cvs       108: </li>
1.18      cvs       109: <li>
                    110: <a href="#sectc325">Global Attributes</a>
1.19      cvs       111: </li>
1.18      cvs       112: <li>
                    113: <a href="#sectc326">Parameters</a>
1.19      cvs       114: </li>
1.18      cvs       115: <li>
                    116: <a href="#sectc327">Structured elements</a>
1.19      cvs       117: </li>
1.18      cvs       118: <li>
                    119: <a href="#sectc328">Structure definitions</a>
                    120: <ul>
                    121: <li>
                    122: <small><a href="#sectd3281">List</a></small>
1.19      cvs       123: </li>
1.18      cvs       124: <li>
                    125: <small><a href="#sectd3282">Aggregate</a></small>
1.19      cvs       126: </li>
1.18      cvs       127: <li>
                    128: <small><a href="#sectd3283">Choice</a></small>
1.19      cvs       129: </li>
1.18      cvs       130: <li>
                    131: <small><a href="#sectd3284">Reference</a></small>
1.19      cvs       132: </li>
1.18      cvs       133: <li>
                    134: <small><a href="#sectd3285">Mark pairs</a></small>
1.19      cvs       135: </li>
1.18      cvs       136: </ul>
1.19      cvs       137: </li>
1.18      cvs       138: <li>
                    139: <a href="#sectc329">Imports</a>
1.19      cvs       140: </li>
1.18      cvs       141: <li>
                    142: <a href="#sectc3210">Extension rules</a>
1.19      cvs       143: </li>
1.18      cvs       144: <li>
                    145: <a href="#sectc3211">Associated elements</a>
1.19      cvs       146: </li>
1.18      cvs       147: <li>
                    148: <a href="#sectc3212">Units</a>
1.19      cvs       149: </li>
1.18      cvs       150: <li>
                    151: <a href="#sectc3213">Skeleton elements</a>
1.19      cvs       152: </li>
1.18      cvs       153: <li>
                    154: <a href="#sectc3214">Exceptions</a>
1.19      cvs       155: </li>
1.18      cvs       156: </ul>
1.19      cvs       157: </li>
1.18      cvs       158: <li>
                    159: <strong><a href="#sectb33">Some examples</a></strong>
                    160: <ul>
                    161: <li>
                    162: <a href="#sectc331">A class of documents: articles</a>
1.19      cvs       163: </li>
1.18      cvs       164: <li>
                    165: <a href="#sectc332">A class of objects: mathematical formulas</a>
1.19      cvs       166: </li>
1.18      cvs       167: </ul>
1.19      cvs       168: </li>
1.18      cvs       169: </ul>
1.19      cvs       170: </li>
1.18      cvs       171: <li>
                    172: <big><a href="#sect4">The P language</a></big>
                    173: <ul>
                    174: <li>
                    175: <strong><a href="#sectb41">Document presentation</a></strong>
                    176: <ul>
                    177: <li>
                    178: <a href="#sectc411">Two levels of presentation</a>
1.19      cvs       179: </li>
1.18      cvs       180: <li>
                    181: <a href="#sectc412">Boxes</a>
1.19      cvs       182: </li>
1.18      cvs       183: <li>
                    184: <a href="#sectc413">Views and visibility</a>
1.19      cvs       185: </li>
1.18      cvs       186: <li>
                    187: <a href="#sectc414">Pages</a>
1.19      cvs       188: </li>
1.18      cvs       189: <li>
                    190: <a href="#sectc415">Numbering</a>
1.19      cvs       191: </li>
1.18      cvs       192: <li>
                    193: <a href="#sectc416">Presentation parameters</a>
1.19      cvs       194: </li>
1.18      cvs       195: </ul>
1.19      cvs       196: </li>
1.18      cvs       197: <li>
                    198: <strong><a href="#sectb42">Presentation description language</a></strong>
                    199: <ul>
                    200: <li>
                    201: <a href="#sectc421">The organization of a presentation schema</a>
1.19      cvs       202: </li>
1.18      cvs       203: <li>
                    204: <a href="#sectc422">Views</a>
1.19      cvs       205: </li>
1.18      cvs       206: <li>
                    207: <a href="#sectc423">Print Views</a>
1.19      cvs       208: </li>
1.18      cvs       209: <li>
                    210: <a href="#sectc424">Counters</a>
1.19      cvs       211: </li>
1.18      cvs       212: <li>
                    213: <a href="#sectc425">Presentation constants</a>
1.19      cvs       214: </li>
1.18      cvs       215: <li>
                    216: <a href="#sectc426">Variables</a>
1.19      cvs       217: </li>
1.18      cvs       218: <li>
                    219: <a href="#sectc427">Default presentation rules</a>
1.19      cvs       220: </li>
1.18      cvs       221: <li>
                    222: <a href="#sectc428">Presentation and page layout boxes</a>
1.19      cvs       223: </li>
1.18      cvs       224: <li>
                    225: <a href="#sectc429">Presentation of structured elements</a>
1.19      cvs       226: </li>
1.18      cvs       227: <li>
                    228: <a href="#sectc4210">Logical attribute presentation</a>
1.19      cvs       229: </li>
1.18      cvs       230: <li>
                    231: <a href="#sectc4212">Value transmission rules</a>
1.19      cvs       232: </li>
1.18      cvs       233: <li>
                    234: <a href="#sectc4213">Presentation rules</a>
1.19      cvs       235: </li>
1.18      cvs       236: <li>
                    237: <a href="#sectc4214">Conditions applying to presentation rules</a>
                    238: <ul>
                    239: <li>
                    240: <small><a href="#sectd42141">Conditions based on the logical position of the
                    241: element</a></small>
1.19      cvs       242: </li>
1.18      cvs       243: <li>
                    244: <small><a href="#sectd42142">Conditions on references</a></small>
1.19      cvs       245: </li>
1.18      cvs       246: <li>
                    247: <small><a href="#sectd42143">Conditions on logical attributes</a></small>
1.19      cvs       248: </li>
1.18      cvs       249: <li>
                    250: <small><a href="#sectd42144">Conditions on page breaks</a></small>
1.19      cvs       251: </li>
1.18      cvs       252: <li>
                    253: <small><a href="#sectd42145">Conditions on the element's content</a></small>
1.19      cvs       254: </li>
1.18      cvs       255: <li>
                    256: <small><a href="#sectd42146">Conditions on counters</a></small>
1.19      cvs       257: </li>
1.18      cvs       258: </ul>
1.19      cvs       259: </li>
1.18      cvs       260: <li>
                    261: <a href="#sectc4215">A presentation rule</a>
1.19      cvs       262: </li>
1.18      cvs       263: <li>
                    264: <a href="#sectc4216">Box axes</a>
1.19      cvs       265: </li>
1.18      cvs       266: <li>
                    267: <a href="#sectc4217">Distance units</a>
1.19      cvs       268: </li>
1.18      cvs       269: <li>
                    270: <a href="#sectc4218">Relative positions</a>
1.19      cvs       271: </li>
1.18      cvs       272: <li>
                    273: <a href="#sectc4219">Box extents</a>
                    274: <ul>
                    275: <li>
                    276: <small><a href="#sectd42191">Fixed extents</a></small>
1.19      cvs       277: </li>
1.18      cvs       278: <li>
                    279: <small><a href="#sectd42192">Relative extents</a></small>
1.19      cvs       280: </li>
1.18      cvs       281: <li>
                    282: <small><a href="#sectd42193">Elastic extents</a></small>
1.19      cvs       283: </li>
1.18      cvs       284: </ul>
1.19      cvs       285: </li>
1.18      cvs       286: <li>
                    287: <a href="#sectc4220">Overflow</a>
1.19      cvs       288: </li>
1.18      cvs       289: <li>
                    290: <a href="#sectc4221">Inheritance</a>
1.19      cvs       291: </li>
1.18      cvs       292: <li>
                    293: <a href="#sectc4222">Line breaking</a>
                    294: <ul>
                    295: <li>
                    296: <small><a href="#sectd42221">Line spacing</a></small>
1.19      cvs       297: </li>
1.18      cvs       298: <li>
                    299: <small><a href="#sectd42222">First line indentation</a></small>
1.19      cvs       300: </li>
1.18      cvs       301: <li>
                    302: <small><a href="#sectd42223">Alignment</a></small>
1.19      cvs       303: </li>
1.18      cvs       304: <li>
                    305: <small><a href="#sectd42224">Justification</a></small>
1.19      cvs       306: </li>
1.18      cvs       307: <li>
                    308: <small><a href="#sectd42225">Hyphenation</a></small>
1.19      cvs       309: </li>
1.18      cvs       310: <li>
                    311: <small><a href="#sectd42226">Avoiding line breaking</a></small>
1.19      cvs       312: </li>
1.18      cvs       313: </ul>
1.19      cvs       314: </li>
1.18      cvs       315: <li>
                    316: <a href="#sectc4223">Page breaking and line breaking conditions</a>
1.19      cvs       317: </li>
1.18      cvs       318: <li>
                    319: <a href="#sectc4224">Visibility</a>
1.19      cvs       320: </li>
1.18      cvs       321: <li>
                    322: <a href="#sectc4225">Character style parameters</a>
                    323: <ul>
                    324: <li>
                    325: <small><a href="#sectd42251">Character size</a></small>
1.19      cvs       326: </li>
1.18      cvs       327: <li>
                    328: <small><a href="#sectd42252">Font and character style</a></small>
1.19      cvs       329: </li>
1.18      cvs       330: <li>
                    331: <small><a href="#sectd42253">Underlining</a></small>
1.19      cvs       332: </li>
1.18      cvs       333: </ul>
1.19      cvs       334: </li>
1.18      cvs       335: <li>
                    336: <a href="#sectc4226">Stacking order</a>
1.19      cvs       337: </li>
1.18      cvs       338: <li>
                    339: <a href="#sectc4227">Line style</a>
1.19      cvs       340: </li>
1.18      cvs       341: <li>
                    342: <a href="#sectc4228">Line thickness</a>
1.19      cvs       343: </li>
1.18      cvs       344: <li>
                    345: <a href="#sectc4229">Fill pattern</a>
1.19      cvs       346: </li>
1.18      cvs       347: <li>
                    348: <a href="#sectc4230">Colors</a>
1.19      cvs       349: </li>
1.18      cvs       350: <li>
                    351: <a href="#sectc4230a">Background color and border</a>
1.19      cvs       352: </li>
1.18      cvs       353: <li>
                    354: <a href="#sectc4230b">Background pictures</a>
1.19      cvs       355: </li>
1.18      cvs       356: <li>
                    357: <a href="#sectc4231">Presentation box content</a>
1.19      cvs       358: </li>
1.18      cvs       359: <li>
                    360: <a href="#sectc4232">Presentation box creation</a>
1.19      cvs       361: </li>
1.18      cvs       362: <li>
                    363: <a href="#sectc4233">Page layout</a>
1.19      cvs       364: </li>
1.18      cvs       365: <li>
                    366: <a href="#sectc4234">Box copies</a>
1.19      cvs       367: </li>
1.18      cvs       368: </ul>
1.19      cvs       369: </li>
1.18      cvs       370: </ul>
1.19      cvs       371: </li>
1.18      cvs       372: <li>
                    373: <big><a href="#sect5">The T language</a></big>
                    374: <ul>
                    375: <li>
                    376: <strong><a href="#sectb51">Document translation</a></strong>
                    377: <ul>
                    378: <li>
                    379: <a href="#sectc511">Translation principles</a>
1.19      cvs       380: </li>
1.18      cvs       381: <li>
                    382: <a href="#sectc512">Translation procedure</a>
1.19      cvs       383: </li>
1.18      cvs       384: </ul>
1.19      cvs       385: </li>
1.18      cvs       386: <li>
                    387: <strong><a href="#sectb52">Translation definition language</a></strong>
                    388: <ul>
                    389: <li>
                    390: <a href="#sectc521">Organization of a translation schema</a>
1.19      cvs       391: </li>
1.18      cvs       392: <li>
                    393: <a href="#sectc522">Line length</a>
1.19      cvs       394: </li>
1.18      cvs       395: <li>
                    396: <a href="#sectc523">Buffers</a>
1.19      cvs       397: </li>
1.18      cvs       398: <li>
                    399: <a href="#sectc524">Counters</a>
1.19      cvs       400: </li>
1.18      cvs       401: <li>
                    402: <a href="#sectc525">Constants</a>
1.19      cvs       403: </li>
1.18      cvs       404: <li>
                    405: <a href="#sectc526">Variables</a>
1.19      cvs       406: </li>
1.18      cvs       407: <li>
                    408: <a href="#sectc527">Translating structure elements</a>
1.19      cvs       409: </li>
1.18      cvs       410: <li>
                    411: <a href="#sectc528">Conditional rules</a>
                    412: <ul>
                    413: <li>
                    414: <small><a href="#sectd5281">Conditions based on the logical position of the
                    415: element</a></small>
1.19      cvs       416: </li>
1.18      cvs       417: <li>
                    418: <small><a href="#sectd5282">Conditions on references</a></small>
1.19      cvs       419: </li>
1.18      cvs       420: <li>
                    421: <small><a href="#sectd5283">Conditions on the parameters</a></small>
1.19      cvs       422: </li>
1.18      cvs       423: <li>
                    424: <small><a href="#sectd5284">Conditions on the alphabets</a></small>
1.19      cvs       425: </li>
1.18      cvs       426: <li>
                    427: <small><a href="#sectd5285">Conditions on page breaks</a></small>
1.19      cvs       428: </li>
1.18      cvs       429: <li>
                    430: <small><a href="#sectd5286">Conditions on the element's content</a></small>
1.19      cvs       431: </li>
1.18      cvs       432: <li>
                    433: <small><a href="#sectd5287">Conditions on the presence of comments</a></small>
1.19      cvs       434: </li>
1.18      cvs       435: <li>
                    436: <small><a href="#sectd5288">Conditions on the presence of specific
                    437: presentation rules</a></small>
1.19      cvs       438: </li>
1.18      cvs       439: <li>
                    440: <small><a href="#sectd5289">Conditions on the presence of logical
                    441: attributes</a></small>
1.19      cvs       442: </li>
1.18      cvs       443: <li>
                    444: <small><a href="#sectd52810">Conditions on logical attributes</a></small>
1.19      cvs       445: </li>
1.18      cvs       446: <li>
                    447: <small><a href="#sectd52811">Conditions on specific presentation
                    448: rules</a></small>
1.19      cvs       449: </li>
1.18      cvs       450: </ul>
1.19      cvs       451: </li>
1.18      cvs       452: <li>
                    453: <a href="#sectc529">Translation rules</a>
1.19      cvs       454: </li>
1.18      cvs       455: <li>
                    456: <a href="#sectc5210">The <tt>Create</tt> rule</a>
1.19      cvs       457: </li>
1.18      cvs       458: <li>
                    459: <a href="#sectc5211">The <tt>Write</tt> rule</a>
1.19      cvs       460: </li>
1.18      cvs       461: <li>
                    462: <a href="#sectc5212">The <tt>Read</tt> rule</a>
1.19      cvs       463: </li>
1.18      cvs       464: <li>
                    465: <a href="#sectc5213">The <tt>Include</tt> rule</a>
1.19      cvs       466: </li>
1.18      cvs       467: <li>
                    468: <a href="#sectc5214">The <tt>Get</tt> rule</a>
1.19      cvs       469: </li>
1.18      cvs       470: <li>
                    471: <a href="#sectc5215">The <tt>Copy</tt> rule</a>
1.19      cvs       472: </li>
1.18      cvs       473: <li>
                    474: <a href="#sectc5216">The <tt>Use</tt> rule</a>
1.19      cvs       475: </li>
1.18      cvs       476: <li>
                    477: <a href="#sectc5217">The <tt>Remove</tt> rule</a>
1.19      cvs       478: </li>
1.18      cvs       479: <li>
                    480: <a href="#sectc5218">The <tt>NoTranslation</tt> rule</a>
1.19      cvs       481: </li>
1.18      cvs       482: <li>
                    483: <a href="#sectc5219">The <tt>NoLineBreak</tt> rule</a>
1.19      cvs       484: </li>
1.18      cvs       485: <li>
                    486: <a href="#sectc5220">The <tt>ChangeMainFile</tt> rule</a>
1.19      cvs       487: </li>
1.18      cvs       488: <li>
                    489: <a href="#sectc5220a">The <tt>RemoveFile</tt> rule</a>
1.19      cvs       490: </li>
1.18      cvs       491: <li>
                    492: <a href="#sectc5221">The <tt>Set</tt> and <tt>Add</tt> rules</a>
1.19      cvs       493: </li>
1.18      cvs       494: <li>
                    495: <a href="#sectc5221a">The <tt>Indent</tt> rule</a>
1.19      cvs       496: </li>
1.18      cvs       497: <li>
                    498: <a href="#sectc5222">Rule application order</a>
1.19      cvs       499: </li>
1.18      cvs       500: <li>
                    501: <a href="#sectc5223">Translation of logical attributes</a>
1.19      cvs       502: </li>
1.18      cvs       503: <li>
                    504: <a href="#sectc5224">Translation of specific presentations</a>
1.19      cvs       505: </li>
1.18      cvs       506: <li>
                    507: <a href="#sectc5225">Recoding of characters, symbols and graphics</a>
1.19      cvs       508: </li>
1.18      cvs       509: </ul>
1.19      cvs       510: </li>
1.18      cvs       511: </ul>
1.19      cvs       512: </li>
1.18      cvs       513: <li>
                    514: <big><a href="#sect6">Language grammars</a></big>
                    515: <ul>
                    516: <li>
                    517: <strong><a href="#sectb61">The M meta-language</a></strong>
1.19      cvs       518: </li>
1.18      cvs       519: <li>
                    520: <strong><a href="#sectb62">The S language</a></strong>
1.19      cvs       521: </li>
1.18      cvs       522: <li>
                    523: <strong><a href="#sectb63">The P language</a></strong>
1.19      cvs       524: </li>
1.18      cvs       525: <li>
                    526: <strong><a href="#sectb64">The T language</a></strong>
1.19      cvs       527: </li>
1.18      cvs       528: </ul>
1.19      cvs       529: </li>
1.18      cvs       530: <li>
                    531: <big><a href="#sect7">Character coding</a></big>
                    532: <ul>
                    533: <li>
                    534: <strong><a href="#sectb71">Characters</a></strong>
1.19      cvs       535: </li>
1.18      cvs       536: <li>
                    537: <strong><a href="#sectb72">Symbols</a></strong>
1.19      cvs       538: </li>
1.18      cvs       539: <li>
                    540: <strong><a href="#sectb73">Graphical elements</a></strong>
1.19      cvs       541: </li>
1.18      cvs       542: </ul>
1.19      cvs       543: </li>
1.18      cvs       544: </ul>
                    545: <hr>
1.19      cvs       546: 
1.18      cvs       547: </div>
1.1       cvs       548: 
1.18      cvs       549: <div class="chapter">
1.1       cvs       550: 
1.18      cvs       551: <h1><a name="sect2">The document model of Thot</a></h1>
                    552: <p>
1.1       cvs       553: All of the services which Thot provides to the user are based on the system's
                    554: internal document representation.  This representation is itself derived from
                    555: the document model which underlies Thot.  The model is presented here, prior
                    556: to the description of the languages which permit the generic specification of
1.18      cvs       557: documents.</p>
1.1       cvs       558: 
1.18      cvs       559: <div class="section">
1.1       cvs       560: 
1.18      cvs       561: <h2><a name="sectb21">The logical structure of documents</a></h2>
                    562: <p>
1.1       cvs       563: The document model of Thot is primarily designed to allow the user to operate
1.5       cvs       564: on those entities which s/he has in mind when s/he works on a document. The
                    565: model makes no assumptions about the nature of these entities. It is
                    566: essentially these logical entities, such as paragraphs, sections, chapters,
                    567: notes, titles, and cross-references which give a document its logical
1.18      cvs       568: structure.</p>
                    569: <p>
1.5       cvs       570: Because of this model, the author can divide the document into chapters,
1.1       cvs       571: giving each one a title.  The content of these chapters can be further divided
1.2       cvs       572: into sections, subsections, etc.  The text is organized into successive
                    573: paragraphs, according to the content. In the writing phase, the lines, pages,
                    574: margins, spacing, fonts, and character styles are not very important. In fact,
                    575: if the system requires documents to be written in these terms, it gets in the
                    576: way. So, Thot's model is primarily based on the logical aspect of documents.
1.18      cvs       577: The creation of a model of this type essentially requires the definition :</p>
                    578: <ul>
                    579: <li>
                    580: of the entities which can appear in the documents,
1.19      cvs       581: </li>
1.18      cvs       582: <li>
                    583: and the relations between these entities.
1.19      cvs       584: </li>
1.18      cvs       585: </ul>
                    586: <p>
1.1       cvs       587: The choice of entities to include in the model can be subtle.  Some documents
                    588: require chapters, while others only need various levels of sections. Certain
                    589: documents contain appendices, others don't.  In different documents the same
                    590: logical entity may go by different names (e.g. ``Conclusion'' and
                    591: ``Summary'').  Certain entities which are absolutely necessary in some
                    592: documents, such as clauses in a contract or the address of the recipient in a
1.18      cvs       593: letter, are useless in most other cases.</p>
                    594: <p>
1.1       cvs       595: The differences between documents result from more than just the entities that
                    596: appear in them, but also from the relationships between these entities and the
                    597: ways that they are linked.  In certain documents, notes are spread throughout
                    598: the document, for example at the bottom of the page containing the
                    599: cross-reference to them, while in other documents they are collected at the
                    600: end of each chapter or even at the end of the work.  As another example, the
                    601: introduction of some documents can contain many sections, while in other
                    602: documents, the introduction is restricted to be a short sequence of
1.18      cvs       603: paragraphs.</p>
                    604: <p>
1.1       cvs       605: All of this makes it unlikely that a single model can describe any document at
                    606: a relatively high level.  It is obviously tempting to make up a list of widely
                    607: used entities, such as chapters, sections, paragraphs, and titles, and then
                    608: map all other entities onto the available choices.  In this way, an
                    609: introduction can be supported as a chapter and a contract clause supported as
                    610: a paragraph or section. However, in trying to widen the range of usage of
                    611: certain entities, their meaning can be lost and the power of the model
                    612: reduced.  In addition, while this widening partially solves the problem of
                    613: choosing entities, it does not solve the problem of their organization: when a
                    614: chapter must be composed of sections, how does one indicate that an
                    615: introduction has none when it is merely another chapter?  One solution is to
                    616: include introductions in the list of supported entities. But then, how does
                    617: one distinguish those introductions which are allowed to have sections from
                    618: those which are not.  Perhaps this could be done by defining two types of
                    619: introduction. Clearly, this approach risks an infinite expansion of the list
1.18      cvs       620: of widely used entities.</p>
                    621: </div>
1.1       cvs       622: 
1.18      cvs       623: <div class="section">
1.1       cvs       624: 
1.18      cvs       625: <h2><a name="sectb22">Generic and specific structures</a></h2>
                    626: <p>
1.1       cvs       627: Thus, it is apparently impossible to construct an exhaustive inventory of all
1.2       cvs       628: those entities which are necessary and sufficient to precisely describe any
                    629: document. It also seems impossible to specify all possible arrangements of
1.18      cvs       630: these entities in a document.  This is why Thot uses a <em>meta-model</em>
                    631: instead, which permits the description of numerous <em>models</em>, each one
                    632: describing a <em>class</em> of documents.</p>
                    633: <p>
                    634: A <em>class</em> is a set of documents having very similar structure. Thus,
1.1       cvs       635: the collection of research reports published by a laboratory constitutes a
                    636: class; the set of commercial proposals by the sales department of a company
                    637: constitutes another class; the set of articles published by a journal
                    638: constitutes a third class.  Clearly, it is not possible to enumerate every
                    639: possible document class.  It is also clear that new document classes must be
1.18      cvs       640: created to satisfy new needs and applications.</p>
                    641: <p>
1.1       cvs       642: To give a more rigorous definition of classes, we must introduce the ideas of
1.18      cvs       643: <em>generic structure</em> and <em>specific structure</em>.  Each document has
                    644: a <em>specific structure</em> which organizes the various parts which comprise
1.1       cvs       645: it.  We illustrate this with the help of a simple example comparing two
1.18      cvs       646: reports, A and B (<a href="#specstruct">see Figure</a>). The report A contains
1.1       cvs       647: an introduction followed by three chapters and a conclusion.  The first
                    648: chapter contains two sections, the second, three sections.  That is the
1.18      cvs       649: <em>specific</em> structure of document A. Similarly, the structure of
1.1       cvs       650: document B is: an introduction, two chapters, a conclusion; Chapter 1 has
                    651: three sections while Chapter 2 has four.  The specific structures of these two
1.18      cvs       652: documents are thus different.</p>
1.1       cvs       653: 
1.18      cvs       654: <div class="figure">
                    655: <hr>
1.19      cvs       656: 
1.18      cvs       657: <pre>        Report A                 Report B
1.1       cvs       658:              Introduction              Introduction
                    659:              Chapter 1                 Chapter 1
                    660:                   Section 1.1               Section 1.1
                    661:                   Section 1.2               Section 1.2
                    662:              Chapter 2                      Section 1.3
                    663:                   Section 2.1          Chapter 2
                    664:                   Section 2.2               Section 2.1
                    665:                   Section 2.3               Section 2.2
                    666:              Chapter 3                      Section 2.3
                    667:              Conclusion                     Section 2.4
1.18      cvs       668:                                        Conclusion</pre>
1.19      cvs       669: <p align="center">
1.18      cvs       670: <em><a name="specstruct">Two specific structures</a></em></p>
                    671: <hr>
1.19      cvs       672: 
1.18      cvs       673: </div>
                    674: <p>
                    675: The <em>generic structure</em> defines the ways in which specific structures
1.1       cvs       676: can be constructed.  It specifies how to generate specific structures.  The
                    677: reports A and B, though different, are constructed in accordance with the same
                    678: generic structure, which specifies that a report contains an introduction
                    679: followed by a variable number of chapters and a conclusion, with each chapter
1.18      cvs       680: containing a variable number of sections.</p>
                    681: <p>
1.1       cvs       682: There is a one-to-one correspondence between a class and a generic structure:
                    683: all the documents of a class are constructed in accordance with the same
                    684: generic structure.  Hence the definition of the class: a class is a set of
                    685: documents whose specific structure is constructed in accordance with the same
1.18      cvs       686: generic structure.  A class is characterized by its generic structure.</p>
                    687: <p>
1.1       cvs       688: Thus, a generic structure can be considered to be a model at the level which
                    689: interests us, but only for one class of documents.  When the definition is
                    690: limited to a single class of documents, it is possible to define a model which
                    691: does a good job of representing the documents of the class, including the
                    692: necessary entities and unencumbered by useless entities.  The description of
                    693: the organization of the documents in the class can then be sufficiently
1.18      cvs       694: precise.</p>
                    695: </div>
1.1       cvs       696: 
1.18      cvs       697: <div class="section">
1.1       cvs       698: 
1.18      cvs       699: <h2><a name="sectb23">Logical structure and physical structure</a></h2>
                    700: <p>
                    701: Generic structures only describe the <em>logical</em> organization of
                    702: documents, not their <em>physical</em> presentation on a screen or on sheets
1.1       cvs       703: of paper.  However, for a document to be displayed or printed, its graphic
1.18      cvs       704: presentation must be taken into account.</p>
                    705: <p>
1.1       cvs       706: An examination of current printed documents shows that the details of
                    707: presentation essentially serve to bring out their logical structure. Outside
                    708: of some particular domains, notably advertising, the presentation is rarely
                    709: independent of the logical organization of the text.  Moreover, the art of
                    710: typography consists of enhancing the organization of the text being set,
                    711: without catching the eye of the reader with overly pronounced effects.  Thus,
                    712: italic and boldface type are used to emphasize words or expressions which have
                    713: greater significance than the rest of the text: keywords, new ideas,
                    714: citations, book titles, etc.  Other effects highlight the organization of the
                    715: text: vertical space, margin changes, page breaks, centering, eventually
                    716: combined with the changes in the shapes or weight of the characters. These
                    717: effects serve to indicate the transitions between paragraphs, sections, or
                    718: chapters: an object's level in the logical structure of the document is shown
1.18      cvs       719: by the markedness of the effects.</p>
                    720: <p>
1.1       cvs       721: Since the model permits the description of all of the logical structure of the
                    722: document, the presentation can be derived from the model without being
                    723: submerged in the document itself.  It suffices to use the logical structure of
                    724: the document to make the desired changes in its presentation: changes in type
1.18      cvs       725: size, type style, spacing, margin, centering, etc.</p>
                    726: <p>
1.1       cvs       727: Just as one cannot define a unique generic logical structure for all document
                    728: classes, one cannot define universal presentation rules which can be applied
                    729: to all document classes.  For certain types of documents the chapter titles
                    730: will be centered on the page and printed in large, bold type.  For other
                    731: documents, the same chapter titles will be printed in small, italic type and
1.18      cvs       732: aligned on the left margin.</p>
                    733: <p>
1.1       cvs       734: Therefore, it is necessary to base the presentation specifications for
                    735: documents on their class.  Such a specification can be very fine-grained,
                    736: because the presentation is expressed in terms of the entities defined in the
                    737: generic logical structure of the class.  Thus, it is possible to specify a
                    738: different presentation for the chapter titles and the section titles, and
                    739: similarly to specify titles for the sections according to their level in the
                    740: section hierarchy.  The set of rules which specify the presentation of all the
1.18      cvs       741: elements defined in a generic logical structure is called a <em>generic
                    742: presentation</em>.</p>
                    743: <p>
1.1       cvs       744: There are several advantages derived from having a presentation linked to the
                    745: generic structure and described by a generic presentation. Homogeneity is the
                    746: first.  Since every document in a class corresponds to the same generic
                    747: logical structure, a homogenous presentation for different documents of the
                    748: same class can be assured by applying the same generic presentation to all
                    749: documents of the class.  Homogeneity of presentation can also be found among
1.2       cvs       750: the entities of a single document: every section heading will be presented  in
1.1       cvs       751: the same way, the first line of every paragraph of the same type will have the
1.18      cvs       752: same indentation, etc.</p>
                    753: <p>
1.1       cvs       754: Another advantage of this approach to presentation is that it facilitates
                    755: changes to the graphical aspect of documents.  A change to the generic
                    756: presentation rules attached to each type of entity will alter the presentation
                    757: of the entire document, and will do so homogenously.  In this case, the
                    758: internal homogeneity of the class is no longer assured, but the way to control
                    759: it is simple.  It suffices to adopt a single generic presentation for the
1.18      cvs       760: entire class.</p>
                    761: <p>
1.1       cvs       762: If the presentation of the class does not have to be homogenous, then the
                    763: appearance of the document can be adapted to the way it will be used or to the
                    764: device used to render it.  This quality is sufficient to allow the existence
1.18      cvs       765: of <a name="mulpres">many generic presentations</a> for the same document
1.1       cvs       766: class. By applying one or the other of these presentations to it, the document
                    767: can be seen under different graphical aspects.  It must be emphasized that
                    768: this type of modification of the presentation is not a change to the document
                    769: itself (in its specific logical structure or its content), but only in its
1.18      cvs       770: appearance at the time of editing or printing.</p>
                    771: </div>
1.1       cvs       772: 
1.18      cvs       773: <div class="section">
1.1       cvs       774: 
1.18      cvs       775: <h2><a name="sectb24">Document structures and object structures</a></h2>
                    776: <p>
1.1       cvs       777: So far, we have only discussed the global structure of documents and have not
                    778: considered the contents found in that structure.  We could limit ourselves to
                    779: purely textual contents by assuming that a title or a paragraph contains a
                    780: simple linear text.  But this model would be too restrictive.  In fact,
                    781: certain documents contain not only text, but also contain tables,  diagrams,
                    782: photographs, mathematical formulas, and program fragments.  The model must
1.18      cvs       783: permit the representation of such <em>objects</em>.</p>
                    784: <p>
1.1       cvs       785: Just as with the whole of the document, the model takes into account the
                    786: logical structure of objects of this type.  Some are clearly structured,
                    787: others are less so.  Logical structure can be recognized in mathematical
                    788: formulas, in tables, and in certain types of diagrams.  On the other hand, it
                    789: is difficult to define the structure of a photograph or of some drawings.  But
                    790: in any case, it does not seem possible to define one unique structure which
                    791: can represent every one of these types of objects.  The approach taken in the
                    792: definition of meta-structure and document classes also applies to objects.
                    793: Object classes can be defined which put together objects of similar type,
1.18      cvs       794: constructed from the same generic logical structure.</p>
                    795: <p>
1.1       cvs       796: Thus, a mathematical class can be defined and have a generic logical structure
                    797: associated with it.  But even if a single generic structure can represent a
                    798: sufficient variety of mathematical formulas, for other objects with less
                    799: rigorous structure, multiple classes must be defined.  As for documents, using
                    800: multiple classes assures that the model can describe the full range of objects
                    801: to be presented.  It also permits the system to support objects which were not
                    802: initially anticipated.  Moreover, this comment applies equally to mathematics:
                    803: different classes of formulas can be described depending on the domain of
1.18      cvs       804: mathematics being described.</p>
                    805: <p>
1.1       cvs       806: Since objects have the same level of logical representation as documents, they
                    807: gain the same advantages.  In particular, it is possible to define the
                    808: presentation separately from the objects themselves and attach it to the
                    809: class.  Thus, as for documents, objects of the same type have a uniform
                    810: presentation and the presentation of every object in a given class can be
                    811: changed simply by changing the generic presentation of the class.  Another
                    812: advantage of using this document model is that the system does not bother the
                    813: user with the details of presentation, but rather allows the user to
1.18      cvs       814: concentrate on the logical aspect of the document and the objects.</p>
                    815: <p>
1.1       cvs       816: It is clear that the documents in a class do not necessarily use the same
                    817: classes of objects: one technical report will contain tables while another
                    818: report will have no tables but will use mathematical formulas. The usable
1.2       cvs       819: object classes are not always mentioned in a limiting way in the generic
                    820: logical structure of documents.  Rather, they can be chosen freely from a
1.18      cvs       821: large set, independent of the document class.</p>
                    822: <p>
1.1       cvs       823: Thus, the object classes will be made commonplace and usable in every
                    824: document. The notion of ``object'' can be enlarged to include not only
                    825: non-textual elements, but also certain types of textual elements which can
                    826: appear in practically every document, whatever their class.  Among these
1.2       cvs       827: textual elements, one can mention enumerations, descriptions, examples,
1.18      cvs       828: quotations, even paragraphs.</p>
                    829: <p>
1.1       cvs       830: Thus, the document model is not a single, general model describing every type
                    831: of document in one place.  Rather, it is a meta-model which can be used to
                    832: describe many different models each of which represents either a class of
                    833: similar documents or a class of similar objects which every document can
1.18      cvs       834: include.</p>
                    835: </div>
                    836: <hr>
1.19      cvs       837: 
1.18      cvs       838: </div>
1.1       cvs       839: 
1.18      cvs       840: <div class="chapter">
1.1       cvs       841: 
1.18      cvs       842: <h1><a name="sect3">The S language</a></h1>
1.1       cvs       843: 
1.18      cvs       844: <div class="section">
1.1       cvs       845: 
1.18      cvs       846: <h2><a name="sectb31">Document meta-structure</a></h2>
                    847: <p>
1.1       cvs       848: Since the concept of meta-structure is well suited to the task of describing
                    849: documents at a high level of abstraction, this meta-structure must be
                    850: precisely defined.  Toward that end this section first presents the basic
                    851: elements from which documents and structured objects are composed and then
                    852: specifies the ways in which these basic elements are assembled into structures
1.18      cvs       853: representing complete documents and objects.</p>
1.1       cvs       854: 
1.18      cvs       855: <div class="subsection">
1.1       cvs       856: 
1.18      cvs       857: <h3><a name="sectc311">The basic types</a></h3>
                    858: <p>
1.1       cvs       859: At the lowest level of a document's structure, the first atom considered is
                    860: the character.  However, since characters are seldom isolated, usually
                    861: appearing as part of a linear sequence, and in order to reduce the complexity
1.18      cvs       862: of the document structure, <em>character strings</em> are used as atoms and
1.1       cvs       863: consecutive characters belonging to the same structural element are grouped in
1.18      cvs       864: the same character string.</p>
                    865: <p>
1.1       cvs       866: If the structure of a document is not refined to go down to  the level of
                    867: words or phrases, the contents of a simple paragraph can be considered to be a
                    868: single character string.  On the other hand, the title of a chapter, the title
                    869: of the first section of that chapter, and the text of the first paragraph of
                    870: that section constitute three different character strings, because they belong
1.18      cvs       871: to distinct structural elements.</p>
                    872: <p>
1.1       cvs       873: If, instead, a very fine-grained representation for the structure of a
                    874: document is sought, character strings could be defined to contain only a
                    875: single word, or even just a single character.  This is the case, for example,
                    876: in programs,  for which one wants to retain a structure very close to the
1.2       cvs       877: syntax of the programming language.  In this case, an assignment statement
1.1       cvs       878: initializing a simple variable to zero would be composed of two structural
                    879: elements, the identifier of the variable (a short character string) and the
1.18      cvs       880: assigned value (a string of a single character, `0').</p>
                    881: <p>
1.1       cvs       882: The character string is not the only atom necessary for representing those
                    883: documents that interest us.  It suffices for purely textual documents, but as
                    884: soon as the non-textual objects which we have considered arise, there must be
                    885: other atoms; the number of objects which are to be represented determines the
1.18      cvs       886: number of types of atoms that are necessary.</p>
                    887: <p>
                    888: Primitive <em>graphical elements</em> are used for tables and figures of
1.1       cvs       889: different types.  These elements are simple geometric shapes like horizontal
                    890: or vertical lines, which are sufficient for tables, or even oblique lines,
1.2       cvs       891: arrows, rectangles, circles, polygons, and curves for use in figures. From
                    892: these elements and character strings, graphical objects and tables can be
1.18      cvs       893: constructed.</p>
                    894: <p>
1.1       cvs       895: Photographs, though having very little structure, must still appear in
1.18      cvs       896: documents.  They are supported by <em>picture</em> elements, which are
                    897: represented as matrices of pixels.</p>
                    898: <p>
1.1       cvs       899: Finally, mathematical notations require certain elements which are
1.18      cvs       900: simultaneously characters and graphical elements, the <em>symbols</em>. By way
1.2       cvs       901: of example, radicals, integration signs, or even large parentheses are
1.1       cvs       902: examples of this type of atom.  The size of each of these symbols is
                    903: determined by its environment, that is to say, by the expression to which it
1.18      cvs       904: is attached.</p>
                    905: <p>
1.1       cvs       906: To summarize, the primitive elements which are used in the construction of
1.18      cvs       907: documents and structured objects are:</p>
                    908: <ul>
                    909: <li>
                    910: character strings,
1.19      cvs       911: </li>
1.18      cvs       912: <li>
                    913: graphical elements,
1.19      cvs       914: </li>
1.18      cvs       915: <li>
                    916: pictures,
1.19      cvs       917: </li>
1.18      cvs       918: <li>
                    919: and mathematical symbols.
1.19      cvs       920: </li>
1.18      cvs       921: </ul>
                    922: </div>
1.1       cvs       923: 
1.18      cvs       924: <div class="subsection">
1.1       cvs       925: 
1.18      cvs       926: <h3><a name="sectc312">Constructed elements</a></h3>
                    927: <p>
1.1       cvs       928: A document is evidently formed from primitive elements.  But the model of Thot
                    929: also proposes higher level elements.  Thus, in a document composed of several
                    930: chapters, each chapter is an element, and in the chapters each section is also
1.18      cvs       931: an element, and so on.  A document is thus an organized set of elements.</p>
                    932: <p>
1.1       cvs       933: In a document there are different sorts of elements.  Each element has a
1.18      cvs       934: <em>type</em> which indicates the role of the element within the document as a
1.1       cvs       935: whole.  Thus, we have, for example, the chapter and section types.  The
                    936: document is made up of typed elements: elements of the type chapter and
                    937: elements of the type section, among others, but also character string elements
                    938: and graphical elements: the primitive elements are typed elements just as
                    939: well.  At the other extreme, the document itself is also considered to be a
1.18      cvs       940: typed element.</p>
                    941: <p>
1.1       cvs       942: The important difference between the primitive elements and the other elements
                    943: of the document is that the primitive elements are atoms (they cannot be
1.18      cvs       944: decomposed), whereas the others, called <em>constructed elements</em>, are
1.1       cvs       945: composed of other elements, which can either be primitive elements or
                    946: constructed elements.  A constructed element of type chapter (or more simply,
                    947: ``a chapter'') is composed of sections, which are also constructed elements. A
                    948: paragraph, a constructed element, can be made up of character strings, which
1.18      cvs       949: are primitive elements, and of equations, which are constructed elements.</p>
                    950: <p>
1.1       cvs       951: A document is also a constructed element.  This is an important point. In
                    952: particular, it allows a document to be treated as part of another document,
                    953: and conversely, permits a part of a document to be treated as a complete
                    954: document.  Thus, an article presented in a journal is treated by its author as
                    955: a document in itself, while the editor of the journal considers it to be part
                    956: of an issue.  A table or a figure appearing in a document can be extracted and
                    957: treated as a complete document, for example to prepare transparencies for a
1.18      cvs       958: conference.</p>
                    959: <p>
1.1       cvs       960: These thoughts about types and constructed elements apply just as well to
                    961: objects as they do to documents.  A table is a constructed element made up of
                    962: other constructed elements, rows and columns.  A row is formed of cells, which
                    963: are also constructed elements which contain primitive elements (character
1.18      cvs       964: strings) and/or constructed elements like equations.</p>
                    965: </div>
1.1       cvs       966: 
1.18      cvs       967: <div class="subsection">
1.1       cvs       968: 
1.18      cvs       969: <h3><a name="sectc313">Logical structure constructors</a></h3>
                    970: <p>
1.1       cvs       971: Having defined the primitive elements and the constructed elements, it is now
                    972: time to define the types of organization which allow the building of
1.18      cvs       973: structures.  For this, we rely on the notion of the <em>constructor</em>.  A
1.1       cvs       974: constructor defines a way of assembling certain elements in a structure.  It
                    975: resides at the level of the meta-structure: it does not describe the existing
                    976: relations in a given structure, but rather defines  how elements are assembled
1.18      cvs       977: to build a structure that conforms to a model.</p>
                    978: <p>
1.1       cvs       979: In defining the overall organization of documents, the first two constructors
1.18      cvs       980: considered are the aggregate and the list.</p>
1.1       cvs       981: 
1.18      cvs       982: <div class="subsubsection">
1.1       cvs       983: 
1.18      cvs       984: <h4><a name="sectd3131">Aggregate and List</a></h4>
                    985: <p>
                    986: The <em>aggregate</em> constructor is used to define constructed element types
1.1       cvs       987: which are collections of a given number of other elements. These collections
                    988: may or may not be ordered.  The elements may be either constructed or
                    989: primitive and are specified by their type.  A report (that is, a constructed
                    990: element of the report type) has an aggregate structure.  It is formed from a
                    991: title, an author's name, an introduction, a body, and a conclusion, making it
                    992: a collection of five element types.  This type of constructor is found in
1.18      cvs       993: practically every document, and generally at several levels in a document.</p>
                    994: <p>
                    995: The <em>list</em> constructor is used to define constructed elements which are
1.1       cvs       996: ordered sequences of elements (constructed or primitive) having the same type.
                    997: The minimum and maximum numbers of elements for the sequence can be specified
                    998: in the list constructor or the number of elements can be left unconstrained.
                    999: The body of a report is a list of chapters and is typically required to
                   1000: contain a minimum of two chapters (is a chapter useful if it is the only one
                   1001: in the report?) The chapter itself can contain a list of sections, each
1.2       cvs      1002: section containing a list of paragraphs.  In the same way as the aggregate,
1.18      cvs      1003: the list is a very frequently used constructor in every type of document.
1.2       cvs      1004: However, these two constructors are not sufficient to describe every document
1.18      cvs      1005: structure; thus other constructors supplement them.</p>
                   1006: </div>
1.1       cvs      1007: 
1.18      cvs      1008: <div class="subsubsection">
1.1       cvs      1009: 
1.18      cvs      1010: <h4><a name="sectd3132">Choice, Schema, and Unit</a></h4>
                   1011: <p>
                   1012: The <em>choice</em> constructor is used to define the structure of an element
1.1       cvs      1013: type for which one alternative is chosen from several possibilities. Thus, a
                   1014: paragraph can be either a simple text paragraph, or an enumeration, or a
1.18      cvs      1015: citation.</p>
                   1016: <p>
1.1       cvs      1017: The choice constructor indicates the complete list of possible options, which
                   1018: can be too restrictive in certain cases, the paragraph being one such case.
1.18      cvs      1019: Two constructors, <em>unit</em> and <em>schema</em>, address this
1.1       cvs      1020: inconvenience.  They allow more freedom in the choice of an element type.  If
                   1021: a paragraph is defined by a schema constructor, it is possible to put in the
                   1022: place of a paragraph a table, an equation, a drawing or any other object
                   1023: defined by another generic logical structure.  It is also possible to define a
                   1024: paragraph as a sequence of units, which could be character strings, symbols,
1.2       cvs      1025: or pictures.  The choice constructor alone defines a generic logical structure
1.1       cvs      1026: that is relatively constrained; in contrast, using units and schemas, a very
1.18      cvs      1027: open structure can be defined.</p>
                   1028: <p>
                   1029: The <em>schema</em> constructor represents an object defined by a generic
                   1030: logical structure chosen freely from among those available.</p>
                   1031: <p>
                   1032: The <em>unit</em> constructor represents an element whose type can be either a
1.1       cvs      1033: primitive type or an element type defined as a unit in the generic logical
                   1034: structure of the document, or in another generic logical structure used in the
                   1035: document.  Such an element may be used in document objects constructed
1.18      cvs      1036: according to other generic structures.</p>
                   1037: <p>
1.1       cvs      1038: Thus, for example, if a cross-reference to a footnote is defined in the
                   1039: generic logical structure ``Article'' as a unit, a table (an object defined by
                   1040: another generic structure) can contain cross-references to footnotes, when
                   1041: they appear in an article.  In another type of document, a table defined by
                   1042: the same generic structure can contain other types of elements, depending on
                   1043: the type of document into which the table is inserted.  All that is needed is
                   1044: to declare, in the generic structure for tables, that the contents of cells
                   1045: are units.  In this way, the generic structure of objects is divided up
                   1046: between different types of documents which are able to adapt themselves to the
1.18      cvs      1047: environment into which they are inserted.</p>
                   1048: </div>
1.1       cvs      1049: 
1.18      cvs      1050: <div class="subsubsection">
1.1       cvs      1051: 
1.18      cvs      1052: <h4><a name="sectd3133">Reference and Inclusion</a></h4>
                   1053: <p>
                   1054: The <em>reference</em> is used to define document elements that are
                   1055: cross-references to other elements, such as a section, a chapter, a
                   1056: bibliographic citation, or a figure.  The reference is bi-directional.  It can
                   1057: be used to access both the element being cross-referenced and each of the
                   1058: elements which make use of the cross-reference.</p>
                   1059: <p>
                   1060: References can be either <em>internal</em> or <em>external</em>.  That is,
1.1       cvs      1061: they can designate elements which appear in the same document or in another
1.18      cvs      1062: document.</p>
                   1063: <p>
                   1064: The <em><a name="inclusion">inclusion</a></em> constructor is a special type
1.1       cvs      1065: of reference.  Like the reference, it is an internal or external bidirectional
                   1066: link, but it is not a cross-reference.  This link represents the ``live''
                   1067: inclusion of the designated element; it accesses the most recent version of
                   1068: that element and not a ``dead'' copy, fixed in the state in which it was found
                   1069: at the moment the copy was made.  As soon as an element is modified, all of
                   1070: its inclusions are automatically brought up to date.  It must be noted that,
1.18      cvs      1071: in addition to inclusion, Thot permits the creation of ``dead'' copies.</p>
                   1072: <p>
1.1       cvs      1073: There are three types of inclusions: inclusions with full expansion,
                   1074: inclusions with partial expansion, and inclusions without expansion. During
                   1075: editing, inclusions without expansion are represented on the screen by the
                   1076: name of the included document, in a special color, while inclusions with
                   1077: expansion (full or partial) are represented by a copy (full or partial) of the
                   1078: included element (also in a special color). The on-screen representation of a
1.18      cvs      1079: partial inclusion is a <a href="#sectc3213">``skeleton''</a> image of the
                   1080: included document.</p>
                   1081: <p>
1.1       cvs      1082: Inclusion with complete expansion can be used to include parts of the same
                   1083: document or of other documents.  Thus, it can be either an internal or an
                   1084: external link.  It can be used to include certain bibliographic entries of a
                   1085: scientific article in another article, or to copy part of a mathematical
                   1086: formula into another formula of the same document, thus assuring that both
1.18      cvs      1087: copies will remain synchronized.</p>
                   1088: <p>
1.1       cvs      1089: Inclusion without expansion or with partial expansion is used to include
                   1090: complete documents.  It is always an external link.  It is used primarily to
                   1091: divide very large documents into sub-documents that are easier to manipulate,
                   1092: especially when there are many authors.  So, a book can include some chapters,
                   1093: where each chapter is a different document which can be edited separately.
                   1094: When viewing the book on the screen, it might be desirable to see only the
                   1095: titles of the chapters and sections.  This can be achieved using inclusion
1.18      cvs      1096: with partial expansion.</p>
                   1097: <p>
1.1       cvs      1098: During printing, inclusions without expansion or with partial expansion can be
                   1099: represented either as they were shown on the screen or by a complete (and
1.18      cvs      1100: up-to-date) copy of the included element or document.</p>
                   1101: <p>
1.1       cvs      1102: The inclusion constructor, whatever its type, respects the generic structure:
                   1103: only those elements authorized by the generic structure can be included at a
1.18      cvs      1104: given position in a document.</p>
                   1105: </div>
1.1       cvs      1106: 
1.18      cvs      1107: <div class="subsubsection">
1.1       cvs      1108: 
1.18      cvs      1109: <h4><a name="sectd3134">Mark pairs</a></h4>
                   1110: <p>
1.1       cvs      1111: It is often useful to delimit certain parts of a document independently from
                   1112: the logical structure.  For example, one might wish to attach some information
1.18      cvs      1113: (in the form of an <a href="#sectc315">attribute</a>) or a particular
                   1114: treatment to a group of words or a set of consecutive paragraphs. <em>Mark
                   1115: pairs</em> are used to do this.</p>
                   1116: <p>
1.1       cvs      1117: Mark pairs are elements which are always paired and are terminals in the
                   1118: logical structure of the document.  Their position in the structure of the
                   1119: document is defined in the generic structure.  It is important to note that
1.18      cvs      1120: when the terminals of a mark pair are <em>extensions</em> (see the next
                   1121: section), they can be used quite freely.</p>
                   1122: </div>
1.1       cvs      1123: 
1.18      cvs      1124: <div class="subsubsection">
1.1       cvs      1125: 
1.18      cvs      1126: <h4><a name="sectd3135">Restrictions and Extensions</a></h4>
                   1127: <p>
1.1       cvs      1128: The primitive types and the constructors presented so far permit the
                   1129: definition of the logical structure of documents and objects in a rigorous
                   1130: way.  But this definition can be very cumbersome in certain cases, notably
                   1131: when trying to constrain or extend the authorized element types in a
1.18      cvs      1132: particular context.  <em>Restrictions</em> and <em>extensions</em> are used to
                   1133: cope with these cases.</p>
                   1134: <p>
                   1135: A restriction associates with a particular element type <em>A</em>, a list of
                   1136: those element types which elements of type <em>A</em> may not contain, even if
                   1137: the definition of type <em>A</em> and those of its components authorize them
1.1       cvs      1138: otherwise.  This simplifies the writing of generic logical structures and
                   1139: allows limitations to be placed, when necessary, on the choices offered by the
1.18      cvs      1140: schema and unit constructors.</p>
                   1141: <p>
1.1       cvs      1142: Extensions are the inverse of restrictions.  They identify a list of element
1.18      cvs      1143: types whose presence <em>is</em> permitted, even if its definition and those
                   1144: of its components do not authorize them otherwise.</p>
                   1145: </div>
                   1146: 
                   1147: <div class="subsubsection">
                   1148: 
                   1149: <h4><a name="sectd3136">Summary</a></h4>
                   1150: <p>
                   1151: Thus, four constructors are used to construct a document:</p>
                   1152: <ul>
                   1153: <li>
                   1154: the aggregate constructor (ordered or not),
1.19      cvs      1155: </li>
1.18      cvs      1156: <li>
                   1157: the list constructor,
1.19      cvs      1158: </li>
1.18      cvs      1159: <li>
                   1160: the choice constructor and its extensions, the unit and schema constructors,
1.19      cvs      1161: </li>
1.18      cvs      1162: <li>
                   1163: the reference constructor and its variant, the inclusion.
1.19      cvs      1164: </li>
1.18      cvs      1165: </ul>
                   1166: <p>
1.1       cvs      1167: These constructors are also sufficient for objects.  Thus, these constructors
                   1168: provide a homogenous meta-model which can describe both the organization of
                   1169: the document as a whole and that of the various types of objects which it
                   1170: contains.  After presenting the description language for generic structures,
                   1171: we will present several examples which illustrate the appropriateness of the
1.18      cvs      1172: model.</p>
                   1173: <p>
1.1       cvs      1174: The first three constructors (aggregate, list and choice) lead to tree-like
                   1175: structures for documents and objects, the objects being simply the subtrees of
                   1176: the tree of a document (or even of other objects' subtrees).  The reference
                   1177: constructor introduces other, non-hierarchical, relations which augment those
                   1178: of the tree: when a paragraph makes reference to a chapter or a section, that
                   1179: relation leaves the purely tree-like structure.  Moreover,  external reference
                   1180: and inclusion constructors permit the establishment of links between different
1.18      cvs      1181: documents, thus creating a hypertext structure.</p>
                   1182: </div>
                   1183: </div>
1.1       cvs      1184: 
1.18      cvs      1185: <div class="subsection">
1.1       cvs      1186: 
1.18      cvs      1187: <h3><a name="sectc314">Associated Elements</a></h3>
                   1188: <p>
1.1       cvs      1189: Thanks to the list, aggregate and choice constructors, the organization of the
                   1190: document is specified rigorously, using constructed and primitive elements.
                   1191: But a document is made up of more than just its elements; it clearly also
                   1192: contains links between them.  There exist elements whose position in the
                   1193: document's structure is not determinable.  This is notably the case for
                   1194: figures and notes.  A figure can be designated at many points in the same
                   1195: document and its place in the physical document can vary over the life of the
                   1196: document without any effect on the meaning or clarity of the document.  At one
                   1197: time, it can be placed at the end of the document along with all other
                   1198: figures.  At another time, it can appear at the top of the page which follows
                   1199: the first mention of the figure.  The figures can be dispersed throughout the
                   1200: document or can be grouped together.  The situation is similar for notes,
                   1201: which can be printed at the bottom of the page on which they are mentioned or
                   1202: assembled together at the end of the chapter or even the end of the work.  Of
                   1203: course, this brings up questions of the physical position of elements in
                   1204: documents that are broken into pages, but this reflects the structural
                   1205: instability of these elements.  They cannot be treated the same way as
                   1206: elements like paragraphs or sections, whose position in the structure is
1.18      cvs      1207: directly linked to the semantics of the document.</p>
                   1208: <p>
1.1       cvs      1209: Those elements whose position in the structure of the document is not fixed,
                   1210: even though they are definitely part of the document, are called
1.18      cvs      1211: <em>associated elements</em>.  Associated elements are themselves structures,
1.1       cvs      1212: which is to say that their content can be organized logically by the
1.18      cvs      1213: constructors from primitive and constructed elements.</p>
                   1214: <p>
1.1       cvs      1215: It can happen that the associated elements are totally disconnected from the
                   1216: structure of the document, as in a commentary or appraisal of the entire work.
                   1217: But more often, the associated elements are linked to the content of the
                   1218: document by references.  This is generally the case for notes and figures,
1.18      cvs      1219: among others.</p>
                   1220: <p>
1.1       cvs      1221: Thus, associated elements introduce a new use for the reference constructor.
                   1222: It not only serves to create links between elements of the principal structure
                   1223: of the document, but also serves to link the associated elements to the
1.18      cvs      1224: primary structure.</p>
                   1225: </div>
1.1       cvs      1226: 
1.18      cvs      1227: <div class="subsection">
1.1       cvs      1228: 
1.18      cvs      1229: <h3><a name="sectc315">Attributes</a></h3>
                   1230: <p>
1.1       cvs      1231: There remain logical aspects of documents that are not entirely described by
                   1232: the structure.  Certain types of semantic information, which are not stated
                   1233: explicitly in the text, must also be taken into account.  In particular, such
                   1234: information is shown by typographic effects which do not correspond to a
                   1235: change between structural elements.  In fact, certain titles are set in bold
                   1236: or italic or are printed in a different typeface from the rest of the text in
                   1237: order to mark them as structurally distinct.  But these same effects
                   1238: frequently appear in the middle of continuous text (e.g. in the interior of a
                   1239: paragraph).  In this case, there is no change between structural elements; the
                   1240: effect serves to highlight a word, expression, or phrase.  The notion of an
1.18      cvs      1241: <em>attribute</em> is used to express this type of information.</p>
                   1242: <p>
1.1       cvs      1243: An attribute is a piece of information attached to a structural element which
                   1244: augments the type of the element and clarifies its function in the document.
                   1245: Keywords, foreign language words, and titles of other works can all be
                   1246: represented by character strings with attached attributes.  Attributes may
                   1247: also be attached to constructed elements.  Thus, an attribute indicating the
                   1248: language can be attached to a single word or to a large part of a
1.18      cvs      1249: document.</p>
                   1250: <p>
1.1       cvs      1251: In fact, an attribute can be any piece of information which is linked to a
                   1252: part of a document and which can be used by agents which work on the document.
                   1253: For example, the language in which the document is written determines the set
                   1254: of characters used by an editor or formatter.  It also determines the
                   1255: algorithm or hyphenation dictionary to be used.  The attribute ``keyword''
                   1256: facilitates the work of an information retrieval system.  The attribute
                   1257: ``index word'' allows a formatter to automatically construct an index at the
1.18      cvs      1258: end of the document.</p>
                   1259: <p>
1.1       cvs      1260: As with the types of constructed elements, the attributes and the values they
                   1261: can take are defined separately in each generic logical structure, not in the
                   1262: meta-model, according to the needs of the document class or the nature of the
1.18      cvs      1263: object.</p>
                   1264: <p>
1.1       cvs      1265: Many types of attributes are offered: numeric, textual, references, and
1.18      cvs      1266: enumerations:</p>
                   1267: <ul>
                   1268: <li>
                   1269: <em>Numeric attributes</em> can take integer values (negative, positive, or
                   1270: null).
1.19      cvs      1271: </li>
1.18      cvs      1272: <li>
                   1273: <em>Textual attributes</em> have as their values character strings.
1.19      cvs      1274: </li>
1.18      cvs      1275: <li>
                   1276: <em>Reference attributes</em> designate an element of the logical structure.
1.19      cvs      1277: </li>
1.18      cvs      1278: <li>
                   1279: <em>Enumeration attributes</em> can take one value from a limited list of
1.1       cvs      1280: possible values, each value being a name.
1.19      cvs      1281: </li>
1.18      cvs      1282: </ul>
                   1283: <p>
                   1284: In a generic structure, there is a distinction between <em>global
                   1285: attributes</em> and <em>local attributes</em>.  A global attribute can be
1.1       cvs      1286: applied to every element type defined in the generic structure where it is
                   1287: specified.  In contrast, a local attribute can only be applied to certain
                   1288: types of elements, even only a single type.  The ``language'' attribute
                   1289: presented above is an example of a global attribute.  An example of a local
                   1290: attribute is the rank of an author (principal author of the document or
                   1291: secondary author): this attribute can only be applied sensibly to an element
1.18      cvs      1292: of the ``author'' type.</p>
                   1293: <p>
1.1       cvs      1294: Attributes can be assigned to the elements which make up the document in many
                   1295: different ways.  The author can freely and dynamically place them on any part
1.18      cvs      1296: of the document in order to attach supplementary information of his/her
                   1297: choice. However, attributes may only be assigned in accordance with the rules
                   1298: of the generic structure; in particular, local attributes can only be assigned
                   1299: to those element types for which they are defined.</p>
                   1300: <p>
1.1       cvs      1301: In the generic structure, certain local attributes can be made mandatory for
1.2       cvs      1302: certain element types.  In this case, Thot automatically associates the
                   1303: attribute with the elements of this type and it requires the user to provide a
1.18      cvs      1304: value for this attribute.</p>
                   1305: <p>
1.1       cvs      1306: Attributes can also be automatically assigned, with a given value, by every
                   1307: application processing the document in order to systematically add a piece of
                   1308: information to certain predefined elements of the document.  By way of
                   1309: example, in a report containing a French abstract and an English abstract,
                   1310: each of the two abstracts is defined as a sequence of paragraphs.  The first
                   1311: abstract has a value of ``French'' for the ``language'' attribute while the
1.18      cvs      1312: second abstract's ``language'' attribute has a value of ``English''.</p>
                   1313: <p>
1.1       cvs      1314: In the case of mark pairs, attributes are logically associated with the pair
1.18      cvs      1315: as a whole, but are actually attached to the first mark.</p>
                   1316: </div>
1.1       cvs      1317: 
1.18      cvs      1318: <div class="subsection">
1.1       cvs      1319: 
1.18      cvs      1320: <h3><a name="sectc316">Discussion of the model</a></h3>
                   1321: <p>
1.1       cvs      1322: The notions of attribute, constructor, structured element, and associated
                   1323: element are used in the definition of generic logical structures of documents
                   1324: and objects.  The problem is to assemble them to form generic structures.  In
                   1325: fact, many types of elements and attributes can be found in a variety of
                   1326: generic structures.  Rather than redefine them for each structure in which
                   1327: they appear, it is best to share them between structures. The object classes
                   1328: already fill this sharing function.  If a mathematical class is defined, its
                   1329: formulas can be used in many different document classes, without redefining
                   1330: the structure of each class.  This problem arises not only for the objects
                   1331: considered here; it also arises for the commonplace textual elements found in
                   1332: many document classes.  This is the reason why the notion of object is so
                   1333: broad and why paragraphs and enumerations are also considered to be objects.
                   1334: These object classes not only permit the sharing of the structures of
1.18      cvs      1335: elements, but also of the attributes defined in the generic structures.</p>
                   1336: <p>
1.1       cvs      1337: Structure, such as that presented here, can appear very rigid, and it is
                   1338: possible to imagine that a document editing system based on this model could
                   1339: prove very constraining to the user.  This is, in fact, a common criticism of
                   1340: syntax-directed editors.  This defect can be avoided with Thot, primarily for
1.18      cvs      1341: three reasons:</p>
                   1342: <ul>
                   1343: <li>
                   1344: the generic structures are not fixed in the model itself,
1.19      cvs      1345: </li>
1.18      cvs      1346: <li>
                   1347: the model takes the dynamics of documents into account,
1.19      cvs      1348: </li>
1.18      cvs      1349: <li>
                   1350: the constructors offer great flexibility.
1.19      cvs      1351: </li>
1.18      cvs      1352: </ul>
                   1353: <p>
1.1       cvs      1354: When the generic structure of a document is not predefined, but rather is
                   1355: constructed specifically for each document class, it can be carefully adapted
                   1356: to the current needs.  In cases where the generic structure is inadequate for
                   1357: a particular document of the class, it is always possible either to create a
                   1358: new class with a generic structure well suited to the new case or to extend
                   1359: the generic structure of the existing class to take into account the specifics
                   1360: of the document which poses the problem.  These two solutions can also be
1.18      cvs      1361: applied to objects whose structures prove to be poorly designed.</p>
                   1362: <p>
1.1       cvs      1363: The model is sufficiently flexible to take into account all the phases of the
                   1364: life of the document.  When a generic structure specifies that a report must
                   1365: contain a title, an abstract, an introduction, at least two chapters, and a
1.18      cvs      1366: conclusion, this means only that a report, <em>upon completion</em>, will have
1.1       cvs      1367: to contain all of these elements.  When the author begins writing, none of
1.2       cvs      1368: these elements is present.  Thot uses this model.  Therefore, it tolerates
                   1369: documents which do not conform strictly to the generic structure of their
                   1370: class;  it also considers the generic logical structure to be a way of helping
1.18      cvs      1371: the user in the construction of a complex document.</p>
                   1372: <p>
1.1       cvs      1373: In contrast, other applications may reject a document which does not conform
                   1374: strictly to its generic structure.  This is, for example, what is done by
                   1375: compilers which refuse to generate code for a program which is not
                   1376: syntactically correct.  This might also occur when using a document
1.18      cvs      1377: application for a report which does not have an abstract or title.</p>
                   1378: <p>
1.1       cvs      1379: The constructors of the document model bring a great flexibility to the
                   1380: generic structures.  A choice constructor (and even more, a unit or schema
                   1381: constructor)  can represent several, very different elements. The list
                   1382: constructor permits the addition of more elements of the same type.  Used
                   1383: together, these two constructors permit any series of elements of different
                   1384: types.  Of course, this flexibility can be reduced wherever necessary since a
                   1385: generic structure can limit the choices or the number of elements in a
1.18      cvs      1386: list.</p>
                   1387: <p>
1.1       cvs      1388: Another difficulty linked to the use of structure in the document model
                   1389: resides in the choice of the level of the structure.  The structure of a
                   1390: discussion could be extracted from the text itself via linguistic analysis.
                   1391: Some studies are exploring this approach, but the model of Thot excludes this
                   1392: type of structure.  It only takes into account the logical structure provided
1.18      cvs      1393: explicitly by the author.</p>
                   1394: <p>
1.1       cvs      1395: However, the level of structure of the model is not imposed.  Each generic
                   1396: structure defines its own level of structure, adapted to the document class or
                   1397: object and to the ways in which it will be processed.  If it will only be
                   1398: edited and printed, a  relatively simple structure suffices.  If more
                   1399: specialized processing will be applied to it, the structure must represent the
                   1400: element types on which this processing must act.  By way of example, a simple
                   1401: structure is sufficient for printing formulas, but a more complex structure is
                   1402: required to perform symbolic or numeric calculations on the mathematical
1.18      cvs      1403: expressions.  The document model of Thot allows both types of structure.</p>
                   1404: </div>
                   1405: </div>
1.1       cvs      1406: 
1.18      cvs      1407: <div class="section">
1.1       cvs      1408: 
1.18      cvs      1409: <h2><a name="sectb32">The definition language for generic structures</a></h2>
                   1410: <p>
1.1       cvs      1411: Generic structures, which form the basis of the document model of Thot, are
                   1412: specified using a special language.  This definition language, called S, is
1.18      cvs      1413: described in this section.</p>
                   1414: <p>
1.1       cvs      1415: Each generic structure, which defines a class of documents or objects, is
1.2       cvs      1416: specified by a file, written in the S language, which is called a
1.18      cvs      1417: <em>structure schema</em>.  Structure schemas are compiled into tables, called
                   1418: structure tables, which are used by Thot and which determine its behavior.</p>
1.1       cvs      1419: 
1.18      cvs      1420: <div class="subsection">
1.1       cvs      1421: 
1.18      cvs      1422: <h3><a name="sectc321">Writing Conventions</a></h3>
                   1423: <p>
1.1       cvs      1424: The grammar of S, like those of the languages P and T presented later, is
                   1425: described using the meta-language M, derived from the Backus-Naur Form
1.18      cvs      1426: (BNF).</p>
                   1427: <p>
1.1       cvs      1428: In this meta-language each rule of the grammar is composed of a grammar symbol
                   1429: followed by an equals sign (`=') and the right part of the rule.  The equals
                   1430: sign plays the same role as the traditional `::=' of BNF: it indicates that
1.18      cvs      1431: the right part defines the symbol of the left part.  In the right part,</p>
                   1432: <dl>
                   1433: <dt>concatenation</dt>
                   1434: <dd>
                   1435: is shown by the juxtaposition of symbols;
                   1436: </dd>
                   1437: <dt>character strings</dt>
                   1438: <dd>
                   1439: between apostrophes ' represent terminal symbols, that is, keywords in the
1.2       cvs      1440: language defined.  Keywords are written here in upper-case letters, but can be
                   1441: written in any combination of upper and lower-case letters.  For example, the
1.18      cvs      1442: keyword <tt>DEFPRES</tt> of S can also be written as <tt>defpres</tt> or
                   1443: <tt>DefPres</tt>.
                   1444: </dd>
                   1445: <dt>material between brackets</dt>
                   1446: <dd>
                   1447: (`[' and `]') is optional;
                   1448: </dd>
                   1449: <dt>material between angle brackets</dt>
                   1450: <dd>
                   1451: (`&lt;' and `>') can be repeated many times or omitted;
                   1452: </dd>
                   1453: <dt>the slash</dt>
                   1454: <dd>
                   1455: (`/') indicates an alternative, a choice between the options separated by the
                   1456: slash character;
                   1457: </dd>
                   1458: <dt>the period</dt>
                   1459: <dd>
                   1460: marks the end of a rule;
                   1461: </dd>
                   1462: <dt>text between braces</dt>
                   1463: <dd>
                   1464: (`{' and `}') is simply a comment.
                   1465: </dd>
                   1466: </dl>
                   1467: <p>
1.1       cvs      1468: The M meta-language also uses the concepts of identifiers, strings, and
1.18      cvs      1469: integers:</p>
                   1470: <dl>
                   1471: <dt><tt>NAME</tt></dt>
                   1472: <dd>
                   1473: represents an identifier, a sequence of letters (upper or lower-case), digits,
                   1474: and underline characters (`_'), beginning with a letter.  Also considered a
                   1475: letter is the sequence of characters `<tt>\nnn</tt>' where the letter
                   1476: <tt>n</tt> represents the ISO Latin-1 code of the letter in octal.  It is thus
                   1477: possible to use accented letters in identifiers.  The maximum length of
                   1478: identifiers is fixed by the compiler.  It is normally 31 characters.
                   1479: <p>
1.1       cvs      1480: Unlike keywords, upper and lower-case letters are distinct in identifiers.
1.18      cvs      1481: Thus, <tt>Title</tt>, <tt>TITLE</tt>, and <tt>title</tt> are considered
                   1482: different identifiers.</p>
                   1483: </dd>
                   1484: <dt><tt>STRING</tt></dt>
                   1485: <dd>
                   1486: represents a string.  This is a string of characters delimited by apostrophes.
                   1487: If an apostrophe must appear in a string, it is doubled.  As with identifiers,
                   1488: strings can contain characters represented by their octal code (after a
                   1489: backslash).  As with apostrophes, if a backslash must appear in a string, it
                   1490: is doubled.
                   1491: </dd>
                   1492: <dt><tt>NUMBER</tt></dt>
                   1493: <dd>
                   1494: represents a positive integer or zero (without a sign), or said another way, a
                   1495: sequence of decimal digits.
                   1496: </dd>
                   1497: </dl>
                   1498: <p>
                   1499: The M language can be used to define itself as follows:</p>
                   1500: <pre>{ Any text between braces is a comment. }
1.1       cvs      1501: Grammar      = Rule &lt; Rule > 'END' .
                   1502:                { The &lt; and > signs indicate zero }
                   1503:                { or more repetitions. }
                   1504:                { END marks the end of the grammar. }
                   1505: Rule         = Ident '=' RightPart '.' .
                   1506:                { The period indicates the end of a rule }
                   1507: RightPart    = RtTerminal / RtIntermed .
                   1508:                { The slash indicates a choice }
                   1509: RtTerminal   ='NAME' / 'STRING' / 'NUMBER' .
                   1510:                { Right part of a terminal rule }
                   1511: RtIntermed   = Possibility &lt; '/' Possibility > .
                   1512:                { Right part of an intermediate rule }
                   1513: Possibility  = ElemOpt &lt; ElemOpt > .
                   1514: ElemOpt      = Element / '[' Element &lt; Element > ']' /
                   1515:               '&lt;' Element &lt; Element > '>'  .
                   1516:                { Brackets delimit optional parts }
                   1517: Element      = Ident / KeyWord .
                   1518: Ident        = NAME .
                   1519:                { Identifier, sequence of characters }
                   1520: KeyWord      = STRING .
                   1521:                { Character string delimited by apostrophes }
1.18      cvs      1522: END</pre>
                   1523: </div>
1.1       cvs      1524: 
1.18      cvs      1525: <div class="subsection">
1.1       cvs      1526: 
1.18      cvs      1527: <h3><a name="sectc322">Extension schemas</a></h3>
                   1528: <p>
1.1       cvs      1529: A structure schema defines the generic logical structure of a class of
                   1530: documents or objects, independent of the operations which can be performed on
                   1531: the documents.  However, certain applications may require particular
                   1532: information to be represented by the structure for the documents that they
                   1533: operate on.  Thus a document version manager will need to indicate in the
                   1534: document the parts which belong to one version or another.  An indexing system
                   1535: will add highly-structured index tables as well as the links between these
1.18      cvs      1536: tables and the rest of the document.</p>
                   1537: <p>
1.2       cvs      1538: Thus, many applications need to extend the generic structure of the documents
                   1539: on which they operate to introduce new attributes, associated elements or
1.1       cvs      1540: element types.  These additions are specific to each application and must be
                   1541: able to be applied to any generic structure: users will want to manage
                   1542: versions or construct indices for many types of documents.  Extension schemas
                   1543: fulfill this role: they define attributes, elements, associated elements,
                   1544: units, etc., but they can only be used jointly with a structure schema that
                   1545: they complete. Otherwise, structure schemas can always be used without these
1.18      cvs      1546: extensions when the corresponding applications are not available.</p>
                   1547: </div>
1.1       cvs      1548: 
1.18      cvs      1549: <div class="subsection">
1.1       cvs      1550: 
1.18      cvs      1551: <h3><a name="sectc323">The general organization of structure schemas</a></h3>
                   1552: <p>
                   1553: Every structure schema begins with the keyword <tt>STRUCTURE</tt> and ends
                   1554: with the keyword <tt>END</tt>.  The keyword <tt>STRUCTURE</tt> is followed by
                   1555: the keyword <tt>EXTENSION</tt> in the case where the schema defines an
1.1       cvs      1556: extension, then by the name of the generic structure which the schema defines
                   1557: (the name of the document or object class).  The name of the structure is
1.18      cvs      1558: followed by a semicolon.</p>
                   1559: <p>
1.1       cvs      1560: In the case of a complete schema (that is, a schema which is not an
                   1561: extension), the definition of the name of the structure is followed by the
                   1562: declarations of the default presentation schema, the global attributes, the
                   1563: parameters, the structure rules, the associated elements, the units, the
                   1564: skeleton elements and the exceptions.  Only the definition of the structure
                   1565: rules is required.  Each series of declarations begins with a keyword:
1.18      cvs      1566: <tt>DEFPRES</tt>, <tt>ATTR</tt>, <tt>PARAM</tt>, <tt>STRUCT</tt>,
                   1567: <tt>ASSOC</tt>, <tt>UNITS</tt>, <tt>EXPORT</tt>, <tt>EXCEPT</tt>.</p>
                   1568: <p>
1.1       cvs      1569: In the case of an extension schema, there are neither parameters nor skeleton
1.18      cvs      1570: elements and the <tt>STRUCT</tt> section is optional, while that section is
1.1       cvs      1571: required in a schema that is not an extension.  On the other hand, extension
1.18      cvs      1572: schemas can contain an <tt>EXTENS</tt> section, which must not appear in a
1.1       cvs      1573: schema which is not an extension; this section defines the complements to
                   1574: attach to the rules found in the schema to which the extension will be added.
1.18      cvs      1575: The sections <tt>ATTR</tt>, <tt>STRUCT</tt>, <tt>ASSOC</tt>, and
                   1576: <tt>UNITS</tt> define new attributes, new elements, new associated elements,
                   1577: and new units which add their definitions to the principal schema.</p>
                   1578: <pre>     StructSchema ='STRUCTURE' ElemID ';'
1.1       cvs      1579:                    'DEFPRES' PresID ';'
                   1580:                  [ 'ATTR' AttrSeq ]
                   1581:                  [ 'PARAM' RulesSeq ]
                   1582:                    'STRUCT' RulesSeq
                   1583:                  [ 'ASSOC' RulesSeq ]
                   1584:                  [ 'UNITS' RulesSeq ]
                   1585:                  [ 'EXPORT' SkeletonSeq ]
                   1586:                  [ 'EXCEPT' ExceptSeq ]
                   1587:                    'END' .
1.18      cvs      1588:      ElemID       = NAME .</pre>
                   1589: <p>
                   1590: or</p>
                   1591: <pre>     ExtensSchema ='STRUCTURE' 'EXTENSION' ElemID ';'
1.1       cvs      1592:                    'DEFPRES' PresID ';'
                   1593:                  [ 'ATTR' AttrSeq ]
                   1594:                  [ 'STRUCT' RulesSeq ]
                   1595:                  [ 'EXTENS' ExtensRuleSeq ]
                   1596:                  [ 'ASSOC' RulesSeq ]
                   1597:                  [ 'UNITS' RulesSeq ]
                   1598:                  [ 'EXCEPT' ExceptSeq ]
                   1599:                    'END' .
1.18      cvs      1600:      ElemID       = NAME .</pre>
                   1601: </div>
1.1       cvs      1602: 
1.18      cvs      1603: <div class="subsection">
1.1       cvs      1604: 
1.18      cvs      1605: <h3><a name="sectc324">The default presentation</a></h3>
                   1606: <p>
                   1607: It was shown <a href="#mulpres">above</a> that many different presentations
1.1       cvs      1608: are possible for documents and objects of the same class.  The structure
1.18      cvs      1609: schema defines a preferred presentation for the class, called the <em>default
                   1610: presentation</em>.  Like generic structures, presentations are described by
                   1611: programs, called <em>presentation schemas</em>, which are written in a
                   1612: specific language, P, presented <a href="#sectb42">later</a> in this document.
                   1613: The name appearing after the keyword <tt>DEFPRES</tt> is the name of the
1.2       cvs      1614: default presentation schema.  When a new document is created, Thot will use
                   1615: this presentation schema by default, but the user remains free to choose
1.18      cvs      1616: another if s/he wishes.</p>
                   1617: <pre>     PresID = NAME .</pre>
                   1618: </div>
1.1       cvs      1619: 
1.18      cvs      1620: <div class="subsection">
1.1       cvs      1621: 
1.18      cvs      1622: <h3><a name="sectc325">Global Attributes</a></h3>
                   1623: <p>
1.1       cvs      1624: If the generic structure includes global attributes of its own, they are
1.18      cvs      1625: declared after the keyword <tt>ATTR</tt>.  Each global attribute is defined by
1.1       cvs      1626: its name, followed by an equals sign and the definition of its type.  The
1.18      cvs      1627: declaration of a global attribute is terminated by a semi-colon.</p>
                   1628: <p>
1.1       cvs      1629: For attributes of the numeric, textual, or reference types, the type is
1.18      cvs      1630: indicated by a keyword, <tt>INTEGER</tt>, <tt>TEXT</tt>, or <tt>REFERENCE</tt>
                   1631: respectively.</p>
                   1632: <p>
                   1633: In the case of a reference attribute, the keyword <tt>REFERENCE</tt> is
1.1       cvs      1634: followed by the type of the referenced element in parentheses.  It can refer
1.18      cvs      1635: to any type at all, specified by using the keyword <tt>ANY</tt>, or to a
1.1       cvs      1636: specific type.  In the latter case, the element type designated by the
1.18      cvs      1637: reference can be defined either in the <a href="#sectc327"><tt>STRUCT</tt>
                   1638: section</a> of the same structure schema or in the <tt>STRUCT</tt> section of
1.1       cvs      1639: another structure schema.  When the type is defined in another schema, the
                   1640: element type is followed by the name of the structure schema (within
                   1641: parentheses) in which it is defined.  The name of the designated element type
1.18      cvs      1642: can be preceded by the keyword <tt>First</tt> or <tt>Second</tt>, but only in
                   1643: the case where the type is defined as <a href="#sectd3285">a pair</a>.  These
1.1       cvs      1644: keywords indicate whether the attribute must designate the first mark of the
                   1645: pair or the second.  If the reference refers to a pair and neither of these
1.18      cvs      1646: two keywords is present, then the first mark is used.</p>
                   1647: <p>
1.1       cvs      1648: In the case of an enumeration attribute, the equals sign is followed by the
                   1649: list of names representing the possible values of the attribute, the names
                   1650: being separated from each other by commas.  An enumeration attribute has at
                   1651: least one possible value; the maximum number of values is defined by the
1.18      cvs      1652: compiler for the S language.</p>
                   1653: <pre>     AttrSeq   = Attribute &lt; Attribute > .
1.1       cvs      1654:      Attribute = AttrID '=' AttrType  ';' .
                   1655:      AttrType  = 'INTEGER' / 'TEXT' /
                   1656:                  'REFERENCE' '(' RefType ')' /
                   1657:                  ValueSeq .
                   1658:      RefType   = 'ANY' / [ FirstSec ] ElemID [ ExtStruct ] .
                   1659:      FirstSec  = 'First' / 'Second' .
                   1660:      ExtStruct = '(' ElemID ')' .
                   1661:      ValueSeq  = AttrVal &lt; ',' AttrVal > .
                   1662:      AttrID    = NAME .
1.18      cvs      1663:      AttrVal   = NAME .</pre>
                   1664: <p>
                   1665: There is a predefined global text attribute, the <em>language</em>, which is
1.2       cvs      1666: automatically added to every Thot structure schema.  This attribute allows
                   1667: Thot to perform certain actions, such as hyphenation and spell-checking, which
                   1668: cannot be performed without knowing the language in which each part of the
                   1669: document is written.  This attribute can be used just like any explicitly
1.18      cvs      1670: declared attribute: the system acts as if every structure schema contains</p>
                   1671: <pre>ATTR
                   1672:    Language = TEXT;</pre>
                   1673: <blockquote class="example">
                   1674: <p>
                   1675: <strong>Example:</strong></p>
                   1676: <p>
1.2       cvs      1677: The following specification defines the global enumeration attribute
1.18      cvs      1678: WordType.</p>
                   1679: <pre>ATTR
                   1680:    WordType = Definition, IndexWord, DocumentTitle;</pre>
                   1681: </blockquote>
                   1682: </div>
1.1       cvs      1683: 
1.18      cvs      1684: <div class="subsection">
1.1       cvs      1685: 
1.18      cvs      1686: <h3><a name="sectc326">Parameters</a></h3>
                   1687: <p>
1.1       cvs      1688: A parameter is a document element which can appear many times in the document,
                   1689: but always has the same value.  This value can only be modified in a
                   1690: controlled way by certain applications.  For example, in an advertising
                   1691: circular, the name of the recipient may appear in the address part and in the
                   1692: text of the circular.  If the recipient's name were a parameter, it might only
1.18      cvs      1693: be able to be changed by a ``mail-merge'' application.</p>
                   1694: <p>
1.1       cvs      1695: Parameters are not needed for every document class, but if the schema includes
1.18      cvs      1696: parameters they are declared after the keyword <tt>PARAM</tt>. Each parameter
                   1697: declaration is made in the same way as a <a href="#sectc327">structure element
                   1698: declaration</a>.</p>
                   1699: <p>
1.1       cvs      1700: During editing, Thot permits the insertion of parameters wherever the
                   1701: structure schema allows; it also permits the removal of parameters which are
                   1702: already in the document but does not allow the modification of the parameter's
1.2       cvs      1703: content in any way.  The content is generated automatically by Thot during the
                   1704: creation of the parameter, based on the value of the parameter in the
1.18      cvs      1705: document.</p>
                   1706: </div>
1.1       cvs      1707: 
1.18      cvs      1708: <div class="subsection">
1.1       cvs      1709: 
1.18      cvs      1710: <h3><a name="sectc327">Structured elements</a></h3>
                   1711: <p>
1.1       cvs      1712: The rules for defining structured elements are required, except in an
                   1713: extension schema: they constitute the core of a structure schema, since they
                   1714: define the structure of the different types of elements that occur in a
1.18      cvs      1715: document or object of the class defined by the schema.</p>
                   1716: <p>
                   1717: The first structure rule after the keyword <tt>STRUCT</tt> must define the
1.1       cvs      1718: structure of the class whose name appears in the first instruction
1.18      cvs      1719: (<tt>STRUCTURE</tt>) of the schema.  This is the root rule of the schema,
                   1720: defining the root of the document tree or object tree.</p>
                   1721: <p>
1.1       cvs      1722: The remaining rules may be placed in any order, since the language permits the
                   1723: definition of element types before or after their use, or even in the same
                   1724: instruction in which they are used.  This last case allows the definition of
1.18      cvs      1725: recursive structures.</p>
                   1726: <p>
1.1       cvs      1727: Each rule is composed of a name (the name of the element type whose structure
1.18      cvs      1728: is being defined) followed by an equals sign and a structure definition.</p>
                   1729: <p>
1.1       cvs      1730: If any local attributes are associated with the element type defined by the
1.2       cvs      1731: rule, they appear between parentheses after the type name and before the
1.18      cvs      1732: equals sign.  The parentheses contain, first, the keyword <tt>ATTR</tt>, then
1.2       cvs      1733: the list of local attributes, separated by commas.  Each local attribute is
                   1734: composed of the name of the attribute followed by an equals sign and the
1.18      cvs      1735: definition of the attribute's type, just as in the definition of <a
                   1736: href="#sectc325">global attributes</a>.  The name of the attribute can be
1.2       cvs      1737: preceded by an exclamation point to indicate that the attribute must always be
                   1738: present for this element type.  The same attribute, identified by its name,
                   1739: can be defined  as a local attribute for multiple element types.  In this
                   1740: case, the equals sign and definition of the attribute type need only appear in
                   1741: the first occurrence of the attribute.  It should be noted that global
1.18      cvs      1742: attributes cannot also be defined as local attributes.</p>
                   1743: <p>
                   1744: If any <a href="#sectd3135">extensions</a> are defined for this element type,
                   1745: a plus sign follows the structure definition and the names of the extension
                   1746: element types appear between parentheses after the plus.  If there are
                   1747: multiple extensions, they are separated by commas.  These types can either be
                   1748: defined in the same schema, defined in other schemas, or they may be base
                   1749: types identified by the keywords <tt>TEXT</tt>, <tt>GRAPHICS</tt>,
                   1750: <tt>SYMBOL</tt>, or <tt>PICTURE</tt>.</p>
                   1751: <p>
                   1752: <a href="#sectd3135">Restrictions</a> are indicated in the same manner as
                   1753: extensions, but they are introduced by a minus sign and they come after the
                   1754: extensions, or if there are no extensions, after the structure definition.</p>
                   1755: <p>
1.1       cvs      1756: If the values of attributes must be attached systematically to this element
1.18      cvs      1757: type, they are introduced by the keyword <tt>WITH</tt> and declared in the
1.1       cvs      1758: form of a list of fixed-value attributes.  When such definitions of fixed
1.18      cvs      1759: attribute values appear, they are always the last part of the rule.</p>
                   1760: <p>
                   1761: The rule is terminated by a semicolon.</p>
                   1762: <pre>  RuleSeq       = Rule &lt; Rule > .
1.1       cvs      1763:   Rule          = ElemID [ LocAttrSeq ] '=' DefWithAttr ';'.
                   1764:   LocAttrSeq    = '(' 'ATTR' LocAttr &lt; ';' LocAttr > ')' .
                   1765:   LocAttr       = [ '!' ] AttrID [ '=' AttrType ] .
                   1766:   DefWithAttr   = Definition
                   1767:                   [ '+' '(' ExtensionSeq ')' ]
                   1768:                   [ '-' '(' RestrictSeq ')' ]
                   1769:                   [ 'WITH' FixedAttrSeq ] .
                   1770:   ExtensionSeq  = ExtensionElem &lt; ',' ExtensionElem > .
                   1771:   ExtensionElem = ElemID / 'TEXT' / 'GRAPHICS' /
                   1772:                   'SYMBOL' / 'PICTURE' .
                   1773:   RestrictSeq   = RestrictElem &lt; ',' RestrictElem > .
                   1774:   RestrictElem  = ElemID / 'TEXT' / 'GRAPHICS' /
1.18      cvs      1775:                   'SYMBOL' / 'PICTURE' .</pre>
                   1776: <p>
1.1       cvs      1777: The list of fixed-value attributes is composed of a sequence of
                   1778: attribute-value pairs separated by commas.  Each pair contains the name of the
                   1779: attribute and the fixed value for this element type, the two being separated
                   1780: by an equals sign.  If the sign is preceded by a question mark the given value
                   1781: is only an initial value that may be modified later rather than a value fixed
                   1782: for all time.  Reference attributes are an exception to this norm.  They
                   1783: cannot be assigned a fixed value, but when the name of such an attribute
                   1784: appears this indicates that this element type must have a valid value for the
1.2       cvs      1785: attribute.  For the other attribute types, the fixed value is indicated by a
1.1       cvs      1786: signed integer (numeric attributes), a character string between apostrophes
1.18      cvs      1787: (textual attributes) or the name of a value (enumeration attributes).</p>
                   1788: <p>
                   1789: Fixed-value attributes can either be <a href="#sectc325">global</a> or local
1.1       cvs      1790: to the element type for which they are fixed, but they must be declared before
1.18      cvs      1791: they are used.</p>
                   1792: <pre>    FixedAttrSeq    = FixedAttr &lt; ',' FixedAttr > .
1.1       cvs      1793:     FixedAttr       = AttrID [ FixedOrModifVal ] .
                   1794:     FixedOrModifVal = [ '?' ] '=' FixedValue .
                   1795:     FixedValue      = [ '-' ] NumValue / TextVal / AttrVal .
                   1796:     NumValue        = NUMBER .
1.18      cvs      1797:     TextVal         = STRING .</pre>
                   1798: </div>
1.1       cvs      1799: 
1.18      cvs      1800: <div class="subsection">
1.1       cvs      1801: 
1.18      cvs      1802: <h3><a name="sectc328">Structure definitions</a></h3>
                   1803: <p>
1.1       cvs      1804: The structure of an element type can be a simple base type or a constructed
1.18      cvs      1805: type.</p>
                   1806: <p>
1.1       cvs      1807: For constructed types, it is frequently the case that similar structures
                   1808: appear in many places in a document.  For example the contents of the
                   1809: abstract, of the introduction, and of a section can have the same structure,
                   1810: that of a sequence of paragraphs.  In this case, a single, common structure
                   1811: can be defined (the paragraph sequence in this example), and the schema is
                   1812: written to indicate that each element type possesses this structure, as
1.18      cvs      1813: follows:</p>
                   1814: <pre>     Abstract           = Paragraph_sequence;
1.1       cvs      1815:      Introduction       = Paragraph_sequence;
1.18      cvs      1816:      Section_contents   = Paragraph_sequence;</pre>
                   1817: <p>
                   1818: The equals sign means ``has the same structure as''.</p>
                   1819: <p>
1.1       cvs      1820: If the element type defined is a simple base type, this is indicated by one of
1.18      cvs      1821: the keywords <tt>TEXT</tt>, <tt>GRAPHICS</tt>, <tt>SYMBOL</tt>, or
                   1822: <tt>PICTURE</tt>.  If some local attributes must be associated with a base
1.1       cvs      1823: type, the keyword of the base type is followed by the declaration of the local
1.18      cvs      1824: attributes using the syntax <a href="#sectc327">presented above.</a></p>
                   1825: <p>
1.1       cvs      1826: In the case of an open choice, the type is indicated by the keyword
1.18      cvs      1827: <tt>UNIT</tt> for units or the keyword <tt>NATURE</tt> for objects having a
                   1828: structure defined by any other schema.</p>
                   1829: <p>
                   1830: A unit represents one of the two following categories:</p>
                   1831: <ul>
                   1832: <li>
                   1833: a base type: text, graphical element, symbol, picture,
1.19      cvs      1834: </li>
1.18      cvs      1835: <li>
                   1836: an element whose type is chosen from among the types defined as units in the
                   1837: <tt>UNITS</tt> section of the document's structure schema.  It can also be
                   1838: chosen from among the types defined as <a href="#sectd3132">units</a> in the
                   1839: <a href="#sectc3212"><tt>UNITS</tt> section</a> of the structure schemas that
1.2       cvs      1840: defines the ancestors of the element to which the rule is applied.
1.19      cvs      1841: </li>
1.18      cvs      1842: </ul>
                   1843: <p>
1.2       cvs      1844: Before the creation of an element defined as a unit, Thot asks the user to
1.18      cvs      1845: choose between the categories of elements.</p>
                   1846: <p>
1.1       cvs      1847: Thus, the contents of a paragraph can be specified as a sequence of units,
                   1848: which will permit the inclusion in the paragraphs of character strings,
                   1849: symbols, and various elements, such as cross-references, if these are defined
1.18      cvs      1850: as units.</p>
                   1851: <p>
                   1852: A schema object (keyword <tt>NATURE</tt>) represents an object defined by a
1.1       cvs      1853: structure schema freely chosen from among the available schemas; in the case
                   1854: the element type is defined by the first rule (the root rule) of the chosen
1.18      cvs      1855: schema.</p>
                   1856: <p>
1.1       cvs      1857: If the element type defined is a constructed type, the list, aggregate,
                   1858: choice, and reference constructors are used.  In this case the definition
                   1859: begins with a keyword identifying the constructor.  This keyword is followed
1.18      cvs      1860: by a syntax specific to each constructor.</p>
                   1861: <p>
1.1       cvs      1862: The local attribute definitions appear after the name of the element type
1.18      cvs      1863: being defined, if this element type has <a href="#sectc327">local
                   1864: attributes</a>.</p>
                   1865: <pre>   Definition = BaseType [ LocAttrSeq ] / Constr / Element .
1.1       cvs      1866:    BaseType   = 'TEXT' / 'GRAPHICS' / 'SYMBOL' / 'PICTURE' /
                   1867:                 'UNIT' / 'NATURE' .
                   1868:    Element    = ElemID [ ExtOrDef ] .
                   1869:    ExtOrDef   = 'EXTERN' / 'INCLUDED' / 
                   1870:                 [ LocAttrSeq ] '=' Definition .
                   1871:    Constr     = 'LIST' [ '[' min '..' max ']' ] 'OF'
                   1872:                        '(' DefWithAttr ')' /
                   1873:                 'BEGIN' DefOptSeq 'END' /
                   1874:                 'AGGREGATE' DefOptSeq 'END' /
                   1875:                 'CASE' 'OF' DefSeq 'END' /
                   1876:                 'REFERENCE' '(' RefType ')' /
1.18      cvs      1877:                 'PAIR' .</pre>
1.1       cvs      1878: 
1.18      cvs      1879: <div class="subsubsection">
1.1       cvs      1880: 
1.18      cvs      1881: <h4><a name="sectd3281">List</a></h4>
                   1882: <p>
1.1       cvs      1883: The list constructor permits the definition of an element type composed of a
                   1884: list of elements, all of the same type.  A list definition begins with the
1.18      cvs      1885: <tt>LIST</tt> keyword followed by an optional range, the keyword <tt>OF</tt>,
1.1       cvs      1886: and the definition, between parentheses, of the element type which must
                   1887: compose the list.  The optional range is composed of the minimum and maximum
                   1888: number of elements for the list separated by two periods and enclosed by
                   1889: brackets.  If the range is not present, the number of list elements is
                   1890: unconstrained.  When only one of the two bounds of the range is unconstrained,
                   1891: it is represented by a star ('*') character.  Even when both bounds are
1.18      cvs      1892: unconstrained, they can be specified by <tt>[*..*]</tt>, but it is simpler not
                   1893: to specify any bound.</p>
                   1894: <pre>               'LIST' [ '[' min '..' max ']' ]
1.1       cvs      1895:                'OF' '(' DefWithAttr ')'
                   1896:      min     = Integer / '*' .
                   1897:      max     = Integer / '*' .
1.18      cvs      1898:      Integer = NUMBER .</pre>
                   1899: <p>
1.2       cvs      1900: Before the document is edited, Thot creates the minimum number of elements for
                   1901: the list.  If no minimum was given, it creates a single element. If a maximum
                   1902: number of elements is given and that number is attained, the editor refuses to
1.18      cvs      1903: create new elements for the list.</p>
                   1904: <blockquote class="example">
                   1905: <p>
                   1906: <strong>Example:</strong></p>
                   1907: <p>
1.3       cvs      1908: The following two instructions define the body of a document as a sequence of
                   1909: at least two chapters and the contents of a section as a sequence of
1.18      cvs      1910: paragraphs.  A single paragraph can be the entire contents of a section.</p>
                   1911: <pre>Body             = LIST [2..*] OF (Chapter);
                   1912: Section_contents = LIST OF (Paragraph);</pre>
                   1913: </blockquote>
                   1914: </div>
1.1       cvs      1915: 
1.18      cvs      1916: <div class="subsubsection">
1.1       cvs      1917: 
1.18      cvs      1918: <h4><a name="sectd3282">Aggregate</a></h4>
                   1919: <p>
1.1       cvs      1920: The aggregate constructor is used to define an element type as a collection of
                   1921: sub-elements, each having a fixed type.  The collection may be ordered or
                   1922: unordered.  The elements composing the collection are called
1.18      cvs      1923: <em>components</em>.  In the definition of an aggregate, a keyword indicates
                   1924: whether or not the aggregate is ordered: <tt>BEGIN</tt> for an ordered
                   1925: aggregate, <tt>AGGREGATE</tt> for an unordered aggregate. This keyword is
1.1       cvs      1926: followed by the list of component type definitions which is terminated by the
1.18      cvs      1927: <tt>END</tt> keyword.  The component type definitions are separated by
                   1928: commas.</p>
                   1929: <p>
1.1       cvs      1930: Before creating an aggregate, the Thot editor creates all the aggregate's
                   1931: components in the order they appear in the structure schema, even for
                   1932: unordered aggregates.  However, unlike ordered aggregates, the components of
                   1933: an unordered aggregate may be rearranged using operations of the Thot editor.
                   1934: The exceptions to the rule are any components whose name was preceded by a
                   1935: question mark character ('?').  These components, which are optional, can be
                   1936: created by explicit request, possibly at the time the aggregate is created,
1.18      cvs      1937: but they are not created automatically <em>prior</em> to the creation of the
                   1938: aggregate.</p>
                   1939: <pre>                 'BEGIN' DefOptSeq 'END'
1.1       cvs      1940:      DefOptSeq = DefOpt ';' &lt; DefOpt ';' > .
1.18      cvs      1941:      DefOpt    = [ '?' ] DefWithAttr .</pre>
                   1942: <blockquote class="example">
                   1943: <p>
                   1944: <strong>Example:</strong></p>
                   1945: <p>
1.3       cvs      1946: In a bilingual document, each paragraph has an English version and a French
                   1947: version.  In certain cases, the translator wants to add a marginal note, but
                   1948: this note is present in very few paragraphs.  Thus, it must not be created
                   1949: systematically for every paragraph.  A bilingual paragraph of this type is
1.18      cvs      1950: declared:</p>
                   1951: <pre>Bilingual_paragraph = BEGIN
1.1       cvs      1952:                       French_paragraph  = TEXT;
                   1953:                       English_paragraph = TEXT;
                   1954:                       ? Note            = TEXT;
1.18      cvs      1955:                       END;</pre>
                   1956: </blockquote>
                   1957: </div>
1.1       cvs      1958: 
1.18      cvs      1959: <div class="subsubsection">
1.1       cvs      1960: 
1.18      cvs      1961: <h4><a name="sectd3283">Choice</a></h4>
                   1962: <p>
1.1       cvs      1963: The choice constructor permits the definition of an element type which is
1.18      cvs      1964: chosen from among a set of possible types.  The keywords <tt>CASE</tt> and
                   1965: <tt>OF</tt> are followed by a list of definitions of possible types, which are
                   1966: separated by semicolons and terminated by the <tt>END</tt> keyword.</p>
                   1967: <pre>               'CASE' 'OF' DefSeq 'END'
                   1968:      DefSeq = DefWithAttr ';' &lt; DefWithAttr ';' > .</pre>
                   1969: <p>
1.1       cvs      1970: Before the creation of an element defined as a choice, the Thot editor
                   1971: presents the list of possible types for the element to the user.  The user has
1.18      cvs      1972: only to select the element type that s/he wants to create from this list.</p>
                   1973: <p>
1.1       cvs      1974: The order of the type declarations is important.  It determines the order of
                   1975: the list presented to the user before the creation of the element.  Also, when
                   1976: a Choice element is being created automatically, the first type in the list is
                   1977: used.  In fact, using the Thot editor, when an empty Choice element is
                   1978: selected, it is possible to select this element and to enter its text from
                   1979: keyboard. In this case, the editor uses the first element type which can
1.18      cvs      1980: contain an atom of the character string type.</p>
                   1981: <p>
                   1982: The two special cases of the choice constructor, the <a
                   1983: href="#sectc328"><em>schema</em></a> and the <a
                   1984: href="#sectc3212"><em>unit</em></a> are discussed elsewhere.</p>
                   1985: <blockquote class="example">
                   1986: <p>
                   1987: <strong>Example:</strong></p>
                   1988: <p>
1.3       cvs      1989: It is common in documents to treat a variety of objects as if they were
                   1990: ordinary paragraphs.  Thus, a ``Paragraph'' might actually be composed of a
                   1991: block of text (an ordinary paragraph), or a mathematical formula whose
                   1992: structure is defined by another structure schema named Math, or a table, also
                   1993: defined by another structure schema.  Here is a definition of such a
1.18      cvs      1994: paragraph:</p>
                   1995: <pre>Paragraph = CASE OF
1.1       cvs      1996:               Simple_text = TEXT;
                   1997:               Formula     = Math;
                   1998:               Table_para  = Table;
1.18      cvs      1999:               END;</pre>
                   2000: </blockquote>
                   2001: </div>
1.1       cvs      2002: 
1.18      cvs      2003: <div class="subsubsection">
1.1       cvs      2004: 
1.18      cvs      2005: <h4><a name="sectd3284">Reference</a></h4>
                   2006: <p>
1.1       cvs      2007: Like all elements in Thot, references are typed.  An element type defined as a
                   2008: reference is a cross-reference to an element of some other given type. The
1.18      cvs      2009: keyword <tt>REFERENCE</tt> is followed by the name of a type enclosed in
1.1       cvs      2010: parentheses.  When the type which is being cross-referenced is defined in
                   2011: another structure schema, the type name is itself followed by the name of the
1.18      cvs      2012: external structure schema in which it is defined.</p>
                   2013: <p>
                   2014: When the designated element type is a <a href="#sectd3285">mark pair</a>, it
                   2015: can be preceded by a <tt>FIRST</tt> or <tt>SECOND</tt> keyword.  These
                   2016: keywords indicate whether the reference points to the first or second mark of
                   2017: the pair. If the reference points to a pair and neither of these two keywords
                   2018: is present, the reference is considered to point to the first mark of the
                   2019: pair.</p>
                   2020: <p>
1.1       cvs      2021: There is an exception to the principle of typed references:  it is possible to
                   2022: define a reference which designates an element of any type, which can either
                   2023: be in the same document or another document. In this case, it suffices to put
1.18      cvs      2024: the keyword <tt>ANY</tt> in the parentheses which indicate the referenced
                   2025: element type.</p>
                   2026: <pre>             'REFERENCE' '(' RefType ')'
                   2027:    RefType = 'ANY' / [ FirstSec ] ElemID [ ExtStruct ] .</pre>
                   2028: <p>
                   2029: When defining an inclusion, the <tt>REFERENCE</tt> keyword is not used.
1.1       cvs      2030: Inclusions with complete expansion are not declared as such in the structure
                   2031: schemas, since any element defined in a structure schema can be replaced by an
                   2032: element of the same type.  Instead, inclusions without expansion or with
                   2033: partial expansion must be declared explicitly whenever they will include a
                   2034: complete object ( and not a part of an object).  In this case, the object type
                   2035: to be included (that is, the name of its structure schema) is followed by a
1.18      cvs      2036: keyword: <tt>EXTERN</tt> for inclusion without expansion and <tt>INCLUDED</tt>
                   2037: for partial expansion.</p>
                   2038: <p>
1.1       cvs      2039: Before creating a cross-reference or an inclusion, the Thot editor asks the
                   2040: user to choose, from the document images displayed, the referenced or included
1.18      cvs      2041: element.</p>
                   2042: <blockquote class="example">
                   2043: <p>
                   2044: <strong>Example:</strong></p>
                   2045: <p>
1.3       cvs      2046: If the types Note and Section are defined in the Article structure schema, it
                   2047: is possible to define, in the same structure schema, a reference to a note and
1.18      cvs      2048: a reference to a section in this manner:</p>
                   2049: <pre>Ref_note    = REFERENCE (Note);
                   2050: Ref_section = REFERENCE (Section);</pre>
                   2051: <p>
1.1       cvs      2052: It is also possible to define the generic structure of a collection of
                   2053: articles, which include (with partial expansion) objects of the Article class
                   2054: and which possess an introduction which may include cross-references to
                   2055: sections of the included articles.  In the Collection structure schema, the
1.18      cvs      2056: definitions are:</p>
                   2057: <pre>Collection = BEGIN
1.6       cvs      2058:              Collection_title = TEXT;
                   2059:              Introduction = LIST OF (Elem = CASE OF
1.1       cvs      2060:                                            TEXT;
                   2061:                                            Ref_sect;
                   2062:                                            END);
1.6       cvs      2063:              Body = LIST OF (Article INCLUDED);
                   2064:              END;
1.18      cvs      2065: Ref_sect   = REFERENCE (Section (Article));</pre>
                   2066: <p>
1.1       cvs      2067: Here we define a Folder document class which has a title and includes
1.18      cvs      2068: documents of different types, particularly Folders:</p>
                   2069: <pre>Folder   = BEGIN
1.6       cvs      2070:            Folder_title    = TEXT;
                   2071:            Folder_contents = LIST OF (Document);
                   2072:            END;
1.1       cvs      2073: 
                   2074: Document = CASE OF
                   2075:               Article EXTERN;
                   2076:               Collection EXTERN;
                   2077:               Folder EXTERN;
1.18      cvs      2078:               END;</pre>
                   2079: <p>
1.1       cvs      2080: Under this definition, Folder represents either an aggregate which contains a
                   2081: folder title and the list of included documents or an included folder.  To
                   2082: resolve this ambiguity, in the P language, the placement of a star character
1.18      cvs      2083: in front of the type name (here, Folder) indicates an included document.</p>
                   2084: </blockquote>
                   2085: </div>
1.1       cvs      2086: 
1.18      cvs      2087: <div class="subsubsection">
1.1       cvs      2088: 
1.18      cvs      2089: <h4><a name="sectd3285">Mark pairs</a></h4>
                   2090: <p>
1.1       cvs      2091: Like other elements, mark pairs are typed.  The two marks of the pair have the
                   2092: same type, but there exist two predefined subtypes which apply to all mark
1.18      cvs      2093: pairs: the first mark of the pair (called <tt>First</tt> in the P and T
                   2094: languages) and the second mark (called <tt>Second</tt>).</p>
                   2095: <p>
                   2096: In the S language, a mark pair is noted simply by the <tt>PAIR</tt>
                   2097: keyword.</p>
                   2098: <p>
1.1       cvs      2099: In the Thot editor, marks are always moved or destroyed together.  The two
                   2100: marks of a pair have the same identifier, unique within the document, which
1.18      cvs      2101: permits intertwining mark pairs without risk of ambiguity.</p>
                   2102: </div>
                   2103: </div>
1.1       cvs      2104: 
1.18      cvs      2105: <div class="subsection">
1.1       cvs      2106: 
1.18      cvs      2107: <h3><a name="sectc329">Imports</a></h3>
                   2108: <p>
1.1       cvs      2109: Because of schema constructors, it is possible, before editing a document, to
                   2110: use classes defined by other structure schemas whenever they are needed. It is
                   2111: also possible to assign specific document classes to certain element types. In
                   2112: this case, these classes are simply designated by their name.  In fact, if a
                   2113: type name is not defined in the structure schema, it is assumed that it
1.18      cvs      2114: specifies a structure defined by another structure schema.</p>
                   2115: <blockquote class="example">
                   2116: <p>
                   2117: <strong>Example:</strong></p>
                   2118: <p>
1.3       cvs      2119: If the types Math and Table don't appear in the left part of a structure rule
                   2120: in the schema, the following two rules indicate that a formula has the
                   2121: structure of an object defined by the structure schema Math and that a table
1.18      cvs      2122: element has the structure of an object defined by the Table schema.</p>
                   2123: <pre>Formula    = Math;
                   2124: Table_elem = Table;</pre>
                   2125: </blockquote>
                   2126: </div>
                   2127: 
                   2128: <div class="subsection">
                   2129: 
                   2130: <h3><a name="sectc3210">Extension rules</a></h3>
                   2131: <p>
                   2132: The <tt>EXTENS</tt> section, which can only appear in an extension schema,
1.1       cvs      2133: defines complements to the rules in the primary schema (i.e. the structure
                   2134: schema to which the extension schema will be applied). More precisely, this
                   2135: section permits the addition to an existing type of local attributes,
1.18      cvs      2136: extensions, restrictions and fixed-value attributes.</p>
                   2137: <p>
1.1       cvs      2138: These additions can be applied to the root rule of the primary schema,
1.18      cvs      2139: designated by the keyword <tt>Root</tt>, or to any other explicitly named
                   2140: rule.</p>
                   2141: <p>
1.1       cvs      2142: Extension rules are separated from each other by a semicolon and each
1.18      cvs      2143: extension rule has the same syntax as a <a href="#sectc327">structure
                   2144: rule</a>, but the part which defines the constructor is absent.</p>
                   2145: <pre>     ExtenRuleSeq = ExtensRule ';' &lt; ExtensRule ';' > .
1.6       cvs      2146:      ExtensRule   = RootOrElem [ LocAttrSeq ]
                   2147:                     [ '+' '(' ExtensionSeq ')' ]
                   2148:                     [ '-' '(' RestrictSeq ')' ]
                   2149:                     [ 'WITH' FixedAttrSeq ] .
1.18      cvs      2150:      RootOrElem   = 'Root' / ElemID .</pre>
                   2151: </div>
1.1       cvs      2152: 
1.18      cvs      2153: <div class="subsection">
1.1       cvs      2154: 
1.18      cvs      2155: <h3><a name="sectc3211">Associated elements</a></h3>
                   2156: <p>
1.1       cvs      2157: If associated elements are necessary, they must be declared in a specific
1.18      cvs      2158: section of the structure schema, introduced by the keyword <tt>ASSOC</tt>.
1.1       cvs      2159: Each associated element type is specified like any other structured element.
                   2160: However, these types must not appear in any other element types of the schema,
1.18      cvs      2161: except in <tt>REFERENCE</tt> rules.</p>
                   2162: </div>
1.1       cvs      2163: 
1.18      cvs      2164: <div class="subsection">
1.1       cvs      2165: 
1.18      cvs      2166: <h3><a name="sectc3212">Units</a></h3>
                   2167: <p>
                   2168: The <tt>UNITS</tt> section of the structure schema contains the declarations
1.1       cvs      2169: of the element types which can be used in the external objects making up parts
                   2170: of the document or in objects of the class defined by the schema.  As with
                   2171: associated elements, these element types are defined just like other
                   2172: structured element types. They can be used in the other element types of the
1.18      cvs      2173: schema, but they can also be used in any other rule of the schema.</p>
                   2174: <blockquote class="example">
                   2175: <p>
                   2176: <strong>Example:</strong></p>
                   2177: <p>
                   2178: If references to notes are declared as units:</p>
                   2179: <pre>UNITS
                   2180:    Ref_note = REFERENCE (Note);</pre>
                   2181: <p>
1.3       cvs      2182: then it is possible to use references to notes in a cell of a table, even when
1.18      cvs      2183: <tt>Table</tt> is an external structure schema.  The <tt>Table</tt> schema
                   2184: must declare a cell to be a sequence of units, which can then be base element
                   2185: types (text, for example) or references to notes in the document.</p>
                   2186: <pre>Cell = LIST OF (UNITS);</pre>
                   2187: </blockquote>
                   2188: </div>
1.1       cvs      2189: 
1.18      cvs      2190: <div class="subsection">
1.1       cvs      2191: 
1.18      cvs      2192: <h3><a name="sectc3213">Skeleton elements</a></h3>
                   2193: <p>
1.1       cvs      2194: When editing a document which contains or must contain external references to
                   2195: several other documents, it may be necessary to load a large number of
                   2196: documents, simply to see the parts designated by the external references of
                   2197: the document while editing, or to access the source of included elements.  In
                   2198: this case, the external documents are not modified and it is only necessary to
                   2199: see the elements of these documents which could be referenced.  Because of
                   2200: this, the editor will suggest that the documents be loaded in ``skeleton''
                   2201: form.  This form contains only the elements of the document explicitly
1.18      cvs      2202: mentioned in the <tt>EXPORT</tt> section of their structure schema and, for
1.1       cvs      2203: these elements, only the part of the contents specified in that section. This
                   2204: form has the advantage of being very compact, thus requiring very few
                   2205: resources from the editor.  This is also the skeleton form which constitutes
1.18      cvs      2206: the expanded form of <a href="#inclusion">inclusions</a> with partial
                   2207: expansion.</p>
                   2208: <p>
                   2209: Skeleton elements must be declared explicitly in the <tt>EXPORT</tt> section
1.1       cvs      2210: of the structure schema that defines them.  This section begins with the
1.18      cvs      2211: keyword <tt>EXPORT</tt> followed by a comma-separated list of the element
1.1       cvs      2212: types which must appear in the skeleton form and ending with a semicolon.
1.18      cvs      2213: These types must have been previously declared in the schema.</p>
                   2214: <p>
1.1       cvs      2215: For each skeleton element type, the part of the contents which is loaded by
                   2216: the editor, and therefore displayable, can be specified by putting the keyword
1.18      cvs      2217: <tt>WITH</tt> and the name of the contained element type to be loaded after
1.1       cvs      2218: the name of the skeleton element type.  In this case only that named element,
                   2219: among all the elements contained in the exportable element type, will be
1.18      cvs      2220: loaded.  If the <tt>WITH</tt> is absent, the entire contents of the skeleton
1.1       cvs      2221: element will be loaded by the editor.  If instead, it is better that the
                   2222: skeleton form not load the contents of a particular element type, the keyword
1.18      cvs      2223: <tt>WITH</tt> must be followed by the word <tt>Nothing</tt>.</p>
                   2224: <pre>                [ 'EXPORT' SkeletonSeq ]
1.1       cvs      2225: 
                   2226:      SkeletonSeq = SkelElem &lt; ',' SkelElem > ';' .
                   2227:      SkelElem    = ElemID [ 'WITH' Contents ] .
1.18      cvs      2228:      Contents    = 'Nothing' / ElemID [ ExtStruct ] .</pre>
                   2229: <blockquote class="example">
                   2230: <p>
                   2231: <strong>Example:</strong></p>
                   2232: <p>
1.3       cvs      2233: Suppose that, in documents of the article class, the element types
                   2234: Article_title, Figure, Section, Paragraph, and Biblio should appear in the
                   2235: skeleton form in order to make it easier to create external references to them
                   2236: from other documents.  When loading an article in its skeleton form, all of
                   2237: these element types will be loaded except for paragraphs, but only the article
1.18      cvs      2238: title will be loaded in its entirety.  For figures, the caption will be
                   2239: loaded, while for sections, the title will be loaded, and for bibliographic
                   2240: entries, only the title that they contain will be loaded.  Note that
1.3       cvs      2241: bibliographic elements are defined in another structure schema, RefBib.  To
                   2242: produce this result, the following declarations should be placed in the
1.18      cvs      2243: Article structure schema:</p>
                   2244: <pre>EXPORT
1.1       cvs      2245:    Article_title,
1.5       cvs      2246:    Figure With Caption,
1.1       cvs      2247:    Section With Section_title,
                   2248:    Paragraph With Nothing,
1.18      cvs      2249:    Biblio With Biblio_title(RefBib);</pre>
                   2250: </blockquote>
                   2251: </div>
1.1       cvs      2252: 
1.18      cvs      2253: <div class="subsection">
1.1       cvs      2254: 
1.18      cvs      2255: <h3><a name="sectc3214">Exceptions</a></h3>
                   2256: <p>
1.1       cvs      2257: The behavior of the Thot editor and the actions that it performs are
                   2258: determined by the structure schemas.  These actions are applied to all
                   2259: document and object types in accordance with their generic structure.  For
                   2260: certain object types, such as tables and graphics, these actions are not
                   2261: sufficient or are poorly adapted and some special actions must be added to or
                   2262: substituted for certain standard actions.  These special actions are called
1.18      cvs      2263: <em>exceptions</em>.</p>
                   2264: <p>
1.1       cvs      2265: Exceptions only inhibit or modify certain standard actions, but they can be
1.18      cvs      2266: used freely in every structure schema.</p>
                   2267: <p>
1.1       cvs      2268: Each structure schema can contain a section defining exceptions.  It begins
1.18      cvs      2269: with the keyword <tt>EXCEPT</tt> and is composed of a sequence of exception
1.1       cvs      2270: declarations, separated by semicolons.  Each declaration of an exception
                   2271: begins with the name of an element type or attribute followed by a colon. This
                   2272: indicates the element type or attribute to which the following exceptions
1.18      cvs      2273: apply.  When the given element type name is a <a href="#sectd3285">mark
                   2274: pair</a>, and only in this case, the type name can be preceded by the keyword
                   2275: <tt>First</tt> or <tt>Second</tt>, to indicate if the exceptions which follow
1.1       cvs      2276: are associated with the first mark of the pair or the second.  In the absence
1.18      cvs      2277: of this keyword, the first mark is used.</p>
                   2278: <p>
                   2279: When placed in an <a href="#sectc322">extension schema</a>, the keyword
                   2280: <tt>EXTERN</tt> indicates that the type name which follows is found in the
1.1       cvs      2281: principal schema (the schema being extended by the extension schema).  The
1.18      cvs      2282: exceptions are indicated by a name.  They are separated by semicolons.</p>
                   2283: <pre>                  [ 'EXCEPT' ExceptSeq ]
1.1       cvs      2284: 
                   2285:      ExceptSeq     = Except ';' &lt; Except ';' > .
                   2286:      Except        = [ 'EXTERN' ] [ FirstSec ] ExcTypeOrAttr
                   2287:                      ':' ExcValSeq .
                   2288:      ExcTypeOrAttr = ElemID / AttrID .
                   2289:      ExcValSeq     = ExcValue &lt; ',' ExcValue > .
1.19      cvs      2290:      ExcValue      ='NoCut' / 'NoCreate' / 'NoHMove' / 
                   2291:                     'NoVMove' / 'NoHResize' / 'NoVResize' /
                   2292:                     'NoMove' / 'NoResize' / 'MoveResize' /
                   2293:                     'NewWidth' / 'NewHeight' / 'NewHPos' /
                   2294:                     'NewVPos' / 'Invisible' /
                   2295:                     'NoSelect' / <math>
                   2296:   <mrow>
                   2297:     <mo></mo>
                   2298:     <mo>'</mo>
                   2299:   </mrow>
                   2300: </math>
1.20      cvs      2301: 
1.21      cvs      2302: 
                   2303: 
1.19      cvs      2304: NoSpellCheck' /
1.1       cvs      2305:                     'Hidden' / 'ActiveRef' /
                   2306:                     'ImportLine' / 'ImportParagraph' /
                   2307:                     'NoPaginate' / 'ParagraphBreak' /
1.19      cvs      2308:                     'PageBreak' / 'PageBreakAllowed' / 'PageBreakPlace' /
                   2309:                     'PageBreakRepetition' / 'PageBreakRepBefore' /
1.9       cvs      2310:                     'HighlightChildren' / 'ExtendedSelection' /
1.19      cvs      2311:                     'ReturnCreateNL' / 'IsDraw' / 'IsTable' /
                   2312:                     'IsRow' / 'IsColHead' / 'IsCell' /
                   2313:                     'NewPercentWidth' / 'ColRef' / 'ColSpan' /
                   2314:                     'RowSpan' / 'SaveDocument' / 'Shadow' .</pre>
1.18      cvs      2315: <p>
                   2316: The following are the available exceptions:</p>
                   2317: <dl>
                   2318: <dt><tt>NoCut</tt></dt>
                   2319: <dd>
                   2320: This exception can only be applied to element types.  Elements of a type to
1.13      cvs      2321: which this exception is applied cannot be deleted by the editor.
1.18      cvs      2322: </dd>
                   2323: <dt><tt>NoCreate</tt></dt>
                   2324: <dd>
                   2325: This exception can only be applied to element types.  Elements of a type to
1.2       cvs      2326: which this exception is applied cannot be created by ordinary commands for
                   2327: creating new elements.  These elements are usually created by special actions
1.13      cvs      2328: associated with other exceptions.
1.18      cvs      2329: </dd>
                   2330: <dt><tt>NoHMove</tt></dt>
                   2331: <dd>
                   2332: This exception can only be applied to element types.  Elements of a type to
                   2333: which this exception is applied cannot be moved horizontally with the mouse.
                   2334: Their children elements cannot be moved either.
                   2335: </dd>
                   2336: <dt><tt>NoVMove</tt></dt>
                   2337: <dd>
                   2338: This exception can only be applied to element types.  Elements of a type to
                   2339: which this exception is applied cannot be moved vertically with the mouse.
                   2340: Their children elements cannot be moved either.
                   2341: </dd>
                   2342: <dt><tt>NoMove</tt></dt>
                   2343: <dd>
                   2344: This exception can only be applied to element types.  Elements of a type to
1.2       cvs      2345: which this exception is applied cannot be moved in any direction with the
1.13      cvs      2346: mouse.  Their children elements cannot be moved either.
1.18      cvs      2347: </dd>
                   2348: <dt><tt>NoHResize</tt></dt>
                   2349: <dd>
                   2350: This exception can only be applied to element types.  Elements of a type to
                   2351: which this exception is applied cannot be resized horizontally with the mouse.
                   2352: Their children elements cannot be resized either.
                   2353: </dd>
                   2354: <dt><tt>NoVResize</tt></dt>
                   2355: <dd>
                   2356: This exception can only be applied to element types.  Elements of a type to
                   2357: which this exception is applied cannot be resized vertically with the mouse.
                   2358: Their children elements cannot be resized either.
                   2359: </dd>
                   2360: <dt><tt>NoResize</tt></dt>
                   2361: <dd>
                   2362: This exception can only be applied to element types.  Elements of a type to
1.2       cvs      2363: which this exception is applied cannot be resized in any direction with the
1.13      cvs      2364: mouse.  Their children elements cannot be resized either.
1.18      cvs      2365: </dd>
                   2366: <dt><tt>MoveResize</tt></dt>
                   2367: <dd>
                   2368: This exception can only be applied to element types.  Elements of a type to
                   2369: which this exception is applied can be moved and resized in any direction with
                   2370: the mouse, even if one of their ancestor element has an exception that
1.13      cvs      2371: prevents moving or resizing.  Their children elements can also be resized or
                   2372: moved.
1.18      cvs      2373: </dd>
                   2374: <dt><tt>NewWidth</tt></dt>
                   2375: <dd>
                   2376: This exception can only be applied to numeric attributes.  If the width of an
                   2377: element which has this attribute is modified with the mouse, the value of the
                   2378: new width will be assigned to the attribute.
                   2379: </dd>
                   2380: <dt><tt>NewHeight</tt></dt>
                   2381: <dd>
                   2382: This exception can only be applied to numeric attributes.  If the height of an
                   2383: element which has this attribute is modified with the mouse, the value of the
                   2384: new height will be assigned to the attribute.
                   2385: </dd>
                   2386: <dt><tt>NewHPos</tt></dt>
                   2387: <dd>
                   2388: This exception can only be applied to numeric attributes.  If the horizontal
                   2389: position of an element which has this attribute is modified with the mouse,
                   2390: the value of the new horizontal position will be assigned to the attribute.
                   2391: </dd>
                   2392: <dt><tt>NewVPos</tt></dt>
                   2393: <dd>
                   2394: This exception can only be applied to numeric attributes.  If the vertical
                   2395: position of an element which has this attribute is modified with the mouse,
                   2396: the value of the new vertical position will be assigned to the attribute.
                   2397: </dd>
                   2398: <dt><tt>Invisible</tt></dt>
                   2399: <dd>
                   2400: This exception can only be applied to attributes, but can be applied to all
1.2       cvs      2401: attribute types.  It indicates that the attribute must not be seen by the user
                   2402: and that its value must not be changed directly.  This exception is usually
1.5       cvs      2403: used when another exception manipulates the value of an attribute.
1.18      cvs      2404: </dd>
1.19      cvs      2405: <dt><tt>NoSelect</tt></dt>
                   2406: <dd>
                   2407: This exception can only be applied to element types.  Elements of a type to
                   2408: which this exception is applied cannot  be selected directly with the mouse,
                   2409: but they can be selected by other methods provided by the editor.
                   2410: </dd>
                   2411: <dt>NoSpellCheck</dt>
                   2412: <dd>
                   2413: This exception can only be applied to element types.  Elements of a type to
                   2414: which this exception is applied are not taken into account by the spell
                   2415: checker.
                   2416: </dd>
1.18      cvs      2417: <dt><tt>Hidden</tt></dt>
                   2418: <dd>
                   2419: This exception can only be applied to element types.  It indicates that
1.2       cvs      2420: elements of this type, although present in the document's structure, must not
1.18      cvs      2421: be shown to the user of the editor.  In particular, the creation menus must
                   2422: not propose this type and the selection message must not pick it.
                   2423: </dd>
                   2424: <dt><tt>ActiveRef</tt></dt>
                   2425: <dd>
                   2426: This exception can only be applied to attributes of the reference type.  It
1.2       cvs      2427: indicates that when the user of the editor makes a double click on an element
                   2428: which possesses a reference attribute having this exception, the element
                   2429: designated by the reference attribute will be selected.
1.18      cvs      2430: </dd>
                   2431: <dt><tt>ImportLine</tt></dt>
                   2432: <dd>
                   2433: This exception can only be applied to element types.  It indicates that
1.2       cvs      2434: elements of this type should receive the content of imported text files.  An
                   2435: element is created for each line of the imported file.  A structure schema
1.18      cvs      2436: cannot contain several exceptions <tt>ImportLine</tt> and, if it contains one,
                   2437: it should not contain any exception <tt>ImportParagraph</tt>.
                   2438: </dd>
                   2439: <dt><tt>ImportParagraph</tt></dt>
                   2440: <dd>
                   2441: This exception can only be applied to element types.  It indicates that
1.2       cvs      2442: elements of this type should receive the content of imported text files.  An
                   2443: element is created for each paragraph of the imported file.  A paragraph is a
                   2444: sequence of lines without any empty line.  A structure schema cannot contain
1.18      cvs      2445: several exceptions <tt>ImportParagraph</tt> and, if it contains one, it should
                   2446: not contain any exception <tt>ImportLine</tt>.
                   2447: </dd>
                   2448: <dt><tt>NoPaginate</tt></dt>
                   2449: <dd>
                   2450: This exception can only be applied to the root element, i.e. the name that
                   2451: appear after the keyword <tt>STRUCTURE</tt> at the beginning of the structure
1.2       cvs      2452: schema.  It indicates that the editor should not allow the user to paginate
1.1       cvs      2453: documents of that type.
1.18      cvs      2454: </dd>
                   2455: <dt><tt>ParagraphBreak</tt></dt>
                   2456: <dd>
                   2457: This exception can only be applied to element types.  When the caret is within
                   2458: an element of a type to which this exception is applied, it is that element
                   2459: that will be split when the user hits the Return key.
                   2460: </dd>
                   2461: <dt><tt>ReturnCreateNL</tt></dt>
                   2462: <dd>
                   2463: This exception can only be applied to element types.  When the caret is within
                   2464: an element of a type to which this exception is applied, the Return key simply
                   2465: inserts a New line character (code \212) at the current position. The Return
                   2466: key does not create a new element; it does not split the current element
                   2467: either.
                   2468: </dd>
                   2469: <dt><tt>HighlightChildren</tt></dt>
                   2470: <dd>
                   2471: This exception can only be applied to element types.  Elements of a type to
1.2       cvs      2472: which this exception is applied are not highlighted themselves when they are
                   2473: selected, but all their children are highlighted instead.
1.18      cvs      2474: </dd>
                   2475: <dt><tt>ExtendedSelection</tt></dt>
                   2476: <dd>
                   2477: This exception can only be applied to element types.  The selection extension
                   2478: command (middle button of the mouse) only add the clicked element (if it has
                   2479: that exception) to the current selection, without selecting other elements
                   2480: between the current selection and the clicked element.
                   2481: </dd>
1.19      cvs      2482: <dt>IsDraw, IsTable, IsColHead, IsRow, IsCell</dt>
                   2483: <dd>
                   2484: These exceptions can only be applied to element types.  Elements of a type to
                   2485: which these exceptions are applied are identified as Draws, Tables, Colheads,
                   2486: Rows or Cells and specific processing are applied to them.
                   2487: </dd>
                   2488: <dt>ColRef</dt>
                   2489: <dd>
                   2490: This exception can only be applied to attributes of the reference type. It
                   2491: indicates that this attribute refers to the column head (see exception
                   2492: IsColHead) which the element belongs to.
                   2493: </dd>
                   2494: <dt>ColSpan, RowSpan</dt>
                   2495: <dd>
                   2496: These exceptions can only be applied to numeric attributes of cells.  They
                   2497: indicate that attribute values give how many columns or rows the element
1.20      cvs      2498: spans.
1.19      cvs      2499: </dd>
                   2500: <dt>Shadow</dt>
                   2501: <dd>
                   2502: This exception can only be applied to element types.  Text of elements of a
                   2503: type to which this exception is applied are displayed and printed as a set of
                   2504: stars ('*').
                   2505: </dd>
1.18      cvs      2506: </dl>
                   2507: <blockquote class="example">
                   2508: <p>
                   2509: <strong>Example:</strong></p>
                   2510: <p>
1.3       cvs      2511: Consider a structure schema for object-style graphics which defines the
1.18      cvs      2512: Graphic_object element type with the associated Height and Weight numeric
                   2513: attributes.  Suppose that we want documents of this class to have the
                   2514: following qualities:</p>
                   2515: <ul>
                   2516: <li>
                   2517: Whenever the width or height of an object is changed using the mouse, the new
                   2518: values are stored in the object's Width and Height attributes.
1.19      cvs      2519: </li>
1.18      cvs      2520: <li>
                   2521: The user should not be able to change the values of the Width and Height
1.5       cvs      2522: attributes via the Attributes menu of the Thot editor.
1.19      cvs      2523: </li>
1.18      cvs      2524: </ul>
                   2525: <p>
                   2526: The following exceptions will produce this effect.</p>
                   2527: <pre>STRUCT
1.1       cvs      2528: ...
1.5       cvs      2529:    Graphics_object (ATTR Height = Integer; Width = Integer)
1.1       cvs      2530:        = GRAPHICS with Height ?= 10, Width ?= 10;
                   2531: ...
                   2532: EXCEPT
                   2533:    Height: NewHeight, Invisible;
1.18      cvs      2534:    Width: NewWidth, Invisible;</pre>
                   2535: </blockquote>
                   2536: </div>
                   2537: </div>
1.1       cvs      2538: 
1.18      cvs      2539: <div class="section">
1.1       cvs      2540: 
1.18      cvs      2541: <h2><a name="sectb33">Some examples</a></h2>
                   2542: <p>
1.1       cvs      2543: In order to illustrate the principles of the document model and the syntax of
                   2544: the S language, this section presents two examples of structure schemas. One
1.18      cvs      2545: defines a class of documents, the other defines a class of objects.</p>
1.1       cvs      2546: 
1.18      cvs      2547: <div class="subsection">
1.1       cvs      2548: 
1.18      cvs      2549: <h3><a name="sectc331">A class of documents: articles</a></h3>
                   2550: <p>
1.1       cvs      2551: This example shows a possible structure for articles published in a journal.
1.18      cvs      2552: Text between braces is comments.</p>
                   2553: <pre>STRUCTURE Article;  { This schema defines the Article class }
1.1       cvs      2554: DEFPRES ArticleP;   { The default presentation schema is
                   2555:                       ArticleP }
                   2556: ATTR                { Global attribute definitions }
                   2557:    WordType = Definition, IndexWord, DocumentTitle;
                   2558:    { A single global attribute is defined, with three values }
                   2559: STRUCT              { Definition of the generic structure }
                   2560:    Article = BEGIN  { The Article class has an aggregate
                   2561:                       structure }
                   2562:              Title = BEGIN   { The title is an aggregate }
                   2563:                      French_title = 
                   2564:                          Text WITH Language='Fran\347ais';
                   2565:                      English_title =
                   2566:                          Text WITH Language='English';
                   2567:                      END;
                   2568:              Authors = 
                   2569:                LIST OF (Author
                   2570:                  (ATTR Author_type=principal,secondary)
                   2571:                  { The Author type has a local attribute }
                   2572:                  = BEGIN
                   2573:                    Author_name = Text;
                   2574:                    Info = Paragraphs ;
                   2575:                    { Paragraphs is defined later }
                   2576:                    Address    = Text;
                   2577:                    END
                   2578:                  );
                   2579:              Keywords = Text;
                   2580:              { The journal's editor introduces the article
                   2581:                with a short introduction, in French and
                   2582:                in English }
                   2583:              Introduction = 
                   2584:                  BEGIN
                   2585:                  French_intr  = Paragraphs WITH
                   2586:                                 Language='Fran\347ais';
                   2587:                  English_intr = Paragraphs WITH
                   2588:                                 Language='English';
                   2589:                  END;
                   2590:              Body = Sections; { Sections are defined later }
                   2591:                    { Appendixes are only created on demand }
                   2592:            ? Appendices = 
                   2593:                  LIST OF (Appendix =
                   2594:                           BEGIN
                   2595:                           Appendix_Title    = Text;
                   2596:                           Appendix_Contents = Paragraphs;
                   2597:                           END
                   2598:                          );
                   2599:              END;      { End of the Article aggregate }
                   2600: 
                   2601:     Sections = LIST [2..*] OF (
                   2602:                  Section = { At least 2 sections }
                   2603:                  BEGIN
                   2604:                  Section_title   = Text;
                   2605:                  Section_contents =
                   2606:                    BEGIN
                   2607:                    Paragraphs;
                   2608:                    Sections; { Sections at a lower level }
                   2609:                    END;
                   2610:                  END
                   2611:                  );
                   2612: 
                   2613:     Paragraphs = LIST OF (Paragraph = CASE OF
                   2614:                                Enumeration = 
                   2615:                                    LIST [2..*] OF
                   2616:                                        (Item = Paragraphs);
                   2617:                                Isolated_formula = Formula;
                   2618:                                LIST OF (UNIT);
                   2619:                                END
                   2620:                           );
                   2621: 
                   2622: ASSOC         { Associated elements definitions }
                   2623: 
                   2624:    Figure = BEGIN
1.5       cvs      2625:             Figure_caption  = Text;
1.1       cvs      2626:             Illustration   = NATURE;
                   2627:             END;
                   2628: 
                   2629:    Biblio_citation = CASE OF
                   2630:                         Ref_Article =
                   2631:                            BEGIN
                   2632:                            Authors_Bib   = Text;
                   2633:                            Article_Title = Text;
                   2634:                            Journal       = Text;
                   2635:                            Page_Numbers  = Text;
                   2636:                            Date          = Text;
                   2637:                            END;
                   2638:                         Ref_Livre =
                   2639:                            BEGIN
                   2640:                            Authors_Bib; { Defined above }
                   2641:                            Book_Title   = Text;
                   2642:                            Editor       = Text;
                   2643:                            Date;        { Defined above }
                   2644:                            END;
                   2645:                        END;
                   2646: 
                   2647:    Note =  Paragraphs - (Ref_note);
                   2648: 
                   2649: UNITS      { Elements which can be used in objects }
                   2650: 
                   2651:    Ref_note    = REFERENCE (Note);
                   2652:    Ref_biblio  = REFERENCE (Biblio_citation);
                   2653:    Ref_figure  = REFERENCE (Figure);
                   2654:    Ref_formula = REFERENCE (Isolated_formula);
                   2655: 
                   2656: EXPORT     { Skeleton elements }
                   2657: 
                   2658:    Title,
1.5       cvs      2659:    Figure with Figure_caption,
1.1       cvs      2660:    Section With Section_title;
                   2661: 
1.18      cvs      2662: END           { End of the structure schema }</pre>
                   2663: <p>
1.1       cvs      2664: This schema is very complete since it defines both paragraphs and
                   2665: bibliographic citations.  These element types could just as well be defined in
1.18      cvs      2666: other structure schemas, as is the case with the <tt>Formula</tt> class.  All
1.1       cvs      2667: sorts of other elements can be inserted into an article, since a paragraph can
                   2668: contain any type of unit.  Similarly, figures can be any class of document or
1.18      cvs      2669: object that the user chooses.</p>
                   2670: <p>
1.1       cvs      2671: Generally, an article doesn't contain appendices, but it is possible to add
                   2672: them on explicit request:  this is the effect of the question mark before the
1.18      cvs      2673: word Appendices.</p>
                   2674: <p>
1.1       cvs      2675: The Figure, Biblio_citation and Note elements are associated elements. Thus,
1.18      cvs      2676: they are only used in <tt>REFERENCE</tt> statements.</p>
                   2677: <p>
1.1       cvs      2678: Various types of cross-references can be put in paragraphs.  They can also be
                   2679: placed the objects which are part of the article, since the cross-references
1.18      cvs      2680: are defined as units (<tt>UNITS</tt>).</p>
                   2681: <p>
1.1       cvs      2682: There is a single restriction to prevent the creation of Ref_note elements
1.18      cvs      2683: within notes.</p>
                   2684: <p>
1.1       cvs      2685: It is worth noting that the S language permits the definition of recursive
                   2686: structures like sections: a section can contain other sections (which are thus
                   2687: at the next lower level of the document tree).  Paragraphs are also recursive
                   2688: elements, since a paragraph can contain an enumeration in which each element
1.18      cvs      2689: (<tt>Item</tt>) is composed of paragraphs.</p>
                   2690: </div>
1.1       cvs      2691: 
1.18      cvs      2692: <div class="subsection">
1.1       cvs      2693: 
1.18      cvs      2694: <h3><a name="sectc332">A class of objects: mathematical formulas</a></h3>
                   2695: <p>
                   2696: The example below defines the <tt>Formula</tt> class which is used in Article
1.1       cvs      2697: documents.  This class represents mathematical formulas  with a rather simple
                   2698: structure, but sufficient to produce a correct rendition on the screen or
                   2699: printer.  To support more elaborate operations (formal or numeric
                   2700: calculations), a finer structure should be defined. This class doesn't use any
1.18      cvs      2701: other class and doesn't define any associated elements or units.</p>
                   2702: <pre>STRUCTURE Formula;
1.1       cvs      2703: DEFPRES FormulaP;
                   2704: 
                   2705: ATTR
                   2706:    String_type = Function_name, Variable_name;
                   2707: 
                   2708: STRUCT
                   2709:    Formula      = Expression;
                   2710:    Expression   = LIST OF (Construction);
                   2711:    Construction = CASE OF
                   2712:                   TEXT;         { Simple character string }
                   2713:                   Index    = Expression;
                   2714:                   Exponent = Expression;
                   2715:                   Fraction =
                   2716:                         BEGIN
1.6       cvs      2717:                         Numerator   = Expression;
1.1       cvs      2718:                         Denominator = Expression;
                   2719:                         END;
                   2720:                   Root = 
                   2721:                         BEGIN
                   2722:                       ? Order = TEXT;
                   2723:                         Root_Contents = Expression;
                   2724:                         END;
                   2725:                   Integral =
                   2726:                         BEGIN
                   2727:                         Integration_Symbol = SYMBOL;
                   2728:                         Lower_Bound        = Expression;
                   2729:                         Upper_Bound        = Expression;
                   2730:                         END;
                   2731:                   Triple =
                   2732:                         BEGIN
                   2733:                         Princ_Expression = Expression;
                   2734:                         Lower_Expression = Expression;
                   2735:                         Upper_Expression = Expression;
                   2736:                         END;
                   2737:                   Column = LIST [2..*] OF 
                   2738:                               (Element = Expression);
                   2739:                   Parentheses_Block =
                   2740:                         BEGIN
                   2741:                         Opening  = SYMBOL;
                   2742:                         Contents = Expression;
                   2743:                         Closing  = SYMBOL;
                   2744:                         END;
                   2745:                   END;       { End of Choice Constructor }
1.18      cvs      2746: END                          { End of Structure Schema }</pre>
                   2747: <p>
1.1       cvs      2748: This schema defines a single global attribute which allows functions and
                   2749: variables to be distinguished.  In the presentation schema, this attribute can
                   2750: be used to choose between roman (for functions) and italic characters (for
1.18      cvs      2751: variables).</p>
                   2752: <p>
1.1       cvs      2753: A formula's structure is that of a mathematical expression, which is itself a
                   2754: sequence of mathematical constructions.  A mathematical construction can be
                   2755: either a simple character string, an index, an exponent, a fraction, a root,
                   2756: etc.  Each of these mathematical constructions has a sensible structure which
                   2757: generally includes one or more expressions, thus making the formula class's
1.18      cvs      2758: structure definition recursive.</p>
                   2759: <p>
1.1       cvs      2760: In most cases, the roots which appear in the formulas are square roots and
                   2761: their order (2) is not specified.  This is why the Order component is marked
                   2762: optional by a question mark.  When explicitly requested, it is possible to add
1.18      cvs      2763: an order to a root, for example for cube roots (order = 3).</p>
                   2764: <p>
1.1       cvs      2765: An integral is formed by an integration symbol, chosen by the user (simple
                   2766: integral, double, curvilinear, etc.), and two bounds.  A more fine-grained
                   2767: schema would add components for the integrand and the integration variable.
                   2768: Similarly, the Block_Parentheses construction leaves the choice of opening and
                   2769: closing symbols to the user.  They can be brackets, braces, parentheses,
1.18      cvs      2770: etc.</p>
                   2771: </div>
                   2772: </div>
                   2773: <hr>
1.19      cvs      2774: 
1.18      cvs      2775: </div>
1.1       cvs      2776: 
1.18      cvs      2777: <div class="chapter">
1.1       cvs      2778: 
1.18      cvs      2779: <h1><a name="sect4">The P Language</a></h1>
1.1       cvs      2780: 
1.18      cvs      2781: <div class="section">
1.1       cvs      2782: 
1.18      cvs      2783: <h2><a name="sectb41">Document presentation</a></h2>
                   2784: <p>
1.1       cvs      2785: Because of the model adopted for Thot, the presentation of documents is
                   2786: clearly separated from their structure and content.  After having presented
                   2787: the logical structure of documents, we now detail the principles implemented
1.18      cvs      2788: for their presentation.  The concept of <em>presentation</em> encompasses what
1.5       cvs      2789: is often called the page layout, the composition, or the document style.  It
1.18      cvs      2790: is the set of operations which display the document on the screen or print it
                   2791: on paper.  Like logical structure, document presentation is defined
                   2792: generically with the help of a language, called P.</p>
1.1       cvs      2793: 
1.18      cvs      2794: <div class="subsection">
1.1       cvs      2795: 
1.18      cvs      2796: <h3><a name="sectc411">Two levels of presentation</a></h3>
                   2797: <p>
1.1       cvs      2798: The link between structure and presentation is clear: the logical organization
                   2799: of a document is used to carry out its presentation, since the purpose of the
                   2800: presentation is to make evident the organization of the document.  But the
                   2801: presentation is equally dependent on the device used to render the document.
                   2802: Certain presentation effects, notably changes of font or character set, cannot
                   2803: be performed on all printers or on all screens.  This is why Thot uses a
                   2804: two-level approach, where the presentation is first described in abstract
                   2805: terms, without taking into account each particular device, and then the
1.18      cvs      2806: presentation is realized within the constraints of a given device.</p>
                   2807: <p>
1.1       cvs      2808: Thus, presentation is only described as a function of the structure of the
                   2809: documents and the image that would be produced on an idealized device.  For
                   2810: this reason, presentation descriptions do not refer to any device
1.18      cvs      2811: characteristics: they describe <em>abstract presentations</em> which can be
                   2812: concretized on different devices.</p>
                   2813: <p>
                   2814: A presentation description also defines a <em>generic presentation</em>, since
1.1       cvs      2815: it describes the appearance of a class of documents or objects. This generic
                   2816: presentation must also be applied to document and object instances, each
                   2817: conforming to its generic logical structure, but with all the allowances that
                   2818: were called to mind above: missing elements, constructed elements with other
1.18      cvs      2819: logical structures, etc.</p>
                   2820: <p>
1.1       cvs      2821: In order to preserve the homogeneity between documents and objects,
                   2822: presentation is described with a single set of tools which support the layout
                   2823: of a large document as well as the composition of objects like a graphical
                   2824: figure or mathematical formula.  This unity of presentation description tools
                   2825: contrasts with the traditional approach, which focuses more on documents than
                   2826: objects and thus is based on the usual typographic conventions, such as the
                   2827: placement of margins, indentations, vertical spaces, line lengths,
1.18      cvs      2828: justification, font changes, etc.</p>
                   2829: </div>
1.1       cvs      2830: 
1.18      cvs      2831: <div class="subsection">
1.1       cvs      2832: 
1.18      cvs      2833: <h3><a name="sectc412">Boxes</a></h3>
                   2834: <p>
1.1       cvs      2835: To assure the homogeneity of tools, all presentation in Thot, for documents as
                   2836: well as for the objects which they contain, is based on the notion of the
1.18      cvs      2837: <em>box</em>, such as was implemented in T<sub><big>E</big></sub>X.</p>
                   2838: <p>
1.1       cvs      2839: Corresponding to each element of the document is a box,  which is the
                   2840: rectangle enclosing the element on the display device (screen or sheet of
1.18      cvs      2841: paper);  the outline of this rectangle is not visible, except when a <a
                   2842: href="#sectc4230a"><tt>ShowBox</tt> rule</a> applies to the element. The sides
                   2843: of the box are parallel to the sides of the screen or the sheet of paper.  By
                   2844: way of example, a box is associated with a character string, a line of text, a
                   2845: page, a paragraph, a title, a mathematical formula, or a table cell.</p>
                   2846: <p>
1.1       cvs      2847: Whatever element it corresponds to, each box possesses four sides and four
1.18      cvs      2848: axes, which we designate as follows (<a href="#boxes">see figure</a>):</p>
                   2849: <dl>
                   2850: <dt><tt>Top</tt></dt>
                   2851: <dd>
                   2852: the upper side,
                   2853: </dd>
                   2854: <dt><tt>Bottom</tt></dt>
                   2855: <dd>
                   2856: the lower side,
                   2857: </dd>
                   2858: <dt><tt>Left</tt></dt>
                   2859: <dd>
                   2860: the left side,
                   2861: </dd>
                   2862: <dt><tt>Right</tt></dt>
                   2863: <dd>
                   2864: the right side,
                   2865: </dd>
                   2866: <dt><tt>VMiddle</tt></dt>
                   2867: <dd>
                   2868: the vertical axis passing through the center of the box,
                   2869: </dd>
                   2870: <dt><tt>HMiddle</tt></dt>
                   2871: <dd>
                   2872: the horizontal axis passing through the center of the box,
                   2873: </dd>
                   2874: <dt><tt>VRef</tt></dt>
                   2875: <dd>
                   2876: the vertical reference axis,
                   2877: </dd>
                   2878: <dt><tt>HRef</tt></dt>
                   2879: <dd>
                   2880: the horizontal reference axis.
                   2881: </dd>
                   2882: </dl>
                   2883: 
                   2884: <div class="figure">
                   2885: <hr>
1.19      cvs      2886: 
1.18      cvs      2887: <pre>        Left   VRef  VMiddle        Right
1.1       cvs      2888:                  :      :
                   2889:     Top   -----------------------------
                   2890:           |      :      :             |
                   2891:           |      :      :             |
                   2892:           |      :      :             |
                   2893:           |      :      :             |
                   2894:           |      :      :             |
                   2895: HMiddle ..|...........................|..
                   2896:           |      :      :             |
                   2897:           |      :      :             |
                   2898:    HRef ..|...........................|..
                   2899:           |      :      :             |
                   2900:           |      :      :             |
                   2901:   Bottom  -----------------------------
1.18      cvs      2902:                  :      :</pre>
1.19      cvs      2903: <p align="center">
1.18      cvs      2904: <em><a name="boxes">The sides and axes of boxes</a><em></em></em></p>
                   2905: <hr>
1.19      cvs      2906: 
1.18      cvs      2907: </div>
                   2908: <p>
1.1       cvs      2909: The principal role of boxes is to set the extent and position of the images of
                   2910: the different elements of a document with respect to each other on the
                   2911: reproduction device.  This is done by defining relations between the boxes of
                   2912: different elements which give relative extents and positions to these
1.18      cvs      2913: boxes.</p>
                   2914: <p>
                   2915: There are three types of boxes:</p>
                   2916: <ul>
                   2917: <li>
                   2918: boxes corresponding to structural elements of the document,
1.19      cvs      2919: </li>
1.18      cvs      2920: <li>
                   2921: presentation boxes,
1.19      cvs      2922: </li>
1.18      cvs      2923: <li>
                   2924: page layout boxes.
1.19      cvs      2925: </li>
1.18      cvs      2926: </ul>
                   2927: <p>
                   2928: <strong>Boxes corresponding to structural elements of the document</strong>
1.1       cvs      2929: are those which linked to each of the elements (base or structured) of the
                   2930: logical structure of the document.  Such a box contains all the contents of
1.18      cvs      2931: the element to which it corresponds (there is an exception: see <a
                   2932: href="#sectc4220">rules <tt>VertOverflow</tt> and <tt>HorizOverflow</tt></a>).
                   2933: These boxes form a tree-like structure, identical to that of the structural
                   2934: elements to which they correspond.  This tree expresses the inclusion
                   2935: relationships between the boxes: a box includes all the boxes of its subtree.
                   2936: On the other hand, there are no predefined rules for the relative positions of
                   2937: the included boxes.  If they are at the same level, they can overlap, be
                   2938: contiguous, or be disjoint. The rules expressed in the generic presentation
                   2939: specify their relative positions.</p>
                   2940: <p>
                   2941: <strong>Presentation boxes</strong> represent elements which are not found in
1.1       cvs      2942: the logical structure of the document but which are added to meet the needs of
                   2943: presentation.  These boxes are linked to the elements of the logical structure
                   2944: that are best suited to bringing them out. For example, they are used to add
                   2945: the character string ``Summary:'' before the summary in the presentation of a
                   2946: report or to represent the fraction bar in a formula, or also to make the
                   2947: title of a field in a form appear.  These elements have no role in the logical
                   2948: structure of the document: the presence of a Summary element in the document
                   2949: does not require the creation of another structural object to hold the word
                   2950: ``Summary''. Similarly, if a Fraction element contains both a Numerator
                   2951: element and a Denominator element, the fraction bar has no purpose
                   2952: structurally.  On the other hand, these elements of the presentation are
                   2953: important for the reader of the reproduced document or for the user of an
                   2954: editor.  This is why they must appear in the document's image.  It is the
                   2955: generic presentation which specifies the presentation boxes to add by
                   2956: indicating their content (a base element for which the value is specified) and
                   2957: the position that they must take in the tree of boxes.  During editing, these
1.18      cvs      2958: boxes cannot be modified by the user.</p>
                   2959: <p>
                   2960: <strong>Page layout boxes</strong> are boxes created implicitly by the page
1.1       cvs      2961: layout rules.  These rules indicate how the contents of a structured element
                   2962: must be broken into lines and pages.  In contrast to presentation boxes, these
                   2963: line and page boxes do not depend on the logical structure of the document,
1.18      cvs      2964: but rather on the physical constraints of the output devices: character size,
                   2965: height and width of the window on the screen or of the sheet of paper.</p>
                   2966: </div>
1.1       cvs      2967: 
1.18      cvs      2968: <div class="subsection">
1.1       cvs      2969: 
1.18      cvs      2970: <h3><a name="sectc413">Views and visibility</a></h3>
                   2971: <p>
1.1       cvs      2972: One of the operations that one might wish to perform on a document is to view
                   2973: it is different ways.  For this reason, it is possible to define several
1.18      cvs      2974: <em>views</em> for the same document, or better yet, for all documents of the
1.1       cvs      2975: same class.  A view is not a different presentation of the document, but
                   2976: rather a filter which only allows the display of certain parts of the
                   2977: document.  For example, it might be desirable to see only the titles of
                   2978: chapters and sections in order to be able to move rapidly through the
                   2979: document.  Such a view could be called a ``table of contents''.  It might also
                   2980: be desirable to see only the mathematical formulas of a document in order to
                   2981: avoid being distracted by the non-mathematical aspects of the document.  A
1.18      cvs      2982: ``mathematics'' view could provide this service.</p>
                   2983: <p>
1.1       cvs      2984: Views, like presentation, are based on the generic logical structure. Each
                   2985: document class, and each generic presentation, can be provided with views
                   2986: which are particularly useful for that class or presentation.  For each view,
1.18      cvs      2987: the <em>visibility</em> of elements is defined, indicated whether or not the
1.1       cvs      2988: elements must be presented to the user.  The visibility is calculated  as a
                   2989: function of the type of the elements or their hierarchical position in the
                   2990: structure of the document.  Thus, for a table of contents, all the ``Chapter
                   2991: Title'' and ``Section Title'' elements are made visible.  However, the
                   2992: hierarchical level could be used to make the section titles invisible below a
                   2993: certain threshold level.  By varying this threshold, the granularity of the
                   2994: view can be varied.  In the ``mathematics'' view, only Formula elements would
1.18      cvs      2995: be made visible, no matter what their hierarchical level.</p>
                   2996: <p>
1.1       cvs      2997: Because views are especially useful for producing a synthetic image of the
                   2998: document, it is necessary to adapt the presentation of the elements to the
                   2999: view in which they appear.  For example, it is inappropriate to have a page
                   3000: break before every chapter title in the table of contents.  Thus, generic
                   3001: presentations take into account the possible views and permit each element
1.18      cvs      3002: type's presentation to vary according the view in which its image appears.</p>
                   3003: <p>
                   3004: <a name="views">Views</a> are also used, when editing documents, to display
1.1       cvs      3005: the associated elements.  So, in addition to the primary view of the document,
                   3006: there can be a ``notes'' view and a ``figures'' view which contain,
                   3007: respectively, the associated elements of the Note and Figure types. In this
                   3008: way, it is possible to see simultaneously the text which refers to these
                   3009: elements and the elements themselves, even if they will be separated when
1.18      cvs      3010: printed.</p>
                   3011: </div>
1.1       cvs      3012: 
1.18      cvs      3013: <div class="subsection">
1.1       cvs      3014: 
1.18      cvs      3015: <h3><a name="sectc414">Pages</a></h3>
                   3016: <p>
1.1       cvs      3017: Presentation schemas can be defined which display the document as a long
                   3018: scroll, without page breaks.  This type of schema is particularly well-suited
                   3019: to the initial phase of work on a document, where jumps from page to page
                   3020: would hinder composing and reading the document on a screen.  In this case,
                   3021: the associated elements (such as notes), which are normally displayed in the
                   3022: page footer, are presented in a separate window.  But, once the document is
                   3023: written, it may be desirable to display the document on the screen in the same
                   3024: manner in which it will be printed.  So, the presentation schema must define
1.18      cvs      3025: pages.</p>
                   3026: <p>
1.1       cvs      3027: The P language permits the specification of the dimensions of pages as well as
                   3028: their composition.  It is possible to generate running titles, page numbers,
                   3029: zones at the bottom of the page for notes, etc.  The editor follows this model
                   3030: and inserts page break marks in the document which are used during printing,
1.18      cvs      3031: insuring that the pages on paper are the same as on the screen.</p>
                   3032: <p>
1.1       cvs      3033: Once a document has been edited with a presentation schema defining pages, it
                   3034: contains page marks.  But it is always possible to edit the document using a
                   3035: schema without pages.  In this case, the page marks are simply ignored by the
                   3036: editor.  They are considered again as soon as a schema with pages is used.
1.18      cvs      3037: Thus, the user is free to choose between schemas with and without pages.</p>
                   3038: <p>
1.1       cvs      3039: Thot treats the page break, rather than the page itself, as a box. This page
                   3040: break box contains all the elements of one page's footer, a rule marking the
                   3041: edge of this page, and all the elements of the next page's header.  The
                   3042: elements of the header and footer can be running titles, page number,
                   3043: associated elements (notes, for example), etc. All these elements, as well as
                   3044: their content and graphical appearance, are defined by the generic
1.18      cvs      3045: presentation.</p>
                   3046: </div>
1.1       cvs      3047: 
1.18      cvs      3048: <div class="subsection">
1.1       cvs      3049: 
1.18      cvs      3050: <h3><a name="sectc415">Numbering</a></h3>
                   3051: <p>
1.1       cvs      3052: Many elements are numbered in documents: pages, chapters, sections, formulas,
                   3053: theorems, notes, figures, bibliographic references, exercises, examples,
                   3054: lemmas, etc.  Because Thot has a notion of logical structure, all of these
                   3055: numbers (with the exception of pages) are redundant with information implicit
                   3056: in the logical structure of the document.  Such numbers are simply a way to
                   3057: make the structure of the document more visible.  So, they are part of the
                   3058: document's presentation and are calculated by the editor from the logical
                   3059: structure.  The structure does not contain numbers as such; it only defines
                   3060: relative structural positions between elements, which serve as ordering
1.18      cvs      3061: relations on these elements.</p>
                   3062: <p>
1.1       cvs      3063: If the structure schema defines the body of a document as a sequence of at
1.18      cvs      3064: least two chapters:</p>
                   3065: <pre>Body = LIST [2..*] OF Chapter;</pre>
                   3066: <p>
                   3067: the sequence defined by the list constructor is ordered and each chapter can
                   3068: be assigned a number based on its rank in the Body list.  Therefore, all
                   3069: elements contained in lists a the structure of a document can be numbered, but
                   3070: they are not the only ones.  The tree structure induced by the aggregate,
                   3071: list, and choice constructors (excluding references) defines a total order on
                   3072: the elements of the document's primary structure.  So, it is possible to
                   3073: define a numbering which uses this order, filtering elements according to
                   3074: their type so that only certain element types are taken into account in the
                   3075: numbering.  In this way, it possible to number all the theorems and lemmas of
                   3076: a chapter in the same sequence of numbers, even when they are not part of the
                   3077: same list constructor and appear at different levels of the document's tree.
                   3078: By changing the filter, they can be numbered separately: one sequence of
                   3079: numbers for theorems, another for the lemmas.</p>
                   3080: <p>
1.1       cvs      3081: Associated elements pose a special problem, since they are not part of the
                   3082: document's primary structure, but are attached only by references, which
                   3083: violate the total order of the document.  Then, these associated elements are
                   3084: frequently numbered, precisely because the number is an effective way to
                   3085: visualize the reference.  In order to resolve this problem, Thot implicitly
                   3086: defines a list constructor for each type of associated element, gathering
                   3087: together (and ordering) these elements.  Thus, the associated elements can be
1.18      cvs      3088: numbered by type.</p>
                   3089: <p>
1.1       cvs      3090: Since they are calculated from the document's logical structure and only for
                   3091: the needs of the presentation, numbers are presentation elements, described by
                   3092: presentation boxes, just like the fraction bar or the word ``Summary''.
                   3093: Nevertheless, numbers differ from these other boxes because their content
                   3094: varies from instance to instance, even though they are of the same type,
                   3095: whereas all fraction bars are horizontal lines and the same word ``Summary''
1.18      cvs      3096: appears at the head of every document's summary.</p>
                   3097: </div>
1.1       cvs      3098: 
1.18      cvs      3099: <div class="subsection">
1.1       cvs      3100: 
1.18      cvs      3101: <h3><a name="sectc416">Presentation parameters</a></h3>
                   3102: <p>
1.1       cvs      3103: The principal parameters which determine document presentation are the
1.18      cvs      3104: <em>positions</em> and <em>dimensions</em> of boxes, the <em>font</em>, the
                   3105: <em>style</em>, the <em>size</em>, the <em>underlining</em> and the
                   3106: <em>color</em> of their content.  From these parameters, and some others of
1.1       cvs      3107: less importance, it is possible to represent the usual typographic parameters
                   3108: for the textual parts of the document.  These same parameters can be used to
                   3109: describe the geometry of the non-textual elements, even though they are
1.18      cvs      3110: two-dimensional elements unlike the text, which is linear.</p>
                   3111: <p>
1.1       cvs      3112: As we have already  seen, the positions of the boxes always respect the rule
                   3113: of enclosure: a box in the tree encloses all the boxes of the next lower level
                   3114: which are attached to it.  The positional parameters permit the specification
                   3115: of the position of each box in relation to the enclosing box or to its sibling
                   3116: boxes (boxes directly attached to the same enclosing box in the tree of
1.18      cvs      3117: boxes).</p>
                   3118: <p>
1.1       cvs      3119: The presentation parameters also provide control over the dimensions of the
                   3120: boxes.  The dimensions of a box can depend either on its content or on its
                   3121: context (its sibling boxes and the enclosing box). Each dimension (height or
1.18      cvs      3122: width) can be defined independently of the other.</p>
                   3123: <p>
1.1       cvs      3124: Because of the position and dimension parameters, it is possible to do the
                   3125: same things that are normally done in typography by changing margins, line
                   3126: lengths, and vertical or horizontal skips.  This approach can also align or
1.18      cvs      3127: center elements and groups of elements.</p>
                   3128: <p>
1.1       cvs      3129: In contrast to the position and dimension parameters, the font, style, size,
                   3130: underlining, and color do not concern the box itself (the rectangle delimiting
                   3131: the element), but its content.  These parameters indicate the typographic
                   3132: attributes which must be applied to the text contained in the box, and by
1.18      cvs      3133: extension, to all base elements.</p>
                   3134: <p>
1.1       cvs      3135: For text, the font parameter is used to change the family of characters
                   3136: (Times, Helvetica, Courier, etc.); the style is used to obtain italic or
                   3137: roman, bold or light characters;  the size determines the point size of the
                   3138: characters; underlining defines the type and thickness of the lines drawn
1.18      cvs      3139: above, below, or through the characters.</p>
                   3140: <p>
1.1       cvs      3141: For graphics, the line style parameter can be either solid, dotted, or dashed;
                   3142: the line thickness parameter controls the width of the lines; the fill pattern
1.18      cvs      3143: parameter determines how closed geometric figures must be filled.</p>
                   3144: <p>
1.1       cvs      3145: While some of the parameters which determine the appearance of a box's
                   3146: contents make sense only for one content type (text or graphic), other
                   3147: parameters apply to all content types: these are the color parameters. These
1.18      cvs      3148: indicate the color of lines and the background color.</p>
                   3149: </div>
                   3150: </div>
1.1       cvs      3151: 
1.18      cvs      3152: <div class="section">
1.1       cvs      3153: 
1.18      cvs      3154: <h2><a name="sectb42">Presentation description language</a></h2>
                   3155: <p>
1.1       cvs      3156: A generic presentation defines the values of presentation parameters (or the
                   3157: way to calculate those values) for a generic structure, or more precisely, for
                   3158: all the element types and all the global and local attributes defined in that
                   3159: generic structure.  This definition of the presentation parameters is made
                   3160: with the P language.  A program written in this language, that is a generic
1.18      cvs      3161: presentation expressed in P, is call a <em>presentation schema</em>. This
                   3162: section describes the syntax and semantics of the language, using the same <a
                   3163: href="#sectc321">meta-language</a> as was used for the definition of the S
                   3164: language.</p>
                   3165: <p>
1.1       cvs      3166: Recall that it is possible to write many different presentation schemas for
                   3167: the same class of documents or objects.  This allows users to choose for a
                   3168: document the graphical appearance  which best suits their type of work or
1.18      cvs      3169: their personal taste.</p>
1.1       cvs      3170: 
1.18      cvs      3171: <div class="subsection">
1.1       cvs      3172: 
1.18      cvs      3173: <h3><a name="sectc421">The organization of a presentation schema</a></h3>
                   3174: <p>
                   3175: A presentation schema begins with the word <tt>PRESENTATION</tt> and ends with
                   3176: the word <tt>END</tt>.  The word <tt>PRESENTATION</tt> is followed by the name
1.1       cvs      3177: of the generic structure to which the presentation will be applied.  This name
1.18      cvs      3178: must be the same as that which follows the keyword <tt>STRUCTURE</tt> in the
                   3179: structure schema associated with the presentation schema.</p>
                   3180: <p>
1.1       cvs      3181: After this declaration of the name of the structure, the following sections
1.18      cvs      3182: appear (in order):</p>
                   3183: <ul>
                   3184: <li>
                   3185: Declarations of
                   3186: <ul>
                   3187: <li>
                   3188: all views,
1.19      cvs      3189: </li>
1.18      cvs      3190: <li>
                   3191: printed views,
1.19      cvs      3192: </li>
1.18      cvs      3193: <li>
                   3194: counters,
1.19      cvs      3195: </li>
1.18      cvs      3196: <li>
                   3197: presentation constants,
1.19      cvs      3198: </li>
1.18      cvs      3199: <li>
                   3200: variables,
1.19      cvs      3201: </li>
1.18      cvs      3202: </ul>
1.19      cvs      3203: </li>
1.18      cvs      3204: <li>
                   3205: default presentation rules,
1.19      cvs      3206: </li>
1.18      cvs      3207: <li>
                   3208: presentation box and page layout box definitions,
1.19      cvs      3209: </li>
1.18      cvs      3210: <li>
                   3211: presentation rules for structured elements,
1.19      cvs      3212: </li>
1.18      cvs      3213: <li>
                   3214: presentation rules for attributes,
1.19      cvs      3215: </li>
1.18      cvs      3216: <li>
                   3217: rules for transmitting values to attributes of included documents.
1.19      cvs      3218: </li>
1.18      cvs      3219: </ul>
                   3220: <p>
1.1       cvs      3221: Each of these sections is introduced by a keyword which is followed by a
1.18      cvs      3222: sequence of declarations.  Every section is optional.</p>
                   3223: <pre>     SchemaPres ='PRESENTATION' ElemID ';'
1.1       cvs      3224:                [ 'VIEWS' ViewSeq ]
                   3225:                [ 'PRINT' PrintViewSeq ]
                   3226:                [ 'COUNTERS' CounterSeq ]
                   3227:                [ 'CONST' ConstSeq ]
                   3228:                [ 'VAR' VarSeq ]
                   3229:                [ 'DEFAULT' ViewRuleSeq ]
                   3230:                [ 'BOXES' BoxSeq ]
                   3231:                [ 'RULES' PresentSeq ]
                   3232:                [ 'ATTRIBUTES' PresAttrSeq ]
                   3233:                [ 'TRANSMIT' TransmitSeq ]
                   3234:                  'END' .
1.18      cvs      3235:      ElemID     = NAME .</pre>
                   3236: </div>
1.1       cvs      3237: 
1.18      cvs      3238: <div class="subsection">
1.1       cvs      3239: 
1.18      cvs      3240: <h3><a name="sectc422">Views</a></h3>
                   3241: <p>
1.1       cvs      3242: Each of the possible views must be declared in the presentation schema.  As
1.18      cvs      3243: has <a href="#views">already been described</a>, the presentation rules for an
1.1       cvs      3244: element type can vary according to the view in which the element appears.  The
                   3245: name of the view is used to designate the view to which the presentation rules
1.18      cvs      3246: apply (see the <a href="#inkeyword"><tt>IN</tt> instruction</a>).  The
1.1       cvs      3247: definition of the view's contents are dispersed throughout the presentation
                   3248: rules attached to the different element types and attributes.  The
1.18      cvs      3249: <tt>VIEWS</tt> section is simply a sequence of view names separated by commas
                   3250: and terminated by a semi-colon.</p>
                   3251: <p>
1.1       cvs      3252: One of the view names (and only one) can be followed by the keyword
1.18      cvs      3253: <tt>EXPORT</tt>.  This keyword identifies the view which presents the members
                   3254: of the document class in <a href="#sectc3213">skeleton form</a>.  The
                   3255: graphical appearance  and the content of this view is defined just as with
                   3256: other views, but it is useless to specify presentation rules concerning this
                   3257: view for the elements which are not loaded in the skeleton form.</p>
                   3258: <p>
1.1       cvs      3259: It is not necessary to declare any views; in this case there is a single
                   3260: unnamed view.  If many views are declared, the first view listed is considered
                   3261: the principal view.  The principal view is the one to which all rules that are
1.18      cvs      3262: not preceded by an indication of a view will apply (see the <a
                   3263: href="#inkeyword">instruction <tt>IN</tt></a>).</p>
                   3264: <p>
1.1       cvs      3265: The principal view is the the one which the editor presents on the screen when
                   3266: the user asks to create or edit a document.  Thus, it makes sense to put the
                   3267: most frequently used view at the head of the list.  But if the structure
1.18      cvs      3268: schema contains <a href="#sectc3213">skeleton elements</a> and is loaded in
                   3269: its skeleton form, the view whose name is followed by the keyword
                   3270: <tt>EXPORT</tt> will be opened and no other views can be opened.</p>
                   3271: <pre>                      'VIEWS' ViewSeq
1.1       cvs      3272:      ViewSeq         = ViewDeclaration
1.6       cvs      3273:                        &lt; ',' ViewDeclaration > ';' .
1.1       cvs      3274:      ViewDeclaration = ViewID [ 'EXPORT' ] .
1.18      cvs      3275:      ViewID          = NAME .</pre>
                   3276: <blockquote class="example">
                   3277: <p>
                   3278: <strong>Example:</strong></p>
                   3279: <p>
1.3       cvs      3280: When editing a report, it might be useful have views of the table of contents
1.18      cvs      3281: and of the mathematical formulas, in addition to the principal view which
                   3282: shows the document in its entirety.  To achieve this, a presentation schema
                   3283: for the Report class would have the following <tt>VIEWS</tt> section:</p>
                   3284: <pre>VIEWS
                   3285:      Full_text, Table_of_contents, Formulas;</pre>
                   3286: <p>
1.1       cvs      3287: The contents of these views are specified in the presentation rules of the
1.18      cvs      3288: schema.</p>
                   3289: </blockquote>
                   3290: </div>
1.1       cvs      3291: 
1.18      cvs      3292: <div class="subsection">
1.1       cvs      3293: 
1.18      cvs      3294: <h3><a name="sectc423">Print Views</a></h3>
                   3295: <p>
1.1       cvs      3296: When editing a document, each view is presented in a different window.  In
1.18      cvs      3297: addition to the views specified by the <tt>VIEWS</tt> instruction, the user
1.1       cvs      3298: can display the associated elements with one window for each type of
1.18      cvs      3299: associated element.</p>
                   3300: <p>
1.1       cvs      3301: When printing a document, it is possible to print any number of views, chosen
                   3302: from among all the views which the editor can display (views in the strict
                   3303: sense or associated elements).  Print views, as well as the order in which
1.18      cvs      3304: they must be printed, are indicated by the <tt>PRINT</tt> instruction. It
                   3305: appears after the <tt>VIEWS</tt> instruction and is formed of the keyword
                   3306: <tt>PRINT</tt> followed by the ordered list of print view names.  The print
1.1       cvs      3307: view names are separated by commas and followed by a semi-colon.  A print view
1.18      cvs      3308: name is either a view name declared in the <tt>VIEWS</tt> instruction or the
1.1       cvs      3309: name of an associated element type (with an ``s'' added to the end).  The
1.18      cvs      3310: associated element must have been declared in the <tt>ASSOC</tt> section of
                   3311: the structure schema.</p>
                   3312: <pre>                    'PRINT' PrintViewSeq
1.1       cvs      3313:      PrintViewSeq = PrintView &lt; ',' PrintView > ';' .
1.18      cvs      3314:      PrintView    = ViewID / ElemID .</pre>
                   3315: <p>
                   3316: If the <tt>PRINT</tt> instruction is absent, the printing program will print
                   3317: only the principal view (the first view specified by the <tt>VIEWS</tt>
                   3318: instruction or the single, unnamed view when there is no <tt>VIEWS</tt>
                   3319: instruction).</p>
                   3320: <blockquote class="example">
                   3321: <p>
                   3322: <strong>Example:</strong></p>
                   3323: <p>
1.3       cvs      3324: Consider a Report presentation using the view declarations from the preceding
                   3325: example.  Suppose we want to print the full text and table of contents views,
                   3326: but not the Formulas view, which is only useful when editing.  In addition,
                   3327: suppose that we also want to print the bibliographic citations, which are
1.18      cvs      3328: associated elements (of type <tt>Citation</tt>).  A sensible printing order
1.3       cvs      3329: would be to print the full text then the bibliography and finally the table of
                   3330: contents.  To obtain this result when printing, the presentation schema would
1.18      cvs      3331: say:</p>
                   3332: <pre>PRINT
                   3333:      Full_text, Citations, Table_of_contents;</pre>
                   3334: </blockquote>
                   3335: </div>
                   3336: 
                   3337: <div class="subsection">
                   3338: 
                   3339: <h3><a name="sectc424">Counters</a></h3>
                   3340: <p>
                   3341: A presentation has a <em>counter</em> for each type of number in the
1.1       cvs      3342: presentation.  All counters, and therefore all types of numbers, used in the
1.18      cvs      3343: schema must be declared after the <tt>COUNTERS</tt> keyword.</p>
                   3344: <p>
1.1       cvs      3345: Each counter declaration is composed of a name identifying the counter
                   3346: followed by a colon and the counting function to be applied to the counter.
1.18      cvs      3347: The counter declaration ends with a semi-colon.</p>
                   3348: <p>
1.1       cvs      3349: The counting function indicates how the counter values will be calculated.
1.16      cvs      3350: Three types of counting functions are available.  The first type is used to
                   3351: count the elements of a list or aggregate: it assigns to the counter the rank
1.18      cvs      3352: of the element in the list or aggregate.  More precisely, the function</p>
                   3353: <pre>RANK OF ElemID [ LevelAsc ] [ INIT AttrID ]
                   3354:         [ 'REINIT' AttrID ]</pre>
                   3355: <p>
                   3356: indicates that when an element creates, by a creation rule (see the <a
                   3357: href="#sectc4232"><tt>Create</tt> instructions</a>), a presentation box
1.5       cvs      3358: containing  the counter value, this value is the rank of the creating element,
1.18      cvs      3359: if it is of type <tt>ElemID</tt>, otherwise the rank of the first element of
                   3360: type <tt>ElemID</tt> which encloses the creating element in the logical
                   3361: structure of the document.</p>
                   3362: <p>
1.1       cvs      3363: The type name can be preceded by a star in the special case where the
1.18      cvs      3364: structure schema defines an element of whose <tt>ElemID</tt> is the same as
                   3365: that of an <a href="#sectd3284">inclusion</a> without expansion or with
                   3366: partial expansion.  To resolve this ambiguity, the <tt>ElemID</tt> alone
                   3367: refers to the type defined in the structure schema while the <tt>ElemID</tt>
                   3368: preceded by a star refers to the included type.</p>
                   3369: <p>
                   3370: The type name <tt>ElemID</tt> can be followed by an integer.  That number
1.1       cvs      3371: represents the relative level, among the ancestors of the creating element, of
1.18      cvs      3372: the element whose rank is asked.  If that relative level <i>n</i> is unsigned,
                   3373: the <i>n</i><sup>th</sup> element of type <tt>ElemID</tt> encountered when
1.1       cvs      3374: travelling the logical structure from the root to the creating element is
1.16      cvs      3375: taken into account.  If the relative level is negative, the logical structure
                   3376: is travelled in the other direction, from the creating element to the
1.18      cvs      3377: root.</p>
                   3378: <p>
                   3379: The function can end with the keyword <tt>INIT</tt> followed by the name of a
1.1       cvs      3380: numeric attribute (and only a numeric attribute).  Then, the rank of the first
                   3381: element of the list or aggregate is considered to be the value of this
                   3382: attribute, rather than the default value of 1, and the rank of the other
                   3383: elements is shifted accordingly.  The attribute which determines the initial
1.18      cvs      3384: value is searched on the element itself and on its ancestors.</p>
                   3385: <p>
                   3386: The function can end with the keyword <tt>REINIT</tt> followed by the name of
1.1       cvs      3387: a numeric attribute (and only a numeric attribute).  Then, if an element to be
                   3388: counted has this attribute, the counter value for this element is the
                   3389: attribute value and the following elements are numbered starting from this
1.18      cvs      3390: value.</p>
                   3391: <p>
                   3392: When the <tt>RANK</tt> function is written</p>
                   3393: <pre>RANK OF Page [ ViewID ] [ INIT AttrID ]</pre>
                   3394: <p>
                   3395: (<tt>Page</tt>is a keyword of the P language), the counter takes as its value
1.5       cvs      3396: the number of the page on which the element which creates the presentation box
                   3397: containing the number appears.  This is done as if the pages of the document
                   3398: form a list for each view.  The counter only takes into account the pages of
                   3399: the relevant view, that is the view displaying the presentation box whose
1.18      cvs      3400: contents take the value of the number.  However, if the keyword <tt>Page</tt>
1.5       cvs      3401: is followed by the name of a view (between parentheses), it is the pages of
                   3402: that view that are taken into account.  As in the preceding form, the
1.18      cvs      3403: <tt>RANK</tt> function applied to pages can end with the <tt>INIT</tt> keyword
1.5       cvs      3404: followed by the name of a numeric attribute which sets the value of the first
                   3405: page's number.  This attribute must be a local attribute of the document
1.18      cvs      3406: itself, and not of one of its components.</p>
                   3407: <p>
1.1       cvs      3408: The second counting function is used to count the occurrences of a certain
1.18      cvs      3409: element type in a specified context.  The instruction</p>
                   3410: <pre>SET n ON Type1 ADD m ON Type2 [ INIT AttrID ]</pre>
                   3411: <p>
1.5       cvs      3412: says that when the document is traversed from beginning to end (in the order
1.18      cvs      3413: induced by the logical structure), the counter is assigned the value
                   3414: <tt>n</tt> each time an element of type <tt>Type1</tt> is encountered, no
                   3415: matter what the current value of the counter, and the value <tt>m</tt> is
                   3416: added to the current value of the counter each time an element of type
                   3417: <tt>Type2</tt> is encountered.</p>
                   3418: <p>
                   3419: As with the <tt>RANK</tt> function, the type names can be preceded by a star
                   3420: to resolve the ambiguity of included elements.</p>
                   3421: <p>
                   3422: If the function ends with the keyword <tt>INIT</tt> followed by the name of an
1.1       cvs      3423: attribute and if the document possesses this attribute, the value of this
1.18      cvs      3424: attribute is used in place of <tt>n</tt>.  The attribute must be numeric.  It
                   3425: is searched on the element itself and on its ancestors.</p>
                   3426: <p>
                   3427: This function can also be used with the <tt>Page</tt> keyword in the place of
                   3428: <tt>Type1</tt> or <tt>Type2</tt>.  In the first case, the counter is
                   3429: reinitialized on each page with the value <tt>n</tt>, while in the second
                   3430: case, it is incremented by <tt>m</tt> on each page.  As with the preceding
                   3431: counting function, the word <tt>Page</tt> can be followed by a name between
1.1       cvs      3432: parentheses.  In this case, the name specifies a view whose pages are taken
1.18      cvs      3433: into account.</p>
                   3434: <p>
                   3435: The definition of a counter can contain several <tt>SET</tt> functions and
                   3436: several <tt>ADD</tt> functions, each with a different value.  The total number
                   3437: of counting functions must not be greater than 6.</p>
                   3438: <p>
1.1       cvs      3439: The third counting function is used to count the elements of a certain type
1.16      cvs      3440: encountered when travelling from the creating element to the root of the
                   3441: logical structure.  The creating element is included if it is of that type.
1.18      cvs      3442: That function is written</p>
                   3443: <pre>RLEVEL OF Type</pre>
                   3444: <p>
                   3445: where <tt>Type</tt> represents the type of the elements to be counted.</p>
                   3446: <p>
                   3447: The formal definition of counter declarations is:</p>
                   3448: <pre>                    'COUNTERS' CounterSeq
1.1       cvs      3449:      CounterSeq   = Counter &lt; Counter > .
                   3450:      Counter      = CounterID ':' CounterFunc ';' .
                   3451:      CounterID    = NAME .
                   3452:      CounterFunc  = 'RANK' 'OF' TypeOrPage [ SLevelAsc ]
1.16      cvs      3453:                     [ 'INIT' AttrID ] [ 'REINIT' AttrID ] /
1.1       cvs      3454:                     SetFunction &lt; SetFunction >
1.16      cvs      3455:                     AddFunction &lt; AddFunction >
                   3456:                     [ 'INIT' AttrID ] /
                   3457:                     'RLEVEL' 'OF' ElemID .
1.1       cvs      3458:      SLevelAsc    = [ '-' ] LevelAsc .
                   3459:      LevelAsc     =  NUMBER .
                   3460:      SetFunction  = 'SET' CounterValue 'ON' TypeOrPage .
                   3461:      AddFunction  = 'ADD' CounterValue 'ON' TypeOrPage .
                   3462:      TypeOrPage   = 'Page' [ '(' ViewID ')' ] / 
1.16      cvs      3463:                     [ '*' ] ElemID .
1.18      cvs      3464:      CounterValue = NUMBER .</pre>
                   3465: <blockquote class="example">
                   3466: <p>
                   3467: <strong>Example:</strong></p>
                   3468: <p>
1.3       cvs      3469: If the body of a chapter is defined as a sequence of sections in the structure
1.18      cvs      3470: schema:</p>
                   3471: <pre>Chapter_body = LIST OF (Section = 
1.1       cvs      3472:                             BEGIN
                   3473:                             Section_Title = Text;
                   3474:                             Section_Body  = Paragraphs;
                   3475:                             END
1.18      cvs      3476:                          );</pre>
                   3477: <p>
                   3478: the section counter is declared:</p>
                   3479: <pre>SectionCtr : RANK OF Section;</pre>
                   3480: <p>
                   3481: and the display of the section number before the section title is obtained by
                   3482: a <a href="#sectc4232"><tt>CreateBefore</tt> rule</a> attached the
                   3483: <tt>Section_Title</tt> type, which creates a presentation box whose content is
                   3484: the value of the <tt>SectionCtr</tt> counter (see the <a
                   3485: href="#sectc4231"><tt>Content</tt> instruction</a>).</p>
                   3486: <p>
1.1       cvs      3487: In order to number the formulas separately within each chapter, the formula
1.18      cvs      3488: counter is declared:</p>
                   3489: <pre>FormulaCtr : SET 0 ON Chapter ADD 1 ON Formula;</pre>
                   3490: <p>
1.4       cvs      3491: and the display of the formula number in the right margin, alongside each
1.18      cvs      3492: formula, is obtained by a <tt>CreateAfter</tt> instruction attached to the
                   3493: <tt>Formula</tt> type, which creates a presentation box whose content is the
                   3494: value of the <tt>FormulaCtr</tt> counter.</p>
                   3495: <p>
1.1       cvs      3496: To number the page chapter by chapter, with the first page of each chapter
1.18      cvs      3497: having the number 1, the counter definition would be</p>
                   3498: <pre>ChapterPageCtr : SET 0 ON Chapter ADD 1 ON Page;</pre>
                   3499: <p>
                   3500: If there is also a chapter counter</p>
                   3501: <pre>ChapterCtr : RANK OF Chapter;</pre>
                   3502: <p>
                   3503: the <a href="#sectc4231">content</a> of a presentation box created at the top
                   3504: of each page could be defined as:</p>
                   3505: <pre>Content : (VALUE(ChapterCtr, URoman) TEXT '-'
                   3506:            VALUE(ChapterPageCtr, Arabic));</pre>
                   3507: <p>
1.5       cvs      3508: Thus, the presentation box contains the number of the chapter in upper-case
1.18      cvs      3509: roman numerals followed by a hyphen and the number of the page within the
                   3510: chapter in arabic numerals.</p>
                   3511: </blockquote>
                   3512: <blockquote class="example">
                   3513: <p>
                   3514: <strong>Example:</strong></p>
                   3515: <p>
1.3       cvs      3516: To count tables and figures together in a document of the chapter type, a
1.18      cvs      3517: counter could be defined using:</p>
                   3518: <pre>CommonCtr : SET 0 ON Chapter ADD 1 ON Table
                   3519:             ADD 1 ON Figure;</pre>
                   3520: </blockquote>
                   3521: </div>
1.1       cvs      3522: 
1.18      cvs      3523: <div class="subsection">
1.1       cvs      3524: 
1.18      cvs      3525: <h3><a name="sectc425">Presentation constants</a></h3>
                   3526: <p>
1.1       cvs      3527: Presentation constants are used in the definition of the content of
1.18      cvs      3528: presentation boxes.  This content is used in <a href="#sectc426">variable
                   3529: definitions</a> and in the <a href="#sectc4231"><tt>Content</tt> rule</a>. The
1.1       cvs      3530: only presentation constants which can be used are character strings,
1.2       cvs      3531: mathematical symbols, graphical elements, and pictures, that is to say, base
1.18      cvs      3532: elements.</p>
                   3533: <p>
1.1       cvs      3534: Constants can be defined directly in the variables or presentation boxes
1.18      cvs      3535: (<tt>Content</tt> rule) which use them.  But it is only necessary them to
1.1       cvs      3536: declare once, in the constant declaration section, even though they are used
                   3537: in many variables or boxes.  Thus, each declared constant has a name, which
                   3538: allows it to be designated whenever it is used, a type (one of the four base
                   3539: types) and a value (a character string or a single character for mathematical
1.18      cvs      3540: symbols and graphical elements).</p>
                   3541: <p>
                   3542: The constant declarations appear after the keyword <tt>CONST</tt>.  Each
1.1       cvs      3543: declaration is composed of the name of the constant, an equals sign, a keyword
1.18      cvs      3544: representing its type (<tt>Text</tt>, <tt>Symbol</tt>, <tt>Graphics</tt> or
                   3545: <tt>Picture</tt>) and the string representing its value. A semi-colon
                   3546: terminates each declaration.</p>
                   3547: <p>
                   3548: In the case of a character string, the keyword <tt>Text</tt> can be followed
                   3549: by the name of an alphabet (for example, <tt>Greek</tt> or <tt>Latin</tt>) in
1.1       cvs      3550: which the constant's text should be expressed.  If the alphabet name is
                   3551: absent, the Latin alphabet is used.  When the alphabet name is present, only
                   3552: the first letter of the alphabet name is interpreted.  Thus, the words
1.18      cvs      3553: <tt>Greek</tt> and <tt>Grec</tt> designate the same alphabet.  In current
                   3554: versions of Thot, only the Greek and Latin alphabets are available.</p>
                   3555: <pre>                 'CONST' ConstSeq
1.1       cvs      3556:      ConstSeq   = Const &lt; Const > .
                   3557:      Const      = ConstID '=' ConstType ConstValue ';' .
                   3558:      ConstID    = NAME .
                   3559:      ConstType  ='Text' [ Alphabet ] / 'Symbol' /
                   3560:                  'Graphics' / 'Picture' .
                   3561:      ConstValue = STRING .
1.18      cvs      3562:      Alphabet   = NAME .</pre>
                   3563: <p>
1.5       cvs      3564: For character strings in the Latin alphabet (ISO Latin-1 character set),
1.1       cvs      3565: characters having codes higher than 127 (decimal) are represented by their
1.18      cvs      3566: code in octal.</p>
                   3567: <p>
1.1       cvs      3568: In the case of a symbol or graphical element, the value only contains a single
                   3569: character, between apostrophes, which indicates the form of the element which
                   3570: must be drawn in the box whose content is the constant.  The symbol or
                   3571: graphical element takes the dimensions of the box, which are determined by the
1.18      cvs      3572: <tt>Height</tt> and <tt>Width</tt> rules. See <a href="#sectb72">table of
                   3573: codes</a> for the symbols and graphical elements.</p>
                   3574: <blockquote class="example">
                   3575: <p>
                   3576: <strong>Example:</strong></p>
                   3577: <p>
1.3       cvs      3578: The constants ``Summary:'' and fraction bar, which were described earlier, are
1.18      cvs      3579: declared:</p>
                   3580: <pre>CONST
1.1       cvs      3581:      SummaryConst = Text 'Summary:';
1.18      cvs      3582:      Bar          = Graphics 'h';</pre>
                   3583: </blockquote>
                   3584: </div>
1.1       cvs      3585: 
1.18      cvs      3586: <div class="subsection">
1.1       cvs      3587: 
1.18      cvs      3588: <h3><a name="sectc426">Variables</a></h3>
                   3589: <p>
1.1       cvs      3590: Variables permit the definition of computed content for presentation boxes. A
1.18      cvs      3591: variable is associated with a presentation box by a <tt>Content</tt> rule; but
                   3592: before being used in a <tt>Content</tt> rule, a variable can be defined in the
                   3593: <tt>VAR</tt> section.  It is also possible to define a variable at the time of
                   3594: its use in a <tt>Content</tt> rule, as can be done with a constant.</p>
                   3595: <p>
1.1       cvs      3596: A variable has a name and a value which is a character string resulting from
                   3597: the concatenation of the values of a sequence of functions.  Each variable
                   3598: declaration is composed of the variable name followed by a colon and the
                   3599: sequence of functions which produces its value, separated by spaces.  Each
1.18      cvs      3600: declaration is terminated by a semi-colon.</p>
                   3601: <pre>                  'VAR' VarSeq
1.1       cvs      3602:      VarSeq      = Variable &lt; Variable > .
                   3603:      Variable    = VarID ':' FunctionSeq ';' .
                   3604:      VarID       = NAME .
1.18      cvs      3605:      FunctionSeq = Function &lt; Function > .</pre>
                   3606: <p>
1.1       cvs      3607: Several functions are available.  The first two return, in the form of a
1.18      cvs      3608: character string, the current date.  <tt>DATE</tt> returns the date in
                   3609: English, while <tt>FDATE</tt> returns the date in french.</p>
                   3610: <p>
                   3611: Two other functions, <tt>DocName</tt> and <tt>DirName</tt>, return the
                   3612: document name and the directory where the document is stored.</p>
                   3613: <p>
                   3614: Function <tt>ElemName</tt> returns the type of the element which created the
                   3615: presentation box whose contents are the variable.</p>
                   3616: <p>
1.1       cvs      3617: Another function simply returns the value of a presentation constant. For any
1.18      cvs      3618: constant declared in the <tt>CONST</tt> section, it is sufficient to give the
1.1       cvs      3619: name of the constant.  Otherwise, the type and value of the constant must be
1.18      cvs      3620: given, using the same form as in a <a href="#sectc425">constant
                   3621: declaration</a>. If the constant is not of type text, (types <tt>Symbol</tt>,
                   3622: <tt>Graphics</tt> or <tt>Picture</tt>), it must be alone in the variable
                   3623: definition; only constants of type <tt>Text</tt> can be mixed with other
                   3624: functions.</p>
                   3625: <p>
1.1       cvs      3626: It is also possible to obtain the value of an attribute, simply by mentioning
                   3627: the attribute's name.  The value of this function is the value of the
                   3628: attribute for the element which created the presentation box whose contents
                   3629: are the variable.  If the creating element does not have the indicated
                   3630: attribute, the value is an empty string.  In the case of a numeric attribute,
                   3631: the attribute is translated into a decimal number in arabic numerals.  If
1.18      cvs      3632: another form is desired, the <tt>VALUE</tt> function must be used.</p>
                   3633: <p>
1.1       cvs      3634: The last available function returns, as a character string, the value of a
                   3635: counter, an attribute or a page number. This value can be presented in
1.18      cvs      3636: different styles.  The keyword <tt>VALUE</tt> is followed (between
1.1       cvs      3637: parentheses) by the name of the counter, the name of the attribute, or the
1.18      cvs      3638: keyword <tt>PageNumber</tt> and the desired style, the two parameters being
1.1       cvs      3639: separated by a comma.  The style is a keyword which indicates whether the
1.18      cvs      3640: value should be presented in arabic numerals (<tt>Arabic</tt>), lower-case
                   3641: roman numerals (<tt>LRoman</tt>), or upper-case roman numerals
                   3642: (<tt>URoman</tt>), or by an upper-case letter (<tt>Uppercase</tt>) or
                   3643: lower-case letter (<tt>Lowercase</tt>).</p>
                   3644: <p>
                   3645: For a page counter, the keyword <tt>PageNumber</tt> can be followed, between
1.1       cvs      3646: parentheses, by the name of the view from which to obtain the page number.  By
1.18      cvs      3647: default, the first view declared in the <tt>VIEWS</tt> section is used.  The
1.1       cvs      3648: value obtained is the number of the page on which is found the element that is
1.18      cvs      3649: using the variable in a <tt>Content</tt> rule.</p>
                   3650: <p>
1.1       cvs      3651: For an ordinary counter, the name of the counter can be preceded by the
1.18      cvs      3652: keyword <tt>MaxRangeVal</tt> or <tt>MinRangeVal</tt>.  These keywords mean
1.1       cvs      3653: that the value returned by the function is the maximum (minimum resp.) value
                   3654: taken by the counter in the whole document, not the value for the element
1.18      cvs      3655: concerned by the function.</p>
                   3656: <pre>     Function     = 'DATE' / 'FDATE' /
1.1       cvs      3657:                     'DocName' / 'DirName' /
                   3658:                     'ElemName' / 'AttributeName' /
                   3659:                      ConstID / ConstType ConstValue /
                   3660:                      AttrID /
                   3661:                     'VALUE' '(' PageAttrCtr ','
                   3662:                                 CounterStyle ')' .
1.6       cvs      3663:      PageAttrCtr  = 'PageNumber' [ '(' ViewID ')' ] /
1.1       cvs      3664:                      [ MinMax ] CounterID / AttrID .
                   3665:      CounterStyle = 'Arabic' / 'LRoman' / 'URoman' /
                   3666:                     'Uppercase' / 'Lowercase' .
1.18      cvs      3667:      MinMax       = 'MaxRangeVal' / 'MinRangeVal' .</pre>
                   3668: <blockquote class="example">
                   3669: <p>
                   3670: <strong>Example:</strong></p>
                   3671: <p>
                   3672: To make today's date appear at the top of the first page of a report, a <a
                   3673: href="#sectc4232"><tt>CREATE</tt> rule</a> associated with the Report_Title
1.3       cvs      3674: element type generates a presentation box whose content (specified by the
1.18      cvs      3675: <tt>Content</tt> rule of that presentation box) is the variable:</p>
                   3676: <pre>VAR
                   3677:      Todays_date : TEXT 'Version of ' DATE;</pre>
                   3678: <p>
1.1       cvs      3679: To produce, before each section title, the chapter number (in upper-case roman
                   3680: numerals) followed by the section number (in arabic numerals), two counters
1.18      cvs      3681: must be defined:</p>
                   3682: <pre>COUNTERS
1.1       cvs      3683:      ChapterCtr : RANK OF Chapter;
1.18      cvs      3684:      SectionCtr : RANK OF Section;</pre>
                   3685: <p>
1.4       cvs      3686: and the Section_Title element must create a presentation box whose content is
1.18      cvs      3687: the variable</p>
                   3688: <pre>VAR
1.1       cvs      3689:      SectionNum : VALUE (ChapterCtr, URoman) TEXT '-'
1.18      cvs      3690:                   VALUE (SectionCtr, Arabic);</pre>
                   3691: <p>
1.1       cvs      3692: In order to make the page number on which each section begins appear in the
                   3693: table of contents view next to the section title, each Section_Title element
                   3694: must create a presentation box, visible only in the table of contents view,
1.18      cvs      3695: whose content is the variable:</p>
                   3696: <pre>VAR
1.1       cvs      3697:      TitlePageNume :
1.18      cvs      3698:            VALUE (PageNumber(Full_text), Arabic);</pre>
                   3699: </blockquote>
                   3700: </div>
1.1       cvs      3701: 
1.18      cvs      3702: <div class="subsection">
1.1       cvs      3703: 
1.18      cvs      3704: <h3><a name="sectc427">Default presentation rules</a></h3>
                   3705: <p>
1.1       cvs      3706: In order to avoid having to specify, for each element type defined in the
                   3707: structure schema, values for every one of the numerous presentation
                   3708: parameters, the presentation schema allows the definition of a set of default
                   3709: presentation rules.  These rules apply to all the boxes of the elements
                   3710: defined in the structure schema and to the presentation boxes and page layout
                   3711: boxes defined in the presentation schema.  Only rules which differ from these
1.18      cvs      3712: default need to be specified in other sections of the presentation schema.</p>
                   3713: <p>
1.1       cvs      3714: For the primary view, the default rules can define every presentation
1.18      cvs      3715: parameter, but not the <a href="#presfunct">presentation functions</a> or the
                   3716: <a href="#sectc4223">linebreaking conditions</a> (the <tt>NoBreak1</tt>,
                   3717: <tt>NoBreak2</tt>, and <tt>Gather</tt> rules).</p>
                   3718: <p>
1.1       cvs      3719: In a presentation schema, the default presentation rules section is optional;
1.18      cvs      3720: in this case, the <tt>DEFAULT</tt> keyword is also absent and the following
                   3721: rules are considered to be the default rules:</p>
                   3722: <pre>   Visibility:    Enclosing =;
1.6       cvs      3723:    VertRef:       * . Left;
                   3724:    HorizRef:      Enclosed . HRef;
                   3725:    Height:        Enclosed . Height;
                   3726:    Width:         Enclosed . Width;
                   3727:    VertPos:       Top = Previous . Bottom;
                   3728:    HorizPos:      Left = Enclosing . Left;
                   3729:    VertOverflow:  No;
1.1       cvs      3730:    HorizOverflow: No;
1.6       cvs      3731:    Size:          Enclosing =;
                   3732:    Style:         Enclosing =;
1.23      cvs      3733:    Weight:        Enclosing =;
1.6       cvs      3734:    Font:          Enclosing =;
                   3735:    Underline:     Enclosing =;
                   3736:    Thickness:     Enclosing =;
                   3737:    Indent:        Enclosing =;
                   3738:    LineSpacing:   Enclosing =;
                   3739:    Adjust:        Enclosing =;
                   3740:    Justify:       Enclosing =;
                   3741:    Hyphenate:     Enclosing =;
                   3742:    PageBreak:     Yes;
                   3743:    LineBreak:     Yes;
                   3744:    InLine:        Yes;
                   3745:    Depth:         0;
                   3746:    LineStyle:     Enclosing =;
                   3747:    LineWeight:    Enclosing =;
                   3748:    FillPattern:   Enclosing =;
                   3749:    Background:    Enclosing =;
1.18      cvs      3750:    Foreground:    Enclosing =;</pre>
                   3751: <p>
1.1       cvs      3752: If other values are desired for the default rules, they must be defined
                   3753: explicitly in the default rules section.  In fact, it is only necessary to
                   3754: define those default rules which differ from the ones above, since the rules
1.18      cvs      3755: above will be used whenever a rule is not explicitly named.</p>
                   3756: <p>
1.1       cvs      3757: Default rules for views other than the primary  view can also be specified.
                   3758: Otherwise, the default rules for the primary views are applied to the other
1.18      cvs      3759: views.</p>
                   3760: <p>
                   3761: Default rules are expressed in the same way as <a href="#sectc4215">explicit
                   3762: rules for document elements</a>.</p>
                   3763: </div>
1.1       cvs      3764: 
1.18      cvs      3765: <div class="subsection">
1.1       cvs      3766: 
1.18      cvs      3767: <h3><a name="sectc428">Presentation and page layout boxes</a></h3>
                   3768: <p>
1.1       cvs      3769: The presentation process uses elements which are not part of the logical
                   3770: structure of the document, such as pages (which are the page layout boxes) or
                   3771: alternatively, rules, numbers, or words introducing certain parts of the
                   3772: document, such as ``Summary'', ``Appendices'', ``Bibliography'', etc. (which
1.18      cvs      3773: are presentation boxes).</p>
                   3774: <p>
                   3775: After the word <tt>BOXES</tt>, each presentation or page layout box is defined
1.1       cvs      3776: by its name and a sequence of presentation rules which indicate how they must
                   3777: be displayed.  These rules are the same as those which define the boxes
                   3778: associated with element of the logical structure of the document, with a
1.18      cvs      3779: single exception, the <a href="#sectc4231"><tt>Content</tt> rule</a> which is
1.1       cvs      3780: used only to specify the content of presentation boxes.  The content of boxes
                   3781: associated with elements of the document structure is defined in each document
                   3782: or object and thus is not specified in the presentation schema, which applies
1.18      cvs      3783: to all documents or objects of a class.</p>
                   3784: <p>
1.1       cvs      3785: Among the rules which define a presentation box, certain ones can refer to
                   3786: another presentation box (for example, in their positional rules).  If the
                   3787: designated box is defined after the box which designates it, a
1.18      cvs      3788: <tt>FORWARD</tt> instruction followed by the name of the designated box must
                   3789: appear before the designation.</p>
                   3790: <pre>             'BOXES' BoxSeq
1.1       cvs      3791:      BoxSeq = Box &lt; Box > .
                   3792:      Box    ='FORWARD' BoxID ';' /
                   3793:               BoxID ':' ViewRuleSeq .
1.18      cvs      3794:      BoxID  = NAME .</pre>
                   3795: </div>
1.1       cvs      3796: 
1.18      cvs      3797: <div class="subsection">
1.1       cvs      3798: 
1.18      cvs      3799: <h3><a name="sectc429">Presentation of structured elements</a></h3>
                   3800: <p>
                   3801: After the words <tt>RULES</tt>, the presentation schema gives the presentation
1.1       cvs      3802: rules that apply to the elements whose types are defined in the structure
1.18      cvs      3803: schema.  Only those rules which differ from the <a
                   3804: href="#sectc427">default</a> must be specified in the <tt>RULES</tt>
                   3805: section.</p>
                   3806: <p>
1.1       cvs      3807: The rule definitions for each element type are composed of the name of the
                   3808: element type (as specified in the structure schema) followed by a colon and
1.18      cvs      3809: the set of rules specific to that type.</p>
                   3810: <p>
1.1       cvs      3811: The type name can be preceded by a star in the special case where the
1.18      cvs      3812: structure schema defines an <a href="#sectd3284">inclusion</a> without
1.1       cvs      3813: expansion (or with partial expansion) of a type with the same name as an
1.18      cvs      3814: element of defined in the structure schema.</p>
                   3815: <p>
                   3816: In the case where the element is a <a href="#sectd3285">mark pair</a>, but
                   3817: only in this case, the type name can be preceded by the keywords
                   3818: <tt>First</tt> or <tt>Second</tt>.  These keywords indicate whether the rules
                   3819: that follow apply to the first or second mark of the pair.</p>
                   3820: <pre>                 'RULES' PresentSeq
1.1       cvs      3821:      PresentSeq = Present &lt; Present > .
1.6       cvs      3822:      Present    = [ '*' ] [ FirstSec ] ElemID ':'
                   3823:                   ViewRuleSeq .
1.18      cvs      3824:      FirstSec   = 'First' / 'Second' .</pre>
                   3825: <p>
1.1       cvs      3826: A presentation schema can define presentation rules for base elements, which
                   3827: are defined implicitly in the structure schemas.  In the English version of
                   3828: the presentation schema compiler, the base type names are the same as in the S
1.18      cvs      3829: language, but they are terminated by the <tt>_UNIT</tt> suffix:
                   3830: <tt>TEXT_UNIT</tt>, <tt>PICTURE_UNIT</tt>, <tt>SYMBOL_UNIT</tt>,
                   3831: <tt>GRAPHICS_UNIT</tt>.  The base type names are written in upper-case
                   3832: letters.</p>
                   3833: </div>
                   3834: 
                   3835: <div class="subsection">
                   3836: 
                   3837: <h3><a name="sectc4210">Logical attribute presentation</a></h3>
                   3838: <p>
                   3839: After the keyword <tt>ATTRIBUTES</tt>, all attributes which are to have some
1.1       cvs      3840: effect on the presentation of the element to which they are attached must be
                   3841: mentioned, along with the corresponding presentation rules.  This is true for
                   3842: both global attributes (which can be attached to all element types) and local
1.18      cvs      3843: attributes (which can only be attached to certain element types).</p>
                   3844: <p>
1.1       cvs      3845: Also mentioned in this section are attributes which imply an effect on
                   3846: elements in the subtree of the element to which they are attached. The
                   3847: presentation of these descendants  can be modified as a function of the value
                   3848: of the attribute which they inherit, just as if it was attached to them
1.18      cvs      3849: directly.</p>
                   3850: <p>
1.1       cvs      3851: The specification for each attribute includes the attribute's name, followed
                   3852: by an optional value specification and, after a colon, a set of rules.  The
1.18      cvs      3853: set of rules must contain at least one rule.</p>
                   3854: <p>
1.1       cvs      3855: When there is no value specification, the rules are applied to all elements
                   3856: which carry the attribute, no matter what their value.  When the rules must
                   3857: only apply when the attribute has certain values, these values must be
1.18      cvs      3858: specified.  Thus, the same attribute can appear in the <tt>ATTRIBUTES</tt>
1.1       cvs      3859: section several times, with each appearance having a different value
                   3860: specification.  However, reference attributes never have a value specification
1.18      cvs      3861: and, as a result, can only appear once in the <tt>ATTRIBUTES</tt> section.</p>
                   3862: <p>
1.1       cvs      3863: To specify that the presentation rules apply to some of the descendants of the
                   3864: element having the attribute, the name of the affected element type is given,
                   3865: between parentheses, after the attribute name.  This way, the presentation
                   3866: rules for the attribute will be applied to the element having the attribute,
                   3867: if it is of the given type, and to all of its descendants of the given type.
1.18      cvs      3868: In the case where this type is a <a href="#sectd3285">mark pair</a>, but only
                   3869: in this case, the type name can be preceded by the keywords <tt>First</tt> or
                   3870: <tt>Second</tt>.  These keywords indicate whether the rules that follow apply
1.1       cvs      3871: to the first or second mark of the pair. If the rule must apply to several
                   3872: different element types, the specification must be repeated for each element
1.18      cvs      3873: type.</p>
                   3874: <p>
1.1       cvs      3875: The specification of values for which the presentation rules will be applied
1.18      cvs      3876: varies according to the type of the attribute:</p>
                   3877: <dl>
                   3878: <dt>numeric attribute</dt>
                   3879: <dd>
                   3880: If the rules are to apply for one value of the attribute, then the attribute
                   3881: name is followed by an equals sign and this value.  If the rules are to apply
                   3882: for all values less than (or greater than) a threshold value, non-inclusive,
                   3883: the attribute name followed by a '&lt;' sign (or a '>' sign, respectively) and
                   3884: the threshold value.  If the rules must apply to a range of values, the
                   3885: attribute name is followed by the word '<tt>IN</tt>' and the two bounds of the
                   3886: range, enclosed in brackets and separated by two periods ('<tt>..</tt>').  In
                   3887: the case of ranges, the values of the bounds are included in the range.
                   3888: <p>
1.1       cvs      3889: The threshold value in the comparisons can be the value of an attribute
                   3890: attached to an ancestor element.  In this case, the attribute name is given
1.18      cvs      3891: instead of a constant value.</p>
                   3892: <p>
1.1       cvs      3893: It is also possible to write rules which apply only when a comparison between
                   3894: two different attributes of the element's ancestors is true. In this case, the
                   3895: first attribute name is followed by a comparison keyword and the name of the
1.18      cvs      3896: second attribute.  The comparison keywords are <tt>EQUAL</tt> (simple
                   3897: equality), <tt>LESS</tt> (non-inclusive less than), and <tt>GREATER</tt>
                   3898: (non-inclusive greater than).</p>
                   3899: </dd>
                   3900: <dt>text attribute</dt>
                   3901: <dd>
                   3902: If the rules are to apply for one value of the attribute, then the attribute
                   3903: name is followed by an equals sign and this value.
                   3904: </dd>
                   3905: <dt>reference attribute</dt>
                   3906: <dd>
                   3907: There is never a value specification; the rules apply no matter what element
                   3908: is designated by the attribute.
                   3909: </dd>
                   3910: <dt>enumerated attribute</dt>
                   3911: <dd>
                   3912: If the rules are to apply for one value of the attribute, then the attribute
                   3913: name is followed by an equals sign and this value.
                   3914: </dd>
                   3915: </dl>
                   3916: <p>
1.1       cvs      3917: The order in which the rules associated with a numeric attribute are defined
                   3918: is important.  When multiple sets of rules can be applied, the first set
1.18      cvs      3919: declared is the one used.</p>
                   3920: <p>
1.1       cvs      3921: Rules for attributes have priority over both default rules and rules
                   3922: associated with element types.  The attribute rules apply to the element to
                   3923: which the attribute is attached.  It is the rules which apply to the
                   3924: surrounding elements (and especially to the descendants) which determine the
                   3925: effect of the attribute rules on the environment ( and especially on the
1.18      cvs      3926: terminal elements of the structure).</p>
                   3927: <pre>                    'ATTRIBUTES' PresAttrSeq
1.1       cvs      3928:      PresAttrSeq  = PresAttr &lt; PresAttr > .
                   3929:      PresAttr     = AttrID [ '(' [ FirstSec ] ElemID ')' ]
                   3930:                     [ AttrRelation ] ':' ViewRuleSeq .
                   3931:      AttrID       = NAME .
                   3932:      AttrRelation ='=' AttrVal /
                   3933:                     '>' [ '-' ] MinValue /
                   3934:                     '&lt;' [ '-' ] MaxValue /
                   3935:                     'IN' '[' [ '-' ] LowerBound '..'
                   3936:                     [ '-' ] UpperBound ']' /
                   3937:                     'GREATER' AttrID /
                   3938:                     'EQUAL' AttrID /
                   3939:                     'LESS' AttrID .
                   3940:      AttrVal      = [ '-' ] EqualNum / EqualText /
                   3941:                     AttrValue .
                   3942:      MinValue     = NUMBER .
                   3943:      MaxValue     = NUMBER .
                   3944:      LowerBound   = NUMBER .
                   3945:      UpperBound   = NUMBER.
                   3946:      EqualNum     = NUMBER .
                   3947:      EqualText    = STRING .
1.18      cvs      3948:      AttrValue    = NAME .</pre>
                   3949: <p>
1.1       cvs      3950: In presentation rules associated with a numeric attribute (and only in such
                   3951: rules), the attribute name can be used in place of a numeric value.  In this
                   3952: case, the value of the attribute is used in the application of the rule. Thus,
                   3953: the attribute can represent a relation between the size of two boxes, the
                   3954: height and width of a box, the height of an area where page breaks are
                   3955: prohibited, the distance between two boxes, the position of the reference axis
                   3956: of a box, the interline spacing,  the indentation of the first line, the
1.18      cvs      3957: visibility, the depth (z-order), or the character set.</p>
                   3958: <p>
1.1       cvs      3959: The presentation rules associated with reference attributes, it is possible to
                   3960: use the element designated by the attribute as a reference box in a positional
1.18      cvs      3961: or extent rule.  This element is represented in the <a
                   3962: href="#sectc4218">position</a> or <a href="#sectc4219">extent</a> rule by the
                   3963: keyword <tt>Referred</tt>.</p>
                   3964: <blockquote class="example">
                   3965: <p>
                   3966: <strong>Example:</strong></p>
                   3967: <p>
1.3       cvs      3968: In all structure schemas, there is a global Language attribute defined as
1.18      cvs      3969: follows:</p>
                   3970: <pre>ATTR
                   3971:      Language = TEXT;</pre>
                   3972: <p>
                   3973: The following rules would make French text be displayed in roman characters
                   3974: and English text be displayed in italics:</p>
                   3975: <pre>ATTRIBUTES
1.1       cvs      3976:      Language = 'French' :
1.6       cvs      3977:                 Style : Roman;
1.1       cvs      3978:      Language = 'English' :
1.18      cvs      3979:                 Style : Italics;</pre>
                   3980: <p>
1.4       cvs      3981: Using these rules, when the user puts the Language attribute with the value
                   3982: 'English' on the summary of a document, every character string (terminal
1.18      cvs      3983: elements) contained in the summary are displayed in italics.  See the <a
                   3984: href="#sectd42252"><tt>Style</tt> rule</a>.</p>
                   3985: </blockquote>
                   3986: <blockquote class="example">
                   3987: <p>
                   3988: <strong>Example:</strong></p>
                   3989: <p>
1.3       cvs      3990: A numeric attribute representing the importance of the part of the document to
1.18      cvs      3991: which it is attached can be defined:</p>
                   3992: <pre>ATTR
                   3993:      Importance = INTEGER;</pre>
                   3994: <p>
1.4       cvs      3995: In the presentation schema, the importance of an element is reflected in the
1.18      cvs      3996: choice of character size, using the following rules.</p>
                   3997: <pre>ATTRIBUTES
1.1       cvs      3998:      Importance &lt; 2 :
                   3999:               Size : 1;
                   4000:      Importance IN [2..4] :
                   4001:               Size : Importance;
                   4002:      Importance = 10 :
                   4003:               Size : 5;
                   4004:      Importance > 4 :
1.18      cvs      4005:               Size : 4;</pre>
                   4006: <p>
1.4       cvs      4007: Thus, the character size corresponds to the value of the Importance attribute;
1.18      cvs      4008: its value is</p>
                   4009: <ul>
                   4010: <li>
                   4011: the value of the Importance attribute when the value is between 2 and 4
1.1       cvs      4012: (inclusive),
1.19      cvs      4013: </li>
1.18      cvs      4014: <li>
                   4015: 1, when the value of the Importance attribute is less than 2,
1.19      cvs      4016: </li>
1.18      cvs      4017: <li>
                   4018: 4, when the value of the Importance attribute is greater than 4,
1.19      cvs      4019: </li>
1.18      cvs      4020: <li>
                   4021: 5, when the value of the Importance attribute is 10.
1.19      cvs      4022: </li>
1.18      cvs      4023: </ul>
                   4024: <p>
1.4       cvs      4025: The last case (value 5) must be defined before the case which handles all
                   4026: Importance values greater than 4, because the two rules are not disjoint and
                   4027: the first one defined will have priority.  Otherwise, when the Importance
1.18      cvs      4028: attribute has value 10, the font size will be 4.</p>
                   4029: </blockquote>
                   4030: <blockquote class="example">
                   4031: <p>
                   4032: <strong>Example:</strong></p>
                   4033: <p>
1.3       cvs      4034: Suppose the structure defines a list element which can have an attribute
1.18      cvs      4035: defining the type of list (numbered or not):</p>
                   4036: <pre>STRUCT
1.1       cvs      4037:     list (ATTR list_type = enumeration, dash)
1.18      cvs      4038:          = LIST OF (list_item = TEXT);</pre>
                   4039: <p>
1.4       cvs      4040: Then, the presentation schema could use the attribute placed on the list
                   4041: element to put either a dash or a number before the each element of the
1.18      cvs      4042: list:</p>
                   4043: <pre>ATTRIBUTES
1.1       cvs      4044:    list_type (list_item) = enumeration :
                   4045:         CreateBefore (NumberBox);
                   4046:    list_type (list_item) = dash :
1.18      cvs      4047:         CreateBefore (DashBox);</pre>
                   4048: </blockquote>
                   4049: <blockquote class="example">
                   4050: <p>
                   4051: <strong>Example:</strong></p>
                   4052: <p>
1.3       cvs      4053: Suppose that two attributes are defined in the structure schema.  The first is
                   4054: a numeric global attribute called ``version''.  The other is a local attribute
1.18      cvs      4055: defined on the root of the document called ``Document_version'':</p>
                   4056: <pre>STRUCTURE Document
1.1       cvs      4057: ATTR
                   4058:     version = INTEGER;
                   4059: STRUCT
                   4060:     Document (ATTR Document_version = INTEGER) =
                   4061:         BEGIN
                   4062:         SomeElement ;
                   4063:         ...
                   4064:         SomeOtherElement ;
                   4065:         END ;
1.18      cvs      4066: ...</pre>
                   4067: <p>
                   4068: These attributes can be used in the presentation schema to place change bars
                   4069: in the margin next to elements whose version attribute has a value equal to
                   4070: the Document_version attribute of the root and to place a star in margin of
1.4       cvs      4071: elements whose version attribute is less than the value of the root's
1.18      cvs      4072: Document_version attribute:</p>
                   4073: <pre>ATTRIBUTES
1.1       cvs      4074:     version EQUAL Document_version :
                   4075:         CreateBefore (ChangeBarBox) ;
                   4076:     version LESS Document_version :
1.18      cvs      4077:         CreateBefore (StarBox) ;</pre>
                   4078: </blockquote>
                   4079: </div>
1.1       cvs      4080: 
1.18      cvs      4081: <div class="subsection">
1.1       cvs      4082: 
1.18      cvs      4083: <h3><a name="sectc4212">Value transmission rules</a></h3>
                   4084: <p>
1.1       cvs      4085: The last section of a presentation schema, which is optional, serves to
                   4086: defines the way in which a document transmits certain values to its
1.18      cvs      4087: sub-documents.  A sub-document is an document <a
                   4088: href="#inclusion">included</a> without expansion or with partial expansion.
1.1       cvs      4089: The primary document can transmit to its sub-documents the values of certain
                   4090: counters or the textual content of certain of its elements, as a function of
1.18      cvs      4091: their type.</p>
                   4092: <p>
1.1       cvs      4093: The sub-documents receive these values in attributes which must be defined in
                   4094: their structure schema as local attributes of the root element.  The types of
                   4095: these attributes must correspond to the type of the value which they receive:
                   4096: numeric attributes for receiving the value of a counter, textual attributes
1.18      cvs      4097: for receiving the content of an element.</p>
                   4098: <p>
1.1       cvs      4099: In the structure schema of the primary document, there appears at the end,
1.18      cvs      4100: after the <tt>TRANSMIT</tt> keyword, a sequence of transmission rules.  Each
1.1       cvs      4101: rule begins with the name of the counter to transmit or of the element type
                   4102: whose textual content will be transmitted.  This name is followed by the
1.18      cvs      4103: keyword <tt>To</tt> and the name of the attribute of the sub-document to which
1.1       cvs      4104: the value is transmitted.  The sub-document class is indicated between
                   4105: parentheses after the name of the attribute.  The transmission rule ends with
1.18      cvs      4106: a semicolon.</p>
                   4107: <pre>     TransmitSeq   =  Transmit &lt; Transmit > .
1.1       cvs      4108:      Transmit      =  TypeOrCounter 'To' ExternAttr
                   4109:                       '(' ElemID ')' ';' .
                   4110:      TypeOrCounter =  CounterID / ElemID .
1.18      cvs      4111:      ExternAttr    =  NAME .</pre>
                   4112: <blockquote class="example">
                   4113: <p>
                   4114: <strong>Example:</strong></p>
                   4115: <p>
                   4116: Consider a Book document class which includes instances of the Chapter
                   4117: document class.  These classes might have the following schemas:</p>
                   4118: <pre>STRUCTURE Book
1.1       cvs      4119: STRUCT
                   4120:    Book = BEGIN
                   4121:           Title = Text;
                   4122:           Body  = LIST OF (Chapter INCLUDED);
                   4123:           END;
                   4124:    ...
                   4125: 
                   4126: STRUCTURE Chapter
                   4127: STRUCT
                   4128:    Chapter (ATTR FirstPageNum = Integer;
                   4129:                  ChapterNum = Integer;
                   4130:                  CurrentTitle   = Text) =
1.6       cvs      4131:           BEGIN
                   4132:           ChapterTitle = Text;
                   4133:           ...
                   4134:           END;
1.18      cvs      4135:    ...</pre>
                   4136: <p>
1.1       cvs      4137: Then the presentation schema for books could define chapter and page counters.
                   4138: The following transmission rules in the book presentation schema would
                   4139: transmit values for the three attributes defined at the root of each chapter
1.18      cvs      4140: sub-document.</p>
                   4141: <pre>PRESENTATION Book;
1.1       cvs      4142: VIEWS
                   4143:    Full_text;
                   4144: COUNTERS
                   4145:    ChapterCtr: Rank of Chapter;
                   4146:    PageCtr: Rank of Page(Full_text);
                   4147: ...
                   4148: TRANSMIT
                   4149:    PageCtr TO FirstPageNum(Chapter);
                   4150:    ChapterCtr TO ChapterNum(Chapter);
                   4151:    Title TO CurrentTitle(Chapter);
1.18      cvs      4152: END</pre>
                   4153: <p>
1.1       cvs      4154: Thus, each chapter included in a book can number its pages as a function of
                   4155: the number of pages preceding it in the book, can make the chapter's number
                   4156: appear before the number of each of its sections, or can place the title of
1.18      cvs      4157: the book at the top of each page.</p>
                   4158: </blockquote>
                   4159: </div>
1.1       cvs      4160: 
1.18      cvs      4161: <div class="subsection">
1.1       cvs      4162: 
1.18      cvs      4163: <h3><a name="sectc4213">Presentation rules</a></h3>
                   4164: <p>
1.1       cvs      4165: Whether defining the appearance of a presentation or page layout box, an
                   4166: element type, or an attribute value, the set of presentation rules that apply
1.18      cvs      4167: is always defined in the same way.</p>
                   4168: <p>
1.1       cvs      4169: Normally, a set of presentation rules is placed between the keywords
1.18      cvs      4170: <tt>BEGIN</tt> and <tt>END</tt>, the keyword <tt>END</tt> being followed by a
1.1       cvs      4171: semicolon.  The first section of this block defines the rules that apply to
1.18      cvs      4172: the primary view, if the <a href="#sectc427">default rules</a> are not
1.1       cvs      4173: completely suitable.  Next comes the rules which apply to specific other
                   4174: views, with a rule sequence for each view for which the default rules are not
                   4175: satisfactory.  If the default rules are suitable for the non-primary views,
                   4176: there will not be any specific rules for these views.  If there is only one
1.18      cvs      4177: rule which applies to all views then the keywords <tt>BEGIN</tt> and
                   4178: <tt>END</tt> need not appear.</p>
                   4179: <p>
1.1       cvs      4180: For each view, it is only necessary to specify those rules which differ from
                   4181: the default rules for the view, so that for certain views (or even all views),
1.18      cvs      4182: there may be no specific rules.</p>
                   4183: <p>
                   4184: The specific rules for a non-primary view are introduced by the <a
                   4185: name="inkeyword"><tt>IN</tt> keyword</a>, followed by the view name.  The
                   4186: rules for that view follow, delimited by the keywords <tt>BEGIN</tt> and
                   4187: <tt>END</tt>, or without these two keywords when there is only one rule.</p>
                   4188: <p>
                   4189: <strong>Note:</strong> the view name which follows the <tt>IN</tt> keyword
1.1       cvs      4190: must not be the name of the primary view, since the rules for that view are
1.18      cvs      4191: found before the rules for the other views.</p>
                   4192: <p>
1.1       cvs      4193: Within each block concerning a view, other blocks can appear, delimited by the
1.18      cvs      4194: same keywords <tt>BEGIN</tt> and <tt>END</tt>.  Each of these blocks gathers
1.1       cvs      4195: the presentation rules that apply, for a given view, only when a given
                   4196: condition is satisfied.  Each block is preceded by a condition introduced by
1.18      cvs      4197: the <tt>IF</tt> keyword.  If such a conditional block contains only one rule,
                   4198: the keywords <tt>BEGIN</tt> and <tt>END</tt> can be omitted.</p>
                   4199: <p>
1.1       cvs      4200: Although the syntax allows any presentation rule to appear in a conditional
1.18      cvs      4201: block, only <a href="#sectc4232">creation rules</a> are allowed after any
                   4202: condition; other rules are allowed only after conditions <tt>Within</tt> and
1.1       cvs      4203: ElemID.  In addition, the following rules cannot be conditional:
1.18      cvs      4204: <tt>PageBreak, LineBreak, Inline, Gather</tt>.</p>
                   4205: <p>
1.1       cvs      4206: For a given view, the rules that apply without any condition must appear
                   4207: before the first conditional block.  If some rules apply only when none of the
                   4208: specified condition holds, they are grouped in a block preceded by the keyword
1.18      cvs      4209: <tt>Otherwise</tt>, and that block must appear after the last conditionnal
                   4210: block concerning the same view.</p>
                   4211: <pre>     ViewRuleSeq  = 'BEGIN' &lt; RulesAndCond > &lt; ViewRules >
1.1       cvs      4212:                     'END' ';' /
                   4213:                     ViewRules / CondRules / Rule .
                   4214:      RulesAndCond = CondRules / Rule .
                   4215:      ViewRules    = 'IN' ViewID CondRuleSeq .
                   4216:      CondRuleSeq  = 'BEGIN' &lt; RulesAndCond > 'END' ';' /
                   4217:                     CondRules / Rule .
                   4218:      CondRules    = CondRule &lt; CondRule >
                   4219:                     [ 'Otherwise' RuleSeq ] .
                   4220:      CondRule     = 'IF' ConditionSeq RuleSeq .
                   4221:      RulesSeq     = 'BEGIN' Rule &lt; Rule > 'END' ';' /
1.18      cvs      4222:                     Rule .</pre>
                   4223: <blockquote class="example">
                   4224: <p>
                   4225: <strong>Example:</strong></p>
                   4226: <p>
1.3       cvs      4227: The following rules for a report's title make the title visible in the primary
                   4228: view and invisible in the table of contents and in the formula views (see the
1.18      cvs      4229: <a href="#sectc4224"><tt>Visibility</tt> rule</a>).</p>
                   4230: <pre>Title : BEGIN
1.1       cvs      4231:         Visibility : 1;
                   4232:         ...    {Other rules for the primary view}
                   4233:         IN Table_of_contents
                   4234:            Visibility : 0;
                   4235:         IN Formulas
                   4236:            Visibility : 0;
1.18      cvs      4237:         END;</pre>
                   4238: </blockquote>
                   4239: </div>
1.1       cvs      4240: 
1.18      cvs      4241: <div class="subsection">
1.1       cvs      4242: 
1.18      cvs      4243: <h3><a name="sectc4214">Conditions applying to presentation rules</a></h3>
                   4244: <p>
1.1       cvs      4245: Many conditions can be applied to presentation rules.  Conditions allow
                   4246: certain presentation rules to apply only in certain cases.  These conditions
                   4247: can be based on the structural position of the element.  They can be based on
                   4248: whether the element has references, and what type of references, whether the
                   4249: element has attributes, whether the element is empty or not.  They can also be
1.18      cvs      4250: based on the value of a counter.</p>
                   4251: <p>
1.1       cvs      4252: It is possible to specify several conditions which must all be true for the
1.18      cvs      4253: rules to apply.</p>
                   4254: <p>
                   4255: A set of conditions is specified by the <tt>IF</tt> keyword.  This keyword is
                   4256: followed by the sequence of conditions, separated by the <tt>AND</tt> keyword.
1.1       cvs      4257: Each condition is specified by a keyword which defines the condition type. In
                   4258: some cases, the keyword is followed by other data, which specify the condition
1.18      cvs      4259: more precisely.</p>
                   4260: <p>
1.1       cvs      4261: An elementary condition can be negative; it is then preceded by the
1.18      cvs      4262: <tt>NOT</tt> keyword.</p>
                   4263: <p>
1.1       cvs      4264: When the presentation rule(s) controlled by the condition apply to a reference
                   4265: element or a reference attribute, an elementary condition can also apply to
1.18      cvs      4266: element referred by this reference.  The <tt>Target</tt> keyword is used for
1.1       cvs      4267: that purpose.  It must appear before the keyword defining the condition
1.18      cvs      4268: type.</p>
                   4269: <pre>     CondRule      ='IF' ConditionSeq RuleSeq .
1.1       cvs      4270:      ConditionSeq  = Condition &lt; 'AND' Condition > .
                   4271:      Condition     = [ 'NOT' ] [ 'Target' ] ConditionElem .
                   4272:      ConditionElem ='First' / 'Last' /
                   4273:                      [ 'Immediately' ] 'Within' [ NumParent ]
                   4274:                                        ElemID [ ExtStruct ] /
                   4275:                      ElemID /
                   4276:                     'Referred' / 'FirstRef' / 'LastRef' /
                   4277:                     'ExternalRef' / 'InternalRef' / 'CopyRef' /
                   4278:                     'AnyAttributes' / 'FirstAttr' / 'LastAttr' /
                   4279:                     'UserPage' / 'StartPage' / 'ComputedPage' /
                   4280:                     'Empty' /
                   4281:                     '(' [ MinMax ] CounterName CounterCond ')' /
                   4282:                      CondPage '(' CounterID ')' .
                   4283:      NumParent     = [ GreaterLess ] NParent .
1.6       cvs      4284:      GreaterLess   ='>' / '&lt;' .
1.1       cvs      4285:      NParent       = NUMBER.
1.6       cvs      4286:      ExtStruct     ='(' ElemID ')' .
1.1       cvs      4287:      CounterCond   ='&lt;' MaxCtrVal / '>' MinCtrVal /
                   4288:                     '=' EqCtrVal / 
                   4289:                     'IN' '[' ['-'] MinCtrBound '.' '.'
                   4290:                      ['-'] MaxCtrBound ']' .
                   4291:      PageCond      ='Even' / 'Odd' / 'One' .
                   4292:      MaxCtrVal     = NUMBER .
                   4293:      MinCtrVal     = NUMBER .
                   4294:      EqCtrVal      = NUMBER .
                   4295:      MaxCtrBound   = NUMBER .
1.18      cvs      4296:      MinCtrBound   = NUMBER .</pre>
1.1       cvs      4297: 
1.18      cvs      4298: <div class="subsubsection">
1.1       cvs      4299: 
1.18      cvs      4300: <h4><a name="sectd42141">Conditions based on the logical position of the
                   4301: element</a></h4>
                   4302: <p>
1.1       cvs      4303: The condition can be on the position of the element in the document's logical
                   4304: structure tree.  It is possible to test whether the element is the first
1.18      cvs      4305: (<tt>First</tt>) or last (<tt>Last</tt>) among its siblings or if it is not
                   4306: the first (<tt>NOT First</tt>) or not the last (<tt>NOT Last</tt>). These
                   4307: conditions can be associated only with <a href="#sectc4232">creation
                   4308: rules</a>.</p>
                   4309: <p>
1.1       cvs      4310: It is also possible to test if the element is contained in an element of a
1.18      cvs      4311: given type (<tt>Within</tt>) or if it is not (<tt>NOT Within</tt>). The type
                   4312: is indicated after the keyword <tt>Within</tt>. If that element type is
1.1       cvs      4313: defined in a structure schema which is not the one which corresponds to the
                   4314: presentation schema, the type name of this element must be followed, between
1.18      cvs      4315: parentheses, by the name of the structure schema which defines it.</p>
                   4316: <p>
                   4317: If the keyword <tt>Within</tt> is preceded by <tt>Immediately</tt>, the
                   4318: condition is satisfied only if the <em>parent</em> element has the type
                   4319: indicated. If the word <tt>Immediately</tt> is missing, the condition is
                   4320: satisfied if any <em>ancestor</em> has the type indicated.</p>
                   4321: <p>
                   4322: An integer <i>n</i> can appear between the keyword <tt>Within</tt> and the
1.1       cvs      4323: type.  It specifies the number of ancestors of the indicated type that must be
                   4324: present for the condition to be satisfied.  If the keyword
1.18      cvs      4325: <tt>Immediately</tt> is also present, the <i>n</i> immediate ancestors of the
                   4326: element must have the indicated type.  The integer <i>n</i> must be positive
                   4327: or zero.  It can be preceded by <tt>&lt;</tt> or <tt>></tt> to indicate a
1.1       cvs      4328: maximum or minimum number of ancestors.  If these symbols are missing, the
1.18      cvs      4329: condition is satisfied only if it exists exactly <i>n</i> ancestors.  When
                   4330: this number is missing, it is equivalent to > 0.</p>
                   4331: <p>
1.1       cvs      4332: If the condition applies to presentation rules associated with an attribute,
1.18      cvs      4333: in the <tt>ATTRIBUTES</tt> section of the presentation schema, the condition
1.1       cvs      4334: can be simply an element name. Presentation rules are then executed only if
1.18      cvs      4335: the attribute is attached to an element of that type. The keyword <tt>NOT</tt>
1.1       cvs      4336: before the element name indicates that the presentation rules must be executed
1.18      cvs      4337: only if the element is not of the type indicated.</p>
                   4338: </div>
1.1       cvs      4339: 
1.18      cvs      4340: <div class="subsubsection">
1.1       cvs      4341: 
1.18      cvs      4342: <h4><a name="sectd42142">Conditions on references</a></h4>
                   4343: <p>
1.1       cvs      4344: References may be taken into account in conditions, which can be based on the
                   4345: fact that the element, or one of its ancestors, is designated by a at least
1.18      cvs      4346: one reference (<tt>Referred</tt>) or by none (<tt>NOT Referred</tt>).</p>
                   4347: <p>
1.1       cvs      4348: If the element or attribute to which the condition is attached is a reference,
                   4349: the condition can be based on the fact that it acts as the first reference to
1.18      cvs      4350: the designated element (<tt>FirstRef</tt>), or as the last (<tt>LastRef</tt>),
1.1       cvs      4351: or as a reference to an element located in another document
1.18      cvs      4352: (<tt>ExternalRef</tt>) or in the same document (<tt>InternalRef</tt>).</p>
                   4353: <p>
                   4354: The condition can also be based on the fact that the element is an <a
                   4355: href="#inclusion">inclusion</a>.  This is noted (<tt>CopyRef</tt>).</p>
                   4356: <p>
1.1       cvs      4357: Like all conditions, conditions on references can be inverted by the
1.18      cvs      4358: <tt>NOT</tt> keyword. These conditions can be associated only with <a
                   4359: href="#sectc4232">creation rules</a>.</p>
                   4360: </div>
1.1       cvs      4361: 
1.18      cvs      4362: <div class="subsubsection">
1.1       cvs      4363: 
1.18      cvs      4364: <h4><a name="sectd42143">Conditions on logical attributes</a></h4>
                   4365: <p>
1.1       cvs      4366: The condition can be based on the presence or absence of attributes associated
                   4367: with the element, no matter what the attributes or their values. The
1.18      cvs      4368: <tt>AnyAttributes</tt> keyword expresses this condition.</p>
                   4369: <p>
1.1       cvs      4370: If the condition appears in the presentation rules of an attribute, the
1.18      cvs      4371: <tt>FirstAttr</tt> and <tt>LastAttr</tt> keywords can be used to indicate that
1.1       cvs      4372: the rules must only be applied if this attribute is the first attribute for
                   4373: the element or if it is the last (respectively).  These conditions can also be
1.18      cvs      4374: inverted by the <tt>NOT</tt> keyword. These conditions can be associated only
                   4375: with <a href="#sectc4232">creation rules</a>.</p>
                   4376: <p>
1.1       cvs      4377: It is also possible to apply certain presentation rules only when the element
                   4378: being processed or one of its ancestors has a certain attribute, perhaps with
1.18      cvs      4379: a certain value.  This can be done in the <a
                   4380: href="#sectc4210"><tt>ATTRIBUTES</tt> section</a>.</p>
                   4381: </div>
1.1       cvs      4382: 
1.18      cvs      4383: <div class="subsubsection">
1.1       cvs      4384: 
1.18      cvs      4385: <h4><a name="sectd42144">Conditions on page breaks</a></h4>
                   4386: <p>
1.1       cvs      4387: The page break base type (and only this type) can use the following
1.18      cvs      4388: conditions: <tt>ComputedPage</tt>, <tt>StartPage</tt>, and <tt>UserPage</tt>.
                   4389: The <tt>ComputedPage</tt> condition indicates that the presentation rule(s)
1.1       cvs      4390: should apply if the page break was created automatically by Thot;  the
1.18      cvs      4391: <tt>StartPage</tt> condition is true if the page break is generated before the
                   4392: element by the <tt>Page</tt> rule; and the <tt>UserPage</tt> condition applies
                   4393: if the page break was inserted by the user.</p>
                   4394: <p>
                   4395: These conditions can be associated only with <a href="#sectc4232">creation
                   4396: rules</a>.</p>
                   4397: </div>
1.1       cvs      4398: 
1.18      cvs      4399: <div class="subsubsection">
1.1       cvs      4400: 
1.18      cvs      4401: <h4><a name="sectd42145">Conditions on the element's content</a></h4>
                   4402: <p>
1.1       cvs      4403: The condition can be based on whether or not the element is empty.  An element
                   4404: which has no children or whose leaves are all empty is considered to be empty
1.18      cvs      4405: itself.  This condition is expressed by the <tt>Empty</tt> keyword, optionally
                   4406: preceded by the <tt>NOT</tt> keyword. This condition can be associated only
                   4407: with <a href="#sectc4232">creation rules</a>.</p>
                   4408: </div>
1.1       cvs      4409: 
1.18      cvs      4410: <div class="subsubsection">
1.1       cvs      4411: 
1.18      cvs      4412: <h4><a name="sectd42146">Conditions on counters</a></h4>
                   4413: <p>
1.1       cvs      4414: Presentation rules can apply when the counter's value is one, is even or odd,
                   4415: is equal, greater than or less than a given value or falls in a range of
                   4416: values.  This is particularly useful for creating header and footer boxes.
1.18      cvs      4417: These conditions can be associated only with <a href="#sectc4232">creation
                   4418: rules</a>.</p>
                   4419: <p>
1.1       cvs      4420: To compare the value of a counter to a given value, a comparison is given
                   4421: between parentheses. The comparison is composed of the counter name followed
                   4422: by an equals, greater than, or less than sign and the value to which the
                   4423: counter will be compared.  A test for whether or not a counter's value falls
                   4424: in a range also appears within parentheses.  In this case, the counter name is
1.18      cvs      4425: followed by the <tt>IN</tt> keyword and the range definition within brackets.
                   4426: The <tt>Even</tt>, <tt>Odd</tt> and <tt>One</tt> are used to test a counter's
                   4427: value and are followed by the counter name between parentheses.</p>
                   4428: <p>
                   4429: The list of possible conditions on counters is:</p>
                   4430: <dl>
                   4431: <dt><tt>Even (Counter)</tt></dt>
                   4432: <dd>
                   4433: the box is created only if the counter has an even value.
                   4434: </dd>
                   4435: <dt><tt>Odd (Counter)</tt></dt>
                   4436: <dd>
                   4437: the box is created only if the counter has an odd value.
                   4438: </dd>
                   4439: <dt><tt>One (Counter)</tt></dt>
                   4440: <dd>
                   4441: the box is created only the counter's value is 1.
                   4442: </dd>
                   4443: <dt><tt>NOT One (Counter)</tt></dt>
                   4444: <dd>
                   4445: the box is created, unless the counter's value is 1.
                   4446: </dd>
                   4447: <dt><tt>(Counter &lt; Value)</tt></dt>
                   4448: <dd>
                   4449: the box is created only if the counter's value is less than Value.
                   4450: </dd>
                   4451: <dt><tt>(Counter > Value)</tt></dt>
                   4452: <dd>
                   4453: the box is created only if the counter's value is greater than Value.
                   4454: </dd>
                   4455: <dt><tt>(Counter = Value)</tt></dt>
                   4456: <dd>
                   4457: the box is created only if the counter's value is equal to Value.
                   4458: </dd>
                   4459: <dt><tt>NOT (Counter = Value)</tt></dt>
                   4460: <dd>
                   4461: the is created only if the counter's value is different than Value.
                   4462: </dd>
                   4463: <dt><tt>(Counter IN [MinValue..MaxValue])</tt></dt>
                   4464: <dd>
                   4465: the box is created only if the counter's value falls in the range bounded by
                   4466: MinValue and MaxValue (inclusive).
                   4467: </dd>
                   4468: <dt><tt>NOT (Counter IN [MinValue..MaxValue])</tt></dt>
                   4469: <dd>
                   4470: the box is created only if the value of the counter does not fall in the range
                   4471: bounded by MinValue and MaxValue (inclusive).
                   4472: </dd>
                   4473: </dl>
                   4474: <p>
                   4475: <strong>Note:</strong> the <tt>NOT Even</tt> and <tt>NOT Odd</tt> conditions
                   4476: are syntactically correct but can be expressed more simply by <tt>Odd</tt> and
                   4477: <tt>Even</tt>, respectively.</p>
                   4478: </div>
                   4479: </div>
1.1       cvs      4480: 
1.18      cvs      4481: <div class="subsection">
1.1       cvs      4482: 
1.18      cvs      4483: <h3><a name="sectc4215">A presentation rule</a></h3>
                   4484: <p>
1.1       cvs      4485: A presentation rule defines either a presentation parameter or presentation
1.18      cvs      4486: function.  The parameters are:</p>
                   4487: <ul>
                   4488: <li>
                   4489: the position of the vertical and horizontal reference axes of the box,
1.19      cvs      4490: </li>
1.18      cvs      4491: <li>
                   4492: the position of the box in relation to other boxes,
1.19      cvs      4493: </li>
1.18      cvs      4494: <li>
                   4495: the height or width of the box, with overflow exceptions,
1.19      cvs      4496: </li>
1.18      cvs      4497: <li>
                   4498: the characteristics of the lines contained in the box: linespacing,
1.1       cvs      4499: indentation of the first line, justification, hyphenation,
1.19      cvs      4500: </li>
1.18      cvs      4501: <li>
                   4502: the conditions for breaking the box across pages,
1.19      cvs      4503: </li>
1.18      cvs      4504: <li>
                   4505: the characteristics of the characters contained in the box: size, font, style,
                   4506: underlining,
1.19      cvs      4507: </li>
1.18      cvs      4508: <li>
                   4509: the depth of the box among overlapping boxes (often called stacking order),
1.19      cvs      4510: </li>
1.18      cvs      4511: <li>
                   4512: the characteristics of graphic elements contained in the box: style and
1.1       cvs      4513: thickness of lines, fill pattern for closed objects,
1.19      cvs      4514: </li>
1.18      cvs      4515: <li>
                   4516: the colors in text, graphics, pictures, and symbols contained in the box are
                   4517: displayed or printed,
1.19      cvs      4518: </li>
1.18      cvs      4519: <li>
                   4520: for presentation boxes only, the contents of the box.
1.19      cvs      4521: </li>
1.18      cvs      4522: </ul>
                   4523: <p>
                   4524: The <a name="presfunct">presentation functions</a> are:</p>
                   4525: <ul>
                   4526: <li>
                   4527: the creation of a presentation box
1.19      cvs      4528: </li>
1.18      cvs      4529: <li>
                   4530: the line-breaking or page-breaking style,
1.19      cvs      4531: </li>
1.18      cvs      4532: <li>
                   4533: the copying of another box,
1.19      cvs      4534: </li>
1.18      cvs      4535: <li>
                   4536: the display of the box background and border,
1.19      cvs      4537: </li>
1.18      cvs      4538: <li>
                   4539: the display of a background picture and its aspect.
1.19      cvs      4540: </li>
1.18      cvs      4541: </ul>
                   4542: <p>
1.1       cvs      4543: For each box and each view, every presentation parameter is defined once and
1.18      cvs      4544: only once, either explicitly or by the <a href="#sectc427">default rules</a>.
                   4545: In contrast, presentation functions are not obligatory and can appear many
                   4546: times for the same element.  for example an element can create many
                   4547: presentation boxes.  Another element may not use any presentation
                   4548: functions.</p>
                   4549: <p>
1.1       cvs      4550: Each rule defining a presentation parameter begins with a keyword followed by
1.18      cvs      4551: a colon.  The keyword indicates the parameter which is the subject of the
                   4552: rule. After the keyword and the colon, the remainder of the rule varies.  All
                   4553: rules are terminated by a semicolon.</p>
                   4554: <pre>     Rule      = PresParam ';' / PresFunc ';' .
1.6       cvs      4555:      PresParam ='VertRef' ':'       PositionHoriz /
                   4556:                 'HorizRef' ':'      PositionVert /
                   4557:                 'VertPos' ':'       VPos /
                   4558:                 'HorizPos' ':'      HPos /
                   4559:                 'Height' ':'        Dimension /
                   4560:                 'Width' ':'         Dimension /
                   4561:                 'VertOverflow' ':'  Boolean /
1.1       cvs      4562:                 'HorizOverflow' ':' Boolean /
1.6       cvs      4563:                 'LineSpacing' ':'   DistanceInherit /
                   4564:                 'Indent' ':'        DistanceInherit /
                   4565:                 'Adjust' ':'        AdjustInherit /
                   4566:                 'Justify' ':'       BoolInherit /
                   4567:                 'Hyphenate' ':'     BoolInherit /
                   4568:                 'PageBreak' ':'     Boolean /
                   4569:                 'LineBreak' ':'     Boolean /
                   4570:                 'InLine' ':'        Boolean /
                   4571:                 'NoBreak1' ':'      AbsDist /
                   4572:                 'NoBreak2' ':'      AbsDist /
                   4573:                 'Gather' ':'        Boolean /
                   4574:                 'Visibility' ':'    NumberInherit /
                   4575:                 'Size'  ':'         SizeInherit /
                   4576:                 'Font' ':'          NameInherit /
                   4577:                 'Style' ':'         StyleInherit /
1.23      cvs      4578:                 'Weight' ':'        WeightInherit /
1.6       cvs      4579:                 'Underline' ':'     UnderLineInherit /
                   4580:                 'Thickness' ':'     ThicknessInherit /
                   4581:                 'Depth' ':'         NumberInherit /
                   4582:                 'LineStyle' ':'     LineStyleInherit /
                   4583:                 'LineWeight' ':'    DistanceInherit /
                   4584:                 'FillPattern' ':'   NameInherit /
                   4585:                 'Background' ':'    NameInherit /
1.13      cvs      4586:                 'Foreground' ':'    NameInherit /
1.6       cvs      4587:                 'Content' ':'       VarConst .
1.1       cvs      4588:      PresFunc = Creation '(' BoxID ')' /
                   4589:                 'Line' /
                   4590:                 'NoLine' /
                   4591:                 'Page' '(' BoxID ')' /
1.13      cvs      4592:                 'Copy' '(' BoxTypeToCopy ')' /
                   4593:                 'ShowBox' /
1.18      cvs      4594:                 'BackgroundPicture' ':' FileName /
                   4595:                 'PictureMode' ':'   PictMode /</pre>
                   4596: </div>
                   4597: 
                   4598: <div class="subsection">
                   4599: 
                   4600: <h3><a name="sectc4216">Box axes</a></h3>
                   4601: <p>
                   4602: The position of the middle axes <tt>VMiddle</tt> and <tt>HMiddle</tt> in
1.1       cvs      4603: relation to their box is always calculated automatically as a function of the
                   4604: height and width of the box and is not specified by the presentation rules. In
                   4605: the presentation schema, these middle axes are used only to position their box
                   4606: with respect to another by specifying the distance between the middle axis and
1.18      cvs      4607: an axis or a side of another box (see the <a href="#sectc4218">relative
                   4608: position</a>).</p>
                   4609: <p>
1.1       cvs      4610: The reference axes of a box are also used to position their box in relation to
                   4611: another, but in contrast to the middle axes, the presentation schema must make
                   4612: their position explicit, either in relation to a side or the middle axis of
1.18      cvs      4613: the box itself, or in relation to an axis of an enclosed box.</p>
                   4614: <p>
1.1       cvs      4615: Only boxes of base elements have predefined reference axes.  For character
                   4616: string boxes, the horizontal reference axis is the baseline of the characters
                   4617: (the line which passes immediately under the upper-case letters, ignoring the
                   4618: letter Q) and the vertical reference axis is at the left edge of the first
1.18      cvs      4619: character of the string.</p>
                   4620: <p>
                   4621: The positions of a box's reference axes are defined by the <tt>VertRef</tt>
                   4622: and <tt>HorizRef</tt> rules which specify the <a href="#distance">distance</a>
1.1       cvs      4623: between the reference axis and an axis or parallel side of the same box or of
1.18      cvs      4624: an enclosed box.</p>
                   4625: <pre>               'VertRef'  ':' PositionHoriz
                   4626:                'HorizRef' ':' PositionVert</pre>
                   4627: <blockquote class="example">
                   4628: <p>
                   4629: <strong>Example:</strong></p>
                   4630: <p>
1.3       cvs      4631: If, in the structure schema for mathematical formulas, the fraction element is
1.18      cvs      4632: defined by</p>
                   4633: <pre>Fraction = BEGIN
1.1       cvs      4634:            Numerator   = Expression;
                   4635:            Denominator = Expression;
1.18      cvs      4636:            END;</pre>
                   4637: <p>
1.3       cvs      4638: then the horizontal reference axis of the fraction can be positioned on top of
1.18      cvs      4639: the denominator by the rule:</p>
                   4640: <pre>Fraction :
1.1       cvs      4641:      BEGIN
                   4642:      HorizRef : Enclosed Denominator . Top;
                   4643:      ...
1.18      cvs      4644:      END;</pre>
                   4645: <p>
                   4646: To put the horizontal reference axis of a column at its middle:</p>
                   4647: <pre>Column :
1.1       cvs      4648:      BEGIN
                   4649:      HorizRef : * . HMiddle;
                   4650:      ...
1.18      cvs      4651:      END;</pre>
                   4652: </blockquote>
                   4653: </div>
1.1       cvs      4654: 
1.18      cvs      4655: <div class="subsection">
1.1       cvs      4656: 
1.18      cvs      4657: <h3><a name="sectc4217">Distance units</a></h3>
                   4658: <p>
1.1       cvs      4659: Some distances and dimensions appear in many rules of a presentation schema,
1.18      cvs      4660: especially in position rules (<tt>VertPos, HorizPos</tt>), in extent rules for
                   4661: boxes (<tt>Height, Width</tt>), in rules defining lines (<tt>LineSpacing,
                   4662: Indent</tt>), in rules controlling pagination (<tt>NoBreak1, NoBreak2</tt>)
                   4663: and in rules specifying the thickness of strokes (<tt>LineWeight</tt>).</p>
                   4664: <p>
                   4665: In all these rules, the distance or extent can be expressed</p>
                   4666: <ul>
                   4667: <li>
                   4668: either in relative units, which depend on the size of the characters in the
                   4669: current font: height of the element's font or height of the letter 'x',
1.19      cvs      4670: </li>
1.18      cvs      4671: <li>
                   4672: or in absolute units: centimeter, millimeter, inch, typographer's point, pica
                   4673: or pixel.
1.19      cvs      4674: </li>
1.18      cvs      4675: </ul>
                   4676: <p>
1.5       cvs      4677: Units can be chosen freely.  Thus, it is possible to use relative units in one
1.18      cvs      4678: rule, centimeters in the next rule, and typographer's points in another.</p>
                   4679: <p>
1.1       cvs      4680: Absolute units are used to set rigid rules for the appearance of documents. In
                   4681: contrast, relative units allow changes of scale.  The editor lets the value of
                   4682: relative units be changed dynamically.  Such changes affect every box using
                   4683: relative units simultaneously and in the same proportion. Changing the value
                   4684: of the relative units affects the size of the characters and graphical
1.18      cvs      4685: elements, and the size of the boxes and the distances between them.</p>
                   4686: <p>
                   4687: A <a name="distance">distance</a> or extent is specified by a number, which
1.1       cvs      4688: may be followed by one or more spaces and a units keyword.  When there is no
                   4689: units keyword, the number specifies the number of relative units, where a
                   4690: relative unit is the height of a character in the current font (an em).  When
                   4691: the number is followed by a units keyword, the keyword indicates the type of
1.18      cvs      4692: absolute units:</p>
                   4693: <ul>
                   4694: <li>
                   4695: <tt>em</tt>: height of the element's font,
1.19      cvs      4696: </li>
1.18      cvs      4697: <li>
                   4698: <tt>ex</tt>: height of the letter 'x',
1.19      cvs      4699: </li>
1.18      cvs      4700: <li>
                   4701: <tt>cm</tt>: centimeter,
1.19      cvs      4702: </li>
1.18      cvs      4703: <li>
                   4704: <tt>mm</tt>: millimeter,
1.19      cvs      4705: </li>
1.18      cvs      4706: <li>
                   4707: <tt>in</tt>: inch (1 in = 2.54 cm),
1.19      cvs      4708: </li>
1.18      cvs      4709: <li>
                   4710: <tt>pt</tt>: point (1 pt = 1/72 in),
1.19      cvs      4711: </li>
1.18      cvs      4712: <li>
                   4713: <tt>pc</tt>: pica (1 pc = 12 pt),
1.19      cvs      4714: </li>
1.18      cvs      4715: <li>
                   4716: <tt>px</tt>: pixel.
1.19      cvs      4717: </li>
1.18      cvs      4718: </ul>
                   4719: <p>
1.1       cvs      4720: Whatever the chosen unit, relative or absolute, the number is not necessarily
                   4721: an integer and may be expressed in fixed point notation (using the American
1.18      cvs      4722: convention of a period to express the decimal point).</p>
                   4723: <p>
1.1       cvs      4724: If the distance appears in a presentation rule for a numeric attribute, the
                   4725: number can be replaced by the name of an attribute.  In this case, the value
                   4726: of the attribute is used.  Obviously, the attribute name cannot be followed by
                   4727: a decimal point and a fractional part, but it can be followed a units keyword.
1.18      cvs      4728: However, the choice of units is limited to em, ex, pt and px.</p>
                   4729: <pre>     Distance      = [ Sign ] AbsDist .
1.1       cvs      4730:      Sign          ='+' / '-' .
                   4731:      AbsDist       = IntegerOrAttr [ '.' DecimalPart ]
                   4732:                      [ Unit ].
                   4733:      IntegerOrAttr = IntegerPart / AttrID .
                   4734:      IntegerPart   = NUMBER .
                   4735:      DecimalPart   = NUMBER .
                   4736:      Unit          ='em' / 'ex' / 'cm' / 'mm' / 'in' / 'pt' /
1.18      cvs      4737:                     'pc' / 'px' / '%' .</pre>
                   4738: <blockquote class="example">
                   4739: <p>
                   4740: <strong>Example:</strong></p>
                   4741: <p>
1.3       cvs      4742: The following rules specify that a box has a height of 10.5 centimeters and a
1.18      cvs      4743: width of 5.3 ems:</p>
                   4744: <pre>Height : 10.5 cm;
                   4745: Width  : 5.3;</pre>
                   4746: </blockquote>
                   4747: </div>
1.1       cvs      4748: 
1.18      cvs      4749: <div class="subsection">
1.1       cvs      4750: 
1.18      cvs      4751: <h3><a name="sectc4218">Relative positions</a></h3>
                   4752: <p>
1.1       cvs      4753: The positioning of boxes uses the eight axes and sides, the sides generally
                   4754: being used to define the juxtapositioning (vertical or horizontal) of boxes,
                   4755: the middle axes being used to define centering, and the reference axes being
1.18      cvs      4756: used for alignment.</p>
                   4757: <p>
                   4758: Two rules allow a box to be placed relative to other boxes.  The
                   4759: <tt>VertPos</tt> rule positions the box vertically.  The <tt>HorizPos</tt>
                   4760: rule positions the box horizontally.  It is possible that a box's position
                   4761: could be entirely determined by other boxes positioned relative to it. In this
                   4762: case, the position is implicit and the word <tt>nil</tt> can be used to
                   4763: specify that no position rule is needed.  Otherwise, an explicit rule must be
                   4764: given by indicating the axis or side which defines the position of the box,
                   4765: followed by an equals sign and the distance between between this axis or side
                   4766: and a parallel axis or side of another box, called the reference box.  The box
                   4767: for which the rule is written will be positioned relative to the reference
                   4768: box.</p>
                   4769: <pre>                 'VertPos' ':' VPos
1.6       cvs      4770:                  'HorizPos' ':' HPos
                   4771:      HPos      = 'nil' / VertAxis '=' HorizPosition
                   4772:                  [ 'UserSpecified' ].
                   4773:      VPos      = 'nil' / HorizAxis '=' VertPosition
                   4774:                  [ 'UserSpecified' ].
1.1       cvs      4775:      VertAxis  = 'Left' / 'VMiddle' / 'VRef' / 'Right' .
1.18      cvs      4776:      HorizAxis = 'Top' / 'HMiddle' / 'HRef' / 'Bottom' .</pre>
                   4777: <p>
1.1       cvs      4778: The reference box is an adjacent box: enclosing, enclosed or adjacent. When a
                   4779: rule is associated with a reference type attribute (and only in this case), it
                   4780: can be a box of the element designated by the attribute.  The reference box
1.18      cvs      4781: can be either a presentation box previously defined in the <tt>BOXES</tt>
1.1       cvs      4782: section of the schema and created by a creation function, or the box
1.18      cvs      4783: associated with a structured element.</p>
                   4784: <p>
1.1       cvs      4785: The structural position of the reference box (relative to the box for which
1.18      cvs      4786: the rule is being written) is indicated by a keyword: <tt>Enclosing</tt>,
                   4787: <tt>Enclosed</tt>, or, for sibling boxes, <tt>Previous</tt> or <tt>Next</tt>.
1.1       cvs      4788: The reference attributes, or presentation boxes created by a reference
1.18      cvs      4789: attribute, the <tt>Referred</tt> keyword may be used to designate the element
                   4790: which the reference points to.  The keyword <tt>Creator</tt> can be used in
1.1       cvs      4791: rules for presentation boxes to designate the box of the element which created
1.18      cvs      4792: the presentation box.  Finally, the <tt>Root</tt> keyword can be used to
                   4793: designate the root of the document.</p>
                   4794: <p>
                   4795: When the keyword is ambiguous, it is followed by the name of an element type
                   4796: or presentation box which resolves the ambiguity (the <tt>Creator</tt> and
                   4797: <tt>Root</tt> keywords are never ambiguous).  If this name is not given, then
1.1       cvs      4798: the first box encountered is used as the reference box. It is also possible to
1.18      cvs      4799: use just the name of an element type or presentation box without an initial
                   4800: keyword. In this case, a sibling having that name will be used.  If the name
                   4801: is preceded by the keyword <tt>NOT</tt>, then the reference box will be the
                   4802: first box whose type is not the named one.</p>
                   4803: <p>
                   4804: In place of the box or type name, the keywords <tt>AnyElem</tt>,
                   4805: <tt>AnyBox</tt> and <tt>ElemWithAttr</tt> can be used, representing
1.17      cvs      4806: respectively, any structured element box, any presentation box, and the box
                   4807: corresponding to any structured element having a particular attribute,
                   4808: whatever its value; the name of this attribute must follow the keyword
1.18      cvs      4809: <tt>ElemWithAttr</tt>.</p>
                   4810: <p>
1.17      cvs      4811: A type name may be preceded by a star in order to resolve the ambiguity in the
1.18      cvs      4812: special case where the structure schema defines an <a
                   4813: href="#sectd3284">inclusion</a> without expansion (or with partial expansion)
                   4814: of the same type as an element of the scheme.  For mark pairs (and only for <a
                   4815: href="#sectd3285">mark pairs</a>) the type name <em>must</em> be preceded by
                   4816: the <tt>First</tt> or <tt>Second</tt> keyword, which indicates which of the
                   4817: two marks of the pair  should be used as the reference box.</p>
                   4818: <p>
                   4819: The star character ('<tt>*</tt>') used alone designates the box to which the
1.1       cvs      4820: rule applies (in this case, it is obviously useless to specify the type of the
1.18      cvs      4821: reference box).</p>
                   4822: <p>
                   4823: The keywords <tt>Enclosing</tt> and <tt>Enclosed</tt> can be used no matter
1.1       cvs      4824: what constructor defines the type to which the rule applies.  When applied to
1.18      cvs      4825: the element which represents the entire document, <tt>Enclosing</tt>
1.1       cvs      4826: designates the window or page in which the document's image is displayed for
                   4827: the view to which the rule applies.  A box or type name without a keyword is
                   4828: used for aggregate elements and designates another element of the same
                   4829: aggregate.  It can also be used to designate a presentation or page layout
1.18      cvs      4830: box.  The keywords <tt>Previous</tt> and <tt>Next</tt> are primarily used to
1.1       cvs      4831: denote list elements, but can also be used to denote elements of an
1.18      cvs      4832: aggregate.</p>
                   4833: <p>
1.1       cvs      4834: In the position rule, the structural position relative to the reference box is
                   4835: followed, after a period, by the name of an axis or side.  The rule specifies
                   4836: its node's position as being some distance from this axis or side of the
                   4837: reference box.  If this distance is zero, then the distance does not appear in
                   4838: the rule.  Otherwise, it does appear as a positive or negative number (the
                   4839: sign is required for negative numbers). The sign takes into account the
                   4840: orientation of the coordinate axes: for top to bottom for the vertical axis
                   4841: and from left to right for the horizontal axis.  Thus, a negative distance in
                   4842: a vertical position indicates that the side or axis specified in the rule is
1.18      cvs      4843: above the side or axis of the reference box.</p>
                   4844: <p>
                   4845: The distance can be followed by the <tt>UserSpecified</tt> keyword (even if
                   4846: the distance is nil and does not appear, the <tt>UserSpecified</tt> keyword
1.1       cvs      4847: can be used).  It indicates that when the element to which the rule applies is
                   4848: being created, the editor will ask the user to specify the distance himself,
                   4849: using the mouse.  In this case, the distance specified in the rule is a
                   4850: default distance which is suggested to the user but can be modified.  The
1.18      cvs      4851: <tt>UserSpecified</tt> keyword can be used either in the vertical position
                   4852: rule, the horizontal position rule, or both.</p>
                   4853: <pre>     VertPosition  = Reference '.' HorizAxis [ Distance ] .
1.1       cvs      4854:      HorizPosition = Reference '.' VertAxis [ Distance ] .
                   4855:      Reference     ='Enclosing' [ BoxTypeNot ] /
                   4856:                     'Enclosed' [ BoxTypeNot ] /
                   4857:                     'Previous' [ BoxTypeNot ] /
                   4858:                     'Next' [ BoxTypeNot ] /
                   4859:                     'Referred' [ BoxTypeNot ] /
                   4860:                     'Creator' /
                   4861:                     'Root' /
                   4862:                     '*' /
                   4863:                      BoxOrType .
                   4864:      BoxOrType     = BoxID /
                   4865:                      [ '*' ] [ FirstSec ] ElemID /
1.17      cvs      4866:                     'AnyElem' / 'AnyBox' /
                   4867:                     'ElemWithAttr' AttrID .
1.18      cvs      4868:      BoxTypeNot    = [ 'NOT' ] BoxOrType .</pre>
                   4869: <blockquote class="example">
                   4870: <p>
                   4871: <strong>Example:</strong></p>
                   4872: <p>
                   4873: If a <a name="expos1">report</a> is defined by the following structure
                   4874: schema:</p>
                   4875: <pre>Report = BEGIN
1.6       cvs      4876:          Title  = Text;
                   4877:          Summary = Text;
                   4878:          Keywords = Text;
                   4879:          ...
1.18      cvs      4880:          END;</pre>
                   4881: <p>
                   4882: then the presentation schema could contain the rules:</p>
                   4883: <pre>Report : BEGIN
1.6       cvs      4884:          VertPos  : Top = Enclosing . Top;
                   4885:          HorizPos : Left = Enclosing . Left;
                   4886:          ...
1.18      cvs      4887:          END;</pre>
                   4888: <p>
                   4889: These rules place the <a name="reportexample">report</a> in the upper left
                   4890: corner of the enclosing box, which is the window in which the document is
                   4891: being edited.</p>
                   4892: <pre>Title :  BEGIN
1.6       cvs      4893:          VertPos  : Top = Enclosing . Top + 1;
                   4894:          HorizPos : VMiddle = Enclosing . VMiddle;
                   4895:          ...
1.18      cvs      4896:          END;</pre>
                   4897: <p>
1.3       cvs      4898: The top of the title is one line (a line has the height of the characters of
                   4899: the title) from the top of the report, which is also the top of the editing
1.18      cvs      4900: window.  The title is centered horizontally in the window (see <a
                   4901: href="#posdim">figure</a>).</p>
                   4902: <pre>Summary : BEGIN
1.1       cvs      4903:           VertPos  : Top = Title . Bottom + 1.5;
                   4904:           HorizPos : Left = Enclosing . Left + 2 cm;
                   4905:           ...
1.18      cvs      4906:           END;</pre>
                   4907: <p>
                   4908: The top of the summary is place a line and a half below the bottom of the
                   4909: title and is shifted two centimeters from the side of the window.</p>
                   4910: </blockquote>
                   4911: <blockquote class="example">
                   4912: <p>
                   4913: <strong>Example:</strong></p>
                   4914: <p>
                   4915: Suppose there is a <a name="expos2">Design</a> logical structure which
                   4916: contains graphical elements:</p>
                   4917: <pre>Design = LIST OF (ElemGraph = GRAPHICS);</pre>
                   4918: <p>
1.3       cvs      4919: The following rules allow the user to freely choose the position of each
1.18      cvs      4920: element when it is created:</p>
                   4921: <pre>ElemGraph =
1.1       cvs      4922:    BEGIN
                   4923:    VertPos : Top = Enclosing . Top + 1 cm UserSpecified;
                   4924:    HorizPos: Left = Enclosing . Left UserSpecified;
                   4925:    ...
1.18      cvs      4926:    END;</pre>
                   4927: <p>
                   4928: Thus, when a graphical element is created, its default placement is at the
                   4929: left of the window and 1 cm from the top, but the user can move it
                   4930: immediately, simply by moving the mouse.</p>
                   4931: </blockquote>
                   4932: </div>
1.1       cvs      4933: 
1.18      cvs      4934: <div class="subsection">
1.1       cvs      4935: 
1.18      cvs      4936: <h3><a name="sectc4219">Box extents</a></h3>
                   4937: <p>
1.1       cvs      4938: The extents (height and width) of each box are defined by the two rules
1.18      cvs      4939: <tt>Height</tt> and <tt>Width</tt>.  There are three types of extents: fixed,
                   4940: relative, and elastic.</p>
1.1       cvs      4941: 
1.18      cvs      4942: <div class="subsubsection">
1.1       cvs      4943: 
1.18      cvs      4944: <h4><a name="sectd42191">Fixed extents</a></h4>
                   4945: <p>
1.1       cvs      4946: A fixed dimension sets the height or width of the box independently of all
1.18      cvs      4947: other boxes.  It is expressed in <a href="#sectc4217">distance units</a>.  The
                   4948: extent can be followed by the <tt>UserSpecified</tt> keyword which indicates
1.1       cvs      4949: that when the element to which the rule applies is being created, the editor
                   4950: will ask the user to specify the extent himself, using the mouse.  In this
                   4951: case, the extent specified in the rule is a default extent which is suggested
1.18      cvs      4952: to the user but can be modified.  The <tt>UserSpecified</tt> keyword can be
                   4953: used either in the <tt>Height</tt> rule, the <tt>Width</tt> rule, or both.</p>
                   4954: <p>
                   4955: A fixed extent rule can be ended by the <tt>Min</tt> keyword, which signifies
1.1       cvs      4956: that the indicated value is a minimum, and that, if the contents of the box
1.18      cvs      4957: require it, a larger extent is possible.</p>
                   4958: <pre>                'Height' ':' Dimension
1.1       cvs      4959:                 'Width' ':' Dimension
                   4960:      Dimension = AbsDist [ 'UserSpecified' ]  [ 'Min' ] /
1.18      cvs      4961:                  ...</pre>
                   4962: <blockquote class="example">
                   4963: <p>
                   4964: <strong>Example:</strong></p>
                   4965: <p>
                   4966: Continuing with the <a href="#expos2">previous example</a>, it is possible to
1.3       cvs      4967: allow the user to choose the size of each graphical element as it is
1.18      cvs      4968: created:</p>
                   4969: <pre>ElemGraph : BEGIN
1.6       cvs      4970:             Width :  2 cm UserSpecified;
1.1       cvs      4971:             Height : 1 cm UserSpecified;
                   4972:             ...
1.18      cvs      4973:             END;</pre>
                   4974: <p>
1.1       cvs      4975: Thus, when a graphical element is create, it is drawn by default with a width
                   4976: of 2 cm and a height of 1 cm, but the user is free to resize it immediately
1.18      cvs      4977: with the mouse.</p>
                   4978: <pre>Summary :  BEGIN
1.1       cvs      4979:            Height : 5 cm Min;
                   4980:            ...
                   4981:            END;
                   4982: Keywords : BEGIN
                   4983:            VertPos : Top = Summary . Bottom;
                   4984:            ...
1.18      cvs      4985:            END;</pre>
                   4986: </blockquote>
                   4987: </div>
1.1       cvs      4988: 
1.18      cvs      4989: <div class="subsubsection">
1.1       cvs      4990: 
1.18      cvs      4991: <h4><a name="sectd42192">Relative extents</a></h4>
                   4992: <p>
1.1       cvs      4993: A relative extent determines the extent as a function of the extent of another
                   4994: box, just as a relative position places a box in relation to another. The
                   4995: reference box in an extent rule is designated using the same syntax as is used
1.18      cvs      4996: in a relative position rule.  It is followed by a period and a <tt>Height</tt>
                   4997: or <tt>Width</tt> keyword, depending on the extent being referred to.  Next
1.1       cvs      4998: comes the relation between the extent being defined and the extent of the
1.18      cvs      4999: reference box.  This relation can be either a percentage or a difference.</p>
                   5000: <p>
1.1       cvs      5001: A percentage is indicated by a star (the multiplication symbol) followed by
                   5002: the numeric percentage value (which may be greater than or less than 100) and
                   5003: the percent (`%') character.  A difference is simply indicated by a signed
1.18      cvs      5004: difference.</p>
                   5005: <p>
1.1       cvs      5006: If the rule appears in the presentation rules of a numeric attribute, the
                   5007: percentage value can be replaced by the name of the attribute. This attribute
1.18      cvs      5008: is then used as a percentage.  The attribute can also be used as part of a <a
                   5009: href="#distance">difference</a>.</p>
                   5010: <p>
1.1       cvs      5011: Just as with a fixed extent, a relative extent rule can end with the
1.18      cvs      5012: <tt>Min</tt> keyword, which signifies that the extent is a minimum and that,
                   5013: if the contents of the box require it, a larger extent is possible.</p>
                   5014: <p>
                   5015: A special case of relative extent rules is:</p>
                   5016: <pre>Height : Enclosed . Height;</pre>
                   5017: <p>
                   5018: or</p>
                   5019: <pre>Width  : Enclosed . Width;</pre>
                   5020: <p>
1.5       cvs      5021: which specifies that the box has a height (or width) such that it encloses all
1.18      cvs      5022: the boxes which it contains, excluding boxes having a rule <tt>VertOverflow:
                   5023: Yes;</tt> or <tt>HorizOverflow: Yes;</tt>.</p>
                   5024: <p>
                   5025: <strong>Note:</strong> character strings (type <tt>TEXT_UNIT</tt>) generally
1.1       cvs      5026: must use the sum of the widths of the characters which compose them as their
1.18      cvs      5027: width, which is expressed by the rule:</p>
                   5028: <pre>TEXT_UNIT :
                   5029:      Width : Enclosed . Width;</pre>
                   5030: <p>
                   5031: If this rule is not the default <tt>Width</tt> rule, it must be given
                   5032: explicitly in the <tt>RULES</tt> section which defines the presentation rules
                   5033: of the logical elements.</p>
                   5034: <pre>                  'Height' ':' Extent
1.1       cvs      5035:                   'Width' ':' Extent
                   5036:      Extent      = Reference '.' HeightWidth [ Relation ]
                   5037:                    [ 'Min' ] / ...
                   5038:      HeightWidth ='Height' / 'Width' .
                   5039:      Relation    ='*' ExtentAttr '%' / Distance .
                   5040:      ExtentAttr  = ExtentVal / AttrID .
1.18      cvs      5041:      ExtentVal   = NUMBER .</pre>
                   5042: <blockquote class="example">
                   5043: <p>
                   5044: <strong>Example:</strong></p>
                   5045: <p>
                   5046: Completing the <a href="#expos1">above example</a>, it is possible to specify
                   5047: that the report takes its width from the editing window and its height from
                   5048: the size of its contents (this can obviously be greater than that of the
                   5049: window):</p>
                   5050: <pre>Report :  BEGIN
1.1       cvs      5051:           Width : Enclosing . Width;
                   5052:           Height : Enclosed . Height;
                   5053:           ...
1.18      cvs      5054:           END;</pre>
                   5055: <p>
1.3       cvs      5056: Then, the following rules make the title occupy 60% of the width of the report
                   5057: (which is that of the window) and is broken into centered lines of this width
1.18      cvs      5058: (see the <a href="#sectc4222"><tt>Line</tt> rule</a>).</p>
                   5059: <pre>Title :   BEGIN
1.1       cvs      5060:           Width : Enclosing . Width * 60%;
                   5061:           Height : Enclosed . Height;
                   5062:           Line;
                   5063:           Adjust : VMiddle;
                   5064:           ...
1.18      cvs      5065:           END;</pre>
                   5066: <p>
                   5067: The summary occupy the entire width of the window, with the exception of a 2
                   5068: cm margin reserved by the horizontal position rule:</p>
                   5069: <pre>Summary : BEGIN
1.1       cvs      5070:           Width : Enclosing . Width - 2 cm;
                   5071:           Height : Enclosed . Height;
                   5072:           ...
1.18      cvs      5073:           END;</pre>
                   5074: <p>
                   5075: This set of rules, plus the <a href="#reportexample">position rules given
                   5076: above</a>, produce the layout of boxes shown in the following<a
                   5077: href="#posdim">figure</a>.</p>
                   5078: 
                   5079: <div class="figure">
                   5080: <hr>
1.19      cvs      5081: 
1.18      cvs      5082: <pre>-------------------------------------------------------------
1.1       cvs      5083: | Window and Report           ^                             |
                   5084: |                             | 1 line                      |
                   5085: |                             v                             |
                   5086: |           -------------------------------------           |
                   5087: |           |                                   |           |
                   5088: :    20%    :               Title               :    20%    :
                   5089: :&lt;--------->:                                   :&lt;--------->:
                   5090: :           :                60%                :           :
                   5091: :           :&lt;--------------------------------->:           :
                   5092: |           |                                   |           |
                   5093: |           -------------------------------------           |
                   5094: |                             ^                             |
                   5095: |                             | 1.5 line                    |
                   5096: |                             |                             |
                   5097: |                             v                             |
                   5098: |        ---------------------------------------------------|
                   5099: |  2 cm  |                                                  |
                   5100: |&lt;------>|                    Summary                       |
1.18      cvs      5101: :        :                                                  :</pre>
1.19      cvs      5102: <p align="center">
1.18      cvs      5103: <em><a name="posdim">Box position and extent</a><em></em></em></p>
                   5104: <hr>
1.19      cvs      5105: 
1.18      cvs      5106: </div>
                   5107: </blockquote>
                   5108: </div>
1.1       cvs      5109: 
1.18      cvs      5110: <div class="subsubsection">
1.1       cvs      5111: 
1.18      cvs      5112: <h4><a name="sectd42193">Elastic extents</a></h4>
                   5113: <p>
1.1       cvs      5114: The last type of extent is the elastic extent.  Either one or both extents can
                   5115: be elastic.  A box has an elastic extent when two opposite sides are linked by
1.18      cvs      5116: distance constraints to two sides or axes of other boxes.</p>
                   5117: <p>
1.1       cvs      5118: One of the sides of the elastic box is linked by a position rule
1.18      cvs      5119: (<tt>VertPos</tt> or <tt>HorizPos</tt>) to a neighboring box.  The other side
                   5120: is link to another box by a <tt>Height</tt> or <tt>Width</tt> rule, which
1.1       cvs      5121: takes the same form as the position rule.  For the elastic box itself, the
                   5122: notions of sides (left or right, top or bottom) are fuzzy, since the movement
                   5123: of either one of the two reference boxes can, for example, make the left side
                   5124: of the elastic box move to the right of its right side.  This is not
                   5125: important.  The only requirement is that the two sides of the elastic box used
1.18      cvs      5126: in the position and extent rule are opposite sides of the box.</p>
                   5127: <pre>             'Height' ':' Extent
1.6       cvs      5128:              'Width' ':' Extent
1.18      cvs      5129:      Extent = HPos / VPos / ...</pre>
                   5130: <blockquote class="example">
                   5131: <p>
                   5132: <strong>Example:</strong></p>
                   5133: <p>
1.3       cvs      5134: Suppose we want to draw an elastic arrow or line between the middle of the
                   5135: bottom side of box A and the upper left corner of box B.  To do this, we would
                   5136: define a graphics box whose upper left corner coincides with the middle of the
                   5137: bottom side of A (a position rule) and whose lower right corner coincides with
1.18      cvs      5138: with the upper left corner of B (dimension rules):</p>
                   5139: <pre>LinkedBox :
1.1       cvs      5140:    BEGIN
1.6       cvs      5141:    VertPos  : Top = A .Bottom;
1.1       cvs      5142:    HorizPos : Left = A . VMiddle;
1.6       cvs      5143:    Height   : Bottom = B . Top;
                   5144:    Width    : Right = B . Left;
1.18      cvs      5145:    END;</pre>
                   5146: </blockquote>
                   5147: <blockquote class="example">
                   5148: <p>
                   5149: <strong>Example:</strong></p>
                   5150: <p>
1.3       cvs      5151: The element SectionTitle creates a presentation box called SectionNum which
                   5152: contains the number of the section.  Suppose we want to align the SectionNum
                   5153: and SectionTitle horizontally, have the SectionNum take its width from its
                   5154: contents (the section number), have the SectionTitle box begin 0.5 cm to the
                   5155: right of the SectionNum box and end at the right edge of its enclosing box.
1.18      cvs      5156: This would make the SectionTitle box elastic, since its width is defined by
                   5157: the position of its left and right sides.  The following rules produce this
                   5158: effect:</p>
                   5159: <pre>SectionNum :
1.1       cvs      5160:    BEGIN
                   5161:    HorizPos : Left = Enclosing . Left;
                   5162:    Width : Enclosed . Width;
                   5163:    ...
                   5164:    END;
                   5165: 
                   5166: SectionTitle :
                   5167:    BEGIN
                   5168:    HorizPos : Left = SectionNum . Right + 0.5 cm;
                   5169:    Width : Right = Enclosing . Right;
                   5170:    ...
1.18      cvs      5171:    END;</pre>
                   5172: </blockquote>
                   5173: </div>
                   5174: </div>
1.1       cvs      5175: 
1.18      cvs      5176: <div class="subsection">
1.1       cvs      5177: 
1.18      cvs      5178: <h3><a name="sectc4220">Overflow</a></h3>
                   5179: <p>
1.1       cvs      5180: A boxes corresponding to a structural element normally contain all boxes
                   5181: corresponding to the elements of its subtree.  However, in some cases, it
                   5182: could be necessary to allow a box to jut out from its parent box. Two
                   5183: presentation rules indicate that such an overflow is allowed, one for
1.18      cvs      5184: horizontal overflow, one for vertical overflow.</p>
                   5185: <p>
1.1       cvs      5186: Each of these rules is expressed by a keyword followed by a colon and the
1.18      cvs      5187: keyword <tt>Yes</tt> or <tt>No</tt>.</p>
                   5188: <pre>               'VertOverflow' ':' Boolean /
1.1       cvs      5189:                'HorizOverflow' ':' Boolean .
1.18      cvs      5190:      Boolean = 'Yes' / 'No' .</pre>
                   5191: </div>
1.1       cvs      5192: 
1.18      cvs      5193: <div class="subsection">
1.1       cvs      5194: 
1.18      cvs      5195: <h3><a name="sectc4221">Inheritance</a></h3>
                   5196: <p>
1.1       cvs      5197: A presentation parameter can be defined by reference to the same parameter of
                   5198: another box in the tree of boxes.  These structural links are expressed by
                   5199: kinship.  The reference box can be that of the element immediately above in
1.18      cvs      5200: the structure (<tt>Enclosing</tt>), two levels above (<tt>GrandFather</tt>),
                   5201: immediately below (<tt>Enclosed</tt>) or immediately before
                   5202: (<tt>Previous</tt>).  In the case of a presentation box, and only in that
1.1       cvs      5203: case, the reference box may be the element which created the presentation box
1.18      cvs      5204: (<tt>Creator</tt>).</p>
                   5205: <p>
1.1       cvs      5206: Kinship is expressed in terms of the logical structure of the document and not
                   5207: in terms of the tree of boxes.  The presentation box cannot transmit any of
                   5208: their parameters by inheritance; only structured element boxes can do so. As
                   5209: an example, consider an element B which follows an element A in the logical
                   5210: structure.  The element B creates a presentation box P in front of itself,
1.18      cvs      5211: using the <tt>CreateBefore</tt> rule (see the <a href="#sectc4232">creation
                   5212: rules</a>).  If element B's box inherits its character style using the
                   5213: <tt>Previous</tt> kinship operation, it gets its character style from A's box,
1.1       cvs      5214: not from P's box.  Inheritance works differently for positions and extents,
1.18      cvs      5215: which can refer to presentation boxes.</p>
                   5216: <p>
1.1       cvs      5217: The inherited parameter value can be the same as that of the reference box.
                   5218: This is indicated by an equals sign.  However, for numeric parameters, a
                   5219: different value can be obtained by adding or subtracting a number from the
                   5220: reference box's parameter value.  Addition is indicated by a plus sign before
                   5221: the number, while subtraction is specified with a minus sign.  The value of a
                   5222: parameter can also be given a maximum (if the sign is a plus) or minimum (if
1.18      cvs      5223: the sign is a minus).</p>
                   5224: <p>
1.1       cvs      5225: If the rule is being applied to a numeric attribute, the number to add or
                   5226: subtract can be replaced by the attribute name.  The value of a maximum or
                   5227: minimum may also be replaced by an attribute name.  In these cases, the value
1.18      cvs      5228: of the attribute is used.</p>
                   5229: <pre>  Inheritance    = Kinship  InheritedValue .
1.6       cvs      5230:   Kinship        ='Enclosing' / 'GrandFather' / 'Enclosed' /
                   5231:                   'Previous' / 'Creator' .
1.1       cvs      5232:   InheritedValue ='+' PosIntAttr [ 'Max' maximumA ] /
1.6       cvs      5233:                   '-' NegIntAttr [ 'Min' minimumA ] /
                   5234:                   '=' .
                   5235:   PosIntAttr     = PosInt / AttrID .
                   5236:   PosInt         = NUMBER .
                   5237:   NegIntAttr     = NegInt / AttrID .
                   5238:   NegInt         = NUMBER .
                   5239:   maximumA       = maximum / AttrID .
                   5240:   maximum        = NUMBER .
                   5241:   minimumA       = minimum / AttrID .
1.18      cvs      5242:   minimum        = NUMBER .</pre>
                   5243: <p>
1.1       cvs      5244: The parameters which can be obtained by inheritance are justification,
                   5245: hyphenation, interline spacing, character font (font family), font style, font
                   5246: size, visibility, indentation, underlining, alignment of text, stacking order
                   5247: of objects, the style and thickness of lines, fill pattern and the colors of
1.18      cvs      5248: lines and characters.</p>
                   5249: </div>
1.1       cvs      5250: 
1.18      cvs      5251: <div class="subsection">
1.1       cvs      5252: 
1.18      cvs      5253: <h3><a name="sectc4222">Line breaking</a></h3>
                   5254: <p>
                   5255: The <tt>Line</tt> rule specifies that the contents of the box should be broken
1.1       cvs      5256: into lines: the boxes included in the box to which this rule is attached are
                   5257: displayed one after the other, from left to right, with their horizontal
                   5258: reference axes aligned so that they form a series of lines.  The length of
1.18      cvs      5259: these lines is equal to the width of the box to which the <tt>Line</tt> rule
                   5260: is attached.</p>
                   5261: <p>
1.1       cvs      5262: When an included box overflows the current line, it is either carried forward
1.18      cvs      5263: to the next line, cur, or left the way it is.  The <a
                   5264: href="#sectc4223"><tt>LineBreak</tt> rule</a> is used to allow or prevent the
1.1       cvs      5265: breaking of included boxes.  If the included box is not breakable but is
                   5266: longer than the space remaining on the line, it is left as is.  When a
                   5267: character string box is breakable, the line is broken between words or, if
1.18      cvs      5268: necessary, by <a href="#sectd42225">hyphenating a word</a>.  When a compound
                   5269: box is breakable, the box is transparent in regard to line breaking. The boxes
                   5270: included in the compound box are treated just like included boxes which have
                   5271: the <tt>LineBreak</tt> rule.  Thus, it is possible to traverse a complete
                   5272: subtree of boxes to line break the text leaves of a complex structure.</p>
                   5273: <p>
1.1       cvs      5274: The relative position rules of the included boxes are ignored, since the boxes
1.18      cvs      5275: will be placed according to the line breaking rules.</p>
                   5276: <p>
                   5277: The <tt>Line</tt> rule does not have a parameter.  The characteristics of the
                   5278: lines that will be constructed are determined by the <tt>LineSpacing</tt>,
                   5279: <tt>Indent</tt>, <tt>Adjust</tt>, <tt>Justify</tt>, and <tt>Hyphenate</tt>
                   5280: rules.  Moreover, the <a href="#insectd42226"><tt>Inline</tt> rule</a> permits
                   5281: the exclusion of certain elements from the line breaking process.</p>
                   5282: <p>
                   5283: When the <tt>Line</tt> rule appears in the rules sequence of a non-primary
                   5284: view, it applies only to that view, but when the <tt>Line</tt> rule appears in
1.1       cvs      5285: the rules sequence of the primary view, it also applies to the other views by
1.18      cvs      5286: default, except for those views which explicitly invoke the <tt>NoLine</tt>
                   5287: rule.  Thus, the <tt>NoLine</tt> rule can be used in a non-primary view to
                   5288: override the primary view's <tt>Line</tt> rule.  The <tt>NoLine</tt> rule must
                   5289: not be used with the primary view because the absence of the <tt>Line</tt>
                   5290: rule has the same effect. Like the <tt>Line</tt> rule, the <tt>NoLine</tt>
                   5291: rule does not take any parameters.</p>
                   5292: <pre>              'Line'
                   5293:               'NoLine'</pre>
                   5294: 
                   5295: <div class="subsubsection">
                   5296: 
                   5297: <h4><a name="sectd42221">Line spacing</a></h4>
                   5298: <p>
                   5299: The <tt>LineSpacing</tt> rule defines the line spacing to be used in the line
1.1       cvs      5300: breaking process.  The line spacing is the distance between the baselines
                   5301: (horizontal reference axis) of the successive lines produced by the
1.18      cvs      5302: <tt>Line</tt> rule.  The value of the line spacing can be specified as a
                   5303: constant or by inheritance.  It is expressed in any of the available <a
                   5304: href="#sectc4217">distance units</a>.</p>
                   5305: <p>
1.1       cvs      5306: Inheritance allows the value to be obtained from a relative in the structure
                   5307: tree, either without change (an equals sign appears after the inheritance
                   5308: keyword), with a positive difference (a plus sign), or a negative difference
                   5309: (a minus sign).  When the rule uses a difference, the value of the difference
1.18      cvs      5310: follows the sign and is expressed as a <a href="#sectc4217">distance</a>.</p>
                   5311: <pre>                     'LineSpacing' ':' DistOrInherit
1.6       cvs      5312:      DistOrInherit =  Kinship InheritedDist / Distance .
1.18      cvs      5313:      InheritedDist = '=' / '+' AbsDist / '-' AbsDist .</pre>
                   5314: <p>
1.1       cvs      5315: When the line spacing value (or its difference from another element) is
                   5316: expressed in relative units, it changes with the size of the characters. Thus,
                   5317: when a larger font is chosen for a part of the document, the line spacing of
                   5318: that part expands proportionally.  In contrast, when the line spacing value is
                   5319: expressed in absolute units (centimeters, inches, typographer's points), it is
                   5320: independent of the characters, which permits the maintenance of a consistent
                   5321: line spacing, whatever the character font.  Either approach can be taken,
1.18      cvs      5322: depending on the desired effect.</p>
                   5323: </div>
1.1       cvs      5324: 
1.18      cvs      5325: <div class="subsubsection">
1.1       cvs      5326: 
1.18      cvs      5327: <h4><a name="sectd42222">First line indentation</a></h4>
                   5328: <p>
                   5329: The <tt>Indent</tt> rule is used to specify the indentation of the first line
                   5330: of the elements broken into lines by the <tt>Line</tt> function. The
1.1       cvs      5331: indentation determines how far the first line of the element is shifted with
                   5332: respect to the other lines of the same element.  It can be specified as a
                   5333: constant or by inheritance.  The constant value is a positive integer (shifted
                   5334: to the right; the sign is optional), a negative integer (shifted to the left)
1.18      cvs      5335: or zero (no shift).  All available <a href="#sectc4217">units</a> can be
                   5336: used.</p>
                   5337: <p>
1.1       cvs      5338: Indentation can be defined for any box, regardless of whether the box is line
                   5339: broken, and transmitted by inheritance to elements that are line broken. The
1.18      cvs      5340: size of the indentation is specified in the same manner as the <a
                   5341: href="#sectd42221">line spacing</a>.</p>
                   5342: <pre>              'Indent' ':' DistOrInherit</pre>
                   5343: </div>
1.1       cvs      5344: 
1.18      cvs      5345: <div class="subsubsection">
1.1       cvs      5346: 
1.18      cvs      5347: <h4><a name="sectd42223">Alignment</a></h4>
                   5348: <p>
1.1       cvs      5349: The alignment style of the lines constructed during line breaking is defined
1.18      cvs      5350: by the <tt>Adjust</tt> rule.  The alignment value can be a constant or
                   5351: inherited.  A constant value is specified by a keyword:</p>
                   5352: <ul>
                   5353: <li>
                   5354: <tt>Left</tt>: at the left edge,
1.19      cvs      5355: </li>
1.18      cvs      5356: <li>
                   5357: <tt>Right</tt>: at the right edge,
1.19      cvs      5358: </li>
1.18      cvs      5359: <li>
                   5360: <tt>VMiddle</tt>: centered
1.19      cvs      5361: </li>
1.18      cvs      5362: <li>
                   5363: <tt>LeftWithDots</tt>: at the left edge with a dotted line filling out the
1.1       cvs      5364: last line up to the right edge of the line breaking box.
1.19      cvs      5365: </li>
1.18      cvs      5366: </ul>
                   5367: <p>
1.1       cvs      5368: An inherited value can only be the same as that of the reference box and is
1.18      cvs      5369: specified by a kinship keyword followed by an equals sign.</p>
                   5370: <pre>                      'Adjust' ':' AlignOrInherit
1.1       cvs      5371:      AlignOrInherit = Kinship '=' / Alignment .
                   5372:      Alignment      = 'Left' / 'Right' / 'VMiddle' /
1.18      cvs      5373:                       'LeftWithDots' .</pre>
                   5374: </div>
1.1       cvs      5375: 
1.18      cvs      5376: <div class="subsubsection">
1.1       cvs      5377: 
1.18      cvs      5378: <h4><a name="sectd42224">Justification</a></h4>
                   5379: <p>
                   5380: The <tt>Justify</tt> rule indicates whether the lines contained in the box and
                   5381: produced by a <tt>Line</tt> rule should be extended horizontally to occupy the
1.1       cvs      5382: entire width of their enclosing box.  The first and last lines are treated
                   5383: specially: the position of the beginning of the first line is fixed by the
1.18      cvs      5384: <tt>Indent</tt> rule and last line is not extended.  The justification
1.1       cvs      5385: parameter defined by this rule takes a boolean value, which can be a constant
                   5386: or inherited.  A constant boolean value is expressed by either the
1.18      cvs      5387: <tt>Yes</tt> or the <tt>No</tt> keyword.  An inherited value can only be the
1.1       cvs      5388: same as that of the reference box and is specified by a kinship keyword
1.18      cvs      5389: followed by an equals sign.</p>
                   5390: <pre>                  'Justify' ':' BoolInherit
1.1       cvs      5391:      BoolInherit = Boolean / Kinship '=' .
1.18      cvs      5392:      Boolean     ='Yes' / 'No' .</pre>
                   5393: <p>
1.1       cvs      5394: When the lines are justified, the alignment parameter specified in the
1.18      cvs      5395: <tt>Adjust</tt> rule has no influence, other than on the last line produced.
1.1       cvs      5396: This occurs because, when the other are extended to the limits of the box, the
1.18      cvs      5397: alignment style is no longer perceptible.</p>
                   5398: <blockquote class="example">
                   5399: <p>
                   5400: <strong>Example:</strong></p>
                   5401: <p>
1.3       cvs      5402: An important use of inheritance is to vary the characteristics of lines for an
                   5403: element type (for example, Paragraph) according to the enclosing environment
                   5404: (for example, Summary or Section), and thus obtain different line breaking
                   5405: styles for the same elements when they appear in different environments.  The
1.18      cvs      5406: following rules specify that paragraphs inherit their alignment,
                   5407: justification, and line spacing:</p>
                   5408: <pre>Paragraph :
1.1       cvs      5409:    BEGIN
                   5410:    Justify : Enclosing = ;
                   5411:    LineSpacing : Enclosing = ;
                   5412:    Adjust : Enclosing =;
                   5413:    Line;
1.18      cvs      5414:    END;</pre>
                   5415: <p>
1.5       cvs      5416: If the alignment, justification, and line spacing of the Section and Summary
1.18      cvs      5417: elements is fixed:</p>
                   5418: <pre>Section :
1.1       cvs      5419:    BEGIN
                   5420:    Adjust : Left;
                   5421:    Justify : Yes;
                   5422:    LineSpacing : 1;
                   5423:    END;
                   5424: Summary :
                   5425:    BEGIN
                   5426:    Adjust : VMiddle;
                   5427:    Justify : No;
                   5428:    LineSpacing : 1.3;
1.18      cvs      5429:    END;</pre>
                   5430: <p>
1.4       cvs      5431: then the paragraphs appearing in sections are justified with a simple line
                   5432: spacing while those appearing in summaries are centered and not justified and
                   5433: have a larger line spacing.  These are nevertheless the very same type of
1.18      cvs      5434: paragraph defined in the logical structure schema.</p>
                   5435: </blockquote>
                   5436: </div>
                   5437: 
                   5438: <div class="subsubsection">
                   5439: 
                   5440: <h4><a name="sectd42225">Hyphenation</a></h4>
                   5441: <p>
                   5442: The <tt>Hyphenate</tt> rule indicates whether or not words should be broken by
1.1       cvs      5443: hyphenation at the end of lines.  It affects the lines produced by the
1.18      cvs      5444: <tt>Line</tt> rule and contained in the box carrying the <tt>Hyphenate</tt>
                   5445: rule.</p>
                   5446: <p>
1.1       cvs      5447: The hyphenation parameter takes a boolean value, which can be either constant
                   5448: or inherited.  A constant boolean value is expressed by either the
1.18      cvs      5449: <tt>Yes</tt> or the <tt>No</tt> keyword.  An inherited value can only be the
1.1       cvs      5450: same as that of the reference box and is specified by a kinship keyword
1.18      cvs      5451: followed by an equals sign.</p>
                   5452: <pre>                   'Hyphenate' ':' BoolInherit
1.1       cvs      5453:      BoolInherit = Boolean / Kinship '=' .
1.18      cvs      5454:      Boolean     = 'Yes' / 'No' .</pre>
                   5455: </div>
                   5456: 
                   5457: <div class="subsubsection">
                   5458: 
                   5459: <h4><a name="sectd42226">Avoiding line breaking</a></h4>
                   5460: <p>
                   5461: The <tt>InLine</tt> rule is used to specify that a box that would otherwise
                   5462: participate in line breaking asked for by the <tt>Line</tt> rule of an
1.1       cvs      5463: enclosing box, instead avoids the line breaking process and positions itself
1.18      cvs      5464: according to the <tt>HorizPos</tt> and <tt>VertPos</tt> rules that apply to
                   5465: it.  When the <tt>InLine</tt> rule applies to a box which would not be line
                   5466: broken, it has no effect.</p>
                   5467: <p>
                   5468: The rule is expressed by the <tt>InLine</tt> keyword followed by a colon and
                   5469: the keyword <tt>Yes</tt>, if the box should participate in line breaking, or
                   5470: the keyword <tt>No</tt>, if it should not.  This is the only form possible:
1.1       cvs      5471: this rule cannot be inherited.  Moreover, it can only appear in the rules of
                   5472: the primary view and applies to all views defined in the presentation
1.18      cvs      5473: schema.</p>
                   5474: <pre>               'InLine' ':' Boolean .
                   5475:      Boolean = 'Yes' / 'No' .</pre>
                   5476: <blockquote class="example">
                   5477: <p>
                   5478: <strong>Example:</strong></p>
                   5479: <p>
                   5480: Suppose the structure schema defines a logical attribute called <tt>New</tt>
                   5481: which is used to identify the passages in a document which were recently
                   5482: modified.  It would be nice to have the presentation schema make a bar appear
                   5483: in the left margin next to each passage having the <tt>New</tt> attribute.  A
                   5484: new passage can be an entire element, such as a paragraph or section, or it
                   5485: can be some words in the middle of a paragraph.  To produce the desired
                   5486: effect, the <tt>New</tt> attribute is given a creation rule which generates a
                   5487: <tt>VerticalBar</tt> presentation box.</p>
                   5488: <p>
                   5489: When the <tt>New</tt> attribute is attached to a character string which is
1.1       cvs      5490: inside a line broken element (inside a paragraph, for example), the bar is one
                   5491: of the elements which participates in line breaking and it is placed normally
                   5492: in the current line, at the end of the character string which has the
1.18      cvs      5493: attribute.  To avoid this, the <tt>InLine</tt> rule is used in the following
                   5494: way:</p>
                   5495: <pre>BOXES
1.1       cvs      5496:   VerticalBar:
                   5497:      BEGIN
                   5498:      Content: Graphics 'l';
                   5499:      HorizPos: Left = Root . Left;
                   5500:      VertPos: Top = Creator . Top;
                   5501:      Height: Bottom = Creator . Bottom;
                   5502:      Width: 1 pt;
                   5503:      InLine: No;
                   5504:      ...
                   5505:      END;
                   5506: ...
                   5507: ATTRIBUTES
                   5508:   Nouveau:
                   5509:      BEGIN
                   5510:      CreateAfter(VerticalBar);
1.18      cvs      5511:      END;</pre>
                   5512: </blockquote>
                   5513: </div>
                   5514: </div>
1.1       cvs      5515: 
1.18      cvs      5516: <div class="subsection">
1.1       cvs      5517: 
1.18      cvs      5518: <h3><a name="sectc4223">Page breaking and line breaking conditions</a></h3>
                   5519: <p>
1.1       cvs      5520: Pages are constructed by the editor in accordance with the model specified by
1.18      cvs      5521: a <a href="#sectc4233"><tt>Page</tt> rule</a>.  The page model describes only
                   5522: the composition of the pages but does not give any rules for breaking
                   5523: different element types across pages.  Now, it is possible that certain
                   5524: elements must not be cut by page breaks, while others can be cut anywhere. The
                   5525: <tt>PageBreak</tt>, <tt>NoBreak1</tt>, and <tt>NoBreak2</tt> rules are used to
                   5526: specify the conditions under which each element type can be cut.</p>
                   5527: <p>
                   5528: The <tt>PageBreak</tt> rule is used to indicate whether or not the box can be
1.1       cvs      5529: cut during the construction of pages.  If cutting is authorized, the box can
                   5530: be cut, with one part appearing at the bottom of a page and the other part
                   5531: appearing at the top of the next page. The rule is formed by the
1.18      cvs      5532: <tt>PageBreak</tt> keyword followed by a colon and a constant boolean value
                   5533: (<tt>Yes</tt> or <tt>No</tt>).  This is the only form possible: this rule
1.1       cvs      5534: cannot be inherited.  Moreover, it can only appear in the rules of the primary
1.18      cvs      5535: view and applies to all views defined in the presentation schema.</p>
                   5536: <p>
1.1       cvs      5537: Whether objects can be cut by line breaks can be controlled in a similar way
1.18      cvs      5538: using the <tt>LineBreak</tt> rule.  This rule allows the specification of
1.1       cvs      5539: whether or not the box can be cut during the construction of lines.  If
                   5540: cutting is authorized, the box can be cut, with one part appearing at the end
                   5541: of a line and the other part appearing at the beginning of the next line.  The
1.18      cvs      5542: rule is formed by the <tt>LineBreak</tt> keyword followed by a colon and a
                   5543: constant boolean value (<tt>Yes</tt> or <tt>No</tt>).  This is the only form
1.1       cvs      5544: possible: this rule cannot be inherited.  Moreover, it can only appear in the
                   5545: rules of the primary view and applies to all views defined in the presentation
1.18      cvs      5546: schema.</p>
                   5547: <pre>               'PageBreak' ':' Boolean .
1.1       cvs      5548:                'LineBreak' ':' Boolean .
1.18      cvs      5549:      Boolean = 'Yes' / 'No' .</pre>
                   5550: <p>
1.1       cvs      5551: When a box can be cut by a page break, it is possible that a page break will
                   5552: fall an inappropriate spot, creating, for example, a widow or orphan, or
                   5553: separating the title of a section from the first paragraph of the section. The
1.18      cvs      5554: <tt>NoBreak1</tt> and <tt>NoBreak2</tt> rules are used to avoid this. They
                   5555: specify that the box of the element to which they apply cannot be cut within a
                   5556: certain zone at the top (<tt>NoBreak1</tt> rule) or at the bottom
                   5557: (<tt>NoBreak2</tt> rule).  These two rules specify the height of the zones in
                   5558: which page breaks are prohibited.</p>
                   5559: <p>
                   5560: The <tt>NoBreak1</tt> and <tt>NoBreak2</tt> rules give the height of the zone
1.1       cvs      5561: in which page breaking is prohibited.  The height is given as a constant value
1.18      cvs      5562: using any of the <a href="#sectc4217">available units</a>, absolute or
                   5563: relative.  The value may not be inherited.</p>
                   5564: <pre>                   'NoBreak1' ':' AbsDist .
                   5565:                    'NoBreak2' ':' AbsDist .</pre>
                   5566: <blockquote class="example">
                   5567: <p>
                   5568: <strong>Example:</strong></p>
                   5569: <p>
                   5570: The following rules prevent widows and orphans in a paragraph:</p>
                   5571: <pre>Paragraph :
1.1       cvs      5572:    BEGIN
                   5573:    NoBreak1 : 2;
                   5574:    NoBreak2 : 2;
1.18      cvs      5575:    END;</pre>
                   5576: <p>
1.3       cvs      5577: This rule prevents a section title from becoming separated from the first
                   5578: paragraph of the section by prohibiting page breaks at the beginning of the
1.18      cvs      5579: section rule:</p>
                   5580: <pre>Section :
                   5581:    NoBreak1 : 1.5 cm;</pre>
                   5582: <p>
                   5583: Finally, this rule prevents a figure from being page broken in any way:</p>
                   5584: <pre>Figure :
                   5585:    PageBreak : No;</pre>
                   5586: </blockquote>
                   5587: <p>
1.1       cvs      5588: The Thot editor constructs the document images displayed on the screen
                   5589: dynamically.  As the user moves in the document or makes the document scroll
                   5590: in a window, the editor constructs the image to be displayed in little bits,
                   5591: filling the gaps which are produced in the course of these operations.  It
                   5592: stops filling in the image when an element reaches the edge of the window in
                   5593: which the gap appears.  If the appearance of the document is complex, it is
                   5594: possible that the image in incomplete, even though the edge of the window was
                   5595: reached.  For example, an element might need to be presented to the side of
                   5596: the last element displayed, but its image was not constructed.  The user will
                   5597: not know whether the element is really absent or if its image has simply not
1.18      cvs      5598: been constructed.</p>
                   5599: <p>
                   5600: The <tt>Gather</tt> rule is used to remedy this problem.  When the rule
                   5601: <tt>Gather : Yes;</tt> is associated with an element type, the image of such
                   5602: elements is constructed as a block by the editor: it is never split up.</p>
                   5603: <p>
                   5604: The <tt>Gather</tt> rule may not appear in the <a href="#sectc427">default
                   5605: rules</a>.  Elements which do not have the <tt>Gather</tt> rule are considered
                   5606: susceptible to being split up during display.  Thus, it is not necessary to
                   5607: use the <tt>Gather : No;</tt> form. This rule must be used prudently and only
                   5608: for those elements which truly need it.  If used incorrectly, it can
                   5609: pointlessly increase the size of the image constructed by the editor and lead
                   5610: to excessive memory consumption by the editor.</p>
                   5611: <p>
                   5612: Like the <tt>PageBreak</tt> and <tt>LineBreak</tt> rules, the <tt>Gather</tt>
1.1       cvs      5613: rule can only appear in rules of the primary view and applies to all views
1.18      cvs      5614: defined in the presentation schema.</p>
                   5615: <pre>                   'Gather' ':' Boolean .</pre>
                   5616: </div>
1.1       cvs      5617: 
1.18      cvs      5618: <div class="subsection">
1.1       cvs      5619: 
1.18      cvs      5620: <h3><a name="sectc4224">Visibility</a></h3>
                   5621: <p>
1.1       cvs      5622: The visibility parameter is used to control which elements should or should
                   5623: not be displayed, based on context.  An element can have different
                   5624: visibilities in different views.  If an element's visibility is zero for a
                   5625: view, that element is not displayed in that view and does not occupy any space
1.18      cvs      5626: (its extents are zero).</p>
                   5627: <p>
1.1       cvs      5628: Visibility takes non-negative integer values (positive or zero).  If values
                   5629: greater than 1 are used, they allow the user to choose a degree of visibility
                   5630: and, thus, to see only those boxes whose visibility parameter exceeds a
                   5631: certain threshold.  This gives the user control over the granularity of the
1.18      cvs      5632: displayed pictures.</p>
                   5633: <p>
1.1       cvs      5634: The visibility parameter can be defined as a constant or by inheritance. If
                   5635: defined by inheritance, it cannot be based on the value of the next or
1.18      cvs      5636: previous box.  Visibility can only be inherited from above.</p>
                   5637: <p>
1.1       cvs      5638: If it is a numeric attribute's presentation rule, the visibility can be
                   5639: specified by the attribute's name, in which case the value of the attribute is
1.18      cvs      5640: used.</p>
                   5641: <pre>                   'Visibility' ':' NumberInherit
1.1       cvs      5642:      NumberInherit = Integer / AttrID / Inheritance .
1.18      cvs      5643:      Integer       = NUMBER .</pre>
                   5644: <blockquote class="example">
                   5645: <p>
                   5646: <strong>Example:</strong></p>
                   5647: <p>
                   5648: Suppose that only <tt>Formula</tt> elements should be displayed in the
                   5649: <tt>MathView</tt> view.  Then, the default rules should include:</p>
                   5650: <pre>DEFAULT
                   5651:      IN MathView Visibility:0;</pre>
                   5652: <p>
                   5653: which makes all elements invisible in the <tt>MathView</tt> view.  However,
                   5654: the <tt>Formula</tt> element also has a <tt>Visibility</tt> rule:</p>
                   5655: <pre>Formula :
                   5656:      IN MathView Visibility:5;</pre>
                   5657: <p>
                   5658: which makes formulas, and only formulas, visible.</p>
                   5659: </blockquote>
                   5660: </div>
1.1       cvs      5661: 
1.18      cvs      5662: <div class="subsection">
1.1       cvs      5663: 
1.18      cvs      5664: <h3><a name="sectc4225">Character style parameters</a></h3>
                   5665: <p>
1.1       cvs      5666: Four parameters are used to determine which characters are used to display
1.18      cvs      5667: text.  They are size, font, style, and underlining.</p>
1.1       cvs      5668: 
1.18      cvs      5669: <div class="subsubsection">
1.1       cvs      5670: 
1.18      cvs      5671: <h4><a name="sectd42251">Character size</a></h4>
                   5672: <p>
1.1       cvs      5673: The size parameter has two effects.  First, it is used to specify the actual
1.18      cvs      5674: size and distance units for boxes defined in <a href="#sectc4217">relative
                   5675: units</a>.  Second, it defines the size of the characters contained in the
                   5676: box.</p>
                   5677: <p>
1.1       cvs      5678: As a distance or length, the size can be expressed in abstract or absolute
                   5679: units.  It can also be inherited.  If it is not inherited, it is expressed
1.18      cvs      5680: simply as an integer followed by the <tt>pt</tt> keyword, which indicates that
                   5681: the size is expressed in typographer's points. The absence of the <tt>pt</tt>
1.1       cvs      5682: keyword indicates that it is in abstract units in which the value 1 represents
                   5683: the smallest size while the value 16 is the largest size.  The relationship
                   5684: between these abstract sizes and the real character sizes is controlled by a
                   5685: table which can be modified statically or even dynamically during the
1.18      cvs      5686: execution of the Thot editor.</p>
                   5687: <p>
1.22      cvs      5688: If the <tt>Size</tt> rule is a numeric attribute's presentation rule, the
                   5689: value of the size parameter can be specified by the attribute's name, in
                   5690: which case the value of the attribute is used.</p>
1.18      cvs      5691: <p>
                   5692: <strong>Note:</strong> the only unit available for  defining an absolute size
                   5693: is the typographer's point.  Centimeters and inches may not be used.</p>
                   5694: <p>
1.1       cvs      5695: If the size is inherited, the rule must specify the relative from which to
1.22      cvs      5696: inherit and any percentage or difference from that relative's value.
1.25    ! cvs      5697: A percentage is indicated by a <tt>*</tt> followed by the value of the
1.22      cvs      5698: percentage and a <tt>%</tt>.
                   5699: A difference can be expressed in either typographer's points or in abstract
                   5700: units and the maximum or minimum size can be specified, but without
                   5701: specifying the unit: it is the same as was specified for the difference.</p>
                   5702: <p>
                   5703: In a numeric attribute's presentation rule, the difference in size or the
                   5704: percentage can be indicated by the attribute's name instead of the numeric
                   5705: value, which means that the attribute's value should be used as the difference
                   5706: or percentage.  The attribute can also be used as the minimum or maximum size
                   5707: for a difference.</p>
                   5708: <pre>                      'Size' ':' SizeInherit
                   5709:      SizeInherit     = SizeAttr [ 'pt' ] /
                   5710:                        Kinship InheritedSize .
                   5711:      InheritedSize   ='+' SizeAttr [ 'pt' ]
                   5712:                        [ 'Max' MaxSizeAttr ] /
                   5713:                       '-' SizeAttr [ 'pt' ]
                   5714:                        [ 'Min' MinSizeAttr ] /
                   5715:                       '*' PercentSizeAttr '%' /
                   5716:                       '=' .
                   5717:      SizeAttr        = Size / AttrID .
                   5718:      Size            = NUMBER .
                   5719:      MaxSizeAttr     = MaxSize / AttrID .
                   5720:      MaxSize         = NUMBER .
                   5721:      MinSizeAttr     = MinSize / AttrID .
                   5722:      MinSize         = NUMBER .
                   5723:      PercentSizeAttr = PercentSize / AttrID .
                   5724:      PercentSize     = NUMBER .</pre>
1.18      cvs      5725: <blockquote class="example">
                   5726: <p>
                   5727: <strong>Example:</strong></p>
                   5728: <p>
                   5729: The rule</p>
                   5730: <pre>Size : Enclosing - 2 pt Min 7;</pre>
                   5731: <p>
                   5732: states that the character size is 2 points less than that of the enclosing
                   5733: box, but that it may not be less than 7 points, whatever the enclosing box's
                   5734: value.</p>
                   5735: <p>
1.1       cvs      5736: The following rules make the text of a report be displayed with medium-sized
                   5737: characters (for example, size 5), while the title is displayed with larger
1.18      cvs      5738: characters and the summary is displayed with smaller characters:</p>
                   5739: <pre>Report :
1.1       cvs      5740:      Size : 5;
                   5741: Title :
                   5742:      Size : Enclosing + 2;
                   5743: Summary :
1.18      cvs      5744:      Size : Enclosing - 1;</pre>
                   5745: <p>
                   5746: Thus, the character sizes in the entire document can be changed by changing
                   5747: the size parameter of the Report element, while preserving the relationships
                   5748: between the sizes of the different elements.</p>
                   5749: </blockquote>
                   5750: </div>
                   5751: 
                   5752: <div class="subsubsection">
                   5753: 
                   5754: <h4><a name="sectd42252">Font and character style</a></h4>
                   5755: <p>
                   5756: The <tt>Font</tt> rule determines the font family to be used to display the
                   5757: characters contained in the box, while the <tt>Style</tt> rule determines
1.23      cvs      5758: their style and the <tt>Weight</tt> rule determines their weight.  Thot
                   5759: recognizes three character fonts (Times, Helvetica, and Courier), three
                   5760: styles: Roman, Italics, and Oblique, and two weights: Normal and Bold.</p>
                   5761: <p>
                   5762: The font family, style and weight can be specified by a named constant or
                   5763: can be inherited.  For the name of the font family only the first character
                   5764: is used.</p>
                   5765: <p>
                   5766: Only identical inheritance is allowed: the box takes the same font, style or
                   5767: weight as the box from which it inherits.  This is indicated by an equals
                   5768: sign after the kinship specification.</p>
                   5769: <pre>               'Font' ':'          NameInherit /
                   5770:                'Style' ':'         StyleInherit /
                   5771:                'Weight' ':'        WeightInherit /
                   5772: 
                   5773: NameInherit   = Kinship '=' / FontName .
                   5774: FontName      = NAME .
                   5775: StyleInherit  = Kinship '=' /
                   5776:                 'Roman' / 'Italics' / 'Oblique' .
                   5777: WeightInherit = Kinship '=' /
                   5778:                 'Normal' / 'Bold' .</pre>
1.18      cvs      5779: <blockquote class="example">
                   5780: <p>
                   5781: <strong>Example:</strong></p>
                   5782: <p>
1.3       cvs      5783: To specify that the summary uses the font family of the rest of the document,
1.18      cvs      5784: but in the italic style, the following rules are used:</p>
                   5785: <pre>Summary :
1.1       cvs      5786:    BEGIN
                   5787:    Font : Enclosing =;
                   5788:    Style : Italics;
1.18      cvs      5789:    END;</pre>
                   5790: </blockquote>
                   5791: </div>
                   5792: 
                   5793: <div class="subsubsection">
                   5794: 
                   5795: <h4><a name="sectd42253">Underlining</a></h4>
                   5796: <p>
                   5797: The <tt>Underline</tt> rule is used to specify if the characters contained in
1.1       cvs      5798: a box should have lines drawn on or near them.  There are four underlining
1.18      cvs      5799: styles: <tt>Underlined</tt>, <tt>Overlined</tt>, <tt>CrossedOut</tt>, and
                   5800: <tt>NoUnderline</tt>.  The <tt>Thickness</tt> rule specifies the thickness of
                   5801: the line, <tt>Thin</tt> or <tt>Thick</tt>.</p>
                   5802: <p>
1.1       cvs      5803: As with font family and style, only identical inheritance is allowed: the box
                   5804: has the same underlining type as the box from which it inherits the value.
1.18      cvs      5805: This is indicated by an equals sign after the kinship specification.</p>
                   5806: <pre>                   'Underline' ':' UnderLineInherit /
1.1       cvs      5807:                    'Thickness' ':' ThicknessInherit /
                   5808: 
                   5809: UnderLineInherit = Kinship '=' / 'NoUnderline' /
                   5810:                    'Underlined' / 
                   5811:                    'Overlined' / 'CrossedOut' .
1.18      cvs      5812: ThicknessInherit = Kinship '=' / 'Thick' / 'Thin' .</pre>
                   5813: </div>
                   5814: </div>
                   5815: 
                   5816: <div class="subsection">
                   5817: 
                   5818: <h3><a name="sectc4226">Stacking order</a></h3>
                   5819: <p>
                   5820: The <tt>Depth</tt> rule is used to define the stacking order of terminal boxes
1.1       cvs      5821: when multiple boxes at least partially overlap.  This rule defines how the
                   5822: depth parameter, which is zero or a positive integer, is calculated.  The
                   5823: depth parameter has a value for all boxes.  For terminal boxes in the
                   5824: structure and for presentation boxes, the depth value is used during display
                   5825: and printing: the boxes with the lowest value overlap those with higher
                   5826: depths.  For non-terminal boxes, the depth is not interpreted during display,
1.18      cvs      5827: but it is used to calculate the depth of terminal boxes by inheritance.</p>
                   5828: <p>
                   5829: Like most other rules, the depth rule is defined in the <a
                   5830: href="#sectc427">default rules</a> of each presentation schema.  Thus, there
                   5831: is always a depth value, even when it is not necessary because there is no
                   5832: overlapping.  To avoid useless operations, a zero value can be given to the
                   5833: depth parameter, which signifies that overlapping is never a problem.</p>
                   5834: <p>
                   5835: The depth rule has the same form as the <a href="#sectc4224">visibility
                   5836: rule</a>. It can be defined by inheritance or by a constant numeric value.
                   5837: When the rule is attached to a numeric attribute, it can take the value of
                   5838: that attribute.</p>
                   5839: <pre>                'Depth' ':' NumberInherit</pre>
                   5840: <blockquote class="example">
                   5841: <p>
                   5842: <strong>Example:</strong></p>
                   5843: <p>
1.3       cvs      5844: For a purely textual document, in which overlapping never poses a problem, a
1.18      cvs      5845: single default <tt>Depth</tt> rule in the presentation schema is
                   5846: sufficient:</p>
                   5847: <pre>DEFAULT
1.1       cvs      5848:     Depth : 0;
1.18      cvs      5849:     ...</pre>
                   5850: <p>
1.1       cvs      5851: To make the text of examples appear on a light blue background, a presentation
1.18      cvs      5852: box is defined:</p>
                   5853: <pre>BOXES
1.1       cvs      5854:    BlueBG :
                   5855:       BEGIN
                   5856:       Content : Graphics 'R';
                   5857:       Background : LightBlue3;
                   5858:       FillPattern: backgroundcolor;
                   5859:       Depth : 2;
                   5860:       ...
1.18      cvs      5861:       END;</pre>
                   5862: <p>
                   5863: and is created by the <tt>Example</tt> element, which has the rules:</p>
                   5864: <pre>RULES
1.1       cvs      5865:    Example :
                   5866:       BEGIN
                   5867:       CreateFirst (BlueBG);
                   5868:       Depth : 1;
                   5869:       ...
1.18      cvs      5870:       END;</pre>
                   5871: <p>
                   5872: In this way, the text of an example (if it inherits its depth from its
                   5873: ancestor) will be superimposed on a light blue background, and not the
                   5874: reverse).</p>
                   5875: </blockquote>
                   5876: </div>
                   5877: 
                   5878: <div class="subsection">
                   5879: 
                   5880: <h3><a name="sectc4227">Line style</a></h3>
                   5881: <p>
                   5882: The <tt>LineStyle</tt> rule determines the style of line which should be used
                   5883: to draw all the elements contained in the box and the box itself, if it has a
                   5884: <a href="#sectc4230a"><tt>ShowBox</tt> rule</a>.  The line style can be
                   5885: indicated by a name (<tt>Solid</tt>, <tt>Dashed</tt>, <tt>Dotted</tt>) or it
1.13      cvs      5886: can be inherited.  All elements of the graphic base type are affected by this
1.1       cvs      5887: rule, but it can be attached to any box and transmitted by inheritance to the
1.18      cvs      5888: graphic elements.  The border of elements having a <a
                   5889: href="#sectc4230a"><tt>ShowBox</tt> rule</a> is drawn according to the line
                   5890: style specified by this rule.</p>
                   5891: <p>
1.1       cvs      5892: Only identical inheritance is allowed: the box takes the same line style as
                   5893: the box from which it inherits.  This is indicated by an equals sign after the
1.18      cvs      5894: kinship specification.</p>
                   5895: <pre>                      'LineStyle' ':' LineStyleInherit
1.1       cvs      5896:      LineStyleInherit = Kinship '=' /
1.18      cvs      5897:                       'Solid' / 'Dashed' / 'Dotted' .</pre>
                   5898: <blockquote class="example">
                   5899: <p>
                   5900: <strong>Example:</strong></p>
                   5901: <p>
1.3       cvs      5902: To specify that, in Figures, the graphical parts should be drawn in solid
1.18      cvs      5903: lines, the Figure element is given a rule using the <tt>Solid</tt> name:</p>
                   5904: <pre>Figure :
                   5905:    LineStyle : Solid;</pre>
                   5906: <p>
                   5907: and the elements composing figures are given an inheritance rule:</p>
                   5908: <pre>   LineStyle : Enclosing =;</pre>
                   5909: </blockquote>
                   5910: </div>
                   5911: 
                   5912: <div class="subsection">
                   5913: 
                   5914: <h3><a name="sectc4228">Line thickness</a></h3>
                   5915: <p>
                   5916: The <tt>LineWeight</tt> rule determines the thickness of the lines  of all
1.1       cvs      5917: graphical elements which appear in the box, no matter what their line style.
                   5918: Line thickness can be specified by a constant value or by inheritance.  A
                   5919: constant value is a positive number followed by an optional unit specification
1.18      cvs      5920: (which is absent when using relative units).  All available <a
                   5921: href="#sectc4217">distance units</a> can be used.  Line thickness is expressed
                   5922: in the same way as <a href="#sectd42221">line spacing</a>.</p>
                   5923: <pre>                 'LineWeight' ':' DistOrInherit</pre>
                   5924: <p>
                   5925: All elements of the graphic base type are affected by this rule, but it can be
                   5926: attached to any box and transmitted by inheritance to the graphic elements.
                   5927: The border of element having a <a href="#sectc4230a"><tt>ShowBox</tt> rule</a>
                   5928: is also drawn according to the thickness specified by this rule.</p>
                   5929: <blockquote class="example">
                   5930: <p>
                   5931: <strong>Example:</strong></p>
                   5932: <p>
                   5933: To specify that, in Figures, the graphical parts should be drawn with lines
                   5934: 0.3 pt thick, the Figure element is given this rule:</p>
                   5935: <pre>Figure :
                   5936:    LineWeight : 0.3 pt;</pre>
                   5937: <p>
                   5938: and the elements composing figures are given an inheritance rule:</p>
                   5939: <pre>   LineWeight : Enclosing =;</pre>
                   5940: </blockquote>
                   5941: </div>
                   5942: 
                   5943: <div class="subsection">
                   5944: 
                   5945: <h3><a name="sectc4229">Fill pattern</a></h3>
                   5946: <p>
                   5947: The <tt>FillPattern</tt> rule determines the pattern used to fill closed
1.1       cvs      5948: graphical elements (circles, rectangles, etc.) which appear in the box.  This
1.18      cvs      5949: rule also specifies the pattern used to fill the box associated with elements
                   5950: having a <a href="#sectc4230a"><tt>ShowBox</tt> rule</a><a>.  This pattern can
                   5951: be indicated by a named constant or by inheritance.  The named constant
                   5952: identifies one of the patterns available in Thot.  The names of the available
                   5953: patterns are: nopattern, foregroundcolor, backgroundcolor, gray1, gray2,
                   5954: gray3, gray4, gray5, gray6, gray7, horiz1, horiz2, horiz3, vert1, vert2,
                   5955: vert3, left1, left2, left3, right1, right2, right3, square1, square2, square3,
                   5956: lozenge, brick, tile, sea, basket.</a></p>
                   5957: <p>
                   5958: Like the other rules peculiar to graphics, <tt>LineStyle</tt> and
                   5959: <tt>LineWeight</tt>, only elements of the graphic base type are affected by
                   5960: the <tt>FillPattern</tt> rule, but the rule can be attached to any box and
1.1       cvs      5961: transmitted by inheritance to the graphic elements.  As with the other rules
1.18      cvs      5962: specific to graphics, only identical inheritance is allowed.</p>
                   5963: <p>
                   5964: The <tt>FillPattern</tt> rule can also be used to determine whether or not
1.12      cvs      5965: text characters, symbols and pictures should be colored.  For these element
                   5966: types (text, symbols, and pictures), the only valid values are
1.18      cvs      5967: <tt>nopattern</tt>, <tt>foregroundcolor</tt>, and <tt>backgroundcolor</tt>.
                   5968: When <tt>FillPattern</tt> has the value <tt>backgroundcolor</tt>, text
                   5969: characters, symbols, and bitmaps are given the color specified by the <a
                   5970: href="#sectc4230"><tt>Background</tt> rule</a> which applies to these
                   5971: elements.  When <tt>FillPattern</tt> has the value <tt>foregroundcolor</tt>,
                   5972: these same elements are given the color specified by the <a
                   5973: href="#sectc4230"><tt>Foreground</tt> rule</a> which applies to these
                   5974: elements.  In all other case, text characters are not colored.</p>
                   5975: <pre>                 'FillPattern' ':' NameInherit</pre>
                   5976: <blockquote class="example">
                   5977: <p>
                   5978: <strong>Example:</strong></p>
                   5979: <p>
1.3       cvs      5980: To specify that, in Figures, the closed graphical elements should be filled
                   5981: with a pattern resembling a brick wall, the Figure element is given this
1.18      cvs      5982: rule:</p>
                   5983: <pre>Figure :
                   5984:    FillPattern : brick;</pre>
                   5985: <p>
                   5986: and the elements composing figures are given an inheritance rule:</p>
                   5987: <pre>   FillPattern : Enclosing =;</pre>
                   5988: </blockquote>
                   5989: </div>
                   5990: 
                   5991: <div class="subsection">
                   5992: 
                   5993: <h3><a name="sectc4230">Colors</a></h3>
                   5994: <p>
                   5995: The <tt>Foreground</tt> and <tt>Background</tt> rules determine the foreground
1.13      cvs      5996: and background colors of the base elements which appear in the box. They also
1.18      cvs      5997: control the color of boxes associated with elements having a <a
                   5998: href="#sectc4230a"><tt>ShowBox</tt> rule</a>.  These colors can be specified
                   5999: with a named constant or by inheritance.  The named constants specify one of
                   6000: the available colors in Thot.  The available color names can be found in the
                   6001: file <tt>thot.color</tt>.</p>
                   6002: <p>
                   6003: The color rules affect the same way all base elements and elements having a <a
                   6004: href="#sectc4230a"><tt>ShowBox</tt> rule</a>, no matter what their type (text,
                   6005: graphics, pictures, symbols).  The color rules can be associated with any box
                   6006: and can be transmitted by inheritance to the base elements or the elements
                   6007: having a <a href="#sectc4230a"><tt>ShowBox</tt> rule</a>.  Like the preceding
                   6008: rules, only inheritance of the same value is allowed.</p>
                   6009: <pre>                 'Foreground' ':' NameInherit
                   6010:                  'Background' ':' NameInherit</pre>
                   6011: <p>
                   6012: <strong>Note:</strong> text colors only appear for text elements whose <a
                   6013: href="#sectc4229">fill pattern</a> does not prevent the use of color.</p>
                   6014: <blockquote class="example">
                   6015: <p>
                   6016: <strong>Example:</strong></p>
                   6017: <p>
1.3       cvs      6018: To specify that, in Figures, everything must be drawn in blue on a background
1.18      cvs      6019: of yellow, the Figure element is given these rules:</p>
                   6020: <pre>Figure :
1.1       cvs      6021:    BEGIN
                   6022:    Foreground : Blue;
                   6023:    Background : Yellow;
                   6024:    Fillpattern : backgroundcolor;
1.18      cvs      6025:    END;</pre>
                   6026: <p>
                   6027: and the elements composing figures are given inheritance rules:</p>
                   6028: <pre>   Foreground : Enclosing =;
1.1       cvs      6029:    Background : Enclosing =;
1.18      cvs      6030:    FillPattern : Enclosing =;</pre>
                   6031: </blockquote>
                   6032: </div>
                   6033: 
                   6034: <div class="subsection">
                   6035: 
                   6036: <h3><a name="sectc4230a">Background color and border</a></h3>
                   6037: <p>
                   6038: Boxes associated with structural elements are normally not visible, but it is
                   6039: possible to draw their border and/or to paint their area when it is needed.
                   6040: This is achieved by associating the <tt>ShowBox</tt> rule with the concerned
1.13      cvs      6041: element.  This rule has no parameter and no value. It is simply written
1.18      cvs      6042: <tt>Showbox;</tt>. It is not inherited nor transmitted to any other element.
                   6043: It applies only to the element with which it is associated.</p>
                   6044: <pre>                 'ShowBox'</pre>
                   6045: <p>
                   6046: When an element has a <tt>ShowBox</tt> rule, the border is drawn only if the
                   6047: <tt>LineWeight</tt> rule that applies to that element has a non-zero value
                   6048: (this value can be inherited).  The color, style and thickness of the border
                   6049: are defined by the <tt>Foreground</tt>, <tt>LineStyle</tt>, and
                   6050: <tt>LineWeight</tt> rules that apply to the element.</p>
                   6051: <p>
                   6052: When an element has a <tt>ShowBox</tt> rule, the background of this element is
                   6053: paint only if the value of the <tt>FillPattern</tt> rule that applies to that
                   6054: element is not <tt>nopattern</tt>.  The pattern and color(s) of the background
                   6055: are defined by the <tt>FillPattern</tt>, <tt>Background</tt>, and
                   6056: <tt>Foreground</tt> rules that apply to the element.</p>
                   6057: </div>
                   6058: 
                   6059: <div class="subsection">
                   6060: 
                   6061: <h3><a name="sectc4230b">Background pictures</a></h3>
                   6062: <p>
                   6063: The <tt>BackgroundPicture</tt> rule allows to display a picture as the
1.13      cvs      6064: background of an element.  It has a single parameter, the file name of the
1.18      cvs      6065: picture.  This is a string delimited by single quotes.  If the first character
                   6066: in this string is '/', it is considered as an absolute path, otherwise the
                   6067: file is searched for along the schema directory path.  This file may contain a
                   6068: picture in any format accepted by Thot (xbm, xpm, gif, jpeg, png, etc.)</p>
                   6069: <p>
                   6070: The <tt>BackgroundPicture</tt> and <tt>PictureMode</tt> rules apply only to
1.13      cvs      6071: the element with which they are associated.  They are not inherited nor
1.18      cvs      6072: transmitted to children elements.</p>
                   6073: <p>
1.13      cvs      6074: The background picture has not always the same size as the element's box.
                   6075: There are diffrent ways to fill the element box with the picture.  This is
1.18      cvs      6076: specified by the <tt>PictureMode</tt> rule, which should be associated to the
                   6077: same element.  This rule may take one of the following values:</p>
                   6078: <dl>
                   6079: <dt><tt>NormalSize</tt></dt>
                   6080: <dd>
                   6081: The picture is centered in the box, and clipped if it is too large.
                   6082: </dd>
                   6083: <dt><tt>Scale</tt></dt>
                   6084: <dd>
                   6085: The picture is zoomed to fit the box size.
                   6086: </dd>
                   6087: <dt><tt>RepeatX</tt></dt>
                   6088: <dd>
                   6089: The picture is repeated horizontally to fit the box width.
                   6090: </dd>
                   6091: <dt><tt>RepeatY</tt></dt>
                   6092: <dd>
                   6093: The picture is repeated vertically to fit the box height.
                   6094: </dd>
                   6095: <dt><tt>RepeatXY</tt></dt>
                   6096: <dd>
                   6097: The picture is repeated both horizontally and vertically to fill the box.
                   6098: </dd>
                   6099: </dl>
                   6100: <p>
                   6101: If an element has a <tt>BackgroundPicture</tt> rule and no
                   6102: <tt>PictureMode</tt> rule, the <tt>NormalSize</tt> value is assumed.</p>
                   6103: <pre>                 'BackgroundPicture' ':' FileName /
1.13      cvs      6104:                  'PictureMode' ':' PictMode .
                   6105:  
                   6106:       FileName = STRING .
1.18      cvs      6107:       PictMode = 'NormalSize' / 'Scale' / 'RepeatXY' / 'RepeatX' / 'RepeatY' .</pre>
                   6108: <p>
                   6109: The <tt>BackgroundPicture</tt> and <tt>PictureMode</tt> rules apply only to
1.13      cvs      6110: the element with which they are associated.  They are not inherited nor
1.18      cvs      6111: transmitted to children elements.</p>
                   6112: </div>
1.13      cvs      6113: 
1.18      cvs      6114: <div class="subsection">
1.1       cvs      6115: 
1.18      cvs      6116: <h3><a name="sectc4231">Presentation box content</a></h3>
                   6117: <p>
                   6118: The <tt>Content</tt> rule applies to presentation boxes.  It indicates the
1.1       cvs      6119: content given to a box.  This content is either a variable's value or a
1.18      cvs      6120: constant value.  In the special case of <a href="#sectc4233">header or footer
                   6121: boxes</a>, the content can also be a structured element type.</p>
                   6122: <p>
1.1       cvs      6123: If the content is a constant, it can be specified, as in a variable
1.18      cvs      6124: declaration, either by the name of a constant declared in the <tt>CONST</tt>
1.1       cvs      6125: section or by direct specification of the type and value of the box's
1.18      cvs      6126: content.</p>
                   6127: <p>
1.1       cvs      6128: Similarly, if it is a variable, the name of a variable declared in
1.18      cvs      6129: <tt>VAR</tt> section can be given or the variable may be defined within
                   6130: parentheses.  The content inside the parentheses has the same syntax as a <a
                   6131: href="#sectc426">variable declaration</a>.</p>
                   6132: <p>
1.1       cvs      6133: When the content is a structured element type, the name of the element type is
                   6134: given after the colon.  In this case,  the box's content is all elements of
                   6135: the named type which are designated by references which are part of the page
1.18      cvs      6136: on which the header or footer with this <tt>Content</tt> rule appears.  Only
                   6137: associated elements can appear in a <tt>Content</tt> rule and the structure
1.1       cvs      6138: must provide references to these elements.  Moreover, the box whose content
                   6139: they are must be a header or footer box generated by a page box of the primary
1.18      cvs      6140: view.</p>
                   6141: <pre>               'Content' ':' VarConst
1.1       cvs      6142:      VarConst = ConstID / ConstType ConstValue /
                   6143:                 VarID / '(' FunctionSeq ')' /
1.18      cvs      6144:                 ElemID .</pre>
                   6145: <p>
                   6146: A presentation box can have only one <tt>Content</tt> rule, which means that
1.1       cvs      6147: the content of a presentation box cannot vary from view to view. However, such
                   6148: an effect can be achieved by creating several presentation boxes, each with
1.18      cvs      6149: different content and visible in different views.</p>
                   6150: <p>
                   6151: The <tt>Content</tt> rule also applies to elements defined as references in
1.1       cvs      6152: the structure schema.  In this case, the content defined by the rule  must be
                   6153: a constant.  It is this content which appears on the screen or paper to
                   6154: represent references of the type to which the rule applies.  A reference can
1.18      cvs      6155: have a <tt>Content</tt> rule or a <a href="#sectc4234"><tt>Copy</tt> rule</a>
1.1       cvs      6156: for each view.  If neither of these rules appears, the reference is displayed
1.18      cvs      6157: as <tt>[*]</tt>, which is equivalent to the rule:</p>
                   6158: <pre>     Content: Text '[*]';</pre>
                   6159: <blockquote class="example">
                   6160: <p>
                   6161: <strong>Example:</strong></p>
                   6162: <p>
1.3       cvs      6163: The content of the presentation box created to make the chapter number and
1.18      cvs      6164: section number appear before each section title can be defined by:</p>
                   6165: <pre>BOXES
1.1       cvs      6166:      SectionNumBox :
                   6167:           BEGIN
                   6168:           Content : NumSection;
                   6169:           ...
1.18      cvs      6170:           END;</pre>
                   6171: <p>
                   6172: if the <tt>NumSection</tt> variable has been defined in the variable
                   6173: definition section of the presentation schema.  Otherwise the <tt>Content</tt>
                   6174: would be written:</p>
                   6175: <pre>BOXES
1.1       cvs      6176:      SectionNumBox :
                   6177:           BEGIN
                   6178:           Content : (VALUE (ChapterCtr, Roman) TEXT '.'
                   6179:                      VALUE (SectionCtr, Arabic));
                   6180:           ...
1.18      cvs      6181:           END;</pre>
                   6182: <p>
                   6183: To specify that a page footer should contain all elements of the <tt>Note</tt>
                   6184: type are referred to in the page, the following rule is written:</p>
                   6185: <pre>BOXES
1.1       cvs      6186:      NotesFooterBox :
                   6187:           BEGIN
                   6188:           Content : Note;
                   6189:           ...
1.18      cvs      6190:           END;</pre>
                   6191: <p>
                   6192: <tt>Note</tt> is defined as an associated element in the structure schema and
                   6193: NotesFooterBox is created by a page box of the primary view.</p>
                   6194: </blockquote>
                   6195: </div>
1.1       cvs      6196: 
1.18      cvs      6197: <div class="subsection">
1.1       cvs      6198: 
1.18      cvs      6199: <h3><a name="sectc4232">Presentation box creation</a></h3>
                   6200: <p>
1.1       cvs      6201: A creation rule specifies that a presentation box should be created when an
1.18      cvs      6202: element of the type to which the rule is attached appears in the document.</p>
                   6203: <p>
1.1       cvs      6204: A keyword specifies the position, relative to the creating box, at which the
1.18      cvs      6205: created box will be placed in the structure:</p>
                   6206: <dl>
                   6207: <dt><tt>CreateFirst</tt></dt>
                   6208: <dd>
                   6209: specifies that the box should be created as the first box of the next lower
1.2       cvs      6210: level, before any already existing boxes, and only if the beginning of the
1.1       cvs      6211: creating element is visible;
1.18      cvs      6212: </dd>
                   6213: <dt><tt>CreateLast</tt></dt>
                   6214: <dd>
                   6215: specifies that the box should be created as the last box of the next lower
                   6216: level, after any existing boxes, and only if the end of the creating element
                   6217: is visible;
                   6218: </dd>
                   6219: <dt><tt>CreateBefore</tt></dt>
                   6220: <dd>
                   6221: specifies that the box should be created before the creating box, on the same
                   6222: level as the creating box, and only if the beginning of the creating element
                   6223: is visible;
                   6224: </dd>
                   6225: <dt><tt>CreateAfter</tt></dt>
                   6226: <dd>
                   6227: specifies that the box should be created after the creating box, on the same
                   6228: level as the creating box, and only if the beginning of the creating element
                   6229: is visible;
                   6230: </dd>
                   6231: <dt><tt>CreateEnclosing</tt></dt>
                   6232: <dd>
                   6233: specifies that the box should be created at the upper level relatively to the
                   6234: creating box, and that it must contain that creating box and all presentation
                   6235: boxes created by the same creating box.
                   6236: </dd>
                   6237: </dl>
                   6238: <p>
                   6239: This keyword can be followed by the <tt>Repeated</tt> keyword to indicate that
1.1       cvs      6240: the box must be created for each part of the creating element. These parts
                   6241: result from the division of the element by page breaks or column changes.  If
1.18      cvs      6242: the <tt>Repeated</tt> keyword is missing, the box is only created for the
                   6243: first part of the creating element (<tt>CreateFirst</tt> and
                   6244: <tt>CreateBefore</tt> rules) or for the last part (<tt>CreateLast</tt> and
                   6245: <tt>CreateAfter</tt> rules).</p>
                   6246: <p>
1.1       cvs      6247: The type of presentation to be created is specified at the end of the rule
1.18      cvs      6248: between parentheses.</p>
                   6249: <p>
                   6250: Creation rules cannot appear in the <a href="#sectc427">default presentation
                   6251: rules</a>.  The boxes being created should have a <tt>Content</tt> rule which
                   6252: indicates their <a href="#sectc4231">content</a>.</p>
                   6253: <p>
1.1       cvs      6254: Creation rules can only appear in the block of rules for the primary view;
                   6255: creation is provoked by a document element for all views. However, for each
                   6256: view, the presentation box is only created if the creating element is itself a
                   6257: box in the view. Moreover, the visibility parameter of the presentation box
                   6258: can be adjusted to control the creation of the box on a view-by-view
1.18      cvs      6259: basis.</p>
                   6260: <pre>                     Creation '(' BoxID ')'
1.1       cvs      6261:      Creation      = Create [ 'Repeated' ] .
                   6262:      Create        ='CreateFirst' / 'CreateLast' /
                   6263:                     'CreateBefore' / 'CreateAfter' /
1.18      cvs      6264:                     'CreateEnclosing' .</pre>
                   6265: <blockquote class="example">
                   6266: <p>
                   6267: <strong>Example:</strong></p>
                   6268: <p>
1.3       cvs      6269: Let us define an object type, called Table, which is composed of a sequence of
                   6270: columns, all having the same fixed width, where the columns are separated by
1.18      cvs      6271: vertical lines.  There is a line to the left of the first column and one to
                   6272: the right of the last.  Each column has a variable number of cells, placed one
                   6273: on top of the other and separated by horizontal lines.  There are no
                   6274: horizontal lines above the first cell or below the last cell.  The text
                   6275: contained in each cell is  broken into lines and these lines are centered
                   6276: horizontally in the cell. The logical structure of this object is defined
                   6277: by:</p>
                   6278: <pre>Table   = LIST OF (Column);
                   6279: Column  = LIST OF (Cell = Text);</pre>
                   6280: 
                   6281: <div class="figure">
                   6282: <hr>
1.19      cvs      6283: 
1.18      cvs      6284: <pre>|                |                |               |
1.1       cvs      6285: |  xx xxxx xxxx  |x xxxx xxx xxxxx|  x xxx x xxx  |
                   6286: | xxx xxx xxxx x |   x xx x xxx   | xxxxx xxxx xx |
                   6287: |   xxxxx xxxx   |----------------|  xxx xxxxx x  |
                   6288: | xxxxx xxx xxxx | xxxx xx xx xxx |     xx xx     |
                   6289: | xxx xxxx x xxx |  xxxx x xxx x  |---------------|
                   6290: |----------------| xxx xxxx xxxxx |  xxxxx xxxxx  |
                   6291: | xxx xxx xxxxxx |----------------| xxx xxxx xxxx |
                   6292: |  xxxx xxxx xx  |  xxxx xx x xx  |  xxx xx x xx  |
                   6293: |----------------| xxx xxxxx xxxx | xxxx xxxx xxx |
                   6294: | xxxxx xxx xxxx |  xxxx xx x xx  |   xxxxx xxx   |
1.18      cvs      6295: |xxxx xx x xxxxxx| xxxx xx xxxxxx |  xxxxx xxxxx  |</pre>
1.19      cvs      6296: <p align="center">
1.18      cvs      6297: <em><a name="table">The design of a table</a></em></p>
                   6298: <hr>
1.19      cvs      6299: 
1.18      cvs      6300: </div>
                   6301: <p>
                   6302: The presentation of the table should resemble the design of the above <a
                   6303: href="#table">figure</a>.  It is defined by the following presentation schema
                   6304: fragment:</p>
                   6305: <pre>BOXES
1.1       cvs      6306:      VertLine : BEGIN
                   6307:                 Width : 0.3 cm;
                   6308:                 Height : Enclosing . Height;
                   6309:                 VertPos : Top = Enclosing . Top;
                   6310:                 HorizPos : Left = Previous . Right;
                   6311:                 Content : Graphics 'v';
                   6312:                 END;
                   6313: 
                   6314:      HorizLine: BEGIN
                   6315:                 Width : Enclosing . Width;
                   6316:                 Height : 0.3 cm;
                   6317:                 VertPos : Top = Previous . Bottom;
                   6318:                 HorizPos : Left = Enclosing . Left;
                   6319:                 Content : Graphics 'h';
                   6320:                 END;
                   6321: 
                   6322: RULES
1.6       cvs      6323:      Column   : BEGIN
                   6324:                 CreateBefore (VertLine);
                   6325:                 IF LAST CreateAfter (VertLine);
                   6326:                 Width : 2.8 cm;
                   6327:                 Height : Enclosed . Height;
                   6328:                 VertPos : Top = Enclosing . Top;
                   6329:                 HorizPos : Left = Previous . Right;
                   6330:                 END;
                   6331: 
                   6332:      Cell     : BEGIN
                   6333:                 IF NOT FIRST CreateBefore (HorizLine);
                   6334:                 Width : Enclosing . Width;
                   6335:                 Height : Enclosed . Height;
                   6336:                 VertPos : Top = Previous . Bottom;
                   6337:                 HorizPos : Left = Enclosing . Left;
                   6338:                 Line;
                   6339:                 Adjust : VMiddle;
1.18      cvs      6340:                 END;</pre>
                   6341: <p>
1.1       cvs      6342: It is useful to note that the horizontal position rule of the first vertical
                   6343: line will not be applied, since there is no preceding box. In this case, the
1.18      cvs      6344: box is simply placed on the left side of the enclosing box.</p>
                   6345: </blockquote>
                   6346: </div>
                   6347: 
                   6348: <div class="subsection">
                   6349: 
                   6350: <h3><a name="sectc4233">Page layout</a></h3>
                   6351: <p>
                   6352: The page models specified in the <tt>Page</tt> rule are defined by boxes
                   6353: declared in the <tt>BOXES</tt> section of the presentation schema.  Pages are
1.1       cvs      6354: not described as frames which will be filled by the document's text, but as
                   6355: element are inserted in the flow of the document and which mark the page
                   6356: breaks.  Each of these page break elements contains presentation boxes which
                   6357: represent the footer boxes of a page followed by header boxes of the next
                   6358: page.  The page box itself is the simple line which separates two pages on the
                   6359: screen.  Both the footer and header boxes placed themselves with respect to
                   6360: this page box, with the footer being placed above it and the header boxes
1.18      cvs      6361: being placed above it.</p>
                   6362: <p>
1.1       cvs      6363: The boxes created by a page box are headers and footers and can only place
                   6364: themselves vertically with respect to the page box itself (which is in fact
                   6365: the separation between two pages).  Besides, it is their vertical position
                   6366: rule  which determines whether they are header or footer boxes.  Header and
                   6367: footer boxes must have an explicit vertical position rule (they must not use
1.18      cvs      6368: the default rule).</p>
                   6369: <p>
1.1       cvs      6370: Footer boxes must have an absolute height or inherit the height of their
1.18      cvs      6371: contents:</p>
                   6372: <pre>Height : Enclosed . Height;</pre>
                   6373: <p>
1.1       cvs      6374: A page box must have height and width rules and these two rules must be
                   6375: specified with constant values, expressed in centimeters, inches, or
                   6376: typographer's points.  These two rules are interpreted in a special way for
                   6377: page boxes:  they determine the width of the page and the vertical distance
                   6378: between two page separators, which is the height of the page and its header
1.18      cvs      6379: and footer together.</p>
                   6380: <p>
1.1       cvs      6381: A page box should also have vertical and horizontal position rules and these
                   6382: two rules should specify the position on the sheet of paper of the rectangle
                   6383: enclosing the page's contents.  These two rules must position the upper left
                   6384: corner of the enclosing rectangle in relation to the upper left corner of the
                   6385: sheet of paper, considered to be the enclosing element.  In both rules,
1.18      cvs      6386: distances must be expressed in fixed units: centimeters (<tt>cm</tt>), inches
                   6387: (<tt>in</tt>), or typographer's points (<tt>pt</tt>).  Thus, rules similar to
                   6388: the following should be found in the rules for a page box:</p>
                   6389: <pre>BOXES
1.1       cvs      6390:    ThePage :
                   6391:       BEGIN
                   6392:       VertPos : Top = Enclosing . Top + 3 cm;
                   6393:       HorizPos : Left = Enclosing . Left + 2.5 cm;
                   6394:       Width : 16 cm;
                   6395:       Height : 22.5 cm;
1.18      cvs      6396:       END;</pre>
                   6397: <p>
1.1       cvs      6398: When a document must be page broken, the page models to be constructed are
1.18      cvs      6399: defined in the <tt>BOXES</tt> section of the presentation schema by declaring
                   6400: page boxes and header and footer boxes.  Also, the <tt>Page</tt> rule is used
1.1       cvs      6401: to specify to which parts of the document and to which views each model should
1.18      cvs      6402: be applied.</p>
                   6403: <p>
                   6404: The <tt>Page</tt> rule has only one parameter, given between parentheses after
                   6405: the <tt>Page</tt> keyword.  This parameter is the name of the box which must
                   6406: serve as the model for page construction.  When a <tt>Page</tt> rule is
1.1       cvs      6407: attached to an element type, each time such an element appears in a document,
                   6408: a page break takes place and the page model indicated in the rule is applied
                   6409: to all following pages, until reaching the next element which has a
1.18      cvs      6410: <tt>Page</tt> rule.</p>
                   6411: <p>
                   6412: The <tt>Page</tt> rule applies to only one view; if it appears in the primary
                   6413: view's block of rules, a <tt>Page</tt> rule applies only to that view. Thus,
1.1       cvs      6414: different page models can be defined for the full document and for its table
                   6415: of contents, which is another view of the same document. Some views can be
                   6416: specified with pages, and other views of the same document can be specified
1.18      cvs      6417: without pages.</p>
                   6418: <pre>                   'Page' '(' BoxID ')'</pre>
                   6419: </div>
                   6420: 
                   6421: <div class="subsection">
                   6422: 
                   6423: <h3><a name="sectc4234">Box copies</a></h3>
                   6424: <p>
                   6425: The <tt>Copy</tt> rule can be used for an element which is defined as a
1.7       cvs      6426: reference in the structure schema.  In this case, the rule specifies, between
1.18      cvs      6427: parenthesis, the name of the box (declared in the <tt>BOXES</tt> section)
1.1       cvs      6428: which must be produced when this reference appears in the structure of a
                   6429: document.  The box produced is a copy (same contents, but possible different
                   6430: presentation) of the box type indicated by the parameter between parentheses,
                   6431: and which is in the element designated by the reference.  The name of a box
                   6432: can be replaced by type name. Then what is copied is the contents of the
1.18      cvs      6433: element of this type which is inside the referenced element.</p>
                   6434: <p>
1.1       cvs      6435: Whether a box name or type name is given, it may be followed by the name of a
                   6436: structure schema between parentheses.  This signifies that the box or type is
                   6437: defined in the indicated structure schema and not in the structure schema with
1.18      cvs      6438: which the rule's presentation schema is associated.</p>
                   6439: <p>
                   6440: The <tt>Copy</tt> rule can also be applied to a presentation box.  If the
1.1       cvs      6441: presentation box was created by a reference attribute, the rule is applied as
                   6442: in the case of a reference element: the contents of the box having the
1.18      cvs      6443: <tt>Copy</tt> rule are based on the element designated by the reference
                   6444: attribute.  For other presentation boxes, the <tt>Copy</tt> rule takes a type
1.1       cvs      6445: name parameter which can be followed, between parentheses, by the name of the
                   6446: structure schema in which the type is defined, if it is not defined in the
                   6447: same schema.  The contents of the box which has this rule are a copy of the
                   6448: element of this type which is in the element creating the presentation box, or
                   6449: by default, the box of this type which precedes the presentation box.  This
                   6450: last facility is used, for example, to define the running titles in headers or
1.18      cvs      6451: footers.</p>
                   6452: <pre>                  'Copy' '(' BoxTypeToCopy ')' .
1.1       cvs      6453:   BoxTypeToCopy = BoxID [ ExtStruct ] /
1.6       cvs      6454:                   ElemID [ ExtStruct ] .
1.18      cvs      6455:   ExtStruct     = '(' ElemID ')' .</pre>
                   6456: <p>
                   6457: Like the creation rules, the <tt>Copy</tt> rule cannot appear in the <a
                   6458: href="#sectc427">default presentation rules</a>.  Moreover, this rule can only
                   6459: appear in the primary view's block of rules; the copy rule is applied to all
                   6460: views.</p>
                   6461: <blockquote class="example">
                   6462: <p>
                   6463: <strong>Example:</strong></p>
                   6464: <p>
                   6465: If the following definitions are in the structure schema:</p>
                   6466: <pre>Body = LIST OF (Chapter =
1.1       cvs      6467:                      BEGIN
                   6468:                      ChapterTitle = Text;
                   6469:                      ChapterBody = SectionSeq;
                   6470:                      END);
1.18      cvs      6471: RefChapter = REFERENCE (Chapter);</pre>
                   6472: <p>
                   6473: then the following presentation rules (among many other rules in the
                   6474: presentation schema) can be specified:</p>
                   6475: <pre>COUNTERS
1.1       cvs      6476:    ChapterCtr : RANK OF Chapter;
                   6477: BOXES
                   6478:    ChapterNumber :
                   6479:       BEGIN
                   6480:       Content : (VALUE (ChapterCtr, URoman));
                   6481:       ...
                   6482:       END;
                   6483: RULES
                   6484:    Chapter :
                   6485:       BEGIN
                   6486:       CreateFirst (ChapterNumber);
                   6487:       ...
                   6488:       END;
                   6489:    RefChapter :
                   6490:       BEGIN
                   6491:       Copy (ChapterNumber);
                   6492:       ...
1.18      cvs      6493:       END;</pre>
                   6494: <p>
1.4       cvs      6495: which makes the number of the chapter designated by the reference appear in
                   6496: uppercase roman numerals, in place of the reference to a chapter itself.
                   6497: Alternatively, the chapter title can be made to appear in place of the
1.18      cvs      6498: reference by writing this <tt>Copy</tt>rule:</p>
                   6499: <pre>      Copy (ChapterTitle);</pre>
                   6500: <p>
                   6501: To define a header box, named <tt>RunningTitle</tt>, which contains the title
                   6502: of the current chapter, the box's contents are defined in this way:</p>
                   6503: <pre>BOXES
1.1       cvs      6504:    RunningTitle :
1.18      cvs      6505:       Copy (ChapterTitle);</pre>
                   6506: </blockquote>
                   6507: </div>
                   6508: </div>
                   6509: <hr>
1.19      cvs      6510: 
1.18      cvs      6511: </div>
1.1       cvs      6512: 
1.18      cvs      6513: <div class="chapter">
1.1       cvs      6514: 
1.18      cvs      6515: <h1><a name="sect5">The T language</a></h1>
1.1       cvs      6516: 
1.18      cvs      6517: <div class="section">
1.1       cvs      6518: 
1.18      cvs      6519: <h2><a name="sectb51">Document translation</a></h2>
                   6520: <p>
1.1       cvs      6521: Because of its document model, Thot can produce documents in a high-level
1.18      cvs      6522: abstract form.  This form, called the <em>canonical form</em> is specific to
1.1       cvs      6523: Thot; it is well suited to the editor's manipulations, but it does not
                   6524: necessarily suit other operations which might be applied to documents. Because
                   6525: of this, the Thot editor offers the choice of saving documents in its own form
                   6526: (the canonical form) or a format defined by the user.  In the latter case, the
                   6527: Thot document is transformed by the translation program.  This facility can
                   6528: also be used to export documents from Thot to systems using other
1.18      cvs      6529: formalisms.</p>
1.1       cvs      6530: 
1.18      cvs      6531: <div class="subsection">
1.1       cvs      6532: 
1.18      cvs      6533: <h3><a name="sectc511">Translation principles</a></h3>
                   6534: <p>
1.1       cvs      6535: Document translation allows the export of documents to other systems which do
                   6536: not accept Thot's canonical form.  Translation can be used to export document
1.18      cvs      6537: to source-based formatters like T<sub><big>E</big></sub>X,
                   6538: L<sup>A</sup>T<sub><big>E</big></sub>X, and <tt>troff</tt>.  It can also be
1.1       cvs      6539: used to translate documents into interchange formats like SGML or HTML.  To
                   6540: allow the widest range of possible exports, Thot does not limit the choice of
                   6541: translations, but rather allows the user to define the formalisms into which
1.18      cvs      6542: documents can be translated.</p>
                   6543: <p>
1.1       cvs      6544: For each document or object class, a set of translation rules can be defined,
                   6545: specifying how the canonical form should be transformed into a given
1.18      cvs      6546: formalism.  These translation rules are grouped into <em>translation
                   6547: schemas</em>, each schema containing the rules necessary to translate a
1.1       cvs      6548: generic logical structure (document or object structure) into a particular
                   6549: formalism.  The same generic logical structure can have several different
                   6550: translation schemas, each defining translation rules for a different
1.18      cvs      6551: formalism.</p>
                   6552: <p>
1.1       cvs      6553: Like presentation schemas, translation schemas are generic.  Thus, they apply
                   6554: to an entire object or document class and permit translation of all documents
1.18      cvs      6555: or objects of that class.</p>
                   6556: </div>
1.1       cvs      6557: 
1.18      cvs      6558: <div class="subsection">
1.1       cvs      6559: 
1.18      cvs      6560: <h3><a name="sectc512">Translation procedure</a></h3>
                   6561: <p>
1.1       cvs      6562: The translator works on the specific logical structure of the document being
                   6563: translated.  It traverses the primary tree of this logical structure in
                   6564: pre-order and, at each node encountered, it applies the corresponding
                   6565: translation rules defined in the translation schema. Translation can be
1.18      cvs      6566: associated:</p>
                   6567: <ul>
                   6568: <li>
                   6569: with element types defined in the structure schema,
1.19      cvs      6570: </li>
1.18      cvs      6571: <li>
                   6572: with global or local attributes defined in the structure schema,
1.19      cvs      6573: </li>
1.18      cvs      6574: <li>
                   6575: with specific presentation rules,
1.19      cvs      6576: </li>
1.18      cvs      6577: <li>
                   6578: with the content of the leaves of  the structure (characters, symbols and
1.1       cvs      6579: graphical elements)
1.19      cvs      6580: </li>
1.18      cvs      6581: </ul>
                   6582: <p>
1.1       cvs      6583: Thus, for each node, the translator applies all rules associated with the
                   6584: element type, all rules associated with each attribute (local or global)
                   6585: carried by the element, and if the element is a leaf of the tree, it also
1.10      cvs      6586: applies translation rules for characters, symbols, or graphical elements,
1.18      cvs      6587: depending on the type of the leaf.</p>
                   6588: <p>
1.1       cvs      6589: Rules associated with the content of leaves are different from all other
                   6590: rules: they specify only how to translate character strings, symbols, and
                   6591: graphical elements.  All other rules, whether associated with element types,
                   6592: with specific presentation rules or with attributes, are treated similarly.
1.18      cvs      6593: These rules primarily allow:</p>
                   6594: <ul>
                   6595: <li>
                   6596: generation of a text constant or variable before or after the contents of an
                   6597: element,
1.19      cvs      6598: </li>
1.18      cvs      6599: <li>
                   6600: modification of the order in which elements appear after translation,
1.19      cvs      6601: </li>
1.18      cvs      6602: <li>
                   6603: removal of an element in the translated document,
1.19      cvs      6604: </li>
1.18      cvs      6605: <li>
                   6606: and writing messages on the user's terminal during translation.
1.19      cvs      6607: </li>
1.18      cvs      6608: </ul>
                   6609: </div>
                   6610: </div>
1.1       cvs      6611: 
1.18      cvs      6612: <div class="section">
1.1       cvs      6613: 
1.18      cvs      6614: <h2><a name="sectb52">Translation definition language</a></h2>
                   6615: <p>
1.1       cvs      6616: Translation schemas are written in a custom language, called T, which is
                   6617: described in the rest of this chapter.  The grammar of T is specified using
1.18      cvs      6618: the same <a href="#sectc321">meta-language</a> as was used for the S and P
1.1       cvs      6619: languages and the translation schemas are written using the same conventions
                   6620: as the structure and presentation schemas.  In particular, the keywords of the
                   6621: T language (the stings between apostrophes in the following syntax rules) can
                   6622: be written in any combination of upper-case and lower-case letters, but
                   6623: identifiers created by the programmer must always be written in the same
1.18      cvs      6624: way.</p>
1.1       cvs      6625: 
1.18      cvs      6626: <div class="subsection">
1.1       cvs      6627: 
1.18      cvs      6628: <h3><a name="sectc521">Organization of a translation schema</a></h3>
                   6629: <p>
                   6630: A translation schema is begun by the <tt>TRANSLATION</tt> keyword and is
                   6631: terminated by the <tt>END</tt> keyword.  The <tt>TRANSLATION</tt> keyword is
1.1       cvs      6632: followed by the name of the generic structure for which a translation is being
                   6633: defined and a semicolon.  This name must be identical to the name which
1.18      cvs      6634: appears after the <tt>STRUCTURE</tt> keyword in the corresponding structure
                   6635: schema.</p>
                   6636: <p>
1.1       cvs      6637: After this declaration of the structure, the following material appears in
1.18      cvs      6638: order:</p>
                   6639: <ul>
                   6640: <li>
                   6641: the length of lines produced by the translation,
1.19      cvs      6642: </li>
1.18      cvs      6643: <li>
                   6644: the character delimiting the end of the line,
1.19      cvs      6645: </li>
1.18      cvs      6646: <li>
                   6647: the character string which the translator will insert if it must line-break
                   6648: the translated text,
1.19      cvs      6649: </li>
1.18      cvs      6650: <li>
                   6651: declarations of
                   6652: <ul>
                   6653: <li>
                   6654: buffers,
1.19      cvs      6655: </li>
1.18      cvs      6656: <li>
                   6657: counters,
1.19      cvs      6658: </li>
1.18      cvs      6659: <li>
                   6660: constants,
1.19      cvs      6661: </li>
1.18      cvs      6662: <li>
                   6663: variables,
1.19      cvs      6664: </li>
1.18      cvs      6665: </ul>
1.19      cvs      6666: </li>
1.18      cvs      6667: <li>
                   6668: translation rules associated with element types,
1.19      cvs      6669: </li>
1.18      cvs      6670: <li>
                   6671: translation rules associated with attributes,
1.19      cvs      6672: </li>
1.18      cvs      6673: <li>
                   6674: translation rules associated with specific presentation rules,
1.19      cvs      6675: </li>
1.18      cvs      6676: <li>
                   6677: translation rules associated with characters strings, symbols and graphical
                   6678: elements.
1.19      cvs      6679: </li>
1.18      cvs      6680: </ul>
                   6681: <p>
1.1       cvs      6682: Each of these sections is introduced by a keyword followed by a sequence of
                   6683: declarations.  All of these sections are optional, expect for the translation
1.18      cvs      6684: rules associated with element types. Many <tt>TEXTTRANSLATE</tt> sections can
1.1       cvs      6685: appear, each defining the rules for translating character strings of a
1.18      cvs      6686: particular alphabet.</p>
                   6687: <pre>     TransSchema ='TRANSLATION' ElemID ';'
1.1       cvs      6688:                 [ 'LINELENGTH' LineLength ';' ]
                   6689:                 [ 'LINEEND' CHARACTER ';' ]
                   6690:                 [ 'LINEENDINSERT' STRING ';' ]
                   6691:                 [ 'BUFFERS' BufferSeq ]
                   6692:                 [ 'COUNTERS' CounterSeq ]
                   6693:                 [ 'CONST' ConstSeq ]
                   6694:                 [ 'VAR' VariableSeq ]
                   6695:                   'RULES' ElemSeq
                   6696:                 [ 'ATTRIBUTES' AttrSeq ]
                   6697:                 [ 'PRESENTATION' PresSeq ]
                   6698:                 &lt; 'TEXTTRANSLATE' TextTransSeq >
                   6699:                 [ 'SYMBTRANSLATE' TransSeq ]
                   6700:                 [ 'GRAPHTRANSLATE' TransSeq ]
1.18      cvs      6701:                   'END' .</pre>
                   6702: </div>
1.1       cvs      6703: 
1.18      cvs      6704: <div class="subsection">
1.1       cvs      6705: 
1.18      cvs      6706: <h3><a name="sectc522">Line length</a></h3>
                   6707: <p>
                   6708: If a <tt>LINELENGTH</tt> instruction is present after the structure
1.1       cvs      6709: declaration, the translator divides the text it produces into lines, each line
                   6710: having a length less than or equal to the integer which follows the
1.18      cvs      6711: <tt>LINELENGTH</tt> keyword.  This maximum line length is expressed as a
1.1       cvs      6712: number of characters.  The end of the line is marked by the character defined
1.18      cvs      6713: by the <tt>LINEEND</tt> instruction.  When the translator breaks the lines on
1.1       cvs      6714: a space character in generated text, this space will be replaced by the
1.18      cvs      6715: character string defined by the <tt>LINEENDINSERT</tt> instruction.</p>
                   6716: <p>
                   6717: If the <tt>LINEEND</tt> instruction is not defined then the linefeed character
1.1       cvs      6718: (octal code 12) is used as the default line end character. If the
1.18      cvs      6719: <tt>LINEENDINSERT</tt> instruction is not defined, the linefeed character is
                   6720: inserted at the end of the produced lines.  If there is no <tt>LINELENGTH</tt>
1.1       cvs      6721: instruction, the translated text is not divided into lines.  Otherwise, if the
                   6722: translation rules generate line end marks, these marks remain in the
                   6723: translated text, but the length of the lines is not controlled by the
1.18      cvs      6724: translator.</p>
                   6725: <pre>     LineLength = NUMBER .</pre>
                   6726: <blockquote class="example">
                   6727: <p>
                   6728: <strong>Example:</strong></p>
                   6729: <p>
                   6730: To limit the lines produced by the translator to a length of 80 characters,
                   6731: the following rule is written at the beginning of the translation schema.</p>
                   6732: <pre>LineLength 80;</pre>
                   6733: </blockquote>
                   6734: </div>
1.1       cvs      6735: 
1.18      cvs      6736: <div class="subsection">
1.1       cvs      6737: 
1.18      cvs      6738: <h3><a name="sectc523">Buffers</a></h3>
                   6739: <p>
1.1       cvs      6740: A buffer is a  unit of memory managed by the translator, which can either
1.18      cvs      6741: contain text read from the terminal during the translation (see the <a
                   6742: href="#sectc5212"><tt>Read</tt> rule</a>), or the name of the last picture
1.1       cvs      6743: (bit-map) encountered by the translator in its traversal of the document.
1.2       cvs      6744: Remember the pictures are stored in files that are separate for the document
1.1       cvs      6745: files and that the canonical form contains only the names of the files in
1.18      cvs      6746: which the pictures are found.</p>
                   6747: <p>
1.1       cvs      6748: Thus, there are two types of buffers:  buffers for reading from the terminal
1.18      cvs      6749: (filled by the <tt>Read</tt> rule) and the buffer of picture names (containing
1.2       cvs      6750: the name of the last picture encountered).  A translation schema can use
                   6751: either type, one or several read buffers and one (and only one) picture name
1.18      cvs      6752: buffer.</p>
                   6753: <p>
                   6754: If any buffers are used, the <tt>BUFFERS</tt> keyword must be present,
1.1       cvs      6755: followed by declarations of every buffer used in the translation schema.  Each
                   6756: buffer declaration  is composed only of the name of the buffer, chosen freely
1.2       cvs      6757: by the programmer.  The picture name buffer is identified by the
1.18      cvs      6758: <tt>Picture</tt> keyword, between parentheses, following the buffer name.  The
                   6759: <tt>Picture</tt> keyword may only appear once.  Each buffer declaration is
                   6760: terminated by a semicolon.</p>
                   6761: <pre>     BufferSeq = Buffer &lt; Buffer > .
1.1       cvs      6762:      Buffer    = BufferID [ '(' 'Picture' ')' ] ';' .
1.18      cvs      6763:      BufferID  = NAME .</pre>
                   6764: <blockquote class="example">
                   6765: <p>
                   6766: <strong>Example:</strong></p>
                   6767: <p>
1.3       cvs      6768: The following buffer declarations create a picture name buffer named
1.18      cvs      6769: <tt>pictureName</tt> and a read buffer named <a
                   6770: name="destname"><tt>DestName</tt></a>:</p>
                   6771: <pre>BUFFERS
                   6772:      pictureName (Picture); DestName;</pre>
                   6773: </blockquote>
                   6774: </div>
1.1       cvs      6775: 
1.18      cvs      6776: <div class="subsection">
1.1       cvs      6777: 
1.18      cvs      6778: <h3><a name="sectc524">Counters</a></h3>
                   6779: <p>
1.1       cvs      6780: Certain translation rules generate text that varies according to the context
                   6781: of the element to which the rules apply.  Variable text is defined either in
1.18      cvs      6782: the <a href="#sectc526"><tt>VAR</tt> section</a> of the translation schema or
                   6783: in the rule itself (see the <tt>Create</tt> and <tt>Write</tt> rules).  Both
1.1       cvs      6784: types of definition rely on counters for the calculation of variable
1.18      cvs      6785: material.</p>
                   6786: <p>
1.1       cvs      6787: There are two types of counter: counters whose value is explicitely computed
1.18      cvs      6788: by applying <a href="#sectc5221"><tt>Set</tt> and <tt>Add</tt> rules</a>, and
1.1       cvs      6789: counters whose value is computed by a function associated with the counter.
                   6790: Those functions allow the same calculations as can be used in presentation
                   6791: schemas. As in a presentation schema, counters must be defined in the
1.18      cvs      6792: <tt>COUNTERS</tt> section of the translation schema before they are used.</p>
                   6793: <p>
                   6794: When counters are used in a translation schema, the <tt>COUNTERS</tt> keyword
1.1       cvs      6795: is followed by the declarations of every counter used.  Each declaration is
                   6796: composed of the counter's name possibly followed by a colon and the counting
                   6797: function to be used for the counter.  The declaration is terminated by a
1.18      cvs      6798: semi-colon. If the counter is explicitely computed by <tt>Set</tt> and
                   6799: <tt>Add</tt> rules, no counting function is indicated. If a counting function
                   6800: is indicated, <tt>Set</tt> and <tt>Add</tt> rules cannot be applied to that
                   6801: counter.</p>
                   6802: <p>
1.1       cvs      6803: The counting function indicates how the counter's value will be computed.
1.18      cvs      6804: Three functions are available: <tt>Rank</tt>, <tt>Rlevel</tt>, and
                   6805: <tt>Set</tt>.</p>
                   6806: <ul>
                   6807: <li>
                   6808: <tt>Rank of ElemID</tt> indicates that the counter's value is the rank of the
                   6809: element of type <tt>ElemID</tt> which encloses the element for which the
1.2       cvs      6810: counter is being evaluated.  For the purposes of this function, an element of
1.18      cvs      6811: type <tt>ElemID</tt> is considered to enclose itself.  This function is
                   6812: primarily used  when the element of type <tt>ElemID</tt> is part of an
1.2       cvs      6813: aggregate or list, in which case the counter's value is the element's rank in
1.18      cvs      6814: its list or aggregate.  Note that, unlike the <tt>Rank</tt> function for
                   6815: presentation schemas, the <tt>Page</tt> keyword cannot be used in place of the
                   6816: <tt>ElemID</tt>.
                   6817: <p>
                   6818: The type name <tt>ElemID</tt> can be followed by an integer.  That number
1.1       cvs      6819: represents the relative level, among the ancestors of the concerned element,
1.18      cvs      6820: of the element whose rank is asked.  If that relative level <i>n</i> is
                   6821: unsigned, the <i>n<sup>th</sup></i> element of type <tt>ElemID</tt>
                   6822: encountered when travelling the logical structure from the root to the
                   6823: concerned element is taken into account.  If the relative level is negative,
                   6824: the logical structure is travelled in the other direction, from the concerned
                   6825: element to the root.</p>
1.19      cvs      6826: </li>
1.18      cvs      6827: <li>
                   6828: <tt>Rlevel of ElemID</tt> indicates that the counter's values is the relative
                   6829: level in the tree of the element for which the counter is being evaluated. The
                   6830: counter counts the number of elements of type <tt>ElemID</tt> which are found
                   6831: on the path between the root of the document's logical structure tree and the
                   6832: element (inclusive).
1.19      cvs      6833: </li>
1.18      cvs      6834: <li>
                   6835: <tt>Set n on Type1 Add m on Type2</tt> indicates that the counter's value is
                   6836: calculated as follows:  in traversing the document from the beginning to the
                   6837: element for which the counter is being evaluated, the counter is set to the
                   6838: value <tt>n</tt> each time a <tt>Type1</tt> element is encountered and is
                   6839: incremented by the amount <tt>m</tt> each time a <tt>Type2</tt> element is
                   6840: encountered.  The initial value <tt>n</tt> and the increment <tt>m</tt> are
1.1       cvs      6841: integers.
1.19      cvs      6842: </li>
1.18      cvs      6843: </ul>
                   6844: <p>
                   6845: As in a presentation schema, the <tt>Rank</tt> and <tt>Set</tt> functions can
1.1       cvs      6846: be modified by a numeric attribute which changes their initial value. This is
1.18      cvs      6847: indicated by the <tt>Init</tt> keyword followed by the numeric attribute's
                   6848: name.  The <tt>Set</tt> function takes the value of the attribute instead of
                   6849: the <tt>InitValue</tt> (<tt>n</tt>).  For the <tt>Rank</tt> function, the
1.1       cvs      6850: value of the attribute is considered to be the rank of the first element of
                   6851: the list (rather than the normal value of 1). Subsequent items in the list
                   6852: have their ranks shifted accordingly.  In both cases, the attribute must be
1.18      cvs      6853: numeric and must be a local attribute of the root of the document itself.</p>
                   6854: <pre>     CounterSeq  = Counter &lt; Counter > .
1.1       cvs      6855:      Counter     = CounterID [ ':' CounterFunc ] ';' .
                   6856:      CounterID   = NAME .
                   6857:      CounterFunc = 'Rank' 'of' ElemID [ SLevelAsc ]
                   6858:                    [ 'Init' AttrID ] /
                   6859:                    'Rlevel' 'of' ElemID /
                   6860:                    'Set' InitValue 'On' ElemID
                   6861:                          'Add' Increment 'On' ElemID
                   6862:                          [ 'Init' AttrID ] .
                   6863:      SLevelAsc   = [ '-' ] LevelAsc .
                   6864:      LevelAsc    =  NUMBER .
                   6865:      InitValue   = NUMBER .
                   6866:      Increment   = NUMBER .
                   6867:      ElemID      = NAME .
1.18      cvs      6868:      AttrID      = NAME .</pre>
                   6869: <blockquote class="example">
                   6870: <p>
                   6871: <strong>Example:</strong></p>
                   6872: <p>
                   6873: If the body of a chapter is defined in the structure schema by:</p>
                   6874: <pre>Chapter_Body = LIST OF
1.1       cvs      6875:          (Section = BEGIN
                   6876:                     Section_Title = Text;
                   6877:                     Section_Body  = BEGIN
                   6878:                                     Paragraphs;
                   6879:                                     Section;
                   6880:                                     END;
                   6881:                     END
1.18      cvs      6882:          );</pre>
                   6883: <p>
                   6884: (sections are defined recursively), a counter can be defined giving the <a
                   6885: name="sectnum">number of a section</a> within its level in the hierarchy:</p>
                   6886: <pre>COUNTERS
                   6887:    SectionNumber : Rank of Section;</pre>
                   6888: <p>
                   6889: A counter holding the hierarchic level of a section:</p>
                   6890: <pre>   SectionLevel : Rlevel of Section;</pre>
                   6891: <p>
                   6892: A <a name="uniquenum">counter</a> which sequentially numbers all the
                   6893: document's sections, whatever their hierarchic level:</p>
                   6894: <pre>   UniqueSectNum : Set 0 on Document Add 1 on Section;</pre>
                   6895: </blockquote>
                   6896: </div>
1.1       cvs      6897: 
1.18      cvs      6898: <div class="subsection">
1.1       cvs      6899: 
1.18      cvs      6900: <h3><a name="sectc525">Constants</a></h3>
                   6901: <p>
1.1       cvs      6902: A common feature of translation rules is the generation of constant text. This
1.18      cvs      6903: text can be defined in the rule that generates it (see for example the <a
                   6904: href="#sectc5210"><tt>Create</tt></a> and <a
                   6905: href="#sectc5211"><tt>Write</tt></a> rules); but it can also be defined once
                   6906: in the constant declaration section and used many times in different rules.
                   6907: The latter option is preferable when the same text is used in several rules or
                   6908: several <a href="#sectc526">variables</a>.</p>
                   6909: <p>
                   6910: The <tt>CONST</tt> keyword begins the constant declaration section of the
1.1       cvs      6911: translation schema.  It must be omitted if no constants are declared. Each
                   6912: constant declaration is composed of the constant name, an equals sign, and the
                   6913: constant's value, which is a character string between apostrophes.  A constant
1.18      cvs      6914: declaration is terminated by a semicolon.</p>
                   6915: <pre>     ConstSeq   = Const &lt; Const > .
1.1       cvs      6916:      Const      = ConstID '=' ConstValue ';' .
                   6917:      ConstID    = NAME .
1.18      cvs      6918:      ConstValue = STRING .</pre>
                   6919: <blockquote class="example">
                   6920: <p>
                   6921: <strong><a name="levelexample">Example:</a></strong></p>
                   6922: <p>
                   6923: The following rule assigns the name <tt>TxtLevel</tt> to the character string
                   6924: ``Level'':</p>
                   6925: <pre>CONST
                   6926:      TxtLevel = 'Level';</pre>
                   6927: </blockquote>
                   6928: </div>
1.1       cvs      6929: 
1.18      cvs      6930: <div class="subsection">
1.1       cvs      6931: 
1.18      cvs      6932: <h3><a name="sectc526">Variables</a></h3>
                   6933: <p>
1.10      cvs      6934: Variables allow to define variable text which is generated by the
1.18      cvs      6935: <tt>Create</tt> and <tt>Write</tt> rules.  They are also used to define file
                   6936: names which are used in the <tt>Create</tt>, <tt>ChangeMainFile</tt>,
                   6937: <tt>RemoveFile</tt>, and <tt>Indent</tt> rules.  Variables can be defined
                   6938: either in the <tt>VAR</tt> section of the translation schema or directly in
                   6939: the rules which use them.  Variables that define file names must be declared
                   6940: in the <tt>VAR</tt> section, and when the same variable is used several times
                   6941: in the translation schema, it makes sense to define it globally in the
                   6942: <tt>VAR</tt> section.  This section is only present if at least one variable
                   6943: is defined globally.</p>
                   6944: <p>
                   6945: After the <tt>VAR</tt> keyword, each global variable is defined by its name, a
1.1       cvs      6946: colon separator and a sequence of functions (at least one function). Each
                   6947: variable definition is terminated by a semicolon. Functions determine the
                   6948: different parts which together give the value of the variable.  The value is
                   6949: obtained by concatenating the strings produced by each of the functions. Seven
                   6950: types of functions are available.  Each variable definition may use any number
1.18      cvs      6951: of functions of each type.</p>
                   6952: <ul>
                   6953: <li>
                   6954: The function <tt>Value(Counter)</tt>returns a string representing the value
                   6955: taken by the counter when it is evaluated for the element in whose rule the
                   6956: variable is used.  The counter must have been declared in the
                   6957: <tt>COUNTERS</tt> section of the translation schema.  When the counter is
1.2       cvs      6958: expressed in arabic numerals, the counter name can be followed by a colon and
                   6959: an integer indicating a minimum length (number of characters) for the string;
                   6960: if the counter's value is normally expressed with fewer characters than the
                   6961: required minimum, zeroes are added to the front of the string to achieve the
1.5       cvs      6962: minimum length.
1.18      cvs      6963: <p>
1.1       cvs      6964: By default, the counter value is written in arabic digits. If another
                   6965: representation of that value is needed, the counter name must be followed by a
1.18      cvs      6966: comma and one of the following keywords:</p>
                   6967: <ul>
                   6968: <li>
                   6969: <tt>Arabic</tt>: arabic numerals (default value),
1.19      cvs      6970: </li>
1.18      cvs      6971: <li>
                   6972: <tt>LRoman</tt>: lower-case roman numerals,
1.19      cvs      6973: </li>
1.18      cvs      6974: <li>
                   6975: <tt>URoman</tt>: upper-case roman numerals,
1.19      cvs      6976: </li>
1.18      cvs      6977: <li>
                   6978: <tt>Uppercase</tt>: upper-case letter,
1.19      cvs      6979: </li>
1.18      cvs      6980: <li>
                   6981: <tt>Lowercase</tt>: lower-case letter.
1.19      cvs      6982: </li>
1.18      cvs      6983: </ul>
1.19      cvs      6984: </li>
1.18      cvs      6985: <li>
                   6986: The function <tt>FileDir</tt>, without parameter, returns a string
1.2       cvs      6987: representing the name of the directory of the output file that has been given
                   6988: as a parameter to the translation program. The string includes a character '/'
                   6989: at the end.
1.19      cvs      6990: </li>
1.18      cvs      6991: <li>
                   6992: The function <tt>FileName</tt>, without parameter, returns a string
1.2       cvs      6993: representing the name of the output file that has been given as a parameter to
                   6994: the translation program. The file extension (the character string that
                   6995: terminate the file name, after a dot) is not part of that string.
1.19      cvs      6996: </li>
1.18      cvs      6997: <li>
                   6998: The function <tt>Extension</tt>, without parameter, returns a string
1.2       cvs      6999: representing the extension of the file name. That string is empty if the file
                   7000: name that has been given as a parameter to the translation program has no
                   7001: extension. If there is an extension, its first character is a dot.
1.19      cvs      7002: </li>
1.18      cvs      7003: <li>
                   7004: The function <tt>DocumentName</tt>, without parameter, returns a string
1.2       cvs      7005: representing the name of the document being translated.
1.19      cvs      7006: </li>
1.18      cvs      7007: <li>
                   7008: The function <tt>DocumentDir</tt>, without parameter, returns a string
1.2       cvs      7009: representing the directory containing the document being translated.
1.19      cvs      7010: </li>
1.18      cvs      7011: <li>
                   7012: The function formed by the name of a constant returns that constant's value.
1.19      cvs      7013: </li>
1.18      cvs      7014: <li>
                   7015: The function formed by a character string between apostrophes returns that
1.1       cvs      7016: string.
1.19      cvs      7017: </li>
1.18      cvs      7018: <li>
                   7019: The function formed by the name of a buffer returns the contents of that
1.2       cvs      7020: buffer.  If the named buffer is the picture buffer, then the name of the last
                   7021: picture encountered is returned.  Otherwise, the buffer is a read buffer and
                   7022: the value returned is text previously read from the terminal.  If the buffer
1.18      cvs      7023: is empty (no picture has been encountered or the <tt>Read</tt> rule has not
1.2       cvs      7024: been executed for the buffer), then the empty string is returned.
1.19      cvs      7025: </li>
1.18      cvs      7026: <li>
                   7027: The function formed by an attribute name takes the value of the indicated
1.2       cvs      7028: attribute for the element to which the variable applies.  If the element does
                   7029: not have that attribute, then the element's ancestor are searched toward the
                   7030: root of the tree.  If one of the ancestors does have the attribute then its
                   7031: value is used.  If no ancestors have the attribute, then the value of the
1.1       cvs      7032: function is the empty string.
1.19      cvs      7033: </li>
1.18      cvs      7034: </ul>
                   7035: <pre>     VariableSeq = Variable &lt; Variable > .
1.1       cvs      7036:      Variable    = VarID ':' Function &lt; Function > ';' .
                   7037:      VarID       = NAME .
                   7038:      Function    ='Value' '(' CounterID [ ':' Length ]
                   7039:                             [ ',' CounterStyle ] ')' /
                   7040:                   'FileDir' / 'FileName' / 'Extension' /
                   7041:                   'DocumentName' / 'DocumentDir' /
                   7042:                    ConstID / CharString / 
                   7043:                    BufferID / AttrID .
                   7044:      Length      = NUMBER .
                   7045:      CounterStyle= 'Arabic' / 'LRoman' / 'URoman' /
                   7046:                    'Uppercase' / 'Lowercase' .
1.18      cvs      7047:      CharString  = STRING .</pre>
                   7048: <blockquote class="example">
                   7049: <p>
                   7050: <strong>Example:</strong></p>
                   7051: <p>
1.3       cvs      7052: To create, at the beginning of each section of the translated document, text
                   7053: composed of the string ``Section'' followed by the section number, the
1.18      cvs      7054: following <a name="varsectexample">variable definition</a> might be used:</p>
                   7055: <pre>VAR
                   7056:      SectionVar : 'Section' Value(SectionNumber);</pre>
                   7057: <p>
                   7058: (see the definition of <a href="#sectnum"><tt>SectionNumber</tt></a>).</p>
                   7059: <p>
1.1       cvs      7060: The following variable definition can be used to create, at the beginning of
                   7061: each section, the text ``Level'' followed by the hierarchical level of the
1.18      cvs      7062: section. It used the constant defined above.</p>
                   7063: <pre>     LevelVar : TxtLevel Value(SectionLevel);</pre>
                   7064: <p>
                   7065: (see the definitions of <a href="#sectnum"><tt>SectionLevel</tt></a> and of <a
                   7066: href="#levelexample"><tt>TxtLevel</tt></a>).</p>
                   7067: <p>
                   7068: To generate the translation of each section in a different file (see <a
                   7069: href="#sectc5220">rule <tt>ChangeMainFile</tt></a>), the name of these files
                   7070: might be defined by the following variable:</p>
                   7071: <pre>     VarOutpuFile : FileName Value(SectionNumber)
                   7072:                     Extension;</pre>
                   7073: <p>
                   7074: If <tt>output.txt</tt> is the name of the <a name="varoutputfile">output
                   7075: file</a> specified when starting the translation program, translated sections
                   7076: are written in files <tt>output1.txt</tt>, <tt>output2.txt</tt>, etc.</p>
                   7077: </blockquote>
                   7078: </div>
                   7079: 
                   7080: <div class="subsection">
                   7081: 
                   7082: <h3><a name="sectc527">Translating structure elements</a></h3>
                   7083: <p>
                   7084: The <tt>RULES</tt> keyword introduces the translation rules which will be
1.1       cvs      7085: applied to the various structured element types.  Translation rules can be
                   7086: specified for each element type defined in the structure schema, including the
1.18      cvs      7087: base types defined implicitly, whose names are <tt>TEXT_UNIT</tt>,
                   7088: <tt>PICTURE_UNIT</tt>, <tt>SYMBOL_UNIT</tt>, <tt>GRAPHIC_UNIT</tt> and
                   7089: <tt>PAGE_UNIT</tt>.  But it is not necessary to specify rules for every
                   7090: defined type.</p>
                   7091: <p>
1.1       cvs      7092: If there are no translation rules for an element type, the elements that it
                   7093: contains (and which may have rules themselves) will still be translated, but
                   7094: the translator will produce nothing for the element itself.  To make the
1.18      cvs      7095: translator completely ignore the content of an element the <a
                   7096: href="#sectc5217"><tt>Remove</tt> rule</a> must be used.</p>
                   7097: <p>
1.1       cvs      7098: The translation rules for an element type defined in the structure schema are
                   7099: written using the name of the type followed by a colon and the list of
1.18      cvs      7100: applicable rules.  When the element  type is a <a href="#sectd3285">mark
                   7101: pair</a>, but only in this case, the type name must be preceded by the
                   7102: <tt>First</tt> or <tt>Second</tt> keyword.  This keyword indicates whether the
                   7103: rules that follow apply to the first or second mark of the pair.</p>
                   7104: <p>
1.1       cvs      7105: The list of rules can take several forms.  It may be a simple non-conditional
                   7106: rule.  It can also be formed by a condition followed by one or more simple
1.18      cvs      7107: rules.  Or it can be a block of rules beginning with the <tt>BEGIN</tt>
                   7108: keyword and ending with the <tt>END</tt> keyword and a semicolon.  This block
1.1       cvs      7109: of rules can contain one or more simple rules and/or one or more conditions,
1.18      cvs      7110: each followed by one or more simple rules.</p>
                   7111: <pre>     ElemSeq        = TransType &lt; TransType > .
1.1       cvs      7112:      TransType      = [ FirstSec ] ElemID ':' RuleSeq .
                   7113:      FirstSec       = 'First' / 'Second' .
                   7114:      RuleSeq        = Rule / 'BEGIN' &lt; Rule > 'END' ';' .
                   7115:      Rule           = SimpleRule / ConditionBlock .
                   7116:      ConditionBlock = 'IF' ConditionSeq SimpleRuleSeq .
                   7117:      SimpleRuleSeq  = 'BEGIN' &lt; SimpleRule > 'END' ';' / 
1.18      cvs      7118:                       SimpleRule .</pre>
                   7119: </div>
1.1       cvs      7120: 
1.18      cvs      7121: <div class="subsection">
1.1       cvs      7122: 
1.18      cvs      7123: <h3><a name="sectc528">Conditional rules</a></h3>
                   7124: <p>
1.1       cvs      7125: In a translation schema, the translation rules are either associated with
                   7126: element types or with attribute values or with a specific presentation.  They
                   7127: are applied by the translator each time an element of the corresponding type
                   7128: is encountered in the translated document or each time the attribute value is
                   7129: carried by an element or also, each time the specific translation is attached
                   7130: to an element.  This systematic application of the rules can be relaxed: it is
                   7131: possible to add a condition to one or more rules, so that these rules are only
1.18      cvs      7132: applied when the condition is true.</p>
                   7133: <p>
                   7134: A condition begins with the keyword <tt>IF</tt>, followed by a sequence of
1.1       cvs      7135: elementary conditions.  Elementary conditions are separated from each other by
1.18      cvs      7136: the <tt>AND</tt> keyword.  If there is only one elementary condition, this
1.1       cvs      7137: keyword is absent.  The rules are only applied if all the elementary
                   7138: conditions are true.  The elementary condition can be negative; it is then
1.18      cvs      7139: preceded by the <tt>NOT</tt> keyword.</p>
                   7140: <p>
1.1       cvs      7141: When the translation rule(s) controlled by the condition apply to a reference
                   7142: element or a reference attribute, an elementary condition can also apply to
1.18      cvs      7143: element referred by this reference.  The <tt>Target</tt> keyword is used for
1.1       cvs      7144: that purpose.  It must appear before the keyword defining the condition
1.18      cvs      7145: type.</p>
                   7146: <p>
1.1       cvs      7147: Depending on their type, some conditions may apply either to the element with
1.5       cvs      7148: which they are associated, or to one of its ancestor.  In the case of an
1.18      cvs      7149: ancestor, the key word <tt>Ancestor</tt> must be used, followed by</p>
                   7150: <ul>
                   7151: <li>
                   7152: either an integer which represents the number of levels in the tree between
                   7153: the element and the ancestor of interest,
1.19      cvs      7154: </li>
1.18      cvs      7155: <li>
                   7156: or the type name of the ancestor of interest.  If that type is defined in a
                   7157: separate structure schema, the name of that schema must follow between
1.1       cvs      7158: parentheses.
1.19      cvs      7159: </li>
1.18      cvs      7160: </ul>
                   7161: <p>
1.2       cvs      7162: There is a special case for the parent element, which can be simply written
1.18      cvs      7163: <tt>Parent</tt> instead of <tt>Ancestor 1</tt>.</p>
                   7164: <p>
                   7165: Only conditions <tt>First</tt>, <tt>Last</tt>, <tt>Referred</tt>,
                   7166: <tt>Within</tt>, <tt>Attributes</tt>, <tt>Presentation</tt>, <tt>Comment</tt>
1.1       cvs      7167: and those concerning an attribute or a specific presentation can apply to an
1.18      cvs      7168: ancestor. Conditions <tt>Defined</tt>, <tt>FirstRef</tt>, <tt>LastRef</tt>,
                   7169: <tt>ExternalRef</tt>, <tt>Alphabet</tt>, <tt>FirstAttr</tt>,
                   7170: <tt>LastAttr</tt>, <tt>ComputedPage</tt>, <tt>StartPage</tt>,
                   7171: <tt>UserPage</tt>, <tt>ReminderPage</tt>, <tt>Empty</tt> cannot be preceded by
                   7172: keywords <tt>Parent</tt> or <tt>Ancestor</tt>.</p>
                   7173: <p>
                   7174: In condition <tt>Referred</tt> and in the condition that applies to a named
                   7175: attribute, a symbol '<tt>*</tt>' can indicate that the condition is related
1.5       cvs      7176: only to the element itself. If this symbol is not present, not only the
1.18      cvs      7177: element is considered, but also its ancestor, at any level.</p>
                   7178: <p>
1.1       cvs      7179: The form of an elementary condition varies according to the type of
1.18      cvs      7180: condition.</p>
1.1       cvs      7181: 
1.18      cvs      7182: <div class="subsubsection">
1.1       cvs      7183: 
1.18      cvs      7184: <h4><a name="sectd5281">Conditions based on the logical position of the
                   7185: element</a></h4>
                   7186: <p>
1.1       cvs      7187: The condition can be on the position of the element in the document's logical
                   7188: structure tree.  It is possible to test whether the element is the first
1.18      cvs      7189: (<tt>First</tt>) or last (<tt>Last</tt>) among its siblings or if it is not
                   7190: the first (<tt>NOT First</tt>) or not the last (<tt>NOT Last</tt>).</p>
                   7191: <p>
1.1       cvs      7192: It is also possible to test if the element is contained in an element of a
1.18      cvs      7193: given type (<tt>Within</tt>) or if it is not (<tt>NOT Within</tt>). If that
1.1       cvs      7194: element type is defined in a structure schema which is not the one which
                   7195: corresponds to the translation schema, the type name of this element must be
                   7196: followed, between parentheses, by the name of the structure schema which
1.18      cvs      7197: defines it.</p>
                   7198: <p>
                   7199: If the keyword <tt>Within</tt> is preceded by <tt>Immediately</tt>, the
                   7200: condition is satisfied only if the <em>parent</em> element has the type
                   7201: indicated. If the word <tt>Immediately</tt> is missing, the condition is
                   7202: satisfied if any <em>ancestor</em> has the type indicated.</p>
                   7203: <p>
                   7204: An integer <i>n</i> can appear between the keyword <tt>Within</tt> and the
1.1       cvs      7205: type.  It specifies the number of ancestors of the indicated type that must be
                   7206: present for the condition to be satisfied.  If the keyword
1.18      cvs      7207: <tt>Immediately</tt> is also present, the <i>n</i> immediate ancestors of the
                   7208: element must have the indicated type.  The integer <i>n</i> must be positive
                   7209: or zero.  It can be preceded by <tt>&lt;</tt> or <tt>></tt> to indicate a
1.1       cvs      7210: maximum or minimum number of ancestors.  If these symbols are missing, the
1.18      cvs      7211: condition is satisfied only if it exists exactly <i>n</i> ancestors.  When
                   7212: this number is missing, it is equivalent to > 0.</p>
                   7213: <p>
1.11      cvs      7214: If the condition applies to translation rules associated with an attribute,
1.18      cvs      7215: i.e. if it is in the <tt>ATTRIBUTES</tt> section of the presentation schema,
1.11      cvs      7216: the condition can be simply an element name. Translation rules are then
1.18      cvs      7217: executed only if the attribute is attached to an element of that type. The
                   7218: keyword <tt>NOT</tt> before the element name indicates that the translation
                   7219: rules must be executed only if the element is not of the type indicated.</p>
                   7220: </div>
1.1       cvs      7221: 
1.18      cvs      7222: <div class="subsubsection">
1.1       cvs      7223: 
1.18      cvs      7224: <h4><a name="sectd5282">Conditions on references</a></h4>
                   7225: <p>
1.1       cvs      7226: References may be taken into account in conditions, which can be based on the
1.18      cvs      7227: fact that the element, or one of its ancestors (unless symbol <tt>*</tt> is
                   7228: present), is designated by a at least one reference (<tt>Referred</tt>) or by
                   7229: none (<tt>NOT Referred</tt>).  If the element or attribute to which the
1.1       cvs      7230: condition is attached is a reference, the condition can be based on the fact
                   7231: that it acts as the first reference to the designated element
1.18      cvs      7232: (<tt>FirstRef</tt>), or as the last (<tt>LastRef</tt>), or as a reference to
                   7233: an element located in another document (<tt>ExternalRef</tt>).  Like all
                   7234: conditions, conditions on references can be inverted by the <tt>NOT</tt>
                   7235: keyword.</p>
                   7236: </div>
                   7237: 
                   7238: <div class="subsubsection">
                   7239: 
                   7240: <h4><a name="sectd5283">Conditions on the parameters</a></h4>
                   7241: <p>
                   7242: Elements which are <a href="#sectc326">parameters</a> can be given a
                   7243: particular condition which is based on whether or not the parameter is given a
                   7244: value in the document (<tt>Defined</tt> or <tt>NOT Defined</tt>,
                   7245: respectively).</p>
                   7246: </div>
1.1       cvs      7247: 
1.18      cvs      7248: <div class="subsubsection">
1.1       cvs      7249: 
1.18      cvs      7250: <h4><a name="sectd5284">Conditions on the alphabets</a></h4>
                   7251: <p>
1.1       cvs      7252: The character string base type (and only this type) can use the condition
1.18      cvs      7253: <tt>Alphabet = a</tt> which indicates that the translation rule(s) should only
1.1       cvs      7254: apply if the alphabet of the character string is the one whose name appears
1.18      cvs      7255: after the equals sign (or is not, if there is a preceding <tt>NOT</tt>
1.1       cvs      7256: keyword).  This condition cannot be applied to translation rules of an
1.18      cvs      7257: attribute.</p>
                   7258: <p>
1.1       cvs      7259: In the current implementation of Thot, the available alphabets are the
1.18      cvs      7260: <tt>Latin</tt> alphabet and the <tt>Greek</tt> alphabet.</p>
                   7261: </div>
1.1       cvs      7262: 
1.18      cvs      7263: <div class="subsubsection">
1.1       cvs      7264: 
1.18      cvs      7265: <h4><a name="sectd5285">Conditions on page breaks</a></h4>
                   7266: <p>
1.1       cvs      7267: The page break base type (and only this type) can use the following
1.18      cvs      7268: conditions: <tt>ComputedPage</tt>, <tt>StartPage</tt>, <tt>UserPage</tt>, and
                   7269: <tt>ReminderPage</tt>.  The <tt>ComputedPage</tt> condition indicates that the
1.1       cvs      7270: translation rule(s) should apply if the page break was created automatically
1.18      cvs      7271: by Thot;  the <tt>StartPage</tt> condition is true if the page break is
                   7272: generated before the element by the <tt>Page</tt> rule of the P language; the
                   7273: <tt>UserPage</tt> condition applies if the page break was inserted by the
                   7274: user; and the <tt>ReminderPage</tt> is applied if the page break is a reminder
                   7275: of page breaking.</p>
                   7276: </div>
1.1       cvs      7277: 
1.18      cvs      7278: <div class="subsubsection">
1.1       cvs      7279: 
1.18      cvs      7280: <h4><a name="sectd5286">Conditions on the element's content</a></h4>
                   7281: <p>
1.1       cvs      7282: The condition can be based on whether or not the element is empty.  An element
                   7283: which has no children or whose leaves are all empty is considered to be empty
1.18      cvs      7284: itself.  This condition is expressed by the <tt>Empty</tt> keyword, optionally
                   7285: preceded by the <tt>NOT</tt> keyword.</p>
                   7286: </div>
1.1       cvs      7287: 
1.18      cvs      7288: <div class="subsubsection">
1.1       cvs      7289: 
1.18      cvs      7290: <h4><a name="sectd5287">Conditions on the presence of comments</a></h4>
                   7291: <p>
1.1       cvs      7292: The condition can be based on the presence or absence of comments associated
                   7293: with the translated element.  This condition is expressed by the keyword
1.18      cvs      7294: <tt>Comment</tt>, optionally preceded by the keyword <tt>NOT</tt>.</p>
                   7295: </div>
1.1       cvs      7296: 
1.18      cvs      7297: <div class="subsubsection">
1.1       cvs      7298: 
1.18      cvs      7299: <h4><a name="sectd5288">Conditions on the presence of specific presentation
                   7300: rules</a></h4>
                   7301: <p>
1.1       cvs      7302: The condition can be based on the presence or absence of specific presentation
                   7303: rules associated with the translated element, whatever the rules, their value
                   7304: or their number.  This condition is expressed by the keyword
1.18      cvs      7305: <tt>Presentation</tt>, optionally preceded by the <tt>NOT</tt> keyword.</p>
                   7306: </div>
1.1       cvs      7307: 
1.18      cvs      7308: <div class="subsubsection">
1.1       cvs      7309: 
1.18      cvs      7310: <h4><a name="sectd5289">Conditions on the presence of logical
                   7311: attributes</a></h4>
                   7312: <p>
1.1       cvs      7313: In the same way, the condition can be based on the presence or absence of
                   7314: attributes associated with the translated elements, no matter what the
1.18      cvs      7315: attributes or their values.  The <tt>Attributes</tt> keyword expresses this
                   7316: condition.</p>
                   7317: </div>
1.1       cvs      7318: 
1.18      cvs      7319: <div class="subsubsection">
1.1       cvs      7320: 
1.18      cvs      7321: <h4><a name="sectd52810">Conditions on logical attributes</a></h4>
                   7322: <p>
1.1       cvs      7323: If the condition appears in the translation rules of an attribute, the
1.18      cvs      7324: <tt>FirstAttr</tt> and <tt>LastAttr</tt> keywords can be used to indicate that
1.1       cvs      7325: the rules must only be applied if this attribute is the first attribute for
                   7326: the translated element or if it is the last (respectively).  These conditions
1.18      cvs      7327: can also be inverted by the <tt>NOT</tt> keyword.</p>
                   7328: <p>
1.1       cvs      7329: Another type of condition can only be applied to the translation rules when
1.18      cvs      7330: the element being processed (or one of its ancestors if symbol <tt>*</tt> is
1.1       cvs      7331: missing) has a certain attribute, perhaps with a certain value or, in
                   7332: contrast, when the element does not have this attribute with this value.  The
                   7333: condition is specified by writing the name of the attribute after the keyword
1.18      cvs      7334: <tt>IF</tt> or <tt>AND</tt>.  The <tt>NOT</tt> keyword can be used to invert
1.1       cvs      7335: the condition.  If the translation rules must be applied to any element which
                   7336: has this attribute (or does not have it, if the condition is inverted) no
                   7337: matter what the attribute's value, the condition is complete.  If, in
                   7338: contrast, the condition applies to one or more values of the attribute, these
                   7339: are indicated after the name of the attribute, except for reference attributes
1.18      cvs      7340: which do not have values.</p>
                   7341: <p>
                   7342: The representation of the values of an <a name="relattr">attribute</a> in a
1.1       cvs      7343: condition depends on the attribute's type.  For attributes with enumerated or
                   7344: textual types, the value (a name or character string between apostrophes,
                   7345: respectively) is simply preceded by an equals sign.  For numeric attributes,
                   7346: the condition can be based on a single value or on a range of values.  In the
                   7347: case of a unique value, this value (an integer) is simply preceded by an
1.18      cvs      7348: equals sign.  Conditions based on ranges of values have several forms:</p>
                   7349: <ul>
                   7350: <li>
                   7351: all values less than a given value (the value is preceded by a ``less than''
                   7352: sign).
1.19      cvs      7353: </li>
1.18      cvs      7354: <li>
                   7355: all values greater than a given value (the value is preceded by a ``greater
1.1       cvs      7356: than'' sign).
1.19      cvs      7357: </li>
1.18      cvs      7358: <li>
                   7359: all values falling in an interval, bounds included.  The range of values is
                   7360: then specified <tt>IN [</tt>Minimum <tt>..</tt>Maximum<tt>]</tt>, where
1.2       cvs      7361: Minimum and Maximum are integers.
1.19      cvs      7362: </li>
1.18      cvs      7363: </ul>
                   7364: <p>
1.2       cvs      7365: All numeric values may be negative.  The integer is simply preceded by a minus
1.18      cvs      7366: sign.</p>
                   7367: <p>
                   7368: Both local and global attributes can be used in conditions.</p>
                   7369: </div>
1.1       cvs      7370: 
1.18      cvs      7371: <div class="subsubsection">
1.1       cvs      7372: 
1.18      cvs      7373: <h4><a name="sectd52811">Conditions on specific presentation rules</a></h4>
                   7374: <p>
1.1       cvs      7375: It is possible to apply translation rules only when the element being
                   7376: processed has or does not have a specific presentation rule, possibly with a
                   7377: certain value.  The condition is specified by writing the name of the
1.18      cvs      7378: presentation rule after the keyword <tt>IF</tt> or <tt>AND</tt>.  The
                   7379: <tt>NOT</tt> keyword can be used to invert the condition.  If the translation
1.1       cvs      7380: rules must be applied to any element which has this presentation rule (or does
                   7381: not have it, if the condition is inverted) no matter what the rule's value,
                   7382: the condition is complete.  If, in contrast, the condition applies to one or
                   7383: more values of the rule, these are indicated after the name of the
1.18      cvs      7384: attribute.</p>
                   7385: <p>
1.1       cvs      7386: The representation of presentation rule values in a condition is similar to
                   7387: that for attribute values.  The representation of these values depend on the
                   7388: type of the presentation rule. There are three categories of presentation
1.18      cvs      7389: rules:</p>
                   7390: <ul>
                   7391: <li>
                   7392: those taking numeric values (<tt>Size, Indent, LineSpacing, LineWeight</tt>),
1.19      cvs      7393: </li>
1.18      cvs      7394: <li>
                   7395: those with values taken from a predefined list (<tt>Adjust, Justify,
1.24      cvs      7396: Hyphenate, Style, Weight, Font, UnderLine, Thickness, LineStyle</tt>),
1.19      cvs      7397: </li>
1.18      cvs      7398: <li>
                   7399: those whose value is a name (<tt>FillPattern, Background, Foreground</tt>).
1.19      cvs      7400: </li>
1.18      cvs      7401: </ul>
                   7402: <p>
1.1       cvs      7403: For presentation rules which take numeric values, the condition can take a
                   7404: unique value or a range of values.  In the case of a unique value, this value
                   7405: (an integer) is simply preceded by an equals sign. Conditions based on ranges
1.18      cvs      7406: of values have several forms:</p>
                   7407: <ul>
                   7408: <li>
                   7409: all values less than a given value (the value is preceded by a ``less than''
                   7410: sign).
1.19      cvs      7411: </li>
1.18      cvs      7412: <li>
                   7413: all values greater than a given value (the value is preceded by a ``greater
1.1       cvs      7414: than'' sign).
1.19      cvs      7415: </li>
1.18      cvs      7416: <li>
                   7417: all values falling in an interval, bounds included.  The range of values is
                   7418: then specified <tt>IN [</tt>Minimum <tt>..</tt>Maximum<tt>]</tt>, where
1.2       cvs      7419: Minimum and Maximum are integers.
1.19      cvs      7420: </li>
1.18      cvs      7421: </ul>
                   7422: <p>
                   7423: Values for the <tt>Indent</tt>rule may be negative.  The integer is then
1.2       cvs      7424: simply preceded by a minus sign and represents how far the first line starts
1.18      cvs      7425: to the left of the other lines.</p>
                   7426: <p>
1.1       cvs      7427: For presentation rules whose values are taken from predefined lists, the value
                   7428: which satisfies the condition is indicated by an equals sign followed by the
1.18      cvs      7429: name of the value.</p>
                   7430: <p>
1.1       cvs      7431: For presentation rule whose values are names, the value which satisfies the
                   7432: condition is indicated by the equals sign followed by the value's name. The
1.18      cvs      7433: names of fill patterns (the <tt>FillPattern</tt> rule) and of colors (the
                   7434: <tt>Foreground</tt> and <tt>Background</tt> rules) known to Thot are the same
                   7435: as in the P language.</p>
                   7436: <p>
1.1       cvs      7437: The syntax of conditions based on the specific presentation is the same as the
1.18      cvs      7438: syntax used to express the <a href="#sectc5224">translation of specific
                   7439: presentation rules</a>.</p>
                   7440: <p>
1.1       cvs      7441: When a condition has only one rule, the condition is simply followed by that
                   7442: rule.  If it has several rules, they are placed after the condition between
1.18      cvs      7443: the keywords <tt>BEGIN</tt> and <tt>END</tt>.</p>
                   7444: <pre>   ConditionSeq = Condition [ 'AND' Condition ] .
1.1       cvs      7445:    Condition    = [ 'NOT' ] [ 'Target' ] Cond .
                   7446:    Cond         = CondElem / CondAscend .
                   7447:    CondElem     ='FirstRef' / 'LastRef' /
                   7448:                  'ExternalRef' /
                   7449:                  'Defined' /
                   7450:                  'Alphabet' '=' Alphabet /
                   7451:                  'ComputedPage' / 'StartPage' / 
                   7452:                  'UserPage' / 'ReminderPage' /
                   7453:                  'Empty' /
1.11      cvs      7454:                   ElemID /
1.1       cvs      7455:                  'FirstAttr' / 'LastAttr' .
                   7456:    CondAscend   = [ Ascend ] CondOnAscend .
                   7457:    Ascend       = '*' / 'Parent' / 'Ancestor' LevelOrType .
                   7458:    LevelOrType  = CondRelLevel / ElemID [ ExtStruct ] .
                   7459:    CondRelLevel = NUMBER .
                   7460:    CondOnAscend ='First' / 'Last' /
                   7461:                  'Referred' / 
                   7462:                   [ 'Immediately' ] 'Within' [ NumParent ]
                   7463:                                     ElemID [ ExtStruct ] /
                   7464:                  'Attributes' /
                   7465:                   AttrID [ RelatAttr ] /
                   7466:                  'Presentation' /
                   7467:                   PresRule /
                   7468:                  'Comment' .                  
                   7469:    NumParent    = [ GreaterLess ] NParent .
                   7470:    GreaterLess  = '>' / '&lt;' .
                   7471:    NParent      = NUMBER.
                   7472:    ExtStruct    = '(' ElemID ')' .
                   7473:    Alphabet     = NAME .
                   7474:    RelatAttr    ='=' Value /
                   7475:                  '>' [ '-' ] Minimum /
                   7476:                  '&lt;' [ '-' ] Maximum /
                   7477:                  'IN' '[' [ '-' ] MinInterval '..'
                   7478:                           [ '-' ] MaxInterval ']' .
                   7479:    Value        = [ '-' ] IntegerVal / TextVal / AttrValue .
                   7480:    Minimum      = NUMBER .
                   7481:    Maximum      = NUMBER .
                   7482:    MinInterval  = NUMBER .
                   7483:    MaxInterval  = NUMBER .
                   7484:    IntegerVal   = NUMBER .
                   7485:    TextVal      = STRING .
1.18      cvs      7486:    AttrValue    = NAME .</pre>
                   7487: <blockquote class="example">
                   7488: <p>
                   7489: <strong>Example:</strong></p>
                   7490: <p>
1.3       cvs      7491: Suppose that after each element of type Section_Title it is useful to produce
1.18      cvs      7492: the text <tt>\label{SectX}</tt> where <tt>X</tt> represents the section
                   7493: number, but only if the section is designated by one or more references in the
                   7494: document.  The following conditional rule produces this effect:</p>
                   7495: <pre>RULES
1.1       cvs      7496:   Section_Title :
                   7497:     IF Referred
1.18      cvs      7498:       Create ('\label{Sect' Value(UniqueSectNum) '}\12') After;</pre>
                   7499: <p>
                   7500: (the declaration of the <a href="#sectc5224"><tt>UniqueSectNum</tt>
                   7501: counter</a> is given above).  The string <tt>\12</tt> represents a line
                   7502: break.</p>
                   7503: </blockquote>
                   7504: <blockquote class="example">
                   7505: <p>
                   7506: <strong>Example:</strong></p>
                   7507: <p>
1.3       cvs      7508: Suppose that for elements of the Elmnt type it would be useful to produce a
                   7509: character indicating the value of the numeric attribute Level associated with
                   7510: the element: an  ``A'' for all values of Level less than 3, a ``B'' for values
                   7511: between 3 and 10 and a ``C'' for values greater than 10.  This can be achieved
1.18      cvs      7512: by writing the following rules for the Elmnt type:</p>
                   7513: <pre>RULES
1.1       cvs      7514:   Elmnt :
                   7515:     BEGIN
                   7516:     IF Level &lt; 3
                   7517:       Create 'A';
                   7518:     IF Level IN [3..10]
                   7519:       Create 'B';
                   7520:     IF Level > 10
                   7521:       Create 'C';
1.18      cvs      7522:     END;</pre>
                   7523: </blockquote>
                   7524: </div>
                   7525: </div>
1.1       cvs      7526: 
1.18      cvs      7527: <div class="subsection">
1.1       cvs      7528: 
1.18      cvs      7529: <h3><a name="sectc529">Translation rules</a></h3>
                   7530: <p>
1.14      cvs      7531: Fifteen types of translation rules can be associated with element types and
1.18      cvs      7532: attribute values.  They are the <tt>Create</tt>, <tt>Write</tt>,
                   7533: <tt>Read</tt>, <tt>Include</tt>, <tt>Get</tt>, <tt>Copy</tt>, <tt>Use</tt>,
                   7534: <tt>Remove</tt>, <tt>NoTranslation</tt>, <tt>NoLineBreak</tt>,
                   7535: <tt>ChangeMainFile</tt>, <tt>RemoveFile</tt>, <tt>Set</tt>, <tt>Add</tt>,
                   7536: <tt>Indent</tt>, rules.  Each rule has its own syntax, although they are all
                   7537: based on very similar models.</p>
                   7538: <pre>     SimpleRule = 'Create' [ 'IN' VarID ] Object
1.1       cvs      7539:                         [ Position ] ';' /
                   7540:                   'Write' Object [ Position ] ';' /
                   7541:                   'Read' BufferID [ Position ] ';' /
                   7542:                   'Include' File [ Position ] ';' /
                   7543:                   'Get' [ RelPosition ] ElemID 
                   7544:                         [ ExtStruct ] 
                   7545:                         [ Position ] ';' /
                   7546:                   'Copy' [ RelPosition ] ElemID 
                   7547:                         [ ExtStruct ] 
                   7548:                         [ Position ] ';' /
                   7549:                   'Use' TrSchema [ 'For' ElemID ] ';' /
                   7550:                   'Remove' ';' /
                   7551:                   'NoTranslation' ';' /
                   7552:                   'NoLineBreak' ';' /
                   7553:                   'ChangeMainFile' VarID [ Position ] ';' /
1.14      cvs      7554:                   'RemoveFile' VarID [ Position ] ';' /
1.10      cvs      7555:                   'Set' CounterID InitValue [ Position ] ';' /
                   7556:                   'Add' CounterID Increment [ Position ] ';' /
1.25    ! cvs      7557:                   'Indent' [ 'IN' VarID ] Indent [ Position ] ';' .</pre>
1.18      cvs      7558: </div>
                   7559: 
                   7560: <div class="subsection">
                   7561: 
                   7562: <h3><a name="sectc5210">The <tt>Create</tt> rule</a></h3>
                   7563: <p>
                   7564: The most frequently used rule is undoubtedly the <tt>Create</tt> rule, which
                   7565: generates fixed or variable text (called an <em>object</em>) in the output
1.1       cvs      7566: file.  The generated text can be made to appear either before or after the
                   7567: content of the element to which the rule applies. The rule begins with the
1.18      cvs      7568: <tt>Create</tt> keyword, followed by a specifier for the object and a keyword
                   7569: (<tt>Before</tt> or <tt>After</tt>) indicating the position of the generated
                   7570: text (<a href="#sectc5222">before or after</a> the element's content).  If the
1.1       cvs      7571: position is not indicated, the object will be generated before the element's
                   7572: content.  This rule, like all translation rules, is terminated by a
1.18      cvs      7573: semicolon.</p>
                   7574: <p>
                   7575: The <tt>Create</tt> keyword can be followed by the <tt>IN</tt> keyword and by
1.1       cvs      7576: the name of a variable.  This means that the text generated by the rule must
                   7577: not be written in the main output file, but in the file whose name is
1.18      cvs      7578: specified by the variable.</p>
                   7579: <p>
1.1       cvs      7580: This allows the translation program to generate text in different files during
1.14      cvs      7581: the same run. These files do not need to be explicitely declared or opened.
1.18      cvs      7582: They do not need to be closed either, but if they contain temporary data, they
                   7583: can be removed (see the <a href="#sectc5220a"><tt>RemoveFile</tt> rule</a>).
                   7584: As soon as the translation program executes a <tt>Create</tt> rule for a file
                   7585: that is not yet open, it opens the file. These files are closed when the
                   7586: translation is finished.</p>
                   7587: <pre>               'Create' [ 'IN' VarID ] Object
1.1       cvs      7588:                         [ Position ] ';'
                   7589:      Object   = ConstID / CharString /
                   7590:                 BufferID /
                   7591:                 VarID /
                   7592:                '(' Function &lt; Function > ')' /
1.21      cvs      7593:                 [ 'Translated' ] AttrID /
1.1       cvs      7594:                'Value' /
                   7595:                'Content' /
                   7596:                'Comment' / 
                   7597:                'Attributes' /
                   7598:                'Presentation' /
                   7599:                'RefId' /
                   7600:                'PairId' /
                   7601:                'FileDir' /
                   7602:                'FileName' /
                   7603:                'Extension' /
                   7604:                'DocumentName' /
                   7605:                'DocumentDir' /
                   7606:                 [ 'Referred' ] ReferredObject .
                   7607:      Position ='After' / 'Before' .
                   7608: 
                   7609:      ReferredObject = VarID /
                   7610:                 ElemID [ ExtStruct ] /
                   7611:                'RefId' /
                   7612:                'DocumentName' /
1.18      cvs      7613:                'DocumentDir' .</pre>
                   7614: <p>
                   7615: The object to be generated can be:</p>
                   7616: <ul>
                   7617: <li>
                   7618: a constant string, specified by its name if it is declared in the schema's
                   7619: <tt>CONST</tt> section, or given directly as a value between apostrophes;
1.19      cvs      7620: </li>
1.18      cvs      7621: <li>
                   7622: the contents of a buffer, designated by the name of the buffer;
1.19      cvs      7623: </li>
1.18      cvs      7624: <li>
                   7625: a variable, designated by its name if it is declared in the translation
                   7626: schema's <tt>VAR</tt> section, or given directly between parentheses.  The
                   7627: text generated is the value of that variable evaluated for the element to
                   7628: which the rule applies.
1.19      cvs      7629: </li>
1.18      cvs      7630: <li>
                   7631: the value of an attribute, if the element being translated has this attribute.
1.21      cvs      7632: The attribute is specified by its name. If it's a text attribute, it can be
                   7633: preceded by the <code>Translated</code> keyword, which causes the attribute
                   7634: value to be recoded using the text translation table defined by section
                   7635: <code><a href="#sectc5225">TEXTTRANSLATE</a></code>;
1.19      cvs      7636: </li>
1.18      cvs      7637: <li>
                   7638: the value of a specific presentation rule.  This object can only be generated
                   7639: if the translation rule is for a <a href="#prestransl">specific presentation
                   7640: rule</a>.  It is specified by the <tt>Value</tt> keyword;
1.19      cvs      7641: </li>
1.18      cvs      7642: <li>
                   7643: the element's content.  That is, the content of the leaves of the subtree of
                   7644: the translated element.  This is specified by the <tt>Content</tt> keyword;
1.19      cvs      7645: </li>
1.18      cvs      7646: <li>
                   7647: the comment attached to the element.  When the element doesn't have a comment,
                   7648: nothing is generated.  This is indicated by the <tt>Comment</tt> keyword;
1.19      cvs      7649: </li>
1.18      cvs      7650: <li>
                   7651: the translation of all attributes of the element (which is primarily used to
                   7652: apply the attribute translation rules <a href="#sectc5222">before</a> those of
                   7653: the element type).  This is specified by the <tt>Attributes</tt> keyword.
1.19      cvs      7654: </li>
1.18      cvs      7655: <li>
                   7656: the translation of all of the element's specific presentation rules (which is
                   7657: primarily used to apply the translation rules for the specific presentation
                   7658: rules <a href="#sectc5222">before</a> those of the element or its attributes).
                   7659: This option is specified by the <tt>Presentation</tt> keyword;
1.19      cvs      7660: </li>
1.18      cvs      7661: <li>
                   7662: The value of the reference's identifier.<br>
                   7663: Thot associates a unique identifier with each element in a document.  This
                   7664: identifier (called <em>reference's identifier</em> or <em>label</em>) is a
                   7665: character string containing the letter `L' followed by digits.  Thot uses it
                   7666: in references for identifying the referred element.<br>
                   7667: The <tt>RefId</tt> keyword produces the reference's identifier of the element
                   7668: to which the translation rule is applied, or the reference's identifier of its
                   7669: first ancestor that is referred by a reference or that can be referred by a
                   7670: reference.
1.19      cvs      7671: </li>
1.18      cvs      7672: <li>
                   7673: the value of a mark pair's unique identifier.  This may only be used for <a
                   7674: href="#sectd3285">mark pairs</a> and is indicated by the <tt>PairId</tt>
1.2       cvs      7675: keyword.
1.19      cvs      7676: </li>
1.18      cvs      7677: <li>
                   7678: the directory containing the file being generated (this string includes an
                   7679: ending '/', if it is not empty).  This is indicated by the <tt>FileDir</tt>
1.2       cvs      7680: keyword.
1.19      cvs      7681: </li>
1.18      cvs      7682: <li>
                   7683: the name of the file being generated (only the name, without the directory and
                   7684: without the extension). This is indicated by the <tt>FileName</tt> keyword.
1.19      cvs      7685: </li>
1.18      cvs      7686: <li>
                   7687: the extension of the file being generated (this string starts with a dot, if
                   7688: it is not empty).  This is indicated by the <tt>Extension</tt> keyword.
1.19      cvs      7689: </li>
1.18      cvs      7690: <li>
                   7691: the name of the document being translated.  This is indicated by the
                   7692: <tt>DocumentName</tt> keyword.
1.19      cvs      7693: </li>
1.18      cvs      7694: <li>
                   7695: the directory containing the document being translated.  This is indicated by
                   7696: the <tt>DocumentDir</tt> keyword.
1.19      cvs      7697: </li>
1.18      cvs      7698: </ul>
                   7699: <p>
1.1       cvs      7700: When the rule applies to a reference (an element or an attribute defined as a
                   7701: reference in the structure schema), it can generate a text related to the
1.21      cvs      7702: element referred by that reference.  The rule name is then followed by the
1.18      cvs      7703: <tt>Referred</tt> keyword and a specification of the object to be generated
                   7704: for the referred element.  This specification can be:</p>
                   7705: <ul>
                   7706: <li>
                   7707: the name of a variable.  The rule generates the value of that variable,
1.1       cvs      7708: computed for the referred element.
1.19      cvs      7709: </li>
1.18      cvs      7710: <li>
                   7711: an element type.  The rule generates the translation of the element of that
                   7712: type, which is in the subtree of the referred element.  If this element is not
                   7713: defined in the structure schema which corresponds to the translation schema
                   7714: (that is, an object defined in another schema), the element's type name must
                   7715: be followed by the name of its structure schema between parentheses.
1.19      cvs      7716: </li>
1.18      cvs      7717: <li>
                   7718: the <tt>RefId</tt> keyword.  The rule generates the reference's identifier of
                   7719: the referred element.
1.19      cvs      7720: </li>
1.18      cvs      7721: <li>
                   7722: the <tt>DocumentName</tt> keyword.  The rule generates the name of the
1.1       cvs      7723: document to which the referred element belongs.
1.19      cvs      7724: </li>
1.18      cvs      7725: <li>
                   7726: the <tt>DocumentDir</tt> keyword.  The rule generates the name of the
1.1       cvs      7727: directory that contains the document of the referred element.
1.19      cvs      7728: </li>
1.18      cvs      7729: </ul>
                   7730: </div>
1.1       cvs      7731: 
1.18      cvs      7732: <div class="subsection">
1.1       cvs      7733: 
1.18      cvs      7734: <h3><a name="sectc5211">The <tt>Write</tt> rule</a></h3>
                   7735: <p>
                   7736: The <tt>Write</tt> has the same syntax as the <tt>Create</tt> rule.  It also
1.1       cvs      7737: produces the same effect, but the generated text is displayed on the user's
                   7738: terminal during the translation of the document, instead of being produced in
                   7739: the translated document.  This is useful for helping the user keep track of
                   7740: the progress of the translation and for prompting the user on the terminal for
1.18      cvs      7741: input required by the <tt>Read</tt> rule.</p>
                   7742: <pre>               'Write' Object [ Position ] ';'</pre>
                   7743: <p>
1.1       cvs      7744: Notice: if the translator is launched by the editor (by the ``Save as''
1.18      cvs      7745: command), messages produced by the <tt>Write</tt> rule are not displayed.</p>
                   7746: <blockquote class="example">
                   7747: <p>
                   7748: <strong>Example:</strong></p>
                   7749: <p>
1.3       cvs      7750: To make the translator display the number of each section being translated on
1.18      cvs      7751: the user's terminal, the following rule is specified for the <tt>Section</tt>
                   7752: element type:</p>
                   7753: <pre>Section : BEGIN
1.1       cvs      7754:           Write VarSection;
                   7755:           ...
1.18      cvs      7756:           END;</pre>
                   7757: <p>
                   7758: (see <a href="#varsectexample">above</a> for the definition of the
                   7759: <tt>VarSection</tt> variable).</p>
                   7760: <p>
1.1       cvs      7761: To display text on the terminal before issuing a read operation with the
1.18      cvs      7762: <tt>Read</tt> rule, the following rule is used:</p>
                   7763: <pre>BEGIN
1.1       cvs      7764: Write 'Enter the name of the destination: ';
                   7765: ...
1.18      cvs      7766: END;</pre>
                   7767: </blockquote>
                   7768: </div>
                   7769: 
                   7770: <div class="subsection">
                   7771: 
                   7772: <h3><a name="sectc5212">The <tt>Read</tt> rule</a></h3>
                   7773: <p>
                   7774: The <tt>Read</tt> rule reads text from the terminal during the translation of
1.1       cvs      7775: the document and saves the text read in one of the buffers declared in the
1.18      cvs      7776: <tt>BUFFERS</tt> section of the schema.  The buffer to be used is indicated by
                   7777: its name, after the <tt>READ</tt> keyword.  This name can be followed, as in
                   7778: the <tt>Create</tt> and <tt>Write</tt> rules, by a keyword indicating if the
                   7779: read operation must be performed <tt>Before</tt> or <tt>After</tt> the
1.1       cvs      7780: translation of the element's content.  If this keyword is absent, the read
                   7781: operation is done beforehand.  The text is read into the buffer and remains
1.5       cvs      7782: there until a rule using the same buffer - possibly the same rule - is
1.18      cvs      7783: applied.</p>
                   7784: <pre>               'Read' BufferID [ Position ] ';'</pre>
                   7785: <blockquote class="example">
                   7786: <p>
                   7787: <strong>Example:</strong></p>
                   7788: <p>
1.3       cvs      7789: The following set of rules tells the user that the translator is waiting for
                   7790: the entry of some text, reads this text into a buffer and copies the text into
1.18      cvs      7791: the translated document.</p>
                   7792: <pre>BEGIN
1.1       cvs      7793: Write 'Enter the name of the destination: ';
                   7794: Read DestName;
                   7795: Create DestName;
                   7796: ...
1.18      cvs      7797: END;</pre>
                   7798: <p>
                   7799: (see <a href="#destname">above</a> the definition of <tt>DestName</tt>).</p>
                   7800: </blockquote>
                   7801: </div>
                   7802: 
                   7803: <div class="subsection">
                   7804: 
                   7805: <h3><a name="sectc5213">The <tt>Include</tt> rule</a></h3>
                   7806: <p>
                   7807: The <tt>Include</tt> rule, like the <tt>Create</tt> rule, is used to produce
1.1       cvs      7808: text in the translated document.  It inserts constant text which is not
                   7809: defined in the translation schema, but is instead taken from a file.  The
1.18      cvs      7810: file's name  is specified after the <tt>Include</tt> keyword, either directly
1.1       cvs      7811: as a character string between apostrophes or as the name of one of the buffers
1.18      cvs      7812: declared in the <tt>BUFFERS</tt> section of the schema.  In the latter case,
1.1       cvs      7813: the buffer is assumed to contain the file's name.  This can be used when the
                   7814: included file's name is known only at the moment of translation.  This only
1.18      cvs      7815: requires that the <tt>Include</tt> rule is preceded by a <tt>Read</tt> rule
                   7816: which puts the name of the file desired by the user into the buffer.</p>
                   7817: <p>
1.1       cvs      7818: Like the other rules, it is possible to specify whether the inclusion will
                   7819: occur before or after the element's content, with the default being before.
                   7820: The file inclusion is only done at the moment of translation, not during the
                   7821: compilation of the translation schema. Thus, the file to be included need not
                   7822: exist during the compilation, but it must be accessible at the time of
                   7823: translation.  Its contents can also be modified between two translations, thus
                   7824: producing different results, even if neither the document or the translation
1.18      cvs      7825: schema are modified.</p>
                   7826: <p>
1.1       cvs      7827: During translation, the file to be included is searched for along the schema
1.18      cvs      7828: directory path (indicated by the environment variable <tt>THOTSCH</tt>).  The
1.1       cvs      7829: file name is normally only composed of a simple name, without specification of
1.12      cvs      7830: a complete file path.  However, if the filename starts with a '/', it is
1.18      cvs      7831: considered as an absolute path.</p>
                   7832: <pre>                'Include' File [ Position ] ';'
1.6       cvs      7833:      File     = FileName / BufferID .
1.18      cvs      7834:      FileName = STRING .</pre>
                   7835: <blockquote class="example">
                   7836: <p>
                   7837: <strong>Example:</strong></p>
                   7838: <p>
1.3       cvs      7839: Suppose that it is desirable to print documents of the Article class with a
                   7840: formatter which requires a number of declarations and definitions at the
1.18      cvs      7841: beginning of the file.  The <tt>Include</tt>rule can be used to achieve this.
1.3       cvs      7842: All the declarations and definitions a replaced in a file called
1.18      cvs      7843: <tt>DeclarArt</tt> and then the <tt>Article</tt> element type is given the
                   7844: following rule:</p>
                   7845: <pre>Article : BEGIN
1.1       cvs      7846:           Include 'DeclarArt' Before;
                   7847:           ...
1.18      cvs      7848:           END;</pre>
                   7849: </blockquote>
                   7850: </div>
                   7851: 
                   7852: <div class="subsection">
                   7853: 
                   7854: <h3><a name="sectc5214">The <tt>Get</tt> rule</a></h3>
                   7855: <p>
                   7856: The <tt>Get</tt> rule is used to change the order in which the elements appear
1.1       cvs      7857: in the translated document.  More precisely, it produces  the translation of a
                   7858: specified element before or after the translation of the content of the
1.18      cvs      7859: element to which the rule applies.  The <tt>Before</tt> and <tt>After</tt>
1.1       cvs      7860: keywords are placed at the end of the rule to specify whether the operation
                   7861: should be performed before or after translation of the rule's element (the
                   7862: default is before). The type of the element to be moved must be specified
1.18      cvs      7863: after the <tt>Get</tt> keyword, optionally preceded by a keyword indicating
                   7864: where the element will be found in the logical structure of the document:</p>
                   7865: <dl>
                   7866: <dt><tt>Included</tt></dt>
                   7867: <dd>
                   7868: The element to be moved is the first element of the indicated type which is
1.1       cvs      7869: found inside the element to which the rule applies.
1.18      cvs      7870: </dd>
                   7871: <dt><tt>Referred</tt></dt>
                   7872: <dd>
                   7873: This keyword can only be used if the rule applies to a reference element. The
                   7874: element to be moved is either the element designated by the reference (if that
                   7875: element is of the specified type), or the first element of the desired type
                   7876: contained within the element designated by the reference.
                   7877: </dd>
                   7878: <dt>no keyword</dt>
                   7879: <dd>
                   7880: If the element to be moved is an associated element, defined in the <a
                   7881: href="#sectc314"><tt>ASSOC</tt> section</a> of the structure schema, all
1.2       cvs      7882: associated elements of this type which have not been translated yet are then
                   7883: translated.  Certain elements may in fact have already been translated by a
1.18      cvs      7884: <tt>Get Referred</tt> rule.
                   7885: <p>
1.1       cvs      7886: If the element to be moved is not an associated element, the translator takes
                   7887: the first element of the indicated type from among the siblings of the rule's
                   7888: element.  This is primarily used to change the order of the components of an
1.18      cvs      7889: aggregate.</p>
                   7890: </dd>
                   7891: </dl>
                   7892: <p>
1.1       cvs      7893: If the element to be moved is defined in a structure schema which is not the
                   7894: one which corresponds to the translation schema (in the case of an included
                   7895: object with a different schema), the type name of this element must be
                   7896: followed, between parentheses, by the name of the structure schema which
1.18      cvs      7897: defines it.</p>
                   7898: <pre>                   'Get' [ RelPosition ] ElemID 
1.6       cvs      7899:                          [ ExtStruct ]
                   7900:                          [ Position ] ';' /
                   7901:      RelPosition = 'Included' / 'Referred' .
1.18      cvs      7902:      ExtStruct   = '(' ElemID ')' .</pre>
                   7903: <p>
                   7904: The <tt>Get</tt> rule has no effect if the element which it is supposed to
1.1       cvs      7905: move has already been translated.  Thus, the element will not be duplicated.
                   7906: It is generally best to associate the rule with the first element which will
                   7907: be encountered by the translator in its traversal of the document.  Suppose an
1.18      cvs      7908: aggregate has two elements <tt>A</tt> and <tt>B</tt>, with <tt>A</tt>
1.1       cvs      7909: appearing first in the logical structure.  To permute these two elements, a
1.18      cvs      7910: <tt>Get B before</tt> rule should be associated with the <tt>A</tt> element
                   7911: type, not the inverse.  Similarly, a rule of the form <tt>Get Included X
                   7912: After</tt>, even though syntactically correct, makes no sense since, by the
1.1       cvs      7913: time it will be applied, after the translation of the contents of the element
1.18      cvs      7914: to which it is attached, the <tt>X</tt> element will already have been
                   7915: translated.</p>
                   7916: <p>
                   7917: The <tt>Get</tt> rule is the only way to obtain the translation of the
1.1       cvs      7918: associated elements.  In fact, the translator only traverses the primary tree
                   7919: of the document and thus does not translate the associated elements, except
1.18      cvs      7920: when the translation is explicitly required by a <tt>Get Referred Type</tt> or
                   7921: <tt>Get Type</tt> rule where <tt>Type</tt> is an associated element type.</p>
                   7922: <blockquote class="example">
                   7923: <p>
                   7924: <strong>Example:</strong></p>
                   7925: <p>
1.3       cvs      7926: The structure schema defined figures as associated element which are composed
                   7927: of some content and a caption.  Moreover, it is possible to make references to
1.18      cvs      7928: figures, using elements of the <tt>RefFigure</tt> type:</p>
                   7929: <pre>     ...
1.1       cvs      7930:      RefFigure = REFERENCE(Figure);
                   7931: ASSOC
1.6       cvs      7932:      Figure    = BEGIN
                   7933:                  Content = NATURE;
                   7934:                  Caption = Text;
                   7935:                  END;
1.18      cvs      7936:      ...</pre>
                   7937: <p>
1.3       cvs      7938: Suppose it would be useful to make a figure appear in the translated document
                   7939: at the place in the text where the first reference to the figure is made.  If
                   7940: some figures are not referenced, then they would appear at the end of the
                   7941: document.  Also, each figure's caption should appear before the content.  The
1.18      cvs      7942: following rules in the translation schema will produce this result:</p>
                   7943: <pre>Article :   BEGIN
1.1       cvs      7944:             ...
                   7945:             Get Figures After;
                   7946:             END;
                   7947: RefFigure : BEGIN
                   7948:             If FirstRef Get Referred Figure;
                   7949:             ...
                   7950:             END;
                   7951: Content :   BEGIN
                   7952:             Get Caption Before;
                   7953:             ...
1.18      cvs      7954:             END;</pre>
                   7955: </blockquote>
                   7956: </div>
                   7957: 
                   7958: <div class="subsection">
                   7959: 
                   7960: <h3><a name="sectc5215">The <tt>Copy</tt> rule</a></h3>
                   7961: <p>
                   7962: Like the <tt>Get</tt> rule, the <tt>Copy</tt> rule generates the translation
1.1       cvs      7963: of a specified element, but it acts even if the element has already been
                   7964: translated and it allows to copy it or to translate it later. Both rules have
1.18      cvs      7965: the same syntax.</p>
                   7966: <pre>              'Copy' [ RelPosition ] ElemID 
                   7967:                      [ ExtStruct ] [ Position ] ';'</pre>
                   7968: </div>
                   7969: 
                   7970: <div class="subsection">
                   7971: 
                   7972: <h3><a name="sectc5216">The <tt>Use</tt> rule</a></h3>
                   7973: <p>
                   7974: The <tt>Use</tt> rule specifies the translation schema to be applied to
1.1       cvs      7975: objects of a certain class that are part of the document.  This rule only
                   7976: appears in the rules for the root element of the document (the first type
1.18      cvs      7977: defined after the <tt>STRUCT</tt> keyword in the structure schema) or the
1.1       cvs      7978: rules of an element defined by an external structure (by another structure
1.18      cvs      7979: schema).  Also, the <tt>Use</tt> rule cannot be conditional.</p>
                   7980: <p>
1.1       cvs      7981: If the rule is applied to an element defined by an external structure, the
1.18      cvs      7982: <tt>Use</tt> keyword is simply followed by the name of the translation schema
1.1       cvs      7983: to be used for element constructed  according to that external structure.  If
                   7984: the rule is applied to the document's root element, it is formed by the
1.18      cvs      7985: <tt>Use</tt> keyword followed by the translation schema's name, the
                   7986: <tt>For</tt> keyword and the name of the external structure to which the
                   7987: indicated translation schema should be applied.</p>
                   7988: <pre>               'Use' TrSchema [ 'For' ElemID ] ';'
                   7989:      TrSchema = NAME .</pre>
                   7990: <p>
                   7991: If no <tt>Use</tt> rule defines the translation schema to be used for an
1.1       cvs      7992: external structure which appears in a document, the translator asks the user,
                   7993: during the translation process, which schema should be used. Thus, it is not
1.18      cvs      7994: necessary to give the translation schema a <tt>Use</tt> rule for every
1.1       cvs      7995: external structure used, especially when the choice of translation schemas is
1.18      cvs      7996: to be left to the user.</p>
                   7997: <p>
1.1       cvs      7998: Notice: if the translator is launched by the editor (by the ``Save as''
1.18      cvs      7999: command), prompts are not displayed.</p>
                   8000: <blockquote class="example">
                   8001: <p>
                   8002: <strong>Example:</strong></p>
                   8003: <p>
                   8004: The <tt>Article</tt> structure schema uses the <tt>Formula</tt> external
                   8005: structure, defined by another structure schema, for mathematical formulas:</p>
                   8006: <pre>STRUCTURE Article;
1.1       cvs      8007:    ...
                   8008: STRUCT
                   8009:    Article = ...
                   8010:    ...
                   8011:    Formula_in_text  = Formula;
                   8012:    Isolated_formula = Formula;
                   8013:    ...
1.18      cvs      8014: END</pre>
                   8015: <p>
                   8016: Suppose that it would be useful to use the <tt>FormulaT</tt> translation
                   8017: schema for the formulas of an article.  This can be expressed in two different
                   8018: ways in the <tt>Article</tt> class translation schema, using the rules:</p>
                   8019: <pre>RULES
1.1       cvs      8020:     Article :
1.18      cvs      8021:        Use FormulaT for Formula;</pre>
                   8022: <p>
                   8023: or:</p>
                   8024: <pre>RULES
1.1       cvs      8025:     ...
                   8026:     Formula :
1.18      cvs      8027:        Use FormulaT;</pre>
                   8028: </blockquote>
                   8029: </div>
                   8030: 
                   8031: <div class="subsection">
                   8032: 
                   8033: <h3><a name="sectc5217">The <tt>Remove</tt> rule</a></h3>
                   8034: <p>
                   8035: The <tt>Remove</tt> rule indicates that nothing should be generated, in the
1.1       cvs      8036: translated document, for the content of the element to which the rule applies.
                   8037: The content of that element is simply ignored by the translator.  This does
                   8038: not prevent the generation of text for the element itself, using the
1.18      cvs      8039: <tt>Create</tt> or <tt>Include</tt> rules, for example.</p>
                   8040: <p>
                   8041: The <tt>Remove</tt> rule is simply written with the <tt>Remove</tt> keyword.
                   8042: It is terminated, like all rules, by a semicolon.</p>
                   8043: <pre>               'Remove' ';'</pre>
                   8044: </div>
                   8045: 
                   8046: <div class="subsection">
                   8047: 
                   8048: <h3><a name="sectc5218">The <tt>NoTranslation</tt> rule</a></h3>
                   8049: <p>
                   8050: The <tt>NoTranslation</tt> rule indicates to the translator that it must not
1.1       cvs      8051: translate the content of the leaves of the element to which it applies. In
1.18      cvs      8052: contrast to the <tt>Remove</tt> rule, it does not suppress the content of the
1.1       cvs      8053: element, but it inhibits the translation of character strings, symbols, and
                   8054: graphical elements contained in the element.  These are retrieved so that
1.18      cvs      8055: after the translation of the document, the rules of the <a
                   8056: href="#sectc5225"><tt>TEXTTRANSLATE</tt>, <tt>SYMBTRANSLATE</tt> and
                   8057: <tt>GRAPHTRANSLATE</tt> sections</a> will not be applied to them.</p>
                   8058: <p>
                   8059: The <tt>NoTranslation</tt> rule is written with the <tt>NoTranslation</tt>
                   8060: keyword followed by a semicolon.</p>
                   8061: <pre>               'NoTranslation' ';'</pre>
                   8062: </div>
                   8063: 
                   8064: <div class="subsection">
                   8065: 
                   8066: <h3><a name="sectc5219">The <tt>NoLineBreak</tt> rule</a></h3>
                   8067: <p>
                   8068: The <tt>NoLineBreak</tt> rule indicates to the translator that it must not
1.1       cvs      8069: generate additional line breaks in the output produced for the element to
1.18      cvs      8070: which it applies.  This is as if it was an <a href="#sectc522">instruction
                   8071: <tt>LINELENGTH 0;</tt></a> at the beginning of the translation schema, but
                   8072: only for the current element.</p>
                   8073: <p>
                   8074: The <tt>NoLineBreak</tt> rule is written with the <tt>NoLineBreak</tt> keyword
                   8075: followed by a semicolon.</p>
                   8076: <pre>               'NoLineBreak' ';'</pre>
                   8077: </div>
1.1       cvs      8078: 
1.18      cvs      8079: <div class="subsection">
1.1       cvs      8080: 
1.18      cvs      8081: <h3><a name="sectc5220">The <tt>ChangeMainFile</tt> rule</a></h3>
                   8082: <p>
1.1       cvs      8083: When the translation program starts, it opens a main output file, whose name
1.18      cvs      8084: is given as a parameter of the translator.  All <a
                   8085: href="#sectc5210"><tt>Create</tt> rules</a> without explicit indication of the
                   8086: output file write sequentially in this file.  When a <tt>ChangeMainFile</tt>
                   8087: rule is executed, the main output file is closed and it is replaced by a new
                   8088: one, whose name is specified in the <tt>ChangeMainFile</tt> rule.  The
                   8089: <tt>Create</tt> rules without indication of the output file that are then
                   8090: executed write in this new file.  Several <tt>ChangeMainFile</tt> rules can be
                   8091: executed during the same translation, for dividing the main output into
                   8092: several files.</p>
                   8093: <p>
                   8094: This rule is written with the <tt>ChangeMainFile</tt> keyword followed by the
1.14      cvs      8095: name of a variable that specifies the name of the new main file. The keyword
1.18      cvs      8096: <tt>Before</tt> or <tt>After</tt> can be placed at the end of the rule to
1.1       cvs      8097: specify whether the operation should be performed before or after translation
                   8098: of the rule's element (the default is before). This rule, like all translation
1.18      cvs      8099: rules, is terminated by a semicolon.</p>
                   8100: <pre>               'ChangeMainFile' VarID [ Position ] ';'</pre>
                   8101: <blockquote class="example">
                   8102: <p>
                   8103: <strong>Example:</strong></p>
                   8104: <p>
1.3       cvs      8105: To generate the translation of each section in a different file, the following
1.18      cvs      8106: rule can be associated with type <tt>Section</tt>.  That rule uses the <a
                   8107: href="#varoutputfile"><tt>VarOutpuFile</tt> variable</a> defined above.</p>
                   8108: <pre>     Section:
                   8109:          ChangeMainFile VarOutpuFile Before;</pre>
                   8110: <p>
                   8111: If <tt>output.txt</tt> is the name of the output file specified when starting
1.3       cvs      8112: the translation program, translated sections are written in files
1.18      cvs      8113: <tt>output1.txt</tt>, <tt>output2.txt</tt>, etc.</p>
                   8114: </blockquote>
                   8115: </div>
1.1       cvs      8116: 
1.18      cvs      8117: <div class="subsection">
1.14      cvs      8118: 
1.18      cvs      8119: <h3><a name="sectc5220a">The <tt>RemoveFile</tt> rule</a></h3>
                   8120: <p>
1.14      cvs      8121: Files may be used for storing temporary data that are no longer needed when
1.18      cvs      8122: the translation of a document is complete.  These files may be removed by the
                   8123: <tt>RemoveFile</tt> rule.</p>
                   8124: <p>
                   8125: This rule is written with the <tt>RemoveFile</tt> keyword followed by the name
                   8126: of a variable that specifies the name of the file to be removed.  The keyword
                   8127: <tt>Before</tt> or <tt>After</tt> can be placed at the end of the rule to
                   8128: specify whether the operation should be performed before or after translation
                   8129: of the rule's element (the default is before).  This rule, like all
                   8130: translation rules, is terminated by a semicolon.</p>
                   8131: <pre>               'RemoveFile' VarID [ Position ] ';'</pre>
                   8132: </div>
                   8133: 
                   8134: <div class="subsection">
                   8135: 
                   8136: <h3><a name="sectc5221">The <tt>Set</tt> and <tt>Add</tt> rules</a></h3>
                   8137: <p>
                   8138: The <tt>Set</tt> and <tt>Add</tt> rules are used for modifying the value of
                   8139: counters that have no <a href="#sectc524">counting function</a>.  Only this
                   8140: type of counter can be used in the <tt>Set</tt> and <tt>Add</tt> rules.</p>
                   8141: <p>
                   8142: Both rules have the same syntax: after the keyword <tt>Set</tt> or
                   8143: <tt>Add</tt> appear the counter name and the value to assign to the counter
                   8144: (<tt>Set</tt> rule) or the value to be added to the counter (<tt>Add</tt>
                   8145: rule).  The keyword <tt>Before</tt> or <tt>After</tt> can follow that value to
1.1       cvs      8146: indicate when the rule must be applied: before or after the element's content
1.18      cvs      8147: is translated. By default, <tt>Before</tt> is assumed.  A semicolon terminates
                   8148: the rule.</p>
                   8149: <pre>               'Set' CounterID InitValue [ Position ] ';' /
                   8150:                'Add' CounterID Increment [ Position ] ';'</pre>
                   8151: </div>
                   8152: 
                   8153: <div class="subsection">
                   8154: 
                   8155: <h3><a name="sectc5221a">The <tt>Indent</tt> rule</a></h3>
                   8156: <p>
                   8157: The <tt>Indent</tt> rule is used to modify the value of text indentation in
                   8158: the output files.</p>
                   8159: <p>
                   8160: Each time the translator creates a new line in an output file, it generates a
                   8161: variable number of space characters at the beginning of the new line.  By
1.25    ! cvs      8162: default, the number of these characters (the indentation value) is 0.  It can
        !          8163: be changed with the <tt>Indent</tt> rule.</p>
1.18      cvs      8164: <p>
1.25    ! cvs      8165: In its simple form, the rule begins with the <tt>Indent</tt> keyword,
        !          8166: followed by the indentation sign (optional) and value and a keyword
        !          8167: <tt>Before</tt> or <tt>After</tt> indicating that the indentation should
        !          8168: be changed <a href="#sectc5222">before or after</a> the element's content
        !          8169: is generated.  If the position is not indicated, the indentation is changed
        !          8170: before the element's content is generated.  This rule, like all translation
        !          8171: rules, is terminated by a semicolon.</p>
1.18      cvs      8172: <p>
                   8173: The indentation value is indicated by an integer, which is the number of space
                   8174: characters to be generated at the beginning of each new line. A sign
                   8175: (<tt>+</tt> or <tt>-</tt>) can appear before the integer to indicate that the
                   8176: value is relative: the current value of indentation is incremented (if sign is
                   8177: <tt>+</tt>) or decremented (if sign is <tt>-</tt>) by the specified value.</p>
                   8178: <p>
1.25    ! cvs      8179: Keyword <tt>Suspend</tt> or <tt>Resume</tt> can appear instead of the
        !          8180: (possibly signed) identation value.  <tt>Suspend</tt> means that the new
        !          8181: indentation value to be used is zero until another <tt>Indent</tt> rule
        !          8182: is executed and changes the indentation value. <tt>Resume</tt> means that
        !          8183: the indentation value that was used before the last <tt>Indent Suspend</tt>
        !          8184: was executed becomes the new value.  Only one <tt>Suspend</tt> can be used
        !          8185: before a <tt>Resume</tt>; <tt>Supend</tt>-<tt>Resume</tt> pairs can not be
        !          8186: nested.
        !          8187: <p>
1.18      cvs      8188: Like the <a href="#sectc5210"><tt>Create</tt> rule</a>, the <tt>Indent</tt>
                   8189: keyword can be followed by the <tt>IN</tt> keyword and by the name of a <a
                   8190: href="#sectc526">variable</a>.  This means that the rule must not change
1.10      cvs      8191: indentation in the main output file, but in the file whose name is specified
                   8192: by the variable (by default, indentation is changed in the main output
1.18      cvs      8193: file).</p>
1.25    ! cvs      8194: <pre>               'Indent' [ 'IN' VarID ] Indent [ Position ] ';' .
1.10      cvs      8195: 
1.25    ! cvs      8196: Indent        = 'Suspend' / 'Resume' / [ IndentSign ] IndentValue .
1.10      cvs      8197: IndentSign    = '+' / '-' .
1.18      cvs      8198: IndentValue   = NUMBER .</pre>
                   8199: </div>
1.10      cvs      8200: 
1.18      cvs      8201: <div class="subsection">
1.1       cvs      8202: 
1.18      cvs      8203: <h3><a name="sectc5222">Rule application order</a></h3>
                   8204: <p>
1.1       cvs      8205: The translator translates the elements which comprise the document in the
1.18      cvs      8206: order induced by the tree structure, except when the <tt>Get</tt> rule is used
1.1       cvs      8207: to change the order of translation.  For each element, the translator first
                   8208: applies the rules specified for the element's type that must be applied before
1.18      cvs      8209: translation of the element's content (rules ending with the <tt>Before</tt>
1.1       cvs      8210: keyword or which have no position keyword).  If several rules meet these
                   8211: criteria, the translator applies them in the order in where they appear in the
1.18      cvs      8212: translation schema.</p>
                   8213: <p>
                   8214: It then applies all <a href="#sectc5223">rules for the attributes</a> which
1.1       cvs      8215: the element has and which must be applied before the translation of the
1.18      cvs      8216: element's content (rules ending with the <tt>Before</tt> keyword or which have
1.1       cvs      8217: no position keyword).  For one attribute value, the translator applies the
1.18      cvs      8218: rules in the order in which they are defined in the translation schema.</p>
                   8219: <p>
1.1       cvs      8220: The same procedure is followed with translation rules for specific
1.18      cvs      8221: presentations.</p>
                   8222: <p>
                   8223: Next, the element's content is translated, as long as a <tt>Remove</tt> rule
                   8224: does not apply.</p>
                   8225: <p>
1.1       cvs      8226: In the next step, the translator applies rules for the specific presentation
                   8227: of the element that are to be applied after translation of the content (rules
1.18      cvs      8228: which end with the <tt>After</tt> keyword).  The rules for each type of
1.1       cvs      8229: presentation rule or each value are applied in the order in which the
1.18      cvs      8230: translation appear in the schema.</p>
                   8231: <p>
1.1       cvs      8232: Then, the same procedure is followed for translation rules for attributes of
1.18      cvs      8233: the element.</p>
                   8234: <p>
1.1       cvs      8235: Finally, the translator applies rules for the element which must be applied
                   8236: after translation of the element's content.  These rules are applied in the
                   8237: order that they appear in the translation schema.  When the translation of an
                   8238: element is done, the translator procedes to translate the following
1.18      cvs      8239: element.</p>
                   8240: <p>
                   8241: This order can be changed with the <tt>Attributes</tt> and
                   8242: <tt>Presentation</tt> options of the <a href="#sectc5210"><tt>Create</tt>
                   8243: rule</a>.</p>
                   8244: </div>
1.1       cvs      8245: 
1.18      cvs      8246: <div class="subsection">
1.1       cvs      8247: 
1.18      cvs      8248: <h3><a name="sectc5223">Translation of logical attributes</a></h3>
                   8249: <p>
1.1       cvs      8250: After the rules for the element types, the translation schema defines rules
1.18      cvs      8251: for attribute values.  This section begins with the <tt>ATTRIBUTES</tt>
1.1       cvs      8252: keyword and is composed of a sequence of rule blocks each preceded by an
1.18      cvs      8253: attribute name and an optional value or value range.</p>
                   8254: <p>
1.1       cvs      8255: If the attribute's name appears alone before the rule block, the rule are
                   8256: applied to all element which have the attribute, no matter what value the
                   8257: attribute has.  In this case, the attribute name is followed by a colon before
1.18      cvs      8258: the beginning of the rule block.</p>
                   8259: <p>
1.1       cvs      8260: The attribute's name can be followed by the name of an element type between
                   8261: parentheses.  This says, as in presentation schemas, that the rule block which
                   8262: follows applies not to the element which has the attribute, but to its
1.18      cvs      8263: descendants of the type indicated between the parentheses.</p>
                   8264: <p>
1.1       cvs      8265: If values are given after the attribute name (or after the name of the element
                   8266: type), the rules are applied only when the attribute has the indicated values.
                   8267: The same attribute can appear several times, with different values and
                   8268: different translation rules.  Attribute values are indicated in the same way
1.18      cvs      8269: as in <a href="#sectc528">conditions</a> and are followed by a colon before
                   8270: the block of rules.</p>
                   8271: <p>
1.1       cvs      8272: The rule block associated with an attribute is either a simple rule or a
1.18      cvs      8273: sequence of rules delimited by the <tt>BEGIN</tt> and <tt>END</tt> keywords.
                   8274: Note that rules associated with attribute values cannot be conditional.</p>
                   8275: <p>
1.1       cvs      8276: Translation rules are not required for all attributes (or their values)
                   8277: defined in a structure schema.  Only those attributes for which a particular
                   8278: action must be performed by the translator must have such rules.  The rules
1.18      cvs      8279: that can be used are those described above, from <a
                   8280: href="#sectc5210"><tt>Create</tt></a> to <a
                   8281: href="#sectc5218"><tt>NoTranslation</tt></a>.</p>
                   8282: <pre>     AttrSeq       = TransAttr &lt; TransAttr > .
1.1       cvs      8283:      TransAttr     = AttrID [ '(' ElemID ')' ] 
                   8284:                      [ RelatAttr ] ':' RuleSeq .
                   8285:      AttrID        = NAME .
1.18      cvs      8286:      ElemID        = NAME .</pre>
                   8287: <blockquote class="example">
                   8288: <p>
                   8289: <strong>Example:</strong></p>
                   8290: <p>
1.3       cvs      8291: The structure defined the ``Language'' attribute which can take the values
                   8292: ``French'' and ``English''.  To have the French parts of the original document
                   8293: removed and prevent the translation of the leaves of the English parts, the
1.18      cvs      8294: following rules would be used:</p>
                   8295: <pre>ATTRIBUTES
1.1       cvs      8296:    Language=French :
                   8297:       Remove;
                   8298:    Language=English :
1.18      cvs      8299:       NoTranslation;</pre>
                   8300: </blockquote>
                   8301: </div>
1.1       cvs      8302: 
1.18      cvs      8303: <div class="subsection">
1.1       cvs      8304: 
1.18      cvs      8305: <h3><a name="sectc5224">Translation of specific presentations</a></h3>
                   8306: <p>
1.1       cvs      8307: After the rules for attributes, the translation schema defines rules for the
1.18      cvs      8308: specific presentation.  This section begins with the <tt>PRESENTATION</tt>
1.1       cvs      8309: keyword and is composed of a sequence of translation rule blocks each preceded
                   8310: by a presentation rule name, optionally accompanied by a part which depends on
1.18      cvs      8311: the particular presentation rule.</p>
                   8312: <p>
1.1       cvs      8313: Each of these translation rule blocks is applied when the translator operates
                   8314: on an element which has a specific presentation rule of the type indicated at
                   8315: the head of the block.  Depending on the type of the specific presentation
                   8316: rule, it is possible to specify values of the presentation rule for which the
1.18      cvs      8317: translation rule block should be applied.</p>
                   8318: <p>
                   8319: There are three categories of the presentation rules:</p>
                   8320: <ul>
                   8321: <li>
                   8322: rules taking numeric values: <tt>Size</tt>, <tt>Indent</tt>,
                   8323: <tt>LineSpacing</tt>, <tt>LineWeight</tt>,
1.19      cvs      8324: </li>
1.18      cvs      8325: <li>
                   8326: rules whose values are taken from a predefined list (i.e. whose type is an
                   8327: enumeration): <tt>Adjust</tt>, <tt>Justify</tt>, <tt>Hyphenate,/TT>,
1.24      cvs      8328: <tt>Style</tt>, <tt>Weight</tt>, <tt>Font</tt>, <tt>UnderLine</tt>,
                   8329: <tt>Thickness</tt>, <tt>LineStyle</tt>,</tt>
1.19      cvs      8330: </li>
1.18      cvs      8331: <li>
                   8332: rules whose value is a name: <tt>FillPattern</tt>, <tt>Background</tt>,
                   8333: <tt>Foreground</tt>.
1.19      cvs      8334: </li>
1.18      cvs      8335: </ul>
                   8336: <p>
1.1       cvs      8337: For presentation rules of the first category, the values which provoke
                   8338: application of the translation rules are indicated in the same manner as for
1.18      cvs      8339: <a href="#relattr">numeric attributes</a>.  This can be either a unique value
1.1       cvs      8340: or range of values.  For a unique value, the value (an integer) is simply
                   8341: preceded by an equals sign.  Value ranges can be specified in one of three
1.18      cvs      8342: ways:</p>
                   8343: <ul>
                   8344: <li>
                   8345: all values less than a given value (this value is preceded by a ``less than''
                   8346: sign '<tt>&lt;</tt>'),
1.19      cvs      8347: </li>
1.18      cvs      8348: <li>
                   8349: all values greater than a given value (this value is preceded by a` `greater
                   8350: than'' sign '<tt>></tt>'),
1.19      cvs      8351: </li>
1.18      cvs      8352: <li>
                   8353: all values falling in an interval, bounds included.  The range of values is
                   8354: then specified <tt>IN [</tt>Minimum<tt>..</tt>Maximum<tt>]</tt>, where Minimum
                   8355: and Maximum are integers.
1.19      cvs      8356: </li>
1.18      cvs      8357: </ul>
                   8358: <p>
1.2       cvs      8359: All numeric values can be negative, in which case the integer is preceded by a
1.18      cvs      8360: minus sign.  All values must be given in typographers points.</p>
                   8361: <p>
1.1       cvs      8362: For presentation rules whose values are taken from a predefined list, the
                   8363: value which provokes application of the translation rules is simply indicated
1.18      cvs      8364: by the equals sign followed by the name of the value.</p>
                   8365: <p>
1.1       cvs      8366: For presentation rules whose values are names, the value which provokes the
                   8367: application of translation rules is simply indicated by the equals sign
                   8368: followed by the name of the value.  The names of the fill patterns (the
1.18      cvs      8369: <tt>FillPattern</tt> rule) and of the colors (the <tt>Foreground</tt> and
                   8370: <tt>Background</tt> rules) used in Thot are the same as in the P language.</p>
                   8371: <pre>     PresSeq        = PresTrans &lt; PresTrans > .
1.1       cvs      8372:      PresTrans      = PresRule ':' RuleSeq .
                   8373:      PresRule       = 'Size' [ PresRelation ] /
                   8374:                       'Indent' [ PresRelation ] /
                   8375:                       'LineSpacing' [ PresRelation ] /
                   8376:                       'Adjust' [ '=' AdjustVal ] /
                   8377:                       'Justify' [ '=' BoolVal ] /
                   8378:                       'Hyphenate' [ '=' BoolVal ] /
                   8379:                       'Style' [ '=' StyleVal ] /
1.24      cvs      8380:                       'Weight' [ '=' WeightVal ] /
1.1       cvs      8381:                       'Font' [ '=' FontVal ] /
                   8382:                       'UnderLine' [ '=' UnderLineVal ] /
                   8383:                       'Thickness' [ '=' ThicknessVal ] /
                   8384:                       'LineStyle' [ '=' LineStyleVal ] /
                   8385:                       'LineWeight' [ PresRelation ] /
                   8386:                       'FillPattern' [ '=' Pattern ] /
                   8387:                       'Background' [ '=' Color ] /
                   8388:                       'Foreground' [ '=' Color ] .
                   8389: 
                   8390:      PresRelation   = '=' PresValue /
                   8391:                       '>' [ '-' ] PresMinimum /
                   8392:                       '&lt;' [ '-' ] PresMaximum /
                   8393:                       'IN' '[' [ '-' ] PresIntervalMin '..'
                   8394:                               [ '-' ] PresIntervalMax ']' .
                   8395:      AdjustVal      = 'Left' / 'Right' / 'VMiddle' / 
                   8396:                       'LeftWithDots' .
                   8397:      BoolVal        = 'Yes' / 'No' .
1.24      cvs      8398:      StyleVal       = 'Roman' / 'Italics' / 'Oblique' .
                   8399:      WeightVal      = 'Normal' / 'Bold' .
1.1       cvs      8400:      FontVal        = 'Times' / 'Helvetica' / 'Courier' .
                   8401:      UnderLineVal   = 'NoUnderline' / 'UnderLined' /
                   8402:                       'OverLined' / 'CrossedOut' .
                   8403:      ThicknessVal   = 'Thick' / 'Thin' .
1.6       cvs      8404:      LineStyleVal   = 'Solid' / 'Dashed' / 'Dotted' .
1.1       cvs      8405:      Pattern        = NAME .
                   8406:      Color          = NAME .
                   8407:      PresMinimum    = NUMBER .
                   8408:      PresMaximum    = NUMBER .
                   8409:      PresIntervalMin= NUMBER .
                   8410:      PresIntervalMax= NUMBER .
                   8411:      PresValue      = [ '-' ] PresVal .
1.18      cvs      8412:      PresVal        = NUMBER .</pre>
                   8413: <p>
                   8414: The <a name="prestransl">translation rules associated with specific
                   8415: presentation rules</a> can use the value of the specific presentation rule
1.1       cvs      8416: that causes them to be applied.  This behavior is designated by the keyword
1.18      cvs      8417: <tt>Value</tt>. For numerically-valued presentation rules, the numeric value
1.1       cvs      8418: is produced.  For other presentation rules, the name of the value is
1.18      cvs      8419: produced.</p>
                   8420: <p>
1.1       cvs      8421: It should be noted that modifications to the layout of the document's elements
                   8422: that are made using the combination of the control key and a mouse button will
1.18      cvs      8423: have no effect on the translation of the document.</p>
                   8424: <blockquote class="example">
                   8425: <p>
                   8426: <strong>Example:</strong></p>
                   8427: <p>
1.3       cvs      8428: Suppose that it is desirable to use the same font sizes as in the specific
1.18      cvs      8429: presentation, but the font size must be between 10 and 18 typographer's
                   8430: points. If font size is set in the translated document by the string
                   8431: <tt>pointsize=n</tt> where <tt>n</tt> is the font size in typographer's points
                   8432: then the following rules will suffice:</p>
                   8433: <pre>PRESENTATION
1.1       cvs      8434:    Size &lt; 10 :
                   8435:         Create 'pointsize=10';
                   8436:    Size in [10..18] :
                   8437:         BEGIN
                   8438:         Create 'pointsize=';
                   8439:         Create Value;
                   8440:         END;
                   8441:    Size > 18 :
1.18      cvs      8442:         Create 'pointsize=18';</pre>
                   8443: </blockquote>
                   8444: </div>
1.1       cvs      8445: 
1.18      cvs      8446: <div class="subsection">
1.1       cvs      8447: 
1.18      cvs      8448: <h3><a name="sectc5225">Recoding of characters, symbols and graphics</a></h3>
                   8449: <p>
1.1       cvs      8450: The coding of characters, graphical elements and symbols as defined in Thot
                   8451: does not necessarily correspond to what is required by an application to which
                   8452: a Thot document must be exported.  Because of this the translator can recode
                   8453: these terminal elements of the documents structure.  The last sections of a
                   8454: translation schema are intended for this purpose, each specifying the recoding
1.18      cvs      8455: rules for one type of terminal element.</p>
                   8456: <p>
1.1       cvs      8457: The recoding rules for character strings are grouped by alphabets. There is a
                   8458: group of rules for each alphabet of the Thot document that must be translated.
1.18      cvs      8459: Each such group of rules begins with the <tt>TEXTTRANSLATE</tt> keyword,
1.1       cvs      8460: followed by the specification of the alphabet to translate and the recoding
1.18      cvs      8461: rules, between the <tt>BEGIN</tt> and <tt>END</tt> keywords unless there is
1.1       cvs      8462: only one recoding rule for the alphabet. The specification of the alphabet is
                   8463: not required: by default it is assumed to the Latin alphabet (the ISO Latin-1
1.18      cvs      8464: character set).</p>
                   8465: <p>
1.1       cvs      8466: Each recoding rule is formed by a source string between apostrophes and a
                   8467: target string, also between apostrophes, the two strings being separated by
1.18      cvs      8468: the arrow symbol (<tt>-></tt>), formed by the ``minus'' and ``greater than''
                   8469: characters.  The rule is terminated by a semi-colon.</p>
                   8470: <pre>     TextTransSeq = [ Alphabet ] TransSeq .
1.1       cvs      8471:      Alphabet     = NAME .
                   8472:      TransSeq     ='BEGIN' &lt; Translation > 'END' ';' /
                   8473:                     Translation .
                   8474:      Translation  = Source [ '->' Target ] ';' .
                   8475:      Source       = STRING .
1.18      cvs      8476:      Target       = STRING .</pre>
                   8477: <p>
1.1       cvs      8478: One such rule signifies that when the source string appears in a text leaf of
                   8479: the document being translated, the translator must replace it, in the
                   8480: translated document, with the target string.  The source string and the target
                   8481: string can have different lengths and the target string can be empty.  In this
                   8482: last case, the translator simply suppresses every occurrence of the source
1.18      cvs      8483: string in the translated document.</p>
                   8484: <p>
1.1       cvs      8485: For a given alphabet, the order of the rules is not important and has no
                   8486: significance because the T language compiler reorders the rules in ways that
                   8487: speed up the translator's work.  The total number of recoding rules is limited
1.18      cvs      8488: by the compiler as is the maximum length of the source and target strings.</p>
                   8489: <p>
1.1       cvs      8490: The recoding rules for symbols and graphical elements are written in the same
                   8491: manner as the recoding rules for character strings.  They are preceded,
1.18      cvs      8492: respectively, by the <tt>SYMBTRANSLATE</tt> and <tt>GRAPHTRANSLATE</tt> and so
1.1       cvs      8493: not require a specification of the alphabet. Their source string is limited to
                   8494: one character, since, in Thot, each symbol and each graphical element is
                   8495: represented by a single character.  The symbol and graphical element codes are
1.18      cvs      8496: defined along with the <a href="#sect7">non-standard character codes</a>.</p>
                   8497: <blockquote class="example">
                   8498: <p>
                   8499: <strong>Example:</strong></p>
                   8500: <p>
                   8501: In a translation schema producing documents destined for use with the
                   8502: L<sup>A</sup>T<sub><big>E</big></sub>X formatter, the Latin
1.1       cvs      8503: characters``&eacute;'' (octal code 351 in Thot) and ``&egrave;'' (octal code
1.18      cvs      8504: 350 in Thot)  must be converted to their representation in
                   8505: L<sup>A</sup>T<sub><big>E</big></sub>X:</p>
                   8506: <pre>TEXTTRANSLATE Latin
1.1       cvs      8507:      BEGIN
                   8508:      '\350' -> '\`{e}';    { e grave }
                   8509:      '\351' -> '\''{e}';   { e acute }
1.18      cvs      8510:      END;</pre>
                   8511: </blockquote>
                   8512: </div>
                   8513: </div>
                   8514: <hr>
1.19      cvs      8515: 
1.18      cvs      8516: </div>
1.1       cvs      8517: 
1.18      cvs      8518: <div class="chapter">
1.1       cvs      8519: 
1.18      cvs      8520: <h1><a name="sect6">Language grammars</a></h1>
                   8521: <p>
1.1       cvs      8522: This chapter gives the complete grammars of the languages of Thot. The
                   8523: grammars were presented and described in the preceding chapters, which also
                   8524: specify the semantics of the languages.  This section gives only the
1.18      cvs      8525: syntax.</p>
1.1       cvs      8526: 
1.18      cvs      8527: <div class="section">
1.1       cvs      8528: 
1.18      cvs      8529: <h2><a name="sectb61">The M meta-language</a></h2>
                   8530: <p>
1.1       cvs      8531: The language grammars are all expressed in the same formalism, the M
1.18      cvs      8532: meta-language, which is defined in this section.</p>
                   8533: <pre>{ Any text between braces is a comment. }
1.1       cvs      8534: Grammar      = Rule &lt; Rule > 'END' .
                   8535:                { The &lt; and > signs indicate zero }
                   8536:                { or more repetitions. }
                   8537:                { END marks the end of the grammar. }
                   8538: Rule         = Ident '=' RightPart '.' .
                   8539:                { The period indicates the end of a rule }
                   8540: RightPart    = RtTerminal / RtIntermed .
                   8541:                { The slash indicates a choice }
                   8542: RtTerminal   ='NAME' / 'STRING' / 'NUMBER' .
                   8543:                { Right part of a terminal rule }
                   8544: RtIntermed   = Possibility &lt; '/' Possibility > .
                   8545:                { Right part of an intermediate rule }
                   8546: Possibility  = ElemOpt &lt; ElemOpt > .
                   8547: ElemOpt      = Element / '[' Element &lt; Element > ']' /
                   8548:               '&lt;' Element &lt; Element > '>'  .
                   8549:                { Brackets delimit optional parts }
                   8550: Element      = Ident / KeyWord .
                   8551: Ident        = NAME .
                   8552:                { Identifier, sequence of characters
                   8553: KeyWord      = STRING .
                   8554:                { Character string delimited by apostrophes }
1.18      cvs      8555: END</pre>
                   8556: </div>
1.1       cvs      8557: 
1.18      cvs      8558: <div class="section">
1.1       cvs      8559: 
1.18      cvs      8560: <h2><a name="sectb62">The S language</a></h2>
                   8561: <p>
1.1       cvs      8562: The S language is used to write structure schemas, which contain the generic
                   8563: logical structures of document and object classes.  It is described here in
1.18      cvs      8564: the M meta-language.</p>
                   8565: <pre>StructSchema   = 'STRUCTURE' [ 'EXTENSION' ] ElemID ';'
1.1       cvs      8566:                  'DEFPRES' PresID ';'
                   8567:                [ 'ATTR' AttrSeq ]
                   8568:                [ 'PARAM' RulesSeq ]
                   8569:                [ 'STRUCT' RulesSeq ]
                   8570:                [ 'EXTENS' ExtensRuleSeq ]
                   8571:                [ 'ASSOC' RulesSeq ]
                   8572:                [ 'UNITS' RulesSeq ]
                   8573:                [ 'EXPORT' SkeletonSeq ]
                   8574:                [ 'EXCEPT' ExceptSeq ]
                   8575:                  'END' .
                   8576: 
                   8577: ElemID         = NAME .
                   8578: PresID         = NAME .
                   8579: 
                   8580: AttrSeq        = Attribute &lt; Attribute > .
                   8581: Attribute      = AttrID '=' AttrType ';' .
                   8582: AttrType       = 'INTEGER' / 'TEXT' /
                   8583:                  'REFERENCE' '(' RefType ')' /
                   8584:                  ValueSeq .
                   8585: RefType        = 'ANY' /
                   8586:                  [ FirstSec ] ElemID [ ExtStruct ] .
                   8587: ValueSeq       = AttrVal &lt; ',' AttrVal > .
                   8588: AttrID         = NAME .
                   8589: FirstSec       = 'First' / 'Second' .
                   8590: ExtStruct      = '(' ElemID ')' .
                   8591: AttrVal        = NAME .
                   8592: 
                   8593: RulesSeq       = Rule &lt; Rule > .
                   8594: Rule           = ElemID [ LocAttrSeq ] '='
                   8595:                  DefWithAttr ';' .
                   8596: LocAttrSeq     = '(' 'ATTR' LocalAttr
                   8597:                       &lt; ';' LocalAttr > ')' .
                   8598: LocalAttr      = [ '!' ] AttrID [ '=' AttrType ] .
                   8599: DefWithAttr    = Definition
                   8600:                  [ '+' '(' ExtensionSeq ')' ]
                   8601:                  [ '-' '(' RestrictSeq ')' ]
                   8602:                  [ 'WITH' FixedAttrSeq ] .
                   8603: ExtensionSeq   = ExtensionElem &lt; ',' ExtensionElem > .
                   8604: ExtensionElem  = ElemID / 'TEXT' / 'GRAPHICS' /
                   8605:                  'SYMBOL' / 'PICTURE' .
                   8606: RestrictSeq    = RestrictElem &lt; ',' RestrictElem > .
                   8607: RestrictElem   = ElemID / 'TEXT' / 'GRAPHICS' /
                   8608:                  'SYMBOL' / 'PICTURE' .
                   8609: FixedAttrSeq   = FixedAttr &lt; ',' FixedAttr > .
                   8610: FixedAttr      = AttrID [ FixedOrModifVal ] .
                   8611: FixedOrModifVal= [ '?' ] '=' FixedValue .
                   8612: FixedValue     = [ '-' ] NumValue / TextValue / AttrVal .
                   8613: NumValue       = NUMBER .
                   8614: TextValue      = STRING .
                   8615: 
                   8616: Definition     = BaseType [ LocAttrSeq ] / Constr /
                   8617:                  Element .
                   8618: BaseType       = 'TEXT' / 'GRAPHICS' / 'SYMBOL' /
                   8619:                  'PICTURE' / 'UNIT' / 'NATURE' .
                   8620: Element        = ElemID [ ExtOrDef ] .
                   8621: ExtOrDef       = 'EXTERN' / 'INCLUDED' /
                   8622:                  [ LocAttrSeq ] '=' Definition .
                   8623: 
                   8624: Constr         = 'LIST' [ '[' min '..' max ']' ] 'OF'
                   8625:                         '(' DefWithAttr ')' /
                   8626:                  'BEGIN' DefOptSeq 'END' /
                   8627:                  'AGGREGATE' DefOptSeq 'END' /
                   8628:                  'CASE' 'OF' DefSeq 'END' /
                   8629:                  'REFERENCE' '(' RefType ')' /
                   8630:                  'PAIR' .
                   8631: 
                   8632: min            = Integer / '*' .
                   8633: max            = Integer / '*' .
                   8634: Integer        = NUMBER .
                   8635: 
                   8636: DefOptSeq      = DefOpt ';' &lt; DefOpt ';' > .
                   8637: DefOpt         = [ '?' ] DefWithAttr .
                   8638: 
                   8639: DefSeq         = DefWithAttr ';' &lt; DefWithAttr ';' > .
                   8640: 
                   8641: SkeletonSeq    = SkeletonElem &lt; ',' SkeletonElem > ';' .
                   8642: SkeletonElem   = ElemID [ 'WITH' Contents ] .
                   8643: Contents       = 'Nothing' / ElemID [ ExtStruct ] .
                   8644: 
                   8645: ExceptSeq      = Except ';' &lt; Except ';' > .
                   8646: Except         = [ 'EXTERN' ] [ FirstSec ] ExcTypeOrAttr ':'
                   8647:                  ExcValSeq .
                   8648: ExcTypeOrAttr  = ElemID / AttrID .
                   8649: ExcValSeq      = ExcValue &lt; ',' ExcValue > .
                   8650: ExcValue       = 'NoCut' / 'NoCreate' /
                   8651:                  'NoHMove' / 'NoVMove' / 'NoMove' /
                   8652:                  'NoHResize' / 'NoVResize' / 'NoResize' /
1.18      cvs      8653:                  'MoveResize' /
1.1       cvs      8654:                  'NewWidth' / 'NewHeight' /
                   8655:                  'NewHPos' / 'NewVPos' /
                   8656:                  'Invisible' / 'NoSelect' /
                   8657:                  'Hidden' / 'ActiveRef' /
                   8658:                  'ImportLine' / 'ImportParagraph' /
1.9       cvs      8659:                  'NoPaginate' / 'ParagraphBreak' /
                   8660:                  'HighlightChildren' / 'ExtendedSelection' /
                   8661:                  'ReturnCreateNL' .
1.1       cvs      8662: 
                   8663: ExtensRuleSeq  = ExtensRule ';' &lt; ExtensRule ';' > .
                   8664: ExtensRule     = RootOrElem [ LocAttrSeq ]
                   8665:                  [ '+' '(' ExtensionSeq ')' ]
                   8666:                  [ '-' '(' RestrictSeq ')' ]
                   8667:                  [ 'WITH' FixedAttrSeq ] .
                   8668: RootOrElem     = 'Root' / ElemID .
                   8669: 
1.18      cvs      8670: END</pre>
                   8671: </div>
1.1       cvs      8672: 
1.18      cvs      8673: <div class="section">
1.1       cvs      8674: 
1.18      cvs      8675: <h2><a name="sectb63">The P language</a></h2>
                   8676: <p>
1.1       cvs      8677: The P language is used to write presentation schemas, which define the
                   8678: graphical presentation rules to be applied to different classes of documents
1.18      cvs      8679: and objects.  It is described here in the M meta-language.</p>
                   8680: <pre>PresSchema      = 'PRESENTATION' ElemID ';'
1.1       cvs      8681:                 [ 'VIEWS' ViewSeq ]
                   8682:                 [ 'PRINT' PrintViewSeq ]
                   8683:                 [ 'COUNTERS' CounterSeq ]
                   8684:                 [ 'CONST' ConstSeq ]
                   8685:                 [ 'VAR' VarSeq ]
                   8686:                 [ 'DEFAULT' ViewRuleSeq ]
                   8687:                 [ 'BOXES' BoxSeq ]
                   8688:                 [ 'RULES' PresentSeq ]
                   8689:                 [ 'ATTRIBUTES' PresAttrSeq ]
                   8690:                 [ 'TRANSMIT' TransmitSeq ]
                   8691:                   'END' .
                   8692: 
                   8693: ElemID          = NAME .
                   8694: 
                   8695: ViewSeq         = ViewDeclaration
                   8696:                   &lt; ',' ViewDeclaration > ';' .
                   8697: ViewDeclaration = ViewID [ 'EXPORT' ] .
                   8698: ViewID          = NAME .
                   8699: 
                   8700: PrintViewSeq    = PrintView &lt; ',' PrintView > ';' .
                   8701: PrintView       = ViewID / ElemID .
                   8702: 
                   8703: CounterSeq      = Counter &lt; Counter > .
                   8704: Counter         = CounterID ':' CounterFunc ';' .
                   8705: CounterID       = NAME .
                   8706: CounterFunc     = 'RANK' 'OF' TypeOrPage [ SLevelAsc ]
                   8707:                   [ 'INIT' AttrID ] [ 'REINIT' AttrID ] /
                   8708:                   SetFunction &lt; SetFunction >
                   8709:                   AddFunction &lt; AddFunction >
                   8710:                   [ 'INIT' AttrID ] /
1.16      cvs      8711:                   'RLEVEL' 'OF' ElemID .
1.1       cvs      8712: SLevelAsc       = [ '-' ] LevelAsc .
                   8713: LevelAsc        = NUMBER .
                   8714: SetFunction     = 'SET' CounterValue 'ON' TypeOrPage .
                   8715: AddFunction     = 'ADD' CounterValue 'ON' TypeOrPage .
                   8716: TypeOrPage      = 'Page' [ '(' ViewID ')' ] /
1.16      cvs      8717:                   [ '*' ] ElemID .
1.1       cvs      8718: CounterValue    = NUMBER .
                   8719: 
                   8720: ConstSeq        = Const &lt; Const > .
                   8721: Const           = ConstID '=' ConstType ConstValue ';' .
                   8722: ConstID         = NAME .
                   8723: ConstType       = 'Text' [ Alphabet ] / 'Symbol' /
                   8724:                   'Graphics' / 'Picture' .
                   8725: ConstValue      = STRING .
                   8726: Alphabet        = NAME .
                   8727: 
                   8728: VarSeq          = Variable &lt; Variable > .
                   8729: Variable        = VarID ':' FunctionSeq ';' .
                   8730: VarID           = NAME .
                   8731: FunctionSeq     = Function &lt; Function > .
                   8732: Function        = 'DATE' / 'FDATE' /
                   8733:                   'DocName' / 'DirName' /
                   8734:                   'ElemName' / 'AttributeName' /
                   8735:                   ConstID / ConstType ConstValue /
                   8736:                   AttrID /
                   8737:                   'VALUE' '(' PageAttrCtr ','
                   8738:                   CounterStyle ')' .
                   8739: PageAttrCtr     = 'PageNumber' [ '(' ViewID ')' ] /
                   8740:                   [ MinMax ] CounterID / AttrID .
                   8741: CounterStyle    = 'Arabic' / 'LRoman' / 'URoman' /
                   8742:                   'Uppercase' / 'Lowercase' .
                   8743: MinMax          = 'MaxRangeVal' / 'MinRangeVal' .
                   8744: 
                   8745: BoxSeq          = Box &lt; Box > .
                   8746: Box             = 'FORWARD' BoxID ';' /
                   8747:                   BoxID ':' ViewRuleSeq .
                   8748: BoxID           = NAME .
                   8749: 
                   8750: PresentSeq      = Present &lt; Present > .
                   8751: Present         = [ '*' ] [ FirstSec ] ElemID ':'
                   8752:                   ViewRuleSeq .
                   8753: FirstSec        = 'First' / 'Second' .
                   8754: 
                   8755: PresAttrSeq     = PresAttr &lt; PresAttr > .
                   8756: PresAttr        = AttrID [ '(' [ FirstSec ] ElemID ')' ] 
                   8757:                   [ AttrRelation ] ':' ViewRuleSeq .
                   8758: AttrID          = NAME .
                   8759: AttrRelation    = '=' AttrVal /
                   8760:                   '>' [ '-' ] MinValue /
                   8761:                   '&lt;' [ '-' ] MaxValue /
                   8762:                   'IN' '[' [ '-' ] LowerBound '..' 
                   8763:                   [ '-' ] UpperBound ']' /
                   8764:                   'GREATER' AttrID /
                   8765:                   'EQUAL' AttrID /
                   8766:                   'LESS' AttrID .
                   8767: AttrVal         = [ '-' ] EqualNum / EqualText / AttrValue .
                   8768: MinValue        = NUMBER .
                   8769: MaxValue        = NUMBER .
                   8770: LowerBound      = NUMBER .
                   8771: UpperBound      = NUMBER.
                   8772: EqualNum        = NUMBER .
                   8773: EqualText       = STRING .
                   8774: AttrValue       = NAME .
                   8775: 
                   8776: ViewRuleSeq     = 'BEGIN' &lt; RulesAndCond > &lt; ViewRules >
                   8777:                   'END' ';' /
                   8778:                   ViewRules / CondRules / Rule .
                   8779: RulesAndCond    = CondRules / Rule .
                   8780: ViewRules       = 'IN' ViewID CondRuleSeq .
                   8781: CondRuleSeq     = 'BEGIN' &lt; RulesAndCond > 'END' ';' /
                   8782:                   CondRules / Rule .
                   8783: CondRules       = CondRule &lt; CondRule >
                   8784:                   [ 'Otherwise' RuleSeq ] .
                   8785: CondRule        = 'IF' ConditionSeq RuleSeq .
                   8786: RulesSeq        = 'BEGIN' Rule &lt; Rule > 'END' ';' / Rule .
                   8787: 
1.6       cvs      8788: ConditionSeq    = Condition &lt; 'AND' Condition > .
                   8789: Condition       = [ 'NOT' ] [ 'Target' ] ConditionElem .
                   8790: ConditionElem   = 'First' / 'Last' /
                   8791:                   [ 'Immediately' ] 'Within' [ NumParent ]
                   8792:                                      ElemID [ ExtStruct ] /
                   8793:                    ElemID /
                   8794:                   'Referred' / 'FirstRef' / 'LastRef' /
                   8795:                   'ExternalRef' / 'InternalRef' / 'CopyRef' /
                   8796:                   'AnyAttributes' / 'FirstAttr' / 'LastAttr' /
                   8797:                   'UserPage' / 'StartPage' / 'ComputedPage' /
                   8798:                   'Empty' /
                   8799:                   '(' [ MinMax ] CounterName CounterCond ')' /
                   8800:                   CondPage '(' CounterID ')' .
                   8801: NumParent       = [ GreaterLess ] NParent .
                   8802: GreaterLess     = '>' / '&lt;' .
                   8803: NParent         = NUMBER.
                   8804: CounterCond     = '&lt;' MaxCtrVal / '>' MinCtrVal /
                   8805:                   '=' EqCtrVal / 
                   8806:                   'IN' '[' ['-'] MinCtrBound '..' 
                   8807:                   ['-'] MaxCtrBound ']' .
                   8808: PageCond        = 'Even' / 'Odd' / 'One' .
                   8809: MaxCtrVal       = NUMBER .
                   8810: MinCtrVal       = NUMBER .
                   8811: EqCtrVal        = NUMBER .
                   8812: MaxCtrBound     = NUMBER .
                   8813: MinCtrBound     = NUMBER .
1.1       cvs      8814: 
                   8815: Rule            = PresParam ';' / PresFunc ';' .
                   8816: PresParam       = 'VertRef' ':' HorizPosition /
                   8817:                   'HorizRef' ':' VertPosition /
                   8818:                   'VertPos' ':' VPos /
                   8819:                   'HorizPos' ':' HPos /
                   8820:                   'Height' ':' Extent /
                   8821:                   'Width' ':' Extent /
                   8822:                   'VertOverflow' ':' Boolean /
                   8823:                   'HorizOverflow' ':' Boolean /
                   8824:                   'LineSpacing' ':' DistOrInherit /
                   8825:                   'Indent' ':' DistOrInherit /
                   8826:                   'Adjust' ':' AlignOrInherit /
                   8827:                   'Justify' ':' BoolInherit /
                   8828:                   'Hyphenate' ':' BoolInherit /
                   8829:                   'PageBreak' ':' Boolean /
                   8830:                   'LineBreak' ':' Boolean /
                   8831:                   'InLine' ':' Boolean /
                   8832:                   'NoBreak1' ':' AbsDist /
                   8833:                   'NoBreak2' ':' AbsDist /
                   8834:                   'Gather' ':' Boolean /
                   8835:                   'Visibility' ':' NumberInherit /
                   8836:                   'Size'  ':' SizeInherit /
                   8837:                   'Font' ':' NameInherit /
                   8838:                   'Style' ':' StyleInherit /
1.23      cvs      8839:                   'Weight' ':' WeightInherit /
1.1       cvs      8840:                   'Underline' ':' UnderLineInherit /
                   8841:                   'Thickness' ':' ThicknessInherit /
                   8842:                   'Depth' ':' NumberInherit /
                   8843:                   'LineStyle' ':' LineStyleInherit /
                   8844:                   'LineWeight' ':' DistOrInherit /
                   8845:                   'FillPattern' ':' NameInherit /
                   8846:                   'Background' ':' NameInherit /
1.13      cvs      8847:                   'Foreground' ':' NameInherit /
1.1       cvs      8848:                   'Content' ':' VarConst .
                   8849: PresFunc        = Creation '(' BoxID ')' /
                   8850:                   'Line' /
                   8851:                   'NoLine' /
                   8852:                   'Page' '(' BoxID ')' /
1.13      cvs      8853:                   'Copy' '(' BoxTypeToCopy ')' /
                   8854:                   'ShowBox' /
1.18      cvs      8855:                   'BackgroundPicture' ':' FileName /
                   8856:                   'PictureMode' ':' PictMode .
1.1       cvs      8857: 
                   8858: BoxTypeToCopy   = BoxID [ ExtStruct ] /
                   8859:                    ElemID [ ExtStruct ] .
                   8860: ExtStruct       = '(' ElemID ')' .
                   8861: 
                   8862: Distance        = [ Sign ] AbsDist .
                   8863: Sign            = '+' / '-' .
                   8864: AbsDist         = IntegerOrAttr [ '.' DecimalPart ]
                   8865:                   [ Unit ] .
                   8866: IntegerOrAttr   = IntegerPart / AttrID .
                   8867: IntegerPart     = NUMBER .
                   8868: DecimalPart     = NUMBER .
                   8869: Unit            = 'em' / 'ex' / 'cm' / 'mm' / 'in' / 'pt' /
                   8870:                   'pc' / 'px' / '%' .
                   8871: 
                   8872: HPos            = 'nil' / VertAxis '=' HorizPosition 
                   8873:                   [ 'UserSpecified' ] .
                   8874: VPos            = 'nil' / HorizAxis '=' VertPosition 
                   8875:                   [ 'UserSpecified' ] .
                   8876: VertAxis        = 'Left' / 'VMiddle' / 'VRef' / 'Right' .
                   8877: HorizAxis       = 'Top' / 'HMiddle' / 'HRef' / 'Bottom' .
                   8878: 
1.6       cvs      8879: VertPosition    = Reference '.' HorizAxis [ Distance ] .
                   8880: HorizPosition   = Reference '.' VertAxis [ Distance ] .
                   8881: Reference       = 'Enclosing' [ BoxTypeNot ] /
                   8882:                   'Enclosed' [ BoxTypeNot ] /
                   8883:                   'Previous' [ BoxTypeNot ] /
                   8884:                   'Next' [ BoxTypeNot ] /
                   8885:                   'Referred' [ BoxTypeNot ] /
                   8886:                   'Creator' /
                   8887:                   'Root' /
                   8888:                   '*' /
                   8889:                   BoxOrType .
                   8890: BoxOrType       = BoxID /
                   8891:                   [ '*' ] [ FirstSec ] ElemID /
1.17      cvs      8892:                   'AnyElem' / 'AnyBox' /
                   8893:                   'ElemWithAttr' AttrID .
1.6       cvs      8894: BoxTypeNot      = [ 'NOT' ] BoxOrType .
                   8895: 
                   8896: Extent          = Reference '.' HeightWidth
                   8897:                   [ Relation ] [ 'Min' ] /
                   8898:                   AbsDist [ 'UserSpecified' ] [ 'Min' ] /
                   8899:                   HPos / VPos .
                   8900: HeightWidth     = 'Height' / 'Width' .
                   8901: Relation        = '*' ExtentAttr '%' / Distance .
                   8902: ExtentAttr      = ExtentVal / AttrID .
                   8903: ExtentVal       = NUMBER .
                   8904: 
                   8905: Inheritance     = Kinship  InheritedValue .
                   8906: Kinship         = 'Enclosing' / 'GrandFather'/ 'Enclosed' /
                   8907:                   'Previous' / 'Creator' .
                   8908: InheritedValue  = '+' PosIntAttr [ 'Max' maximumA ] /
                   8909:                   '-' NegIntAttr [ 'Min' minimumA ] /
                   8910:                   '=' .
                   8911: PosIntAttr      = PosInt / AttrID .
                   8912: PosInt          = NUMBER .
                   8913: NegIntAttr      = NegInt / AttrID .
                   8914: NegInt          = NUMBER .
                   8915: maximumA        = maximum / AttrID .
                   8916: maximum         = NUMBER .
                   8917: minimumA        = minimum / AttrID .
                   8918: minimum         = NUMBER .
                   8919: 
                   8920: AlignOrInherit  = Kinship '=' / Alignment .
                   8921: Alignment       = 'Left' / 'Right' / 'VMiddle' /
                   8922:                   'LeftWithDots' .
1.1       cvs      8923: 
1.6       cvs      8924: DistOrInherit   = Kinship InheritedDist / Distance .
                   8925: InheritedDist   = '=' / '+' AbsDist / '-' AbsDist .
1.1       cvs      8926: 
1.6       cvs      8927: BoolInherit     = Boolean / Kinship '=' .
                   8928: Boolean         = 'Yes' / 'No' .
1.1       cvs      8929: 
1.6       cvs      8930: NumberInherit   = Integer / AttrID / Inheritance .
                   8931: Integer         = NUMBER .
1.1       cvs      8932: 
                   8933: LineStyleInherit= Kinship '=' / 'Solid' / 'Dashed' /
                   8934:                   'Dotted' .
                   8935: 
1.6       cvs      8936: SizeInherit     = SizeAttr [ 'pt' ] / Kinship InheritedSize .
                   8937: InheritedSize   = '+' SizeAttr [ 'pt' ]
                   8938:                       [ 'Max' MaxSizeAttr ] /
                   8939:                   '-' SizeAttr [ 'pt' ]
                   8940:                       [ 'Min' MinSizeAttr ] /
1.22      cvs      8941:                   '*' PercentSizeAttr '%' /
1.6       cvs      8942:                   '=' .
                   8943: SizeAttr        = Size / AttrID .
                   8944: Size            = NUMBER .
                   8945: MaxSizeAttr     = MaxSize / AttrID .
                   8946: MaxSize         = NUMBER .
                   8947: MinSizeAttr     = MinSize / AttrID .
                   8948: MinSize         = NUMBER .
1.22      cvs      8949: PercentSizeAttr = PercentSize / AttrID .
                   8950: PercentSize     = NUMBER .
1.6       cvs      8951: 
                   8952: NameInherit     = Kinship '=' / FontName .
                   8953: FontName        = NAME .
                   8954: StyleInherit    = Kinship '=' /
1.23      cvs      8955:                   'Roman' / 'Italics' / 'Oblique' .
                   8956: WeightInherit   = Kinship '=' /
                   8957:                   'Normal' / 'Bold' .
1.1       cvs      8958: UnderLineInherit= Kinship '=' /
1.6       cvs      8959:                   'NoUnderline' / 'Underlined' / 
                   8960:                   'Overlined' / 'CrossedOut' .
1.1       cvs      8961: ThicknessInherit= Kinship '=' / 'Thick' / 'Thin' .
1.13      cvs      8962: 
                   8963: FileName =        STRING .
                   8964: PictMode =        'NormalSize' / 'Scale' /
                   8965:                   'RepeatXY' / 'RepeatX' / 'RepeatY' .
1.1       cvs      8966: 
1.6       cvs      8967: VarConst        = ConstID / ConstType ConstValue /
                   8968:                   VarID / '(' FunctionSeq ')' /
                   8969:                   ElemID .
                   8970: 
                   8971: Creation        = Create [ 'Repeated' ] .
                   8972: Create          = 'CreateFirst' / 'CreateLast' /
                   8973:                   'CreateBefore' / 'CreateAfter' /
                   8974:                   'CreateEnclosing' .
                   8975: 
                   8976: TransmitSeq     = Transmit &lt; Transmit > .
                   8977: Transmit        = TypeOrCounter 'To' ExternAttr
                   8978:                   '(' ElemID ')' ';' .
                   8979: TypeOrCounter   = CounterID / ElemID .
                   8980: ExternAttr      = NAME .
1.1       cvs      8981: 
1.18      cvs      8982: END</pre>
                   8983: </div>
1.1       cvs      8984: 
1.18      cvs      8985: <div class="section">
1.1       cvs      8986: 
1.18      cvs      8987: <h2><a name="sectb64">The T language</a></h2>
                   8988: <pre>TransSchema   = 'TRANSLATION' ElemID ';'
1.1       cvs      8989:               [ 'LINELENGTH' LineLength ';' ]
                   8990:               [ 'LINEEND' CHARACTER ';' ]
                   8991:               [ 'LINEENDINSERT' STRING ';' ]
                   8992:               [ 'BUFFERS' BufferSeq ]
                   8993:               [ 'COUNTERS' CounterSeq ]
                   8994:               [ 'CONST' ConstSeq ]
                   8995:               [ 'VAR' VariableSeq ]
                   8996:                 'RULES' ElemSeq
                   8997:               [ 'ATTRIBUTES' AttrSeq ]
                   8998:               [ 'PRESENTATION' PresSeq ]
                   8999:               &lt; 'TEXTTRANSLATE' TextTransSeq >
                   9000:               [ 'SYMBTRANSLATE' TransSeq ]
                   9001:               [ 'GRAPHTRANSLATE' TransSeq ]
                   9002:                 'END' .
                   9003: 
                   9004: LineLength    = NUMBER .
                   9005: 
                   9006: BufferSeq     = Buffer &lt; Buffer > .
                   9007: Buffer        = BufferID [ '(' 'Picture' ')' ] ';' .
                   9008: BufferID      = NAME .
                   9009: 
                   9010: CounterSeq    = Counter &lt; Counter > .
                   9011: Counter       = CounterID [ ':' CounterFunc ] ';' .
                   9012: CounterID     = NAME .
                   9013: CounterFunc   = 'Rank' 'of' ElemID [ SLevelAsc ]
                   9014:                 [ 'Init' AttrID ] /
                   9015:                 'Rlevel' 'of' ElemID /
                   9016:                 'Set' InitValue 'On' ElemID
                   9017:                       'Add' Increment 'On' ElemID
                   9018:                       [ 'Init' AttrID ] .
                   9019: SLevelAsc     = [ '-' ] LevelAsc .
                   9020: LevelAsc      =  NUMBER .
                   9021: InitValue     = NUMBER .
                   9022: Increment     = NUMBER .
                   9023: ElemID        = NAME .
                   9024: AttrID        = NAME .
                   9025: 
                   9026: ConstSeq      = Const &lt; Const > .
                   9027: Const         = ConstID '=' ConstValue ';' .
                   9028: ConstID       = NAME .
                   9029: ConstValue    = STRING .
                   9030: 
                   9031: VariableSeq   = Variable &lt; Variable > .
                   9032: Variable      = VarID ':' Function &lt; Function > ';' .
                   9033: VarID         = NAME .
                   9034: Function      = 'Value' '(' CounterID [ ':' Length ]
                   9035:                           [ ',' CounterStyle ]  ')' /
                   9036:                 'FileDir' / 'FileName' / 'Extension' /
                   9037:                 'DocumentName' / 'DocumentDir' /
                   9038:                 ConstID / CharString / 
                   9039:                 BufferID / AttrID .
                   9040: Length        = NUMBER .
                   9041: CounterStyle=   'Arabic' / 'LRoman' / 'URoman' /
                   9042:                 'Uppercase' / 'Lowercase' .
                   9043: CharString    = STRING .
                   9044: 
                   9045: ElemSeq       = TransType &lt; TransType > .
                   9046: TransType     = [ FirstSec ] ElemID ':' RuleSeq .
                   9047: FirstSec      = 'First' / 'Second' .
                   9048: RuleSeq       = Rule / 'BEGIN' &lt; Rule > 'END' ';' .
                   9049: Rule          = SimpleRule / ConditionBlock .
                   9050: ConditionBlock= 'IF' ConditionSeq SimpleRuleSeq .
                   9051: SimpleRuleSeq = 'BEGIN' &lt; SimpleRule > 'END' ';' / 
                   9052:                 SimpleRule .
                   9053: 
                   9054: ConditionSeq  = Condition [ 'AND' Condition ] .
                   9055: Condition     = [ 'NOT' ] [ 'Target' ] Cond .
                   9056: Cond          = CondElem / CondAscend .
                   9057: CondElem      = 'FirstRef' / 'LastRef' /
                   9058:                 'ExternalRef' /
                   9059:                 'Defined' /
                   9060:                 'Alphabet' '=' Alphabet /
                   9061:                 'ComputedPage' / 'StartPage' / 
                   9062:                 'UserPage' / 'ReminderPage' /
                   9063:                 'Empty' /
1.18      cvs      9064:                 ElemID /
1.1       cvs      9065:                 'FirstAttr' / 'LastAttr' .
                   9066: CondAscend    = [ Ascend ] CondOnAscend .
                   9067: Ascend        = '*' / 'Parent' / 'Ancestor' LevelOrType .
                   9068: LevelOrType   = CondRelLevel / ElemID [ ExtStruct ] .
                   9069: CondRelLevel  = NUMBER .
                   9070: CondOnAscend  = 'First' / 'Last' /
                   9071:                 'Referred' / 
                   9072:                 [ 'Immediately' ] 'Within' [ NumParent ]
                   9073:                                   ElemID [ ExtStruct ] /
                   9074:                 'Attributes' /
                   9075:                 AttrID [ RelatAttr ] /
                   9076:                 'Presentation' /
                   9077:                 PresRule /
                   9078:                 'Comment' .                  
                   9079: NumParent     = [ GreaterLess ] NParent .
                   9080: GreaterLess   = '>' / '&lt;' .
                   9081: NParent       = NUMBER.
                   9082: Alphabet      = NAME .
                   9083: RelatAttr     = '=' Value /
                   9084:                  '>' [ '-' ] Minimum /
                   9085:                  '&lt;' [ '-' ] Maximum /
                   9086:                  'IN' '[' [ '-' ] MinInterval '..'
                   9087:                           [ '-' ] MaxInterval ']' .
                   9088: Value         = [ '-' ] IntegerVal / TextVal / AttrValue .
                   9089: Minimum       = NUMBER .
                   9090: Maximum       = NUMBER .
                   9091: MinInterval   = NUMBER .
                   9092: MaxInterval   = NUMBER .
                   9093: IntegerVal    = NUMBER .
                   9094: TextVal       = STRING .
                   9095: AttrValue     = NAME .
                   9096: 
                   9097: SimpleRule    = 'Create' [ 'IN' VarID ] Object
                   9098:                        [ Position ] ';' /
                   9099:                 'Write' Object [ Position ] ';' /
                   9100:                 'Read' BufferID [ Position ] ';' /
                   9101:                 'Include' File [ Position ] ';' /
1.6       cvs      9102:                 'Get'  [ RelPosition ] ElemID 
                   9103:                        [ ExtStruct ] 
                   9104:                        [ Position ] ';' /
1.1       cvs      9105:                 'Copy' [ RelPosition ] ElemID 
                   9106:                        [ ExtStruct ] 
                   9107:                        [ Position ] ';' /
                   9108:                 'Use' TrSchema [ 'For' ElemID ] ';' /
                   9109:                 'Remove' ';' /
                   9110:                 'NoTranslation' ';' /
                   9111:                 'NoLineBreak' ';' /
                   9112:                 'ChangeMainFile' VarID [ Position ] ';' /
1.14      cvs      9113:                 'RemoveFile' VarID [ Position ] ';' /
1.10      cvs      9114:                 'Set' CounterID InitValue [ Position ] ';' /
                   9115:                 'Add' CounterID Increment [ Position ] ';' /
1.25    ! cvs      9116:                 'Indent' [ 'IN' VarID ] Indent [ Position ] ';' .
1.10      cvs      9117: 
1.25    ! cvs      9118: Indent        = 'Suspend' / 'Resume' / [ IndentSign ] IndentValue .
1.10      cvs      9119: IndentSign    = '+' / '-' .
                   9120: IndentValue   = NUMBER .
1.1       cvs      9121: 
                   9122: Object        = ConstID / CharString /
                   9123:                 BufferID /
                   9124:                 VarID /
                   9125:                 '(' Function &lt; Function > ')' /
1.21      cvs      9126:                  [ 'Translated' ] AttrID /
1.1       cvs      9127:                 'Value' /
                   9128:                 'Content' /
                   9129:                 'Comment' / 
                   9130:                 'Attributes' /
                   9131:                 'Presentation' /
                   9132:                 'RefId' /
                   9133:                 'PairId' /
                   9134:                 'FileDir' / 'FileName' / 'Extension' /
                   9135:                 'DocumentName' / 'DocumentDir' /
                   9136:                 [ 'Referred' ] ReferredObject .
                   9137: Position      = 'After' / 'Before' .
                   9138: 
1.6       cvs      9139: ReferredObject= VarID /
                   9140:                 ElemID [ ExtStruct ] /
                   9141:                 'RefId' /
                   9142:                 'DocumentName' / 'DocumentDir' .                
1.1       cvs      9143: 
1.6       cvs      9144: File          = FileName / BufferID .
                   9145: FileName      = STRING .
1.1       cvs      9146: 
1.6       cvs      9147: RelPosition   = 'Included' / 'Referred' .
                   9148: ExtStruct     = '(' ElemID ')' .
1.1       cvs      9149: 
1.6       cvs      9150: TrSchema      = NAME .
                   9151: 
                   9152: AttrSeq       = TransAttr &lt; TransAttr > .
                   9153: TransAttr     = AttrID [ '(' ElemID ')' ] 
                   9154:                 [ RelatAttr ] ':' RuleSeq .
                   9155: 
                   9156: PresSeq       = PresTrans &lt; PresTrans > .
                   9157: PresTrans     = PresRule ':' RuleSeq .
                   9158: PresRule      = 'Size' [ PresRelation ] /
                   9159:                 'Indent' [ PresRelation ] /
                   9160:                 'LineSpacing' [ PresRelation ] /
                   9161:                 'Adjust' [ '=' AdjustVal ] /
                   9162:                 'Justify' [ '=' BoolVal ] /
                   9163:                 'Hyphenate' [ '=' BoolVal ] /
                   9164:                 'Style' [ '=' StyleVal ] /
1.24      cvs      9165:                 'Weight' [ '=' WeightVal ] /
1.6       cvs      9166:                 'Font' [ '=' FontVal ] /
                   9167:                 'UnderLine' [ '=' UnderLineVal ] /
                   9168:                 'Thickness' [ '=' ThicknessVal ] /
                   9169:                 'LineStyle' [ '=' LineStyleVal ] /
                   9170:                 'LineWeight' [ PresRelation ] /
                   9171:                 'FillPattern' [ '=' Pattern ] /
                   9172:                 'Background' [ '=' Color ] /
                   9173:                 'Foreground' [ '=' Color ] .
                   9174: 
                   9175: PresRelation  = '=' PresValue /
                   9176:                 '>' [ '-' ] PresMinimum /
                   9177:                 '&lt;' [ '-' ] PresMaximum /
                   9178:                 'IN' '[' [ '-' ] PresIntervalMin '..'
                   9179:                          [ '-' ] PresIntervalMax ']' .
                   9180: AdjustVal     = 'Left' / 'Right' / 'VMiddle' / 
                   9181:                 'LeftWithDots' .
                   9182: BoolVal       = 'Yes' / 'No' .
1.24      cvs      9183: StyleVal      = 'Roman' / 'Italics' / 'Oblique' .
                   9184: WeightVal     = 'Normal' / 'Bold' .
1.6       cvs      9185: FontVal       = 'Times' / 'Helvetica' / 'Courier' .
                   9186: UnderLineVal  = 'NoUnderline' / 'UnderLined' /
                   9187:                 'OverLined' / 'CrossedOut' .
                   9188: ThicknessVal  = 'Thick' / 'Thin' .
                   9189: LineStyleVal  = 'Solid' / 'Dashed' / 'Dotted' .
                   9190: Pattern       = NAME .
                   9191: Color         = NAME .
                   9192: PresMinimum   = NUMBER .
                   9193: PresMaximum   = NUMBER .
1.1       cvs      9194: PresIntervalMin= NUMBER .
                   9195: PresIntervalMax= NUMBER .
1.6       cvs      9196: PresValue     = [ '-' ] PresVal .
                   9197: PresVal       = NUMBER .
1.1       cvs      9198: 
1.6       cvs      9199: TextTransSeq  = [ Alphabet ] TransSeq .
                   9200: Alphabet      = NAME .
                   9201: TransSeq      = 'BEGIN' &lt; Translation > 'END' ';' /
                   9202:                 Translation .
                   9203: Translation   = Source [ '->' Target ] ';' .
                   9204: Source        = STRING .
1.18      cvs      9205: Target        = STRING .</pre>
                   9206: </div>
                   9207: <hr>
1.19      cvs      9208: 
1.18      cvs      9209: </div>
1.1       cvs      9210: 
1.18      cvs      9211: <div class="chapter">
1.1       cvs      9212: 
1.18      cvs      9213: <h1><a name="sect7">Character coding</a></h1>
1.1       cvs      9214: 
1.18      cvs      9215: <div class="section">
1.1       cvs      9216: 
1.18      cvs      9217: <h2><a name="sectb71">Characters</a></h2>
                   9218: <p>
1.1       cvs      9219: The characters of the Latin alphabet follow the encoding defined in the ISO
1.5       cvs      9220: 8859-1 (ISO Latin-1) standard.  The characters of the Greek alphabet follow
1.18      cvs      9221: the encoding defined by Adobe for its Symbol font (Adobe FontSpecific).</p>
                   9222: <p>
1.1       cvs      9223: Characters whose octal code is greater than 0200 are written in the form of
                   9224: their octal code preceded by a backslash character (``\'').  For example, the
1.18      cvs      9225: French word 'R&eacute;sum&eacute;' is written <tt>R\351sum\351</tt>.</p>
                   9226: <p>
1.2       cvs      9227: To the ISO 8859-1 encoding four characters with the following codes have been
1.18      cvs      9228: added:<br>
                   9229: <tt>212</tt>: line break<br>
                   9230: <tt>240</tt>: sticky space<br>
                   9231: <tt>201</tt>: thin space<br>
                   9232: <tt>202</tt>: en space</p>
                   9233: <p>
                   9234: The <tt>212</tt> character is a ``line break'' character which forces a line
                   9235: break.  The <tt>240</tt> character is a ``sticky space'', which cannot be
                   9236: replaced by a line break.</p>
                   9237: </div>
1.1       cvs      9238: 
1.18      cvs      9239: <div class="section">
1.1       cvs      9240: 
1.18      cvs      9241: <h2><a name="sectb72">Symbols</a></h2>
                   9242: <p>
1.1       cvs      9243: The table below gives the codes for the symbols of Thot.  Symbols can be used
                   9244: in presentation schemas constants and in transcoding rules of translation
1.18      cvs      9245: schemas.  Each symbol is represented by a single character.</p>
                   9246: <ul>
                   9247: <li>
                   9248: <tt>r</tt>: a radical
1.19      cvs      9249: </li>
1.18      cvs      9250: <li>
                   9251: <tt>i</tt>: a simple integral
1.19      cvs      9252: </li>
1.18      cvs      9253: <li>
                   9254: <tt>c</tt>: a curvilinear integral
1.19      cvs      9255: </li>
1.18      cvs      9256: <li>
                   9257: <tt>d</tt>: a double integral
1.19      cvs      9258: </li>
1.18      cvs      9259: <li>
                   9260: <tt>t</tt>: a triple integral
1.19      cvs      9261: </li>
1.18      cvs      9262: <li>
                   9263: <tt>S</tt>: the summation symbol
1.19      cvs      9264: </li>
1.18      cvs      9265: <li>
                   9266: <tt>P</tt>: the product symbol
1.19      cvs      9267: </li>
1.18      cvs      9268: <li>
                   9269: <tt>U</tt>: the union symbol
1.19      cvs      9270: </li>
1.18      cvs      9271: <li>
                   9272: <tt>I</tt>: the intersection symbol
1.19      cvs      9273: </li>
1.18      cvs      9274: <li>
                   9275: <tt>></tt>: a right arrow
1.19      cvs      9276: </li>
1.18      cvs      9277: <li>
                   9278: <tt>&lt;</tt>: a left arrow
1.19      cvs      9279: </li>
1.18      cvs      9280: <li>
                   9281: <tt>^</tt>:  an up arrow
1.19      cvs      9282: </li>
1.18      cvs      9283: <li>
                   9284: <tt>V</tt>: a down arrow
1.19      cvs      9285: </li>
1.18      cvs      9286: <li>
                   9287: <tt>(</tt>: an opening parenthesis
1.19      cvs      9288: </li>
1.18      cvs      9289: <li>
                   9290: <tt>)</tt>: a closing parenthesis
1.19      cvs      9291: </li>
1.18      cvs      9292: <li>
                   9293: <tt>{</tt>: an opening brace
1.19      cvs      9294: </li>
1.18      cvs      9295: <li>
                   9296: <tt>}</tt>: a closing brace
1.19      cvs      9297: </li>
1.18      cvs      9298: <li>
                   9299: <tt>[</tt>: an opening bracket
1.19      cvs      9300: </li>
1.18      cvs      9301: <li>
                   9302: <tt>]</tt>: a closing bracket
1.19      cvs      9303: </li>
1.18      cvs      9304: </ul>
                   9305: </div>
1.1       cvs      9306: 
1.18      cvs      9307: <div class="section">
1.1       cvs      9308: 
1.18      cvs      9309: <h2><a name="sectb73">Graphical elements</a></h2>
                   9310: <p>
1.1       cvs      9311: The table below gives the codes for the graphical elements of Thot. These
                   9312: elements can be used in presentation schemas constants and in transcoding
                   9313: rules of translation schemas.  Each graphical element is represented by a
1.18      cvs      9314: single character.</p>
                   9315: <ul>
                   9316: <li>
                   9317: a: a circle
1.19      cvs      9318: </li>
1.18      cvs      9319: <li><p>
                   9320: <tt>A</tt>: an open curve with an arrow head at the end</p>
1.19      cvs      9321: </li>
1.18      cvs      9322: <li>
                   9323: <tt>b</tt>: a horizontal line along the lower side of the box
1.19      cvs      9324: </li>
1.18      cvs      9325: <li>
                   9326: <tt>B</tt>: an open curve
1.19      cvs      9327: </li>
1.18      cvs      9328: <li>
                   9329: <tt>c</tt>: an ellipse inscribed in the box
1.19      cvs      9330: </li>
1.18      cvs      9331: <li>
                   9332: <tt>C</tt>: a rectangle with rounded corners
1.19      cvs      9333: </li>
1.18      cvs      9334: <li>
                   9335: <tt>D</tt>: an open curve with two arrow heads
1.19      cvs      9336: </li>
1.18      cvs      9337: <li>
                   9338: <tt>e</tt>: The northwest/southeast diagonal of the box with an arrowhead at
                   9339: the bottom
1.19      cvs      9340: </li>
1.18      cvs      9341: <li>
                   9342: <tt>E</tt>: The southwest/northeast diagonal of the box with an arrowhead at
                   9343: the top
1.19      cvs      9344: </li>
1.18      cvs      9345: <li>
                   9346: <tt>F</tt>: an open curve with an arrow head at start
1.19      cvs      9347: </li>
1.18      cvs      9348: <li>
                   9349: <tt>h</tt>: a horizontal line as wide as the box and placed in its middle
1.19      cvs      9350: </li>
1.18      cvs      9351: <li>
                   9352: <tt>l</tt>: a vertical line on the left side of the box
1.19      cvs      9353: </li>
1.18      cvs      9354: <li>
                   9355: <tt>L</tt>: a lozenge
1.19      cvs      9356: </li>
1.18      cvs      9357: <li>
                   9358: <tt>M</tt>: an open broken line with two arrow heads
1.19      cvs      9359: </li>
1.18      cvs      9360: <li>
                   9361: <tt>N</tt>: an open broken line with an arrow head at start
1.19      cvs      9362: </li>
1.18      cvs      9363: <li>
                   9364: <tt>o</tt>: The southwest/northeast diagonal of the box with an arrowhead at
                   9365: the bottom
1.19      cvs      9366: </li>
1.18      cvs      9367: <li>
                   9368: <tt>O</tt>: The northwest/southeast diagonal of the box with an arrowhead at
                   9369: the top
1.19      cvs      9370: </li>
1.18      cvs      9371: <li>
                   9372: <tt>p</tt>: a polygon
1.19      cvs      9373: </li>
1.18      cvs      9374: <li>
                   9375: <tt>P</tt>: a rectangle with round corners and a horizontal bar at the top
1.19      cvs      9376: </li>
1.18      cvs      9377: <li>
                   9378: <tt>Q</tt>: an ellipse with a horizontal bar at the top
1.19      cvs      9379: </li>
1.18      cvs      9380: <li>
                   9381: <tt>r</tt>: a vertical line on the right side of the box
1.19      cvs      9382: </li>
1.18      cvs      9383: <li>
                   9384: <tt>R</tt>: a rectangle which is the shape of the box
1.19      cvs      9385: </li>
1.18      cvs      9386: <li>
                   9387: <tt>s</tt>: a closed curve
1.19      cvs      9388: </li>
1.18      cvs      9389: <li>
                   9390: <tt>S</tt>: an open broken line
1.19      cvs      9391: </li>
1.18      cvs      9392: <li>
                   9393: <tt>t</tt>: a horizontal line along the upper side of the box
1.19      cvs      9394: </li>
1.18      cvs      9395: <li>
                   9396: <tt>U</tt>: an open broken line with an arrow head at the end
1.19      cvs      9397: </li>
1.18      cvs      9398: <li>
                   9399: <tt>v</tt>: a vertical line as tall as the box and placed in its middle
1.19      cvs      9400: </li>
1.18      cvs      9401: <li>
                   9402: <tt>V</tt>: a down arrow as tall as the box and in its middle
1.19      cvs      9403: </li>
1.18      cvs      9404: <li>
                   9405: w: a segment (2 points)
1.19      cvs      9406: </li>
1.18      cvs      9407: <li>
                   9408: <tt>W</tt>: the upper right corner
1.19      cvs      9409: </li>
1.18      cvs      9410: <li>
                   9411: x: a segment (2 points) with an arrow head at the end
1.19      cvs      9412: </li>
1.18      cvs      9413: <li>
                   9414: <tt>X</tt>: the lower right corner
1.19      cvs      9415: </li>
1.18      cvs      9416: <li>
                   9417: y: a segment (2 points) with an arrow head at the end
1.19      cvs      9418: </li>
1.18      cvs      9419: <li>
                   9420: <tt>Y</tt>: the lower left corner
1.19      cvs      9421: </li>
1.18      cvs      9422: <li>
                   9423: z: a segment (2 points) with an arrow head at the end
1.19      cvs      9424: </li>
1.18      cvs      9425: <li>
                   9426: <tt>Z</tt>: the upper left corner
1.19      cvs      9427: </li>
1.18      cvs      9428: <li>
                   9429: <tt>space</tt>: a transparent element
1.19      cvs      9430: </li>
1.18      cvs      9431: <li>
                   9432: <tt>^</tt>: an up arrow as tall as the box and in its middle
1.19      cvs      9433: </li>
1.18      cvs      9434: <li>
                   9435: <tt>></tt>: a right arrow as long as the box's width and in its middle
1.19      cvs      9436: </li>
1.18      cvs      9437: <li>
                   9438: <tt>></tt>: a left arrow as long as the box's width and in its middle
1.19      cvs      9439: </li>
1.18      cvs      9440: <li>
                   9441: <tt>/</tt>: The southwest/northeast diagonal of the box
1.19      cvs      9442: </li>
1.18      cvs      9443: <li>
                   9444: <tt>\</tt>: the northwest/southeast diagonal of the box
1.19      cvs      9445: </li>
1.18      cvs      9446: </ul>
                   9447: <hr>
1.19      cvs      9448: 
1.18      cvs      9449: </div>
                   9450: </div>
                   9451: </body>
                   9452: </html>

Webmaster