Annotation of Amaya/doc/languages.html, revision 1.19
1.18 cvs 1: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2: <html>
3: <head>
4: <title>
5: The Languages of Thot</title>
6: </head>
7: <body>
8:
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:
17: <h4>Version of March, 1998</h4>
18: <p>
19: © 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: (`<' 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 < Rule > 'END' .
1502: { The < 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 < '/' Possibility > .
1512: { Right part of an intermediate rule }
1513: Possibility = ElemOpt < ElemOpt > .
1514: ElemOpt = Element / '[' Element < Element > ']' /
1515: '<' Element < 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 < 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 < ',' 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 < Rule > .
1.1 cvs 1763: Rule = ElemID [ LocAttrSeq ] '=' DefWithAttr ';'.
1764: LocAttrSeq = '(' 'ATTR' LocAttr < ';' LocAttr > ')' .
1765: LocAttr = [ '!' ] AttrID [ '=' AttrType ] .
1766: DefWithAttr = Definition
1767: [ '+' '(' ExtensionSeq ')' ]
1768: [ '-' '(' RestrictSeq ')' ]
1769: [ 'WITH' FixedAttrSeq ] .
1770: ExtensionSeq = ExtensionElem < ',' ExtensionElem > .
1771: ExtensionElem = ElemID / 'TEXT' / 'GRAPHICS' /
1772: 'SYMBOL' / 'PICTURE' .
1773: RestrictSeq = RestrictElem < ',' 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 < ',' 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 ';' < 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 ';' < 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 ';' < 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 < ',' 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 ';' < Except ';' > .
2286: Except = [ 'EXTERN' ] [ FirstSec ] ExcTypeOrAttr
2287: ':' ExcValSeq .
2288: ExcTypeOrAttr = ElemID / AttrID .
2289: ExcValSeq = ExcValue < ',' 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>
! 2301: NoSpellCheck' /
1.1 cvs 2302: 'Hidden' / 'ActiveRef' /
2303: 'ImportLine' / 'ImportParagraph' /
2304: 'NoPaginate' / 'ParagraphBreak' /
1.19 ! cvs 2305: 'PageBreak' / 'PageBreakAllowed' / 'PageBreakPlace' /
! 2306: 'PageBreakRepetition' / 'PageBreakRepBefore' /
1.9 cvs 2307: 'HighlightChildren' / 'ExtendedSelection' /
1.19 ! cvs 2308: 'ReturnCreateNL' / 'IsDraw' / 'IsTable' /
! 2309: 'IsRow' / 'IsColHead' / 'IsCell' /
! 2310: 'NewPercentWidth' / 'ColRef' / 'ColSpan' /
! 2311: 'RowSpan' / 'SaveDocument' / 'Shadow' .</pre>
1.18 cvs 2312: <p>
2313: The following are the available exceptions:</p>
2314: <dl>
2315: <dt><tt>NoCut</tt></dt>
2316: <dd>
2317: This exception can only be applied to element types. Elements of a type to
1.13 cvs 2318: which this exception is applied cannot be deleted by the editor.
1.18 cvs 2319: </dd>
2320: <dt><tt>NoCreate</tt></dt>
2321: <dd>
2322: This exception can only be applied to element types. Elements of a type to
1.2 cvs 2323: which this exception is applied cannot be created by ordinary commands for
2324: creating new elements. These elements are usually created by special actions
1.13 cvs 2325: associated with other exceptions.
1.18 cvs 2326: </dd>
2327: <dt><tt>NoHMove</tt></dt>
2328: <dd>
2329: This exception can only be applied to element types. Elements of a type to
2330: which this exception is applied cannot be moved horizontally with the mouse.
2331: Their children elements cannot be moved either.
2332: </dd>
2333: <dt><tt>NoVMove</tt></dt>
2334: <dd>
2335: This exception can only be applied to element types. Elements of a type to
2336: which this exception is applied cannot be moved vertically with the mouse.
2337: Their children elements cannot be moved either.
2338: </dd>
2339: <dt><tt>NoMove</tt></dt>
2340: <dd>
2341: This exception can only be applied to element types. Elements of a type to
1.2 cvs 2342: which this exception is applied cannot be moved in any direction with the
1.13 cvs 2343: mouse. Their children elements cannot be moved either.
1.18 cvs 2344: </dd>
2345: <dt><tt>NoHResize</tt></dt>
2346: <dd>
2347: This exception can only be applied to element types. Elements of a type to
2348: which this exception is applied cannot be resized horizontally with the mouse.
2349: Their children elements cannot be resized either.
2350: </dd>
2351: <dt><tt>NoVResize</tt></dt>
2352: <dd>
2353: This exception can only be applied to element types. Elements of a type to
2354: which this exception is applied cannot be resized vertically with the mouse.
2355: Their children elements cannot be resized either.
2356: </dd>
2357: <dt><tt>NoResize</tt></dt>
2358: <dd>
2359: This exception can only be applied to element types. Elements of a type to
1.2 cvs 2360: which this exception is applied cannot be resized in any direction with the
1.13 cvs 2361: mouse. Their children elements cannot be resized either.
1.18 cvs 2362: </dd>
2363: <dt><tt>MoveResize</tt></dt>
2364: <dd>
2365: This exception can only be applied to element types. Elements of a type to
2366: which this exception is applied can be moved and resized in any direction with
2367: the mouse, even if one of their ancestor element has an exception that
1.13 cvs 2368: prevents moving or resizing. Their children elements can also be resized or
2369: moved.
1.18 cvs 2370: </dd>
2371: <dt><tt>NewWidth</tt></dt>
2372: <dd>
2373: This exception can only be applied to numeric attributes. If the width of an
2374: element which has this attribute is modified with the mouse, the value of the
2375: new width will be assigned to the attribute.
2376: </dd>
2377: <dt><tt>NewHeight</tt></dt>
2378: <dd>
2379: This exception can only be applied to numeric attributes. If the height of an
2380: element which has this attribute is modified with the mouse, the value of the
2381: new height will be assigned to the attribute.
2382: </dd>
2383: <dt><tt>NewHPos</tt></dt>
2384: <dd>
2385: This exception can only be applied to numeric attributes. If the horizontal
2386: position of an element which has this attribute is modified with the mouse,
2387: the value of the new horizontal position will be assigned to the attribute.
2388: </dd>
2389: <dt><tt>NewVPos</tt></dt>
2390: <dd>
2391: This exception can only be applied to numeric attributes. If the vertical
2392: position of an element which has this attribute is modified with the mouse,
2393: the value of the new vertical position will be assigned to the attribute.
2394: </dd>
2395: <dt><tt>Invisible</tt></dt>
2396: <dd>
2397: This exception can only be applied to attributes, but can be applied to all
1.2 cvs 2398: attribute types. It indicates that the attribute must not be seen by the user
2399: and that its value must not be changed directly. This exception is usually
1.5 cvs 2400: used when another exception manipulates the value of an attribute.
1.18 cvs 2401: </dd>
1.19 ! cvs 2402: <dt><tt>NoSelect</tt></dt>
! 2403: <dd>
! 2404: This exception can only be applied to element types. Elements of a type to
! 2405: which this exception is applied cannot be selected directly with the mouse,
! 2406: but they can be selected by other methods provided by the editor.
! 2407: </dd>
! 2408: <dt>NoSpellCheck</dt>
! 2409: <dd>
! 2410: This exception can only be applied to element types. Elements of a type to
! 2411: which this exception is applied are not taken into account by the spell
! 2412: checker.
! 2413: </dd>
1.18 cvs 2414: <dt><tt>Hidden</tt></dt>
2415: <dd>
2416: This exception can only be applied to element types. It indicates that
1.2 cvs 2417: elements of this type, although present in the document's structure, must not
1.18 cvs 2418: be shown to the user of the editor. In particular, the creation menus must
2419: not propose this type and the selection message must not pick it.
2420: </dd>
2421: <dt><tt>ActiveRef</tt></dt>
2422: <dd>
2423: This exception can only be applied to attributes of the reference type. It
1.2 cvs 2424: indicates that when the user of the editor makes a double click on an element
2425: which possesses a reference attribute having this exception, the element
2426: designated by the reference attribute will be selected.
1.18 cvs 2427: </dd>
2428: <dt><tt>ImportLine</tt></dt>
2429: <dd>
2430: This exception can only be applied to element types. It indicates that
1.2 cvs 2431: elements of this type should receive the content of imported text files. An
2432: element is created for each line of the imported file. A structure schema
1.18 cvs 2433: cannot contain several exceptions <tt>ImportLine</tt> and, if it contains one,
2434: it should not contain any exception <tt>ImportParagraph</tt>.
2435: </dd>
2436: <dt><tt>ImportParagraph</tt></dt>
2437: <dd>
2438: This exception can only be applied to element types. It indicates that
1.2 cvs 2439: elements of this type should receive the content of imported text files. An
2440: element is created for each paragraph of the imported file. A paragraph is a
2441: sequence of lines without any empty line. A structure schema cannot contain
1.18 cvs 2442: several exceptions <tt>ImportParagraph</tt> and, if it contains one, it should
2443: not contain any exception <tt>ImportLine</tt>.
2444: </dd>
2445: <dt><tt>NoPaginate</tt></dt>
2446: <dd>
2447: This exception can only be applied to the root element, i.e. the name that
2448: appear after the keyword <tt>STRUCTURE</tt> at the beginning of the structure
1.2 cvs 2449: schema. It indicates that the editor should not allow the user to paginate
1.1 cvs 2450: documents of that type.
1.18 cvs 2451: </dd>
2452: <dt><tt>ParagraphBreak</tt></dt>
2453: <dd>
2454: This exception can only be applied to element types. When the caret is within
2455: an element of a type to which this exception is applied, it is that element
2456: that will be split when the user hits the Return key.
2457: </dd>
2458: <dt><tt>ReturnCreateNL</tt></dt>
2459: <dd>
2460: This exception can only be applied to element types. When the caret is within
2461: an element of a type to which this exception is applied, the Return key simply
2462: inserts a New line character (code \212) at the current position. The Return
2463: key does not create a new element; it does not split the current element
2464: either.
2465: </dd>
2466: <dt><tt>HighlightChildren</tt></dt>
2467: <dd>
2468: This exception can only be applied to element types. Elements of a type to
1.2 cvs 2469: which this exception is applied are not highlighted themselves when they are
2470: selected, but all their children are highlighted instead.
1.18 cvs 2471: </dd>
2472: <dt><tt>ExtendedSelection</tt></dt>
2473: <dd>
2474: This exception can only be applied to element types. The selection extension
2475: command (middle button of the mouse) only add the clicked element (if it has
2476: that exception) to the current selection, without selecting other elements
2477: between the current selection and the clicked element.
2478: </dd>
1.19 ! cvs 2479: <dt>IsDraw, IsTable, IsColHead, IsRow, IsCell</dt>
! 2480: <dd>
! 2481: These exceptions can only be applied to element types. Elements of a type to
! 2482: which these exceptions are applied are identified as Draws, Tables, Colheads,
! 2483: Rows or Cells and specific processing are applied to them.
! 2484: </dd>
! 2485: <dt>ColRef</dt>
! 2486: <dd>
! 2487: This exception can only be applied to attributes of the reference type. It
! 2488: indicates that this attribute refers to the column head (see exception
! 2489: IsColHead) which the element belongs to.
! 2490: </dd>
! 2491: <dt>ColSpan, RowSpan</dt>
! 2492: <dd>
! 2493: These exceptions can only be applied to numeric attributes of cells. They
! 2494: indicate that attribute values give how many columns or rows the element
! 2495: spans.
! 2496: </dd>
! 2497: <dt>Shadow</dt>
! 2498: <dd>
! 2499: This exception can only be applied to element types. Text of elements of a
! 2500: type to which this exception is applied are displayed and printed as a set of
! 2501: stars ('*').
! 2502: </dd>
1.18 cvs 2503: </dl>
2504: <blockquote class="example">
2505: <p>
2506: <strong>Example:</strong></p>
2507: <p>
1.3 cvs 2508: Consider a structure schema for object-style graphics which defines the
1.18 cvs 2509: Graphic_object element type with the associated Height and Weight numeric
2510: attributes. Suppose that we want documents of this class to have the
2511: following qualities:</p>
2512: <ul>
2513: <li>
2514: Whenever the width or height of an object is changed using the mouse, the new
2515: values are stored in the object's Width and Height attributes.
1.19 ! cvs 2516: </li>
1.18 cvs 2517: <li>
2518: The user should not be able to change the values of the Width and Height
1.5 cvs 2519: attributes via the Attributes menu of the Thot editor.
1.19 ! cvs 2520: </li>
1.18 cvs 2521: </ul>
2522: <p>
2523: The following exceptions will produce this effect.</p>
2524: <pre>STRUCT
1.1 cvs 2525: ...
1.5 cvs 2526: Graphics_object (ATTR Height = Integer; Width = Integer)
1.1 cvs 2527: = GRAPHICS with Height ?= 10, Width ?= 10;
2528: ...
2529: EXCEPT
2530: Height: NewHeight, Invisible;
1.18 cvs 2531: Width: NewWidth, Invisible;</pre>
2532: </blockquote>
2533: </div>
2534: </div>
1.1 cvs 2535:
1.18 cvs 2536: <div class="section">
1.1 cvs 2537:
1.18 cvs 2538: <h2><a name="sectb33">Some examples</a></h2>
2539: <p>
1.1 cvs 2540: In order to illustrate the principles of the document model and the syntax of
2541: the S language, this section presents two examples of structure schemas. One
1.18 cvs 2542: defines a class of documents, the other defines a class of objects.</p>
1.1 cvs 2543:
1.18 cvs 2544: <div class="subsection">
1.1 cvs 2545:
1.18 cvs 2546: <h3><a name="sectc331">A class of documents: articles</a></h3>
2547: <p>
1.1 cvs 2548: This example shows a possible structure for articles published in a journal.
1.18 cvs 2549: Text between braces is comments.</p>
2550: <pre>STRUCTURE Article; { This schema defines the Article class }
1.1 cvs 2551: DEFPRES ArticleP; { The default presentation schema is
2552: ArticleP }
2553: ATTR { Global attribute definitions }
2554: WordType = Definition, IndexWord, DocumentTitle;
2555: { A single global attribute is defined, with three values }
2556: STRUCT { Definition of the generic structure }
2557: Article = BEGIN { The Article class has an aggregate
2558: structure }
2559: Title = BEGIN { The title is an aggregate }
2560: French_title =
2561: Text WITH Language='Fran\347ais';
2562: English_title =
2563: Text WITH Language='English';
2564: END;
2565: Authors =
2566: LIST OF (Author
2567: (ATTR Author_type=principal,secondary)
2568: { The Author type has a local attribute }
2569: = BEGIN
2570: Author_name = Text;
2571: Info = Paragraphs ;
2572: { Paragraphs is defined later }
2573: Address = Text;
2574: END
2575: );
2576: Keywords = Text;
2577: { The journal's editor introduces the article
2578: with a short introduction, in French and
2579: in English }
2580: Introduction =
2581: BEGIN
2582: French_intr = Paragraphs WITH
2583: Language='Fran\347ais';
2584: English_intr = Paragraphs WITH
2585: Language='English';
2586: END;
2587: Body = Sections; { Sections are defined later }
2588: { Appendixes are only created on demand }
2589: ? Appendices =
2590: LIST OF (Appendix =
2591: BEGIN
2592: Appendix_Title = Text;
2593: Appendix_Contents = Paragraphs;
2594: END
2595: );
2596: END; { End of the Article aggregate }
2597:
2598: Sections = LIST [2..*] OF (
2599: Section = { At least 2 sections }
2600: BEGIN
2601: Section_title = Text;
2602: Section_contents =
2603: BEGIN
2604: Paragraphs;
2605: Sections; { Sections at a lower level }
2606: END;
2607: END
2608: );
2609:
2610: Paragraphs = LIST OF (Paragraph = CASE OF
2611: Enumeration =
2612: LIST [2..*] OF
2613: (Item = Paragraphs);
2614: Isolated_formula = Formula;
2615: LIST OF (UNIT);
2616: END
2617: );
2618:
2619: ASSOC { Associated elements definitions }
2620:
2621: Figure = BEGIN
1.5 cvs 2622: Figure_caption = Text;
1.1 cvs 2623: Illustration = NATURE;
2624: END;
2625:
2626: Biblio_citation = CASE OF
2627: Ref_Article =
2628: BEGIN
2629: Authors_Bib = Text;
2630: Article_Title = Text;
2631: Journal = Text;
2632: Page_Numbers = Text;
2633: Date = Text;
2634: END;
2635: Ref_Livre =
2636: BEGIN
2637: Authors_Bib; { Defined above }
2638: Book_Title = Text;
2639: Editor = Text;
2640: Date; { Defined above }
2641: END;
2642: END;
2643:
2644: Note = Paragraphs - (Ref_note);
2645:
2646: UNITS { Elements which can be used in objects }
2647:
2648: Ref_note = REFERENCE (Note);
2649: Ref_biblio = REFERENCE (Biblio_citation);
2650: Ref_figure = REFERENCE (Figure);
2651: Ref_formula = REFERENCE (Isolated_formula);
2652:
2653: EXPORT { Skeleton elements }
2654:
2655: Title,
1.5 cvs 2656: Figure with Figure_caption,
1.1 cvs 2657: Section With Section_title;
2658:
1.18 cvs 2659: END { End of the structure schema }</pre>
2660: <p>
1.1 cvs 2661: This schema is very complete since it defines both paragraphs and
2662: bibliographic citations. These element types could just as well be defined in
1.18 cvs 2663: other structure schemas, as is the case with the <tt>Formula</tt> class. All
1.1 cvs 2664: sorts of other elements can be inserted into an article, since a paragraph can
2665: contain any type of unit. Similarly, figures can be any class of document or
1.18 cvs 2666: object that the user chooses.</p>
2667: <p>
1.1 cvs 2668: Generally, an article doesn't contain appendices, but it is possible to add
2669: them on explicit request: this is the effect of the question mark before the
1.18 cvs 2670: word Appendices.</p>
2671: <p>
1.1 cvs 2672: The Figure, Biblio_citation and Note elements are associated elements. Thus,
1.18 cvs 2673: they are only used in <tt>REFERENCE</tt> statements.</p>
2674: <p>
1.1 cvs 2675: Various types of cross-references can be put in paragraphs. They can also be
2676: placed the objects which are part of the article, since the cross-references
1.18 cvs 2677: are defined as units (<tt>UNITS</tt>).</p>
2678: <p>
1.1 cvs 2679: There is a single restriction to prevent the creation of Ref_note elements
1.18 cvs 2680: within notes.</p>
2681: <p>
1.1 cvs 2682: It is worth noting that the S language permits the definition of recursive
2683: structures like sections: a section can contain other sections (which are thus
2684: at the next lower level of the document tree). Paragraphs are also recursive
2685: elements, since a paragraph can contain an enumeration in which each element
1.18 cvs 2686: (<tt>Item</tt>) is composed of paragraphs.</p>
2687: </div>
1.1 cvs 2688:
1.18 cvs 2689: <div class="subsection">
1.1 cvs 2690:
1.18 cvs 2691: <h3><a name="sectc332">A class of objects: mathematical formulas</a></h3>
2692: <p>
2693: The example below defines the <tt>Formula</tt> class which is used in Article
1.1 cvs 2694: documents. This class represents mathematical formulas with a rather simple
2695: structure, but sufficient to produce a correct rendition on the screen or
2696: printer. To support more elaborate operations (formal or numeric
2697: calculations), a finer structure should be defined. This class doesn't use any
1.18 cvs 2698: other class and doesn't define any associated elements or units.</p>
2699: <pre>STRUCTURE Formula;
1.1 cvs 2700: DEFPRES FormulaP;
2701:
2702: ATTR
2703: String_type = Function_name, Variable_name;
2704:
2705: STRUCT
2706: Formula = Expression;
2707: Expression = LIST OF (Construction);
2708: Construction = CASE OF
2709: TEXT; { Simple character string }
2710: Index = Expression;
2711: Exponent = Expression;
2712: Fraction =
2713: BEGIN
1.6 cvs 2714: Numerator = Expression;
1.1 cvs 2715: Denominator = Expression;
2716: END;
2717: Root =
2718: BEGIN
2719: ? Order = TEXT;
2720: Root_Contents = Expression;
2721: END;
2722: Integral =
2723: BEGIN
2724: Integration_Symbol = SYMBOL;
2725: Lower_Bound = Expression;
2726: Upper_Bound = Expression;
2727: END;
2728: Triple =
2729: BEGIN
2730: Princ_Expression = Expression;
2731: Lower_Expression = Expression;
2732: Upper_Expression = Expression;
2733: END;
2734: Column = LIST [2..*] OF
2735: (Element = Expression);
2736: Parentheses_Block =
2737: BEGIN
2738: Opening = SYMBOL;
2739: Contents = Expression;
2740: Closing = SYMBOL;
2741: END;
2742: END; { End of Choice Constructor }
1.18 cvs 2743: END { End of Structure Schema }</pre>
2744: <p>
1.1 cvs 2745: This schema defines a single global attribute which allows functions and
2746: variables to be distinguished. In the presentation schema, this attribute can
2747: be used to choose between roman (for functions) and italic characters (for
1.18 cvs 2748: variables).</p>
2749: <p>
1.1 cvs 2750: A formula's structure is that of a mathematical expression, which is itself a
2751: sequence of mathematical constructions. A mathematical construction can be
2752: either a simple character string, an index, an exponent, a fraction, a root,
2753: etc. Each of these mathematical constructions has a sensible structure which
2754: generally includes one or more expressions, thus making the formula class's
1.18 cvs 2755: structure definition recursive.</p>
2756: <p>
1.1 cvs 2757: In most cases, the roots which appear in the formulas are square roots and
2758: their order (2) is not specified. This is why the Order component is marked
2759: optional by a question mark. When explicitly requested, it is possible to add
1.18 cvs 2760: an order to a root, for example for cube roots (order = 3).</p>
2761: <p>
1.1 cvs 2762: An integral is formed by an integration symbol, chosen by the user (simple
2763: integral, double, curvilinear, etc.), and two bounds. A more fine-grained
2764: schema would add components for the integrand and the integration variable.
2765: Similarly, the Block_Parentheses construction leaves the choice of opening and
2766: closing symbols to the user. They can be brackets, braces, parentheses,
1.18 cvs 2767: etc.</p>
2768: </div>
2769: </div>
2770: <hr>
1.19 ! cvs 2771:
1.18 cvs 2772: </div>
1.1 cvs 2773:
1.18 cvs 2774: <div class="chapter">
1.1 cvs 2775:
1.18 cvs 2776: <h1><a name="sect4">The P Language</a></h1>
1.1 cvs 2777:
1.18 cvs 2778: <div class="section">
1.1 cvs 2779:
1.18 cvs 2780: <h2><a name="sectb41">Document presentation</a></h2>
2781: <p>
1.1 cvs 2782: Because of the model adopted for Thot, the presentation of documents is
2783: clearly separated from their structure and content. After having presented
2784: the logical structure of documents, we now detail the principles implemented
1.18 cvs 2785: for their presentation. The concept of <em>presentation</em> encompasses what
1.5 cvs 2786: is often called the page layout, the composition, or the document style. It
1.18 cvs 2787: is the set of operations which display the document on the screen or print it
2788: on paper. Like logical structure, document presentation is defined
2789: generically with the help of a language, called P.</p>
1.1 cvs 2790:
1.18 cvs 2791: <div class="subsection">
1.1 cvs 2792:
1.18 cvs 2793: <h3><a name="sectc411">Two levels of presentation</a></h3>
2794: <p>
1.1 cvs 2795: The link between structure and presentation is clear: the logical organization
2796: of a document is used to carry out its presentation, since the purpose of the
2797: presentation is to make evident the organization of the document. But the
2798: presentation is equally dependent on the device used to render the document.
2799: Certain presentation effects, notably changes of font or character set, cannot
2800: be performed on all printers or on all screens. This is why Thot uses a
2801: two-level approach, where the presentation is first described in abstract
2802: terms, without taking into account each particular device, and then the
1.18 cvs 2803: presentation is realized within the constraints of a given device.</p>
2804: <p>
1.1 cvs 2805: Thus, presentation is only described as a function of the structure of the
2806: documents and the image that would be produced on an idealized device. For
2807: this reason, presentation descriptions do not refer to any device
1.18 cvs 2808: characteristics: they describe <em>abstract presentations</em> which can be
2809: concretized on different devices.</p>
2810: <p>
2811: A presentation description also defines a <em>generic presentation</em>, since
1.1 cvs 2812: it describes the appearance of a class of documents or objects. This generic
2813: presentation must also be applied to document and object instances, each
2814: conforming to its generic logical structure, but with all the allowances that
2815: were called to mind above: missing elements, constructed elements with other
1.18 cvs 2816: logical structures, etc.</p>
2817: <p>
1.1 cvs 2818: In order to preserve the homogeneity between documents and objects,
2819: presentation is described with a single set of tools which support the layout
2820: of a large document as well as the composition of objects like a graphical
2821: figure or mathematical formula. This unity of presentation description tools
2822: contrasts with the traditional approach, which focuses more on documents than
2823: objects and thus is based on the usual typographic conventions, such as the
2824: placement of margins, indentations, vertical spaces, line lengths,
1.18 cvs 2825: justification, font changes, etc.</p>
2826: </div>
1.1 cvs 2827:
1.18 cvs 2828: <div class="subsection">
1.1 cvs 2829:
1.18 cvs 2830: <h3><a name="sectc412">Boxes</a></h3>
2831: <p>
1.1 cvs 2832: To assure the homogeneity of tools, all presentation in Thot, for documents as
2833: well as for the objects which they contain, is based on the notion of the
1.18 cvs 2834: <em>box</em>, such as was implemented in T<sub><big>E</big></sub>X.</p>
2835: <p>
1.1 cvs 2836: Corresponding to each element of the document is a box, which is the
2837: rectangle enclosing the element on the display device (screen or sheet of
1.18 cvs 2838: paper); the outline of this rectangle is not visible, except when a <a
2839: href="#sectc4230a"><tt>ShowBox</tt> rule</a> applies to the element. The sides
2840: of the box are parallel to the sides of the screen or the sheet of paper. By
2841: way of example, a box is associated with a character string, a line of text, a
2842: page, a paragraph, a title, a mathematical formula, or a table cell.</p>
2843: <p>
1.1 cvs 2844: Whatever element it corresponds to, each box possesses four sides and four
1.18 cvs 2845: axes, which we designate as follows (<a href="#boxes">see figure</a>):</p>
2846: <dl>
2847: <dt><tt>Top</tt></dt>
2848: <dd>
2849: the upper side,
2850: </dd>
2851: <dt><tt>Bottom</tt></dt>
2852: <dd>
2853: the lower side,
2854: </dd>
2855: <dt><tt>Left</tt></dt>
2856: <dd>
2857: the left side,
2858: </dd>
2859: <dt><tt>Right</tt></dt>
2860: <dd>
2861: the right side,
2862: </dd>
2863: <dt><tt>VMiddle</tt></dt>
2864: <dd>
2865: the vertical axis passing through the center of the box,
2866: </dd>
2867: <dt><tt>HMiddle</tt></dt>
2868: <dd>
2869: the horizontal axis passing through the center of the box,
2870: </dd>
2871: <dt><tt>VRef</tt></dt>
2872: <dd>
2873: the vertical reference axis,
2874: </dd>
2875: <dt><tt>HRef</tt></dt>
2876: <dd>
2877: the horizontal reference axis.
2878: </dd>
2879: </dl>
2880:
2881: <div class="figure">
2882: <hr>
1.19 ! cvs 2883:
1.18 cvs 2884: <pre> Left VRef VMiddle Right
1.1 cvs 2885: : :
2886: Top -----------------------------
2887: | : : |
2888: | : : |
2889: | : : |
2890: | : : |
2891: | : : |
2892: HMiddle ..|...........................|..
2893: | : : |
2894: | : : |
2895: HRef ..|...........................|..
2896: | : : |
2897: | : : |
2898: Bottom -----------------------------
1.18 cvs 2899: : :</pre>
1.19 ! cvs 2900: <p align="center">
1.18 cvs 2901: <em><a name="boxes">The sides and axes of boxes</a><em></em></em></p>
2902: <hr>
1.19 ! cvs 2903:
1.18 cvs 2904: </div>
2905: <p>
1.1 cvs 2906: The principal role of boxes is to set the extent and position of the images of
2907: the different elements of a document with respect to each other on the
2908: reproduction device. This is done by defining relations between the boxes of
2909: different elements which give relative extents and positions to these
1.18 cvs 2910: boxes.</p>
2911: <p>
2912: There are three types of boxes:</p>
2913: <ul>
2914: <li>
2915: boxes corresponding to structural elements of the document,
1.19 ! cvs 2916: </li>
1.18 cvs 2917: <li>
2918: presentation boxes,
1.19 ! cvs 2919: </li>
1.18 cvs 2920: <li>
2921: page layout boxes.
1.19 ! cvs 2922: </li>
1.18 cvs 2923: </ul>
2924: <p>
2925: <strong>Boxes corresponding to structural elements of the document</strong>
1.1 cvs 2926: are those which linked to each of the elements (base or structured) of the
2927: logical structure of the document. Such a box contains all the contents of
1.18 cvs 2928: the element to which it corresponds (there is an exception: see <a
2929: href="#sectc4220">rules <tt>VertOverflow</tt> and <tt>HorizOverflow</tt></a>).
2930: These boxes form a tree-like structure, identical to that of the structural
2931: elements to which they correspond. This tree expresses the inclusion
2932: relationships between the boxes: a box includes all the boxes of its subtree.
2933: On the other hand, there are no predefined rules for the relative positions of
2934: the included boxes. If they are at the same level, they can overlap, be
2935: contiguous, or be disjoint. The rules expressed in the generic presentation
2936: specify their relative positions.</p>
2937: <p>
2938: <strong>Presentation boxes</strong> represent elements which are not found in
1.1 cvs 2939: the logical structure of the document but which are added to meet the needs of
2940: presentation. These boxes are linked to the elements of the logical structure
2941: that are best suited to bringing them out. For example, they are used to add
2942: the character string ``Summary:'' before the summary in the presentation of a
2943: report or to represent the fraction bar in a formula, or also to make the
2944: title of a field in a form appear. These elements have no role in the logical
2945: structure of the document: the presence of a Summary element in the document
2946: does not require the creation of another structural object to hold the word
2947: ``Summary''. Similarly, if a Fraction element contains both a Numerator
2948: element and a Denominator element, the fraction bar has no purpose
2949: structurally. On the other hand, these elements of the presentation are
2950: important for the reader of the reproduced document or for the user of an
2951: editor. This is why they must appear in the document's image. It is the
2952: generic presentation which specifies the presentation boxes to add by
2953: indicating their content (a base element for which the value is specified) and
2954: the position that they must take in the tree of boxes. During editing, these
1.18 cvs 2955: boxes cannot be modified by the user.</p>
2956: <p>
2957: <strong>Page layout boxes</strong> are boxes created implicitly by the page
1.1 cvs 2958: layout rules. These rules indicate how the contents of a structured element
2959: must be broken into lines and pages. In contrast to presentation boxes, these
2960: line and page boxes do not depend on the logical structure of the document,
1.18 cvs 2961: but rather on the physical constraints of the output devices: character size,
2962: height and width of the window on the screen or of the sheet of paper.</p>
2963: </div>
1.1 cvs 2964:
1.18 cvs 2965: <div class="subsection">
1.1 cvs 2966:
1.18 cvs 2967: <h3><a name="sectc413">Views and visibility</a></h3>
2968: <p>
1.1 cvs 2969: One of the operations that one might wish to perform on a document is to view
2970: it is different ways. For this reason, it is possible to define several
1.18 cvs 2971: <em>views</em> for the same document, or better yet, for all documents of the
1.1 cvs 2972: same class. A view is not a different presentation of the document, but
2973: rather a filter which only allows the display of certain parts of the
2974: document. For example, it might be desirable to see only the titles of
2975: chapters and sections in order to be able to move rapidly through the
2976: document. Such a view could be called a ``table of contents''. It might also
2977: be desirable to see only the mathematical formulas of a document in order to
2978: avoid being distracted by the non-mathematical aspects of the document. A
1.18 cvs 2979: ``mathematics'' view could provide this service.</p>
2980: <p>
1.1 cvs 2981: Views, like presentation, are based on the generic logical structure. Each
2982: document class, and each generic presentation, can be provided with views
2983: which are particularly useful for that class or presentation. For each view,
1.18 cvs 2984: the <em>visibility</em> of elements is defined, indicated whether or not the
1.1 cvs 2985: elements must be presented to the user. The visibility is calculated as a
2986: function of the type of the elements or their hierarchical position in the
2987: structure of the document. Thus, for a table of contents, all the ``Chapter
2988: Title'' and ``Section Title'' elements are made visible. However, the
2989: hierarchical level could be used to make the section titles invisible below a
2990: certain threshold level. By varying this threshold, the granularity of the
2991: view can be varied. In the ``mathematics'' view, only Formula elements would
1.18 cvs 2992: be made visible, no matter what their hierarchical level.</p>
2993: <p>
1.1 cvs 2994: Because views are especially useful for producing a synthetic image of the
2995: document, it is necessary to adapt the presentation of the elements to the
2996: view in which they appear. For example, it is inappropriate to have a page
2997: break before every chapter title in the table of contents. Thus, generic
2998: presentations take into account the possible views and permit each element
1.18 cvs 2999: type's presentation to vary according the view in which its image appears.</p>
3000: <p>
3001: <a name="views">Views</a> are also used, when editing documents, to display
1.1 cvs 3002: the associated elements. So, in addition to the primary view of the document,
3003: there can be a ``notes'' view and a ``figures'' view which contain,
3004: respectively, the associated elements of the Note and Figure types. In this
3005: way, it is possible to see simultaneously the text which refers to these
3006: elements and the elements themselves, even if they will be separated when
1.18 cvs 3007: printed.</p>
3008: </div>
1.1 cvs 3009:
1.18 cvs 3010: <div class="subsection">
1.1 cvs 3011:
1.18 cvs 3012: <h3><a name="sectc414">Pages</a></h3>
3013: <p>
1.1 cvs 3014: Presentation schemas can be defined which display the document as a long
3015: scroll, without page breaks. This type of schema is particularly well-suited
3016: to the initial phase of work on a document, where jumps from page to page
3017: would hinder composing and reading the document on a screen. In this case,
3018: the associated elements (such as notes), which are normally displayed in the
3019: page footer, are presented in a separate window. But, once the document is
3020: written, it may be desirable to display the document on the screen in the same
3021: manner in which it will be printed. So, the presentation schema must define
1.18 cvs 3022: pages.</p>
3023: <p>
1.1 cvs 3024: The P language permits the specification of the dimensions of pages as well as
3025: their composition. It is possible to generate running titles, page numbers,
3026: zones at the bottom of the page for notes, etc. The editor follows this model
3027: and inserts page break marks in the document which are used during printing,
1.18 cvs 3028: insuring that the pages on paper are the same as on the screen.</p>
3029: <p>
1.1 cvs 3030: Once a document has been edited with a presentation schema defining pages, it
3031: contains page marks. But it is always possible to edit the document using a
3032: schema without pages. In this case, the page marks are simply ignored by the
3033: editor. They are considered again as soon as a schema with pages is used.
1.18 cvs 3034: Thus, the user is free to choose between schemas with and without pages.</p>
3035: <p>
1.1 cvs 3036: Thot treats the page break, rather than the page itself, as a box. This page
3037: break box contains all the elements of one page's footer, a rule marking the
3038: edge of this page, and all the elements of the next page's header. The
3039: elements of the header and footer can be running titles, page number,
3040: associated elements (notes, for example), etc. All these elements, as well as
3041: their content and graphical appearance, are defined by the generic
1.18 cvs 3042: presentation.</p>
3043: </div>
1.1 cvs 3044:
1.18 cvs 3045: <div class="subsection">
1.1 cvs 3046:
1.18 cvs 3047: <h3><a name="sectc415">Numbering</a></h3>
3048: <p>
1.1 cvs 3049: Many elements are numbered in documents: pages, chapters, sections, formulas,
3050: theorems, notes, figures, bibliographic references, exercises, examples,
3051: lemmas, etc. Because Thot has a notion of logical structure, all of these
3052: numbers (with the exception of pages) are redundant with information implicit
3053: in the logical structure of the document. Such numbers are simply a way to
3054: make the structure of the document more visible. So, they are part of the
3055: document's presentation and are calculated by the editor from the logical
3056: structure. The structure does not contain numbers as such; it only defines
3057: relative structural positions between elements, which serve as ordering
1.18 cvs 3058: relations on these elements.</p>
3059: <p>
1.1 cvs 3060: If the structure schema defines the body of a document as a sequence of at
1.18 cvs 3061: least two chapters:</p>
3062: <pre>Body = LIST [2..*] OF Chapter;</pre>
3063: <p>
3064: the sequence defined by the list constructor is ordered and each chapter can
3065: be assigned a number based on its rank in the Body list. Therefore, all
3066: elements contained in lists a the structure of a document can be numbered, but
3067: they are not the only ones. The tree structure induced by the aggregate,
3068: list, and choice constructors (excluding references) defines a total order on
3069: the elements of the document's primary structure. So, it is possible to
3070: define a numbering which uses this order, filtering elements according to
3071: their type so that only certain element types are taken into account in the
3072: numbering. In this way, it possible to number all the theorems and lemmas of
3073: a chapter in the same sequence of numbers, even when they are not part of the
3074: same list constructor and appear at different levels of the document's tree.
3075: By changing the filter, they can be numbered separately: one sequence of
3076: numbers for theorems, another for the lemmas.</p>
3077: <p>
1.1 cvs 3078: Associated elements pose a special problem, since they are not part of the
3079: document's primary structure, but are attached only by references, which
3080: violate the total order of the document. Then, these associated elements are
3081: frequently numbered, precisely because the number is an effective way to
3082: visualize the reference. In order to resolve this problem, Thot implicitly
3083: defines a list constructor for each type of associated element, gathering
3084: together (and ordering) these elements. Thus, the associated elements can be
1.18 cvs 3085: numbered by type.</p>
3086: <p>
1.1 cvs 3087: Since they are calculated from the document's logical structure and only for
3088: the needs of the presentation, numbers are presentation elements, described by
3089: presentation boxes, just like the fraction bar or the word ``Summary''.
3090: Nevertheless, numbers differ from these other boxes because their content
3091: varies from instance to instance, even though they are of the same type,
3092: whereas all fraction bars are horizontal lines and the same word ``Summary''
1.18 cvs 3093: appears at the head of every document's summary.</p>
3094: </div>
1.1 cvs 3095:
1.18 cvs 3096: <div class="subsection">
1.1 cvs 3097:
1.18 cvs 3098: <h3><a name="sectc416">Presentation parameters</a></h3>
3099: <p>
1.1 cvs 3100: The principal parameters which determine document presentation are the
1.18 cvs 3101: <em>positions</em> and <em>dimensions</em> of boxes, the <em>font</em>, the
3102: <em>style</em>, the <em>size</em>, the <em>underlining</em> and the
3103: <em>color</em> of their content. From these parameters, and some others of
1.1 cvs 3104: less importance, it is possible to represent the usual typographic parameters
3105: for the textual parts of the document. These same parameters can be used to
3106: describe the geometry of the non-textual elements, even though they are
1.18 cvs 3107: two-dimensional elements unlike the text, which is linear.</p>
3108: <p>
1.1 cvs 3109: As we have already seen, the positions of the boxes always respect the rule
3110: of enclosure: a box in the tree encloses all the boxes of the next lower level
3111: which are attached to it. The positional parameters permit the specification
3112: of the position of each box in relation to the enclosing box or to its sibling
3113: boxes (boxes directly attached to the same enclosing box in the tree of
1.18 cvs 3114: boxes).</p>
3115: <p>
1.1 cvs 3116: The presentation parameters also provide control over the dimensions of the
3117: boxes. The dimensions of a box can depend either on its content or on its
3118: context (its sibling boxes and the enclosing box). Each dimension (height or
1.18 cvs 3119: width) can be defined independently of the other.</p>
3120: <p>
1.1 cvs 3121: Because of the position and dimension parameters, it is possible to do the
3122: same things that are normally done in typography by changing margins, line
3123: lengths, and vertical or horizontal skips. This approach can also align or
1.18 cvs 3124: center elements and groups of elements.</p>
3125: <p>
1.1 cvs 3126: In contrast to the position and dimension parameters, the font, style, size,
3127: underlining, and color do not concern the box itself (the rectangle delimiting
3128: the element), but its content. These parameters indicate the typographic
3129: attributes which must be applied to the text contained in the box, and by
1.18 cvs 3130: extension, to all base elements.</p>
3131: <p>
1.1 cvs 3132: For text, the font parameter is used to change the family of characters
3133: (Times, Helvetica, Courier, etc.); the style is used to obtain italic or
3134: roman, bold or light characters; the size determines the point size of the
3135: characters; underlining defines the type and thickness of the lines drawn
1.18 cvs 3136: above, below, or through the characters.</p>
3137: <p>
1.1 cvs 3138: For graphics, the line style parameter can be either solid, dotted, or dashed;
3139: the line thickness parameter controls the width of the lines; the fill pattern
1.18 cvs 3140: parameter determines how closed geometric figures must be filled.</p>
3141: <p>
1.1 cvs 3142: While some of the parameters which determine the appearance of a box's
3143: contents make sense only for one content type (text or graphic), other
3144: parameters apply to all content types: these are the color parameters. These
1.18 cvs 3145: indicate the color of lines and the background color.</p>
3146: </div>
3147: </div>
1.1 cvs 3148:
1.18 cvs 3149: <div class="section">
1.1 cvs 3150:
1.18 cvs 3151: <h2><a name="sectb42">Presentation description language</a></h2>
3152: <p>
1.1 cvs 3153: A generic presentation defines the values of presentation parameters (or the
3154: way to calculate those values) for a generic structure, or more precisely, for
3155: all the element types and all the global and local attributes defined in that
3156: generic structure. This definition of the presentation parameters is made
3157: with the P language. A program written in this language, that is a generic
1.18 cvs 3158: presentation expressed in P, is call a <em>presentation schema</em>. This
3159: section describes the syntax and semantics of the language, using the same <a
3160: href="#sectc321">meta-language</a> as was used for the definition of the S
3161: language.</p>
3162: <p>
1.1 cvs 3163: Recall that it is possible to write many different presentation schemas for
3164: the same class of documents or objects. This allows users to choose for a
3165: document the graphical appearance which best suits their type of work or
1.18 cvs 3166: their personal taste.</p>
1.1 cvs 3167:
1.18 cvs 3168: <div class="subsection">
1.1 cvs 3169:
1.18 cvs 3170: <h3><a name="sectc421">The organization of a presentation schema</a></h3>
3171: <p>
3172: A presentation schema begins with the word <tt>PRESENTATION</tt> and ends with
3173: the word <tt>END</tt>. The word <tt>PRESENTATION</tt> is followed by the name
1.1 cvs 3174: of the generic structure to which the presentation will be applied. This name
1.18 cvs 3175: must be the same as that which follows the keyword <tt>STRUCTURE</tt> in the
3176: structure schema associated with the presentation schema.</p>
3177: <p>
1.1 cvs 3178: After this declaration of the name of the structure, the following sections
1.18 cvs 3179: appear (in order):</p>
3180: <ul>
3181: <li>
3182: Declarations of
3183: <ul>
3184: <li>
3185: all views,
1.19 ! cvs 3186: </li>
1.18 cvs 3187: <li>
3188: printed views,
1.19 ! cvs 3189: </li>
1.18 cvs 3190: <li>
3191: counters,
1.19 ! cvs 3192: </li>
1.18 cvs 3193: <li>
3194: presentation constants,
1.19 ! cvs 3195: </li>
1.18 cvs 3196: <li>
3197: variables,
1.19 ! cvs 3198: </li>
1.18 cvs 3199: </ul>
1.19 ! cvs 3200: </li>
1.18 cvs 3201: <li>
3202: default presentation rules,
1.19 ! cvs 3203: </li>
1.18 cvs 3204: <li>
3205: presentation box and page layout box definitions,
1.19 ! cvs 3206: </li>
1.18 cvs 3207: <li>
3208: presentation rules for structured elements,
1.19 ! cvs 3209: </li>
1.18 cvs 3210: <li>
3211: presentation rules for attributes,
1.19 ! cvs 3212: </li>
1.18 cvs 3213: <li>
3214: rules for transmitting values to attributes of included documents.
1.19 ! cvs 3215: </li>
1.18 cvs 3216: </ul>
3217: <p>
1.1 cvs 3218: Each of these sections is introduced by a keyword which is followed by a
1.18 cvs 3219: sequence of declarations. Every section is optional.</p>
3220: <pre> SchemaPres ='PRESENTATION' ElemID ';'
1.1 cvs 3221: [ 'VIEWS' ViewSeq ]
3222: [ 'PRINT' PrintViewSeq ]
3223: [ 'COUNTERS' CounterSeq ]
3224: [ 'CONST' ConstSeq ]
3225: [ 'VAR' VarSeq ]
3226: [ 'DEFAULT' ViewRuleSeq ]
3227: [ 'BOXES' BoxSeq ]
3228: [ 'RULES' PresentSeq ]
3229: [ 'ATTRIBUTES' PresAttrSeq ]
3230: [ 'TRANSMIT' TransmitSeq ]
3231: 'END' .
1.18 cvs 3232: ElemID = NAME .</pre>
3233: </div>
1.1 cvs 3234:
1.18 cvs 3235: <div class="subsection">
1.1 cvs 3236:
1.18 cvs 3237: <h3><a name="sectc422">Views</a></h3>
3238: <p>
1.1 cvs 3239: Each of the possible views must be declared in the presentation schema. As
1.18 cvs 3240: has <a href="#views">already been described</a>, the presentation rules for an
1.1 cvs 3241: element type can vary according to the view in which the element appears. The
3242: name of the view is used to designate the view to which the presentation rules
1.18 cvs 3243: apply (see the <a href="#inkeyword"><tt>IN</tt> instruction</a>). The
1.1 cvs 3244: definition of the view's contents are dispersed throughout the presentation
3245: rules attached to the different element types and attributes. The
1.18 cvs 3246: <tt>VIEWS</tt> section is simply a sequence of view names separated by commas
3247: and terminated by a semi-colon.</p>
3248: <p>
1.1 cvs 3249: One of the view names (and only one) can be followed by the keyword
1.18 cvs 3250: <tt>EXPORT</tt>. This keyword identifies the view which presents the members
3251: of the document class in <a href="#sectc3213">skeleton form</a>. The
3252: graphical appearance and the content of this view is defined just as with
3253: other views, but it is useless to specify presentation rules concerning this
3254: view for the elements which are not loaded in the skeleton form.</p>
3255: <p>
1.1 cvs 3256: It is not necessary to declare any views; in this case there is a single
3257: unnamed view. If many views are declared, the first view listed is considered
3258: the principal view. The principal view is the one to which all rules that are
1.18 cvs 3259: not preceded by an indication of a view will apply (see the <a
3260: href="#inkeyword">instruction <tt>IN</tt></a>).</p>
3261: <p>
1.1 cvs 3262: The principal view is the the one which the editor presents on the screen when
3263: the user asks to create or edit a document. Thus, it makes sense to put the
3264: most frequently used view at the head of the list. But if the structure
1.18 cvs 3265: schema contains <a href="#sectc3213">skeleton elements</a> and is loaded in
3266: its skeleton form, the view whose name is followed by the keyword
3267: <tt>EXPORT</tt> will be opened and no other views can be opened.</p>
3268: <pre> 'VIEWS' ViewSeq
1.1 cvs 3269: ViewSeq = ViewDeclaration
1.6 cvs 3270: < ',' ViewDeclaration > ';' .
1.1 cvs 3271: ViewDeclaration = ViewID [ 'EXPORT' ] .
1.18 cvs 3272: ViewID = NAME .</pre>
3273: <blockquote class="example">
3274: <p>
3275: <strong>Example:</strong></p>
3276: <p>
1.3 cvs 3277: When editing a report, it might be useful have views of the table of contents
1.18 cvs 3278: and of the mathematical formulas, in addition to the principal view which
3279: shows the document in its entirety. To achieve this, a presentation schema
3280: for the Report class would have the following <tt>VIEWS</tt> section:</p>
3281: <pre>VIEWS
3282: Full_text, Table_of_contents, Formulas;</pre>
3283: <p>
1.1 cvs 3284: The contents of these views are specified in the presentation rules of the
1.18 cvs 3285: schema.</p>
3286: </blockquote>
3287: </div>
1.1 cvs 3288:
1.18 cvs 3289: <div class="subsection">
1.1 cvs 3290:
1.18 cvs 3291: <h3><a name="sectc423">Print Views</a></h3>
3292: <p>
1.1 cvs 3293: When editing a document, each view is presented in a different window. In
1.18 cvs 3294: addition to the views specified by the <tt>VIEWS</tt> instruction, the user
1.1 cvs 3295: can display the associated elements with one window for each type of
1.18 cvs 3296: associated element.</p>
3297: <p>
1.1 cvs 3298: When printing a document, it is possible to print any number of views, chosen
3299: from among all the views which the editor can display (views in the strict
3300: sense or associated elements). Print views, as well as the order in which
1.18 cvs 3301: they must be printed, are indicated by the <tt>PRINT</tt> instruction. It
3302: appears after the <tt>VIEWS</tt> instruction and is formed of the keyword
3303: <tt>PRINT</tt> followed by the ordered list of print view names. The print
1.1 cvs 3304: view names are separated by commas and followed by a semi-colon. A print view
1.18 cvs 3305: name is either a view name declared in the <tt>VIEWS</tt> instruction or the
1.1 cvs 3306: name of an associated element type (with an ``s'' added to the end). The
1.18 cvs 3307: associated element must have been declared in the <tt>ASSOC</tt> section of
3308: the structure schema.</p>
3309: <pre> 'PRINT' PrintViewSeq
1.1 cvs 3310: PrintViewSeq = PrintView < ',' PrintView > ';' .
1.18 cvs 3311: PrintView = ViewID / ElemID .</pre>
3312: <p>
3313: If the <tt>PRINT</tt> instruction is absent, the printing program will print
3314: only the principal view (the first view specified by the <tt>VIEWS</tt>
3315: instruction or the single, unnamed view when there is no <tt>VIEWS</tt>
3316: instruction).</p>
3317: <blockquote class="example">
3318: <p>
3319: <strong>Example:</strong></p>
3320: <p>
1.3 cvs 3321: Consider a Report presentation using the view declarations from the preceding
3322: example. Suppose we want to print the full text and table of contents views,
3323: but not the Formulas view, which is only useful when editing. In addition,
3324: suppose that we also want to print the bibliographic citations, which are
1.18 cvs 3325: associated elements (of type <tt>Citation</tt>). A sensible printing order
1.3 cvs 3326: would be to print the full text then the bibliography and finally the table of
3327: contents. To obtain this result when printing, the presentation schema would
1.18 cvs 3328: say:</p>
3329: <pre>PRINT
3330: Full_text, Citations, Table_of_contents;</pre>
3331: </blockquote>
3332: </div>
3333:
3334: <div class="subsection">
3335:
3336: <h3><a name="sectc424">Counters</a></h3>
3337: <p>
3338: A presentation has a <em>counter</em> for each type of number in the
1.1 cvs 3339: presentation. All counters, and therefore all types of numbers, used in the
1.18 cvs 3340: schema must be declared after the <tt>COUNTERS</tt> keyword.</p>
3341: <p>
1.1 cvs 3342: Each counter declaration is composed of a name identifying the counter
3343: followed by a colon and the counting function to be applied to the counter.
1.18 cvs 3344: The counter declaration ends with a semi-colon.</p>
3345: <p>
1.1 cvs 3346: The counting function indicates how the counter values will be calculated.
1.16 cvs 3347: Three types of counting functions are available. The first type is used to
3348: count the elements of a list or aggregate: it assigns to the counter the rank
1.18 cvs 3349: of the element in the list or aggregate. More precisely, the function</p>
3350: <pre>RANK OF ElemID [ LevelAsc ] [ INIT AttrID ]
3351: [ 'REINIT' AttrID ]</pre>
3352: <p>
3353: indicates that when an element creates, by a creation rule (see the <a
3354: href="#sectc4232"><tt>Create</tt> instructions</a>), a presentation box
1.5 cvs 3355: containing the counter value, this value is the rank of the creating element,
1.18 cvs 3356: if it is of type <tt>ElemID</tt>, otherwise the rank of the first element of
3357: type <tt>ElemID</tt> which encloses the creating element in the logical
3358: structure of the document.</p>
3359: <p>
1.1 cvs 3360: The type name can be preceded by a star in the special case where the
1.18 cvs 3361: structure schema defines an element of whose <tt>ElemID</tt> is the same as
3362: that of an <a href="#sectd3284">inclusion</a> without expansion or with
3363: partial expansion. To resolve this ambiguity, the <tt>ElemID</tt> alone
3364: refers to the type defined in the structure schema while the <tt>ElemID</tt>
3365: preceded by a star refers to the included type.</p>
3366: <p>
3367: The type name <tt>ElemID</tt> can be followed by an integer. That number
1.1 cvs 3368: represents the relative level, among the ancestors of the creating element, of
1.18 cvs 3369: the element whose rank is asked. If that relative level <i>n</i> is unsigned,
3370: the <i>n</i><sup>th</sup> element of type <tt>ElemID</tt> encountered when
1.1 cvs 3371: travelling the logical structure from the root to the creating element is
1.16 cvs 3372: taken into account. If the relative level is negative, the logical structure
3373: is travelled in the other direction, from the creating element to the
1.18 cvs 3374: root.</p>
3375: <p>
3376: The function can end with the keyword <tt>INIT</tt> followed by the name of a
1.1 cvs 3377: numeric attribute (and only a numeric attribute). Then, the rank of the first
3378: element of the list or aggregate is considered to be the value of this
3379: attribute, rather than the default value of 1, and the rank of the other
3380: elements is shifted accordingly. The attribute which determines the initial
1.18 cvs 3381: value is searched on the element itself and on its ancestors.</p>
3382: <p>
3383: The function can end with the keyword <tt>REINIT</tt> followed by the name of
1.1 cvs 3384: a numeric attribute (and only a numeric attribute). Then, if an element to be
3385: counted has this attribute, the counter value for this element is the
3386: attribute value and the following elements are numbered starting from this
1.18 cvs 3387: value.</p>
3388: <p>
3389: When the <tt>RANK</tt> function is written</p>
3390: <pre>RANK OF Page [ ViewID ] [ INIT AttrID ]</pre>
3391: <p>
3392: (<tt>Page</tt>is a keyword of the P language), the counter takes as its value
1.5 cvs 3393: the number of the page on which the element which creates the presentation box
3394: containing the number appears. This is done as if the pages of the document
3395: form a list for each view. The counter only takes into account the pages of
3396: the relevant view, that is the view displaying the presentation box whose
1.18 cvs 3397: contents take the value of the number. However, if the keyword <tt>Page</tt>
1.5 cvs 3398: is followed by the name of a view (between parentheses), it is the pages of
3399: that view that are taken into account. As in the preceding form, the
1.18 cvs 3400: <tt>RANK</tt> function applied to pages can end with the <tt>INIT</tt> keyword
1.5 cvs 3401: followed by the name of a numeric attribute which sets the value of the first
3402: page's number. This attribute must be a local attribute of the document
1.18 cvs 3403: itself, and not of one of its components.</p>
3404: <p>
1.1 cvs 3405: The second counting function is used to count the occurrences of a certain
1.18 cvs 3406: element type in a specified context. The instruction</p>
3407: <pre>SET n ON Type1 ADD m ON Type2 [ INIT AttrID ]</pre>
3408: <p>
1.5 cvs 3409: says that when the document is traversed from beginning to end (in the order
1.18 cvs 3410: induced by the logical structure), the counter is assigned the value
3411: <tt>n</tt> each time an element of type <tt>Type1</tt> is encountered, no
3412: matter what the current value of the counter, and the value <tt>m</tt> is
3413: added to the current value of the counter each time an element of type
3414: <tt>Type2</tt> is encountered.</p>
3415: <p>
3416: As with the <tt>RANK</tt> function, the type names can be preceded by a star
3417: to resolve the ambiguity of included elements.</p>
3418: <p>
3419: If the function ends with the keyword <tt>INIT</tt> followed by the name of an
1.1 cvs 3420: attribute and if the document possesses this attribute, the value of this
1.18 cvs 3421: attribute is used in place of <tt>n</tt>. The attribute must be numeric. It
3422: is searched on the element itself and on its ancestors.</p>
3423: <p>
3424: This function can also be used with the <tt>Page</tt> keyword in the place of
3425: <tt>Type1</tt> or <tt>Type2</tt>. In the first case, the counter is
3426: reinitialized on each page with the value <tt>n</tt>, while in the second
3427: case, it is incremented by <tt>m</tt> on each page. As with the preceding
3428: counting function, the word <tt>Page</tt> can be followed by a name between
1.1 cvs 3429: parentheses. In this case, the name specifies a view whose pages are taken
1.18 cvs 3430: into account.</p>
3431: <p>
3432: The definition of a counter can contain several <tt>SET</tt> functions and
3433: several <tt>ADD</tt> functions, each with a different value. The total number
3434: of counting functions must not be greater than 6.</p>
3435: <p>
1.1 cvs 3436: The third counting function is used to count the elements of a certain type
1.16 cvs 3437: encountered when travelling from the creating element to the root of the
3438: logical structure. The creating element is included if it is of that type.
1.18 cvs 3439: That function is written</p>
3440: <pre>RLEVEL OF Type</pre>
3441: <p>
3442: where <tt>Type</tt> represents the type of the elements to be counted.</p>
3443: <p>
3444: The formal definition of counter declarations is:</p>
3445: <pre> 'COUNTERS' CounterSeq
1.1 cvs 3446: CounterSeq = Counter < Counter > .
3447: Counter = CounterID ':' CounterFunc ';' .
3448: CounterID = NAME .
3449: CounterFunc = 'RANK' 'OF' TypeOrPage [ SLevelAsc ]
1.16 cvs 3450: [ 'INIT' AttrID ] [ 'REINIT' AttrID ] /
1.1 cvs 3451: SetFunction < SetFunction >
1.16 cvs 3452: AddFunction < AddFunction >
3453: [ 'INIT' AttrID ] /
3454: 'RLEVEL' 'OF' ElemID .
1.1 cvs 3455: SLevelAsc = [ '-' ] LevelAsc .
3456: LevelAsc = NUMBER .
3457: SetFunction = 'SET' CounterValue 'ON' TypeOrPage .
3458: AddFunction = 'ADD' CounterValue 'ON' TypeOrPage .
3459: TypeOrPage = 'Page' [ '(' ViewID ')' ] /
1.16 cvs 3460: [ '*' ] ElemID .
1.18 cvs 3461: CounterValue = NUMBER .</pre>
3462: <blockquote class="example">
3463: <p>
3464: <strong>Example:</strong></p>
3465: <p>
1.3 cvs 3466: If the body of a chapter is defined as a sequence of sections in the structure
1.18 cvs 3467: schema:</p>
3468: <pre>Chapter_body = LIST OF (Section =
1.1 cvs 3469: BEGIN
3470: Section_Title = Text;
3471: Section_Body = Paragraphs;
3472: END
1.18 cvs 3473: );</pre>
3474: <p>
3475: the section counter is declared:</p>
3476: <pre>SectionCtr : RANK OF Section;</pre>
3477: <p>
3478: and the display of the section number before the section title is obtained by
3479: a <a href="#sectc4232"><tt>CreateBefore</tt> rule</a> attached the
3480: <tt>Section_Title</tt> type, which creates a presentation box whose content is
3481: the value of the <tt>SectionCtr</tt> counter (see the <a
3482: href="#sectc4231"><tt>Content</tt> instruction</a>).</p>
3483: <p>
1.1 cvs 3484: In order to number the formulas separately within each chapter, the formula
1.18 cvs 3485: counter is declared:</p>
3486: <pre>FormulaCtr : SET 0 ON Chapter ADD 1 ON Formula;</pre>
3487: <p>
1.4 cvs 3488: and the display of the formula number in the right margin, alongside each
1.18 cvs 3489: formula, is obtained by a <tt>CreateAfter</tt> instruction attached to the
3490: <tt>Formula</tt> type, which creates a presentation box whose content is the
3491: value of the <tt>FormulaCtr</tt> counter.</p>
3492: <p>
1.1 cvs 3493: To number the page chapter by chapter, with the first page of each chapter
1.18 cvs 3494: having the number 1, the counter definition would be</p>
3495: <pre>ChapterPageCtr : SET 0 ON Chapter ADD 1 ON Page;</pre>
3496: <p>
3497: If there is also a chapter counter</p>
3498: <pre>ChapterCtr : RANK OF Chapter;</pre>
3499: <p>
3500: the <a href="#sectc4231">content</a> of a presentation box created at the top
3501: of each page could be defined as:</p>
3502: <pre>Content : (VALUE(ChapterCtr, URoman) TEXT '-'
3503: VALUE(ChapterPageCtr, Arabic));</pre>
3504: <p>
1.5 cvs 3505: Thus, the presentation box contains the number of the chapter in upper-case
1.18 cvs 3506: roman numerals followed by a hyphen and the number of the page within the
3507: chapter in arabic numerals.</p>
3508: </blockquote>
3509: <blockquote class="example">
3510: <p>
3511: <strong>Example:</strong></p>
3512: <p>
1.3 cvs 3513: To count tables and figures together in a document of the chapter type, a
1.18 cvs 3514: counter could be defined using:</p>
3515: <pre>CommonCtr : SET 0 ON Chapter ADD 1 ON Table
3516: ADD 1 ON Figure;</pre>
3517: </blockquote>
3518: </div>
1.1 cvs 3519:
1.18 cvs 3520: <div class="subsection">
1.1 cvs 3521:
1.18 cvs 3522: <h3><a name="sectc425">Presentation constants</a></h3>
3523: <p>
1.1 cvs 3524: Presentation constants are used in the definition of the content of
1.18 cvs 3525: presentation boxes. This content is used in <a href="#sectc426">variable
3526: definitions</a> and in the <a href="#sectc4231"><tt>Content</tt> rule</a>. The
1.1 cvs 3527: only presentation constants which can be used are character strings,
1.2 cvs 3528: mathematical symbols, graphical elements, and pictures, that is to say, base
1.18 cvs 3529: elements.</p>
3530: <p>
1.1 cvs 3531: Constants can be defined directly in the variables or presentation boxes
1.18 cvs 3532: (<tt>Content</tt> rule) which use them. But it is only necessary them to
1.1 cvs 3533: declare once, in the constant declaration section, even though they are used
3534: in many variables or boxes. Thus, each declared constant has a name, which
3535: allows it to be designated whenever it is used, a type (one of the four base
3536: types) and a value (a character string or a single character for mathematical
1.18 cvs 3537: symbols and graphical elements).</p>
3538: <p>
3539: The constant declarations appear after the keyword <tt>CONST</tt>. Each
1.1 cvs 3540: declaration is composed of the name of the constant, an equals sign, a keyword
1.18 cvs 3541: representing its type (<tt>Text</tt>, <tt>Symbol</tt>, <tt>Graphics</tt> or
3542: <tt>Picture</tt>) and the string representing its value. A semi-colon
3543: terminates each declaration.</p>
3544: <p>
3545: In the case of a character string, the keyword <tt>Text</tt> can be followed
3546: by the name of an alphabet (for example, <tt>Greek</tt> or <tt>Latin</tt>) in
1.1 cvs 3547: which the constant's text should be expressed. If the alphabet name is
3548: absent, the Latin alphabet is used. When the alphabet name is present, only
3549: the first letter of the alphabet name is interpreted. Thus, the words
1.18 cvs 3550: <tt>Greek</tt> and <tt>Grec</tt> designate the same alphabet. In current
3551: versions of Thot, only the Greek and Latin alphabets are available.</p>
3552: <pre> 'CONST' ConstSeq
1.1 cvs 3553: ConstSeq = Const < Const > .
3554: Const = ConstID '=' ConstType ConstValue ';' .
3555: ConstID = NAME .
3556: ConstType ='Text' [ Alphabet ] / 'Symbol' /
3557: 'Graphics' / 'Picture' .
3558: ConstValue = STRING .
1.18 cvs 3559: Alphabet = NAME .</pre>
3560: <p>
1.5 cvs 3561: For character strings in the Latin alphabet (ISO Latin-1 character set),
1.1 cvs 3562: characters having codes higher than 127 (decimal) are represented by their
1.18 cvs 3563: code in octal.</p>
3564: <p>
1.1 cvs 3565: In the case of a symbol or graphical element, the value only contains a single
3566: character, between apostrophes, which indicates the form of the element which
3567: must be drawn in the box whose content is the constant. The symbol or
3568: graphical element takes the dimensions of the box, which are determined by the
1.18 cvs 3569: <tt>Height</tt> and <tt>Width</tt> rules. See <a href="#sectb72">table of
3570: codes</a> for the symbols and graphical elements.</p>
3571: <blockquote class="example">
3572: <p>
3573: <strong>Example:</strong></p>
3574: <p>
1.3 cvs 3575: The constants ``Summary:'' and fraction bar, which were described earlier, are
1.18 cvs 3576: declared:</p>
3577: <pre>CONST
1.1 cvs 3578: SummaryConst = Text 'Summary:';
1.18 cvs 3579: Bar = Graphics 'h';</pre>
3580: </blockquote>
3581: </div>
1.1 cvs 3582:
1.18 cvs 3583: <div class="subsection">
1.1 cvs 3584:
1.18 cvs 3585: <h3><a name="sectc426">Variables</a></h3>
3586: <p>
1.1 cvs 3587: Variables permit the definition of computed content for presentation boxes. A
1.18 cvs 3588: variable is associated with a presentation box by a <tt>Content</tt> rule; but
3589: before being used in a <tt>Content</tt> rule, a variable can be defined in the
3590: <tt>VAR</tt> section. It is also possible to define a variable at the time of
3591: its use in a <tt>Content</tt> rule, as can be done with a constant.</p>
3592: <p>
1.1 cvs 3593: A variable has a name and a value which is a character string resulting from
3594: the concatenation of the values of a sequence of functions. Each variable
3595: declaration is composed of the variable name followed by a colon and the
3596: sequence of functions which produces its value, separated by spaces. Each
1.18 cvs 3597: declaration is terminated by a semi-colon.</p>
3598: <pre> 'VAR' VarSeq
1.1 cvs 3599: VarSeq = Variable < Variable > .
3600: Variable = VarID ':' FunctionSeq ';' .
3601: VarID = NAME .
1.18 cvs 3602: FunctionSeq = Function < Function > .</pre>
3603: <p>
1.1 cvs 3604: Several functions are available. The first two return, in the form of a
1.18 cvs 3605: character string, the current date. <tt>DATE</tt> returns the date in
3606: English, while <tt>FDATE</tt> returns the date in french.</p>
3607: <p>
3608: Two other functions, <tt>DocName</tt> and <tt>DirName</tt>, return the
3609: document name and the directory where the document is stored.</p>
3610: <p>
3611: Function <tt>ElemName</tt> returns the type of the element which created the
3612: presentation box whose contents are the variable.</p>
3613: <p>
1.1 cvs 3614: Another function simply returns the value of a presentation constant. For any
1.18 cvs 3615: constant declared in the <tt>CONST</tt> section, it is sufficient to give the
1.1 cvs 3616: name of the constant. Otherwise, the type and value of the constant must be
1.18 cvs 3617: given, using the same form as in a <a href="#sectc425">constant
3618: declaration</a>. If the constant is not of type text, (types <tt>Symbol</tt>,
3619: <tt>Graphics</tt> or <tt>Picture</tt>), it must be alone in the variable
3620: definition; only constants of type <tt>Text</tt> can be mixed with other
3621: functions.</p>
3622: <p>
1.1 cvs 3623: It is also possible to obtain the value of an attribute, simply by mentioning
3624: the attribute's name. The value of this function is the value of the
3625: attribute for the element which created the presentation box whose contents
3626: are the variable. If the creating element does not have the indicated
3627: attribute, the value is an empty string. In the case of a numeric attribute,
3628: the attribute is translated into a decimal number in arabic numerals. If
1.18 cvs 3629: another form is desired, the <tt>VALUE</tt> function must be used.</p>
3630: <p>
1.1 cvs 3631: The last available function returns, as a character string, the value of a
3632: counter, an attribute or a page number. This value can be presented in
1.18 cvs 3633: different styles. The keyword <tt>VALUE</tt> is followed (between
1.1 cvs 3634: parentheses) by the name of the counter, the name of the attribute, or the
1.18 cvs 3635: keyword <tt>PageNumber</tt> and the desired style, the two parameters being
1.1 cvs 3636: separated by a comma. The style is a keyword which indicates whether the
1.18 cvs 3637: value should be presented in arabic numerals (<tt>Arabic</tt>), lower-case
3638: roman numerals (<tt>LRoman</tt>), or upper-case roman numerals
3639: (<tt>URoman</tt>), or by an upper-case letter (<tt>Uppercase</tt>) or
3640: lower-case letter (<tt>Lowercase</tt>).</p>
3641: <p>
3642: For a page counter, the keyword <tt>PageNumber</tt> can be followed, between
1.1 cvs 3643: parentheses, by the name of the view from which to obtain the page number. By
1.18 cvs 3644: default, the first view declared in the <tt>VIEWS</tt> section is used. The
1.1 cvs 3645: value obtained is the number of the page on which is found the element that is
1.18 cvs 3646: using the variable in a <tt>Content</tt> rule.</p>
3647: <p>
1.1 cvs 3648: For an ordinary counter, the name of the counter can be preceded by the
1.18 cvs 3649: keyword <tt>MaxRangeVal</tt> or <tt>MinRangeVal</tt>. These keywords mean
1.1 cvs 3650: that the value returned by the function is the maximum (minimum resp.) value
3651: taken by the counter in the whole document, not the value for the element
1.18 cvs 3652: concerned by the function.</p>
3653: <pre> Function = 'DATE' / 'FDATE' /
1.1 cvs 3654: 'DocName' / 'DirName' /
3655: 'ElemName' / 'AttributeName' /
3656: ConstID / ConstType ConstValue /
3657: AttrID /
3658: 'VALUE' '(' PageAttrCtr ','
3659: CounterStyle ')' .
1.6 cvs 3660: PageAttrCtr = 'PageNumber' [ '(' ViewID ')' ] /
1.1 cvs 3661: [ MinMax ] CounterID / AttrID .
3662: CounterStyle = 'Arabic' / 'LRoman' / 'URoman' /
3663: 'Uppercase' / 'Lowercase' .
1.18 cvs 3664: MinMax = 'MaxRangeVal' / 'MinRangeVal' .</pre>
3665: <blockquote class="example">
3666: <p>
3667: <strong>Example:</strong></p>
3668: <p>
3669: To make today's date appear at the top of the first page of a report, a <a
3670: href="#sectc4232"><tt>CREATE</tt> rule</a> associated with the Report_Title
1.3 cvs 3671: element type generates a presentation box whose content (specified by the
1.18 cvs 3672: <tt>Content</tt> rule of that presentation box) is the variable:</p>
3673: <pre>VAR
3674: Todays_date : TEXT 'Version of ' DATE;</pre>
3675: <p>
1.1 cvs 3676: To produce, before each section title, the chapter number (in upper-case roman
3677: numerals) followed by the section number (in arabic numerals), two counters
1.18 cvs 3678: must be defined:</p>
3679: <pre>COUNTERS
1.1 cvs 3680: ChapterCtr : RANK OF Chapter;
1.18 cvs 3681: SectionCtr : RANK OF Section;</pre>
3682: <p>
1.4 cvs 3683: and the Section_Title element must create a presentation box whose content is
1.18 cvs 3684: the variable</p>
3685: <pre>VAR
1.1 cvs 3686: SectionNum : VALUE (ChapterCtr, URoman) TEXT '-'
1.18 cvs 3687: VALUE (SectionCtr, Arabic);</pre>
3688: <p>
1.1 cvs 3689: In order to make the page number on which each section begins appear in the
3690: table of contents view next to the section title, each Section_Title element
3691: must create a presentation box, visible only in the table of contents view,
1.18 cvs 3692: whose content is the variable:</p>
3693: <pre>VAR
1.1 cvs 3694: TitlePageNume :
1.18 cvs 3695: VALUE (PageNumber(Full_text), Arabic);</pre>
3696: </blockquote>
3697: </div>
1.1 cvs 3698:
1.18 cvs 3699: <div class="subsection">
1.1 cvs 3700:
1.18 cvs 3701: <h3><a name="sectc427">Default presentation rules</a></h3>
3702: <p>
1.1 cvs 3703: In order to avoid having to specify, for each element type defined in the
3704: structure schema, values for every one of the numerous presentation
3705: parameters, the presentation schema allows the definition of a set of default
3706: presentation rules. These rules apply to all the boxes of the elements
3707: defined in the structure schema and to the presentation boxes and page layout
3708: boxes defined in the presentation schema. Only rules which differ from these
1.18 cvs 3709: default need to be specified in other sections of the presentation schema.</p>
3710: <p>
1.1 cvs 3711: For the primary view, the default rules can define every presentation
1.18 cvs 3712: parameter, but not the <a href="#presfunct">presentation functions</a> or the
3713: <a href="#sectc4223">linebreaking conditions</a> (the <tt>NoBreak1</tt>,
3714: <tt>NoBreak2</tt>, and <tt>Gather</tt> rules).</p>
3715: <p>
1.1 cvs 3716: In a presentation schema, the default presentation rules section is optional;
1.18 cvs 3717: in this case, the <tt>DEFAULT</tt> keyword is also absent and the following
3718: rules are considered to be the default rules:</p>
3719: <pre> Visibility: Enclosing =;
1.6 cvs 3720: VertRef: * . Left;
3721: HorizRef: Enclosed . HRef;
3722: Height: Enclosed . Height;
3723: Width: Enclosed . Width;
3724: VertPos: Top = Previous . Bottom;
3725: HorizPos: Left = Enclosing . Left;
3726: VertOverflow: No;
1.1 cvs 3727: HorizOverflow: No;
1.6 cvs 3728: Size: Enclosing =;
3729: Style: Enclosing =;
3730: Font: Enclosing =;
3731: Underline: Enclosing =;
3732: Thickness: Enclosing =;
3733: Indent: Enclosing =;
3734: LineSpacing: Enclosing =;
3735: Adjust: Enclosing =;
3736: Justify: Enclosing =;
3737: Hyphenate: Enclosing =;
3738: PageBreak: Yes;
3739: LineBreak: Yes;
3740: InLine: Yes;
3741: Depth: 0;
3742: LineStyle: Enclosing =;
3743: LineWeight: Enclosing =;
3744: FillPattern: Enclosing =;
3745: Background: Enclosing =;
1.18 cvs 3746: Foreground: Enclosing =;</pre>
3747: <p>
1.1 cvs 3748: If other values are desired for the default rules, they must be defined
3749: explicitly in the default rules section. In fact, it is only necessary to
3750: define those default rules which differ from the ones above, since the rules
1.18 cvs 3751: above will be used whenever a rule is not explicitly named.</p>
3752: <p>
1.1 cvs 3753: Default rules for views other than the primary view can also be specified.
3754: Otherwise, the default rules for the primary views are applied to the other
1.18 cvs 3755: views.</p>
3756: <p>
3757: Default rules are expressed in the same way as <a href="#sectc4215">explicit
3758: rules for document elements</a>.</p>
3759: </div>
1.1 cvs 3760:
1.18 cvs 3761: <div class="subsection">
1.1 cvs 3762:
1.18 cvs 3763: <h3><a name="sectc428">Presentation and page layout boxes</a></h3>
3764: <p>
1.1 cvs 3765: The presentation process uses elements which are not part of the logical
3766: structure of the document, such as pages (which are the page layout boxes) or
3767: alternatively, rules, numbers, or words introducing certain parts of the
3768: document, such as ``Summary'', ``Appendices'', ``Bibliography'', etc. (which
1.18 cvs 3769: are presentation boxes).</p>
3770: <p>
3771: After the word <tt>BOXES</tt>, each presentation or page layout box is defined
1.1 cvs 3772: by its name and a sequence of presentation rules which indicate how they must
3773: be displayed. These rules are the same as those which define the boxes
3774: associated with element of the logical structure of the document, with a
1.18 cvs 3775: single exception, the <a href="#sectc4231"><tt>Content</tt> rule</a> which is
1.1 cvs 3776: used only to specify the content of presentation boxes. The content of boxes
3777: associated with elements of the document structure is defined in each document
3778: or object and thus is not specified in the presentation schema, which applies
1.18 cvs 3779: to all documents or objects of a class.</p>
3780: <p>
1.1 cvs 3781: Among the rules which define a presentation box, certain ones can refer to
3782: another presentation box (for example, in their positional rules). If the
3783: designated box is defined after the box which designates it, a
1.18 cvs 3784: <tt>FORWARD</tt> instruction followed by the name of the designated box must
3785: appear before the designation.</p>
3786: <pre> 'BOXES' BoxSeq
1.1 cvs 3787: BoxSeq = Box < Box > .
3788: Box ='FORWARD' BoxID ';' /
3789: BoxID ':' ViewRuleSeq .
1.18 cvs 3790: BoxID = NAME .</pre>
3791: </div>
1.1 cvs 3792:
1.18 cvs 3793: <div class="subsection">
1.1 cvs 3794:
1.18 cvs 3795: <h3><a name="sectc429">Presentation of structured elements</a></h3>
3796: <p>
3797: After the words <tt>RULES</tt>, the presentation schema gives the presentation
1.1 cvs 3798: rules that apply to the elements whose types are defined in the structure
1.18 cvs 3799: schema. Only those rules which differ from the <a
3800: href="#sectc427">default</a> must be specified in the <tt>RULES</tt>
3801: section.</p>
3802: <p>
1.1 cvs 3803: The rule definitions for each element type are composed of the name of the
3804: element type (as specified in the structure schema) followed by a colon and
1.18 cvs 3805: the set of rules specific to that type.</p>
3806: <p>
1.1 cvs 3807: The type name can be preceded by a star in the special case where the
1.18 cvs 3808: structure schema defines an <a href="#sectd3284">inclusion</a> without
1.1 cvs 3809: expansion (or with partial expansion) of a type with the same name as an
1.18 cvs 3810: element of defined in the structure schema.</p>
3811: <p>
3812: In the case where the element is a <a href="#sectd3285">mark pair</a>, but
3813: only in this case, the type name can be preceded by the keywords
3814: <tt>First</tt> or <tt>Second</tt>. These keywords indicate whether the rules
3815: that follow apply to the first or second mark of the pair.</p>
3816: <pre> 'RULES' PresentSeq
1.1 cvs 3817: PresentSeq = Present < Present > .
1.6 cvs 3818: Present = [ '*' ] [ FirstSec ] ElemID ':'
3819: ViewRuleSeq .
1.18 cvs 3820: FirstSec = 'First' / 'Second' .</pre>
3821: <p>
1.1 cvs 3822: A presentation schema can define presentation rules for base elements, which
3823: are defined implicitly in the structure schemas. In the English version of
3824: the presentation schema compiler, the base type names are the same as in the S
1.18 cvs 3825: language, but they are terminated by the <tt>_UNIT</tt> suffix:
3826: <tt>TEXT_UNIT</tt>, <tt>PICTURE_UNIT</tt>, <tt>SYMBOL_UNIT</tt>,
3827: <tt>GRAPHICS_UNIT</tt>. The base type names are written in upper-case
3828: letters.</p>
3829: </div>
3830:
3831: <div class="subsection">
3832:
3833: <h3><a name="sectc4210">Logical attribute presentation</a></h3>
3834: <p>
3835: After the keyword <tt>ATTRIBUTES</tt>, all attributes which are to have some
1.1 cvs 3836: effect on the presentation of the element to which they are attached must be
3837: mentioned, along with the corresponding presentation rules. This is true for
3838: both global attributes (which can be attached to all element types) and local
1.18 cvs 3839: attributes (which can only be attached to certain element types).</p>
3840: <p>
1.1 cvs 3841: Also mentioned in this section are attributes which imply an effect on
3842: elements in the subtree of the element to which they are attached. The
3843: presentation of these descendants can be modified as a function of the value
3844: of the attribute which they inherit, just as if it was attached to them
1.18 cvs 3845: directly.</p>
3846: <p>
1.1 cvs 3847: The specification for each attribute includes the attribute's name, followed
3848: by an optional value specification and, after a colon, a set of rules. The
1.18 cvs 3849: set of rules must contain at least one rule.</p>
3850: <p>
1.1 cvs 3851: When there is no value specification, the rules are applied to all elements
3852: which carry the attribute, no matter what their value. When the rules must
3853: only apply when the attribute has certain values, these values must be
1.18 cvs 3854: specified. Thus, the same attribute can appear in the <tt>ATTRIBUTES</tt>
1.1 cvs 3855: section several times, with each appearance having a different value
3856: specification. However, reference attributes never have a value specification
1.18 cvs 3857: and, as a result, can only appear once in the <tt>ATTRIBUTES</tt> section.</p>
3858: <p>
1.1 cvs 3859: To specify that the presentation rules apply to some of the descendants of the
3860: element having the attribute, the name of the affected element type is given,
3861: between parentheses, after the attribute name. This way, the presentation
3862: rules for the attribute will be applied to the element having the attribute,
3863: if it is of the given type, and to all of its descendants of the given type.
1.18 cvs 3864: In the case where this type is a <a href="#sectd3285">mark pair</a>, but only
3865: in this case, the type name can be preceded by the keywords <tt>First</tt> or
3866: <tt>Second</tt>. These keywords indicate whether the rules that follow apply
1.1 cvs 3867: to the first or second mark of the pair. If the rule must apply to several
3868: different element types, the specification must be repeated for each element
1.18 cvs 3869: type.</p>
3870: <p>
1.1 cvs 3871: The specification of values for which the presentation rules will be applied
1.18 cvs 3872: varies according to the type of the attribute:</p>
3873: <dl>
3874: <dt>numeric attribute</dt>
3875: <dd>
3876: If the rules are to apply for one value of the attribute, then the attribute
3877: name is followed by an equals sign and this value. If the rules are to apply
3878: for all values less than (or greater than) a threshold value, non-inclusive,
3879: the attribute name followed by a '<' sign (or a '>' sign, respectively) and
3880: the threshold value. If the rules must apply to a range of values, the
3881: attribute name is followed by the word '<tt>IN</tt>' and the two bounds of the
3882: range, enclosed in brackets and separated by two periods ('<tt>..</tt>'). In
3883: the case of ranges, the values of the bounds are included in the range.
3884: <p>
1.1 cvs 3885: The threshold value in the comparisons can be the value of an attribute
3886: attached to an ancestor element. In this case, the attribute name is given
1.18 cvs 3887: instead of a constant value.</p>
3888: <p>
1.1 cvs 3889: It is also possible to write rules which apply only when a comparison between
3890: two different attributes of the element's ancestors is true. In this case, the
3891: first attribute name is followed by a comparison keyword and the name of the
1.18 cvs 3892: second attribute. The comparison keywords are <tt>EQUAL</tt> (simple
3893: equality), <tt>LESS</tt> (non-inclusive less than), and <tt>GREATER</tt>
3894: (non-inclusive greater than).</p>
3895: </dd>
3896: <dt>text attribute</dt>
3897: <dd>
3898: If the rules are to apply for one value of the attribute, then the attribute
3899: name is followed by an equals sign and this value.
3900: </dd>
3901: <dt>reference attribute</dt>
3902: <dd>
3903: There is never a value specification; the rules apply no matter what element
3904: is designated by the attribute.
3905: </dd>
3906: <dt>enumerated attribute</dt>
3907: <dd>
3908: If the rules are to apply for one value of the attribute, then the attribute
3909: name is followed by an equals sign and this value.
3910: </dd>
3911: </dl>
3912: <p>
1.1 cvs 3913: The order in which the rules associated with a numeric attribute are defined
3914: is important. When multiple sets of rules can be applied, the first set
1.18 cvs 3915: declared is the one used.</p>
3916: <p>
1.1 cvs 3917: Rules for attributes have priority over both default rules and rules
3918: associated with element types. The attribute rules apply to the element to
3919: which the attribute is attached. It is the rules which apply to the
3920: surrounding elements (and especially to the descendants) which determine the
3921: effect of the attribute rules on the environment ( and especially on the
1.18 cvs 3922: terminal elements of the structure).</p>
3923: <pre> 'ATTRIBUTES' PresAttrSeq
1.1 cvs 3924: PresAttrSeq = PresAttr < PresAttr > .
3925: PresAttr = AttrID [ '(' [ FirstSec ] ElemID ')' ]
3926: [ AttrRelation ] ':' ViewRuleSeq .
3927: AttrID = NAME .
3928: AttrRelation ='=' AttrVal /
3929: '>' [ '-' ] MinValue /
3930: '<' [ '-' ] MaxValue /
3931: 'IN' '[' [ '-' ] LowerBound '..'
3932: [ '-' ] UpperBound ']' /
3933: 'GREATER' AttrID /
3934: 'EQUAL' AttrID /
3935: 'LESS' AttrID .
3936: AttrVal = [ '-' ] EqualNum / EqualText /
3937: AttrValue .
3938: MinValue = NUMBER .
3939: MaxValue = NUMBER .
3940: LowerBound = NUMBER .
3941: UpperBound = NUMBER.
3942: EqualNum = NUMBER .
3943: EqualText = STRING .
1.18 cvs 3944: AttrValue = NAME .</pre>
3945: <p>
1.1 cvs 3946: In presentation rules associated with a numeric attribute (and only in such
3947: rules), the attribute name can be used in place of a numeric value. In this
3948: case, the value of the attribute is used in the application of the rule. Thus,
3949: the attribute can represent a relation between the size of two boxes, the
3950: height and width of a box, the height of an area where page breaks are
3951: prohibited, the distance between two boxes, the position of the reference axis
3952: of a box, the interline spacing, the indentation of the first line, the
1.18 cvs 3953: visibility, the depth (z-order), or the character set.</p>
3954: <p>
1.1 cvs 3955: The presentation rules associated with reference attributes, it is possible to
3956: use the element designated by the attribute as a reference box in a positional
1.18 cvs 3957: or extent rule. This element is represented in the <a
3958: href="#sectc4218">position</a> or <a href="#sectc4219">extent</a> rule by the
3959: keyword <tt>Referred</tt>.</p>
3960: <blockquote class="example">
3961: <p>
3962: <strong>Example:</strong></p>
3963: <p>
1.3 cvs 3964: In all structure schemas, there is a global Language attribute defined as
1.18 cvs 3965: follows:</p>
3966: <pre>ATTR
3967: Language = TEXT;</pre>
3968: <p>
3969: The following rules would make French text be displayed in roman characters
3970: and English text be displayed in italics:</p>
3971: <pre>ATTRIBUTES
1.1 cvs 3972: Language = 'French' :
1.6 cvs 3973: Style : Roman;
1.1 cvs 3974: Language = 'English' :
1.18 cvs 3975: Style : Italics;</pre>
3976: <p>
1.4 cvs 3977: Using these rules, when the user puts the Language attribute with the value
3978: 'English' on the summary of a document, every character string (terminal
1.18 cvs 3979: elements) contained in the summary are displayed in italics. See the <a
3980: href="#sectd42252"><tt>Style</tt> rule</a>.</p>
3981: </blockquote>
3982: <blockquote class="example">
3983: <p>
3984: <strong>Example:</strong></p>
3985: <p>
1.3 cvs 3986: A numeric attribute representing the importance of the part of the document to
1.18 cvs 3987: which it is attached can be defined:</p>
3988: <pre>ATTR
3989: Importance = INTEGER;</pre>
3990: <p>
1.4 cvs 3991: In the presentation schema, the importance of an element is reflected in the
1.18 cvs 3992: choice of character size, using the following rules.</p>
3993: <pre>ATTRIBUTES
1.1 cvs 3994: Importance < 2 :
3995: Size : 1;
3996: Importance IN [2..4] :
3997: Size : Importance;
3998: Importance = 10 :
3999: Size : 5;
4000: Importance > 4 :
1.18 cvs 4001: Size : 4;</pre>
4002: <p>
1.4 cvs 4003: Thus, the character size corresponds to the value of the Importance attribute;
1.18 cvs 4004: its value is</p>
4005: <ul>
4006: <li>
4007: the value of the Importance attribute when the value is between 2 and 4
1.1 cvs 4008: (inclusive),
1.19 ! cvs 4009: </li>
1.18 cvs 4010: <li>
4011: 1, when the value of the Importance attribute is less than 2,
1.19 ! cvs 4012: </li>
1.18 cvs 4013: <li>
4014: 4, when the value of the Importance attribute is greater than 4,
1.19 ! cvs 4015: </li>
1.18 cvs 4016: <li>
4017: 5, when the value of the Importance attribute is 10.
1.19 ! cvs 4018: </li>
1.18 cvs 4019: </ul>
4020: <p>
1.4 cvs 4021: The last case (value 5) must be defined before the case which handles all
4022: Importance values greater than 4, because the two rules are not disjoint and
4023: the first one defined will have priority. Otherwise, when the Importance
1.18 cvs 4024: attribute has value 10, the font size will be 4.</p>
4025: </blockquote>
4026: <blockquote class="example">
4027: <p>
4028: <strong>Example:</strong></p>
4029: <p>
1.3 cvs 4030: Suppose the structure defines a list element which can have an attribute
1.18 cvs 4031: defining the type of list (numbered or not):</p>
4032: <pre>STRUCT
1.1 cvs 4033: list (ATTR list_type = enumeration, dash)
1.18 cvs 4034: = LIST OF (list_item = TEXT);</pre>
4035: <p>
1.4 cvs 4036: Then, the presentation schema could use the attribute placed on the list
4037: element to put either a dash or a number before the each element of the
1.18 cvs 4038: list:</p>
4039: <pre>ATTRIBUTES
1.1 cvs 4040: list_type (list_item) = enumeration :
4041: CreateBefore (NumberBox);
4042: list_type (list_item) = dash :
1.18 cvs 4043: CreateBefore (DashBox);</pre>
4044: </blockquote>
4045: <blockquote class="example">
4046: <p>
4047: <strong>Example:</strong></p>
4048: <p>
1.3 cvs 4049: Suppose that two attributes are defined in the structure schema. The first is
4050: a numeric global attribute called ``version''. The other is a local attribute
1.18 cvs 4051: defined on the root of the document called ``Document_version'':</p>
4052: <pre>STRUCTURE Document
1.1 cvs 4053: ATTR
4054: version = INTEGER;
4055: STRUCT
4056: Document (ATTR Document_version = INTEGER) =
4057: BEGIN
4058: SomeElement ;
4059: ...
4060: SomeOtherElement ;
4061: END ;
1.18 cvs 4062: ...</pre>
4063: <p>
4064: These attributes can be used in the presentation schema to place change bars
4065: in the margin next to elements whose version attribute has a value equal to
4066: the Document_version attribute of the root and to place a star in margin of
1.4 cvs 4067: elements whose version attribute is less than the value of the root's
1.18 cvs 4068: Document_version attribute:</p>
4069: <pre>ATTRIBUTES
1.1 cvs 4070: version EQUAL Document_version :
4071: CreateBefore (ChangeBarBox) ;
4072: version LESS Document_version :
1.18 cvs 4073: CreateBefore (StarBox) ;</pre>
4074: </blockquote>
4075: </div>
1.1 cvs 4076:
1.18 cvs 4077: <div class="subsection">
1.1 cvs 4078:
1.18 cvs 4079: <h3><a name="sectc4212">Value transmission rules</a></h3>
4080: <p>
1.1 cvs 4081: The last section of a presentation schema, which is optional, serves to
4082: defines the way in which a document transmits certain values to its
1.18 cvs 4083: sub-documents. A sub-document is an document <a
4084: href="#inclusion">included</a> without expansion or with partial expansion.
1.1 cvs 4085: The primary document can transmit to its sub-documents the values of certain
4086: counters or the textual content of certain of its elements, as a function of
1.18 cvs 4087: their type.</p>
4088: <p>
1.1 cvs 4089: The sub-documents receive these values in attributes which must be defined in
4090: their structure schema as local attributes of the root element. The types of
4091: these attributes must correspond to the type of the value which they receive:
4092: numeric attributes for receiving the value of a counter, textual attributes
1.18 cvs 4093: for receiving the content of an element.</p>
4094: <p>
1.1 cvs 4095: In the structure schema of the primary document, there appears at the end,
1.18 cvs 4096: after the <tt>TRANSMIT</tt> keyword, a sequence of transmission rules. Each
1.1 cvs 4097: rule begins with the name of the counter to transmit or of the element type
4098: whose textual content will be transmitted. This name is followed by the
1.18 cvs 4099: keyword <tt>To</tt> and the name of the attribute of the sub-document to which
1.1 cvs 4100: the value is transmitted. The sub-document class is indicated between
4101: parentheses after the name of the attribute. The transmission rule ends with
1.18 cvs 4102: a semicolon.</p>
4103: <pre> TransmitSeq = Transmit < Transmit > .
1.1 cvs 4104: Transmit = TypeOrCounter 'To' ExternAttr
4105: '(' ElemID ')' ';' .
4106: TypeOrCounter = CounterID / ElemID .
1.18 cvs 4107: ExternAttr = NAME .</pre>
4108: <blockquote class="example">
4109: <p>
4110: <strong>Example:</strong></p>
4111: <p>
4112: Consider a Book document class which includes instances of the Chapter
4113: document class. These classes might have the following schemas:</p>
4114: <pre>STRUCTURE Book
1.1 cvs 4115: STRUCT
4116: Book = BEGIN
4117: Title = Text;
4118: Body = LIST OF (Chapter INCLUDED);
4119: END;
4120: ...
4121:
4122: STRUCTURE Chapter
4123: STRUCT
4124: Chapter (ATTR FirstPageNum = Integer;
4125: ChapterNum = Integer;
4126: CurrentTitle = Text) =
1.6 cvs 4127: BEGIN
4128: ChapterTitle = Text;
4129: ...
4130: END;
1.18 cvs 4131: ...</pre>
4132: <p>
1.1 cvs 4133: Then the presentation schema for books could define chapter and page counters.
4134: The following transmission rules in the book presentation schema would
4135: transmit values for the three attributes defined at the root of each chapter
1.18 cvs 4136: sub-document.</p>
4137: <pre>PRESENTATION Book;
1.1 cvs 4138: VIEWS
4139: Full_text;
4140: COUNTERS
4141: ChapterCtr: Rank of Chapter;
4142: PageCtr: Rank of Page(Full_text);
4143: ...
4144: TRANSMIT
4145: PageCtr TO FirstPageNum(Chapter);
4146: ChapterCtr TO ChapterNum(Chapter);
4147: Title TO CurrentTitle(Chapter);
1.18 cvs 4148: END</pre>
4149: <p>
1.1 cvs 4150: Thus, each chapter included in a book can number its pages as a function of
4151: the number of pages preceding it in the book, can make the chapter's number
4152: appear before the number of each of its sections, or can place the title of
1.18 cvs 4153: the book at the top of each page.</p>
4154: </blockquote>
4155: </div>
1.1 cvs 4156:
1.18 cvs 4157: <div class="subsection">
1.1 cvs 4158:
1.18 cvs 4159: <h3><a name="sectc4213">Presentation rules</a></h3>
4160: <p>
1.1 cvs 4161: Whether defining the appearance of a presentation or page layout box, an
4162: element type, or an attribute value, the set of presentation rules that apply
1.18 cvs 4163: is always defined in the same way.</p>
4164: <p>
1.1 cvs 4165: Normally, a set of presentation rules is placed between the keywords
1.18 cvs 4166: <tt>BEGIN</tt> and <tt>END</tt>, the keyword <tt>END</tt> being followed by a
1.1 cvs 4167: semicolon. The first section of this block defines the rules that apply to
1.18 cvs 4168: the primary view, if the <a href="#sectc427">default rules</a> are not
1.1 cvs 4169: completely suitable. Next comes the rules which apply to specific other
4170: views, with a rule sequence for each view for which the default rules are not
4171: satisfactory. If the default rules are suitable for the non-primary views,
4172: there will not be any specific rules for these views. If there is only one
1.18 cvs 4173: rule which applies to all views then the keywords <tt>BEGIN</tt> and
4174: <tt>END</tt> need not appear.</p>
4175: <p>
1.1 cvs 4176: For each view, it is only necessary to specify those rules which differ from
4177: the default rules for the view, so that for certain views (or even all views),
1.18 cvs 4178: there may be no specific rules.</p>
4179: <p>
4180: The specific rules for a non-primary view are introduced by the <a
4181: name="inkeyword"><tt>IN</tt> keyword</a>, followed by the view name. The
4182: rules for that view follow, delimited by the keywords <tt>BEGIN</tt> and
4183: <tt>END</tt>, or without these two keywords when there is only one rule.</p>
4184: <p>
4185: <strong>Note:</strong> the view name which follows the <tt>IN</tt> keyword
1.1 cvs 4186: must not be the name of the primary view, since the rules for that view are
1.18 cvs 4187: found before the rules for the other views.</p>
4188: <p>
1.1 cvs 4189: Within each block concerning a view, other blocks can appear, delimited by the
1.18 cvs 4190: same keywords <tt>BEGIN</tt> and <tt>END</tt>. Each of these blocks gathers
1.1 cvs 4191: the presentation rules that apply, for a given view, only when a given
4192: condition is satisfied. Each block is preceded by a condition introduced by
1.18 cvs 4193: the <tt>IF</tt> keyword. If such a conditional block contains only one rule,
4194: the keywords <tt>BEGIN</tt> and <tt>END</tt> can be omitted.</p>
4195: <p>
1.1 cvs 4196: Although the syntax allows any presentation rule to appear in a conditional
1.18 cvs 4197: block, only <a href="#sectc4232">creation rules</a> are allowed after any
4198: condition; other rules are allowed only after conditions <tt>Within</tt> and
1.1 cvs 4199: ElemID. In addition, the following rules cannot be conditional:
1.18 cvs 4200: <tt>PageBreak, LineBreak, Inline, Gather</tt>.</p>
4201: <p>
1.1 cvs 4202: For a given view, the rules that apply without any condition must appear
4203: before the first conditional block. If some rules apply only when none of the
4204: specified condition holds, they are grouped in a block preceded by the keyword
1.18 cvs 4205: <tt>Otherwise</tt>, and that block must appear after the last conditionnal
4206: block concerning the same view.</p>
4207: <pre> ViewRuleSeq = 'BEGIN' < RulesAndCond > < ViewRules >
1.1 cvs 4208: 'END' ';' /
4209: ViewRules / CondRules / Rule .
4210: RulesAndCond = CondRules / Rule .
4211: ViewRules = 'IN' ViewID CondRuleSeq .
4212: CondRuleSeq = 'BEGIN' < RulesAndCond > 'END' ';' /
4213: CondRules / Rule .
4214: CondRules = CondRule < CondRule >
4215: [ 'Otherwise' RuleSeq ] .
4216: CondRule = 'IF' ConditionSeq RuleSeq .
4217: RulesSeq = 'BEGIN' Rule < Rule > 'END' ';' /
1.18 cvs 4218: Rule .</pre>
4219: <blockquote class="example">
4220: <p>
4221: <strong>Example:</strong></p>
4222: <p>
1.3 cvs 4223: The following rules for a report's title make the title visible in the primary
4224: view and invisible in the table of contents and in the formula views (see the
1.18 cvs 4225: <a href="#sectc4224"><tt>Visibility</tt> rule</a>).</p>
4226: <pre>Title : BEGIN
1.1 cvs 4227: Visibility : 1;
4228: ... {Other rules for the primary view}
4229: IN Table_of_contents
4230: Visibility : 0;
4231: IN Formulas
4232: Visibility : 0;
1.18 cvs 4233: END;</pre>
4234: </blockquote>
4235: </div>
1.1 cvs 4236:
1.18 cvs 4237: <div class="subsection">
1.1 cvs 4238:
1.18 cvs 4239: <h3><a name="sectc4214">Conditions applying to presentation rules</a></h3>
4240: <p>
1.1 cvs 4241: Many conditions can be applied to presentation rules. Conditions allow
4242: certain presentation rules to apply only in certain cases. These conditions
4243: can be based on the structural position of the element. They can be based on
4244: whether the element has references, and what type of references, whether the
4245: element has attributes, whether the element is empty or not. They can also be
1.18 cvs 4246: based on the value of a counter.</p>
4247: <p>
1.1 cvs 4248: It is possible to specify several conditions which must all be true for the
1.18 cvs 4249: rules to apply.</p>
4250: <p>
4251: A set of conditions is specified by the <tt>IF</tt> keyword. This keyword is
4252: followed by the sequence of conditions, separated by the <tt>AND</tt> keyword.
1.1 cvs 4253: Each condition is specified by a keyword which defines the condition type. In
4254: some cases, the keyword is followed by other data, which specify the condition
1.18 cvs 4255: more precisely.</p>
4256: <p>
1.1 cvs 4257: An elementary condition can be negative; it is then preceded by the
1.18 cvs 4258: <tt>NOT</tt> keyword.</p>
4259: <p>
1.1 cvs 4260: When the presentation rule(s) controlled by the condition apply to a reference
4261: element or a reference attribute, an elementary condition can also apply to
1.18 cvs 4262: element referred by this reference. The <tt>Target</tt> keyword is used for
1.1 cvs 4263: that purpose. It must appear before the keyword defining the condition
1.18 cvs 4264: type.</p>
4265: <pre> CondRule ='IF' ConditionSeq RuleSeq .
1.1 cvs 4266: ConditionSeq = Condition < 'AND' Condition > .
4267: Condition = [ 'NOT' ] [ 'Target' ] ConditionElem .
4268: ConditionElem ='First' / 'Last' /
4269: [ 'Immediately' ] 'Within' [ NumParent ]
4270: ElemID [ ExtStruct ] /
4271: ElemID /
4272: 'Referred' / 'FirstRef' / 'LastRef' /
4273: 'ExternalRef' / 'InternalRef' / 'CopyRef' /
4274: 'AnyAttributes' / 'FirstAttr' / 'LastAttr' /
4275: 'UserPage' / 'StartPage' / 'ComputedPage' /
4276: 'Empty' /
4277: '(' [ MinMax ] CounterName CounterCond ')' /
4278: CondPage '(' CounterID ')' .
4279: NumParent = [ GreaterLess ] NParent .
1.6 cvs 4280: GreaterLess ='>' / '<' .
1.1 cvs 4281: NParent = NUMBER.
1.6 cvs 4282: ExtStruct ='(' ElemID ')' .
1.1 cvs 4283: CounterCond ='<' MaxCtrVal / '>' MinCtrVal /
4284: '=' EqCtrVal /
4285: 'IN' '[' ['-'] MinCtrBound '.' '.'
4286: ['-'] MaxCtrBound ']' .
4287: PageCond ='Even' / 'Odd' / 'One' .
4288: MaxCtrVal = NUMBER .
4289: MinCtrVal = NUMBER .
4290: EqCtrVal = NUMBER .
4291: MaxCtrBound = NUMBER .
1.18 cvs 4292: MinCtrBound = NUMBER .</pre>
1.1 cvs 4293:
1.18 cvs 4294: <div class="subsubsection">
1.1 cvs 4295:
1.18 cvs 4296: <h4><a name="sectd42141">Conditions based on the logical position of the
4297: element</a></h4>
4298: <p>
1.1 cvs 4299: The condition can be on the position of the element in the document's logical
4300: structure tree. It is possible to test whether the element is the first
1.18 cvs 4301: (<tt>First</tt>) or last (<tt>Last</tt>) among its siblings or if it is not
4302: the first (<tt>NOT First</tt>) or not the last (<tt>NOT Last</tt>). These
4303: conditions can be associated only with <a href="#sectc4232">creation
4304: rules</a>.</p>
4305: <p>
1.1 cvs 4306: It is also possible to test if the element is contained in an element of a
1.18 cvs 4307: given type (<tt>Within</tt>) or if it is not (<tt>NOT Within</tt>). The type
4308: is indicated after the keyword <tt>Within</tt>. If that element type is
1.1 cvs 4309: defined in a structure schema which is not the one which corresponds to the
4310: presentation schema, the type name of this element must be followed, between
1.18 cvs 4311: parentheses, by the name of the structure schema which defines it.</p>
4312: <p>
4313: If the keyword <tt>Within</tt> is preceded by <tt>Immediately</tt>, the
4314: condition is satisfied only if the <em>parent</em> element has the type
4315: indicated. If the word <tt>Immediately</tt> is missing, the condition is
4316: satisfied if any <em>ancestor</em> has the type indicated.</p>
4317: <p>
4318: An integer <i>n</i> can appear between the keyword <tt>Within</tt> and the
1.1 cvs 4319: type. It specifies the number of ancestors of the indicated type that must be
4320: present for the condition to be satisfied. If the keyword
1.18 cvs 4321: <tt>Immediately</tt> is also present, the <i>n</i> immediate ancestors of the
4322: element must have the indicated type. The integer <i>n</i> must be positive
4323: or zero. It can be preceded by <tt><</tt> or <tt>></tt> to indicate a
1.1 cvs 4324: maximum or minimum number of ancestors. If these symbols are missing, the
1.18 cvs 4325: condition is satisfied only if it exists exactly <i>n</i> ancestors. When
4326: this number is missing, it is equivalent to > 0.</p>
4327: <p>
1.1 cvs 4328: If the condition applies to presentation rules associated with an attribute,
1.18 cvs 4329: in the <tt>ATTRIBUTES</tt> section of the presentation schema, the condition
1.1 cvs 4330: can be simply an element name. Presentation rules are then executed only if
1.18 cvs 4331: the attribute is attached to an element of that type. The keyword <tt>NOT</tt>
1.1 cvs 4332: before the element name indicates that the presentation rules must be executed
1.18 cvs 4333: only if the element is not of the type indicated.</p>
4334: </div>
1.1 cvs 4335:
1.18 cvs 4336: <div class="subsubsection">
1.1 cvs 4337:
1.18 cvs 4338: <h4><a name="sectd42142">Conditions on references</a></h4>
4339: <p>
1.1 cvs 4340: References may be taken into account in conditions, which can be based on the
4341: fact that the element, or one of its ancestors, is designated by a at least
1.18 cvs 4342: one reference (<tt>Referred</tt>) or by none (<tt>NOT Referred</tt>).</p>
4343: <p>
1.1 cvs 4344: If the element or attribute to which the condition is attached is a reference,
4345: the condition can be based on the fact that it acts as the first reference to
1.18 cvs 4346: the designated element (<tt>FirstRef</tt>), or as the last (<tt>LastRef</tt>),
1.1 cvs 4347: or as a reference to an element located in another document
1.18 cvs 4348: (<tt>ExternalRef</tt>) or in the same document (<tt>InternalRef</tt>).</p>
4349: <p>
4350: The condition can also be based on the fact that the element is an <a
4351: href="#inclusion">inclusion</a>. This is noted (<tt>CopyRef</tt>).</p>
4352: <p>
1.1 cvs 4353: Like all conditions, conditions on references can be inverted by the
1.18 cvs 4354: <tt>NOT</tt> keyword. These conditions can be associated only with <a
4355: href="#sectc4232">creation rules</a>.</p>
4356: </div>
1.1 cvs 4357:
1.18 cvs 4358: <div class="subsubsection">
1.1 cvs 4359:
1.18 cvs 4360: <h4><a name="sectd42143">Conditions on logical attributes</a></h4>
4361: <p>
1.1 cvs 4362: The condition can be based on the presence or absence of attributes associated
4363: with the element, no matter what the attributes or their values. The
1.18 cvs 4364: <tt>AnyAttributes</tt> keyword expresses this condition.</p>
4365: <p>
1.1 cvs 4366: If the condition appears in the presentation rules of an attribute, the
1.18 cvs 4367: <tt>FirstAttr</tt> and <tt>LastAttr</tt> keywords can be used to indicate that
1.1 cvs 4368: the rules must only be applied if this attribute is the first attribute for
4369: the element or if it is the last (respectively). These conditions can also be
1.18 cvs 4370: inverted by the <tt>NOT</tt> keyword. These conditions can be associated only
4371: with <a href="#sectc4232">creation rules</a>.</p>
4372: <p>
1.1 cvs 4373: It is also possible to apply certain presentation rules only when the element
4374: being processed or one of its ancestors has a certain attribute, perhaps with
1.18 cvs 4375: a certain value. This can be done in the <a
4376: href="#sectc4210"><tt>ATTRIBUTES</tt> section</a>.</p>
4377: </div>
1.1 cvs 4378:
1.18 cvs 4379: <div class="subsubsection">
1.1 cvs 4380:
1.18 cvs 4381: <h4><a name="sectd42144">Conditions on page breaks</a></h4>
4382: <p>
1.1 cvs 4383: The page break base type (and only this type) can use the following
1.18 cvs 4384: conditions: <tt>ComputedPage</tt>, <tt>StartPage</tt>, and <tt>UserPage</tt>.
4385: The <tt>ComputedPage</tt> condition indicates that the presentation rule(s)
1.1 cvs 4386: should apply if the page break was created automatically by Thot; the
1.18 cvs 4387: <tt>StartPage</tt> condition is true if the page break is generated before the
4388: element by the <tt>Page</tt> rule; and the <tt>UserPage</tt> condition applies
4389: if the page break was inserted by the user.</p>
4390: <p>
4391: These conditions can be associated only with <a href="#sectc4232">creation
4392: rules</a>.</p>
4393: </div>
1.1 cvs 4394:
1.18 cvs 4395: <div class="subsubsection">
1.1 cvs 4396:
1.18 cvs 4397: <h4><a name="sectd42145">Conditions on the element's content</a></h4>
4398: <p>
1.1 cvs 4399: The condition can be based on whether or not the element is empty. An element
4400: which has no children or whose leaves are all empty is considered to be empty
1.18 cvs 4401: itself. This condition is expressed by the <tt>Empty</tt> keyword, optionally
4402: preceded by the <tt>NOT</tt> keyword. This condition can be associated only
4403: with <a href="#sectc4232">creation rules</a>.</p>
4404: </div>
1.1 cvs 4405:
1.18 cvs 4406: <div class="subsubsection">
1.1 cvs 4407:
1.18 cvs 4408: <h4><a name="sectd42146">Conditions on counters</a></h4>
4409: <p>
1.1 cvs 4410: Presentation rules can apply when the counter's value is one, is even or odd,
4411: is equal, greater than or less than a given value or falls in a range of
4412: values. This is particularly useful for creating header and footer boxes.
1.18 cvs 4413: These conditions can be associated only with <a href="#sectc4232">creation
4414: rules</a>.</p>
4415: <p>
1.1 cvs 4416: To compare the value of a counter to a given value, a comparison is given
4417: between parentheses. The comparison is composed of the counter name followed
4418: by an equals, greater than, or less than sign and the value to which the
4419: counter will be compared. A test for whether or not a counter's value falls
4420: in a range also appears within parentheses. In this case, the counter name is
1.18 cvs 4421: followed by the <tt>IN</tt> keyword and the range definition within brackets.
4422: The <tt>Even</tt>, <tt>Odd</tt> and <tt>One</tt> are used to test a counter's
4423: value and are followed by the counter name between parentheses.</p>
4424: <p>
4425: The list of possible conditions on counters is:</p>
4426: <dl>
4427: <dt><tt>Even (Counter)</tt></dt>
4428: <dd>
4429: the box is created only if the counter has an even value.
4430: </dd>
4431: <dt><tt>Odd (Counter)</tt></dt>
4432: <dd>
4433: the box is created only if the counter has an odd value.
4434: </dd>
4435: <dt><tt>One (Counter)</tt></dt>
4436: <dd>
4437: the box is created only the counter's value is 1.
4438: </dd>
4439: <dt><tt>NOT One (Counter)</tt></dt>
4440: <dd>
4441: the box is created, unless the counter's value is 1.
4442: </dd>
4443: <dt><tt>(Counter < Value)</tt></dt>
4444: <dd>
4445: the box is created only if the counter's value is less than Value.
4446: </dd>
4447: <dt><tt>(Counter > Value)</tt></dt>
4448: <dd>
4449: the box is created only if the counter's value is greater 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 equal to Value.
4454: </dd>
4455: <dt><tt>NOT (Counter = Value)</tt></dt>
4456: <dd>
4457: the is created only if the counter's value is different than Value.
4458: </dd>
4459: <dt><tt>(Counter IN [MinValue..MaxValue])</tt></dt>
4460: <dd>
4461: the box is created only if the counter's value falls in the range bounded by
4462: MinValue and MaxValue (inclusive).
4463: </dd>
4464: <dt><tt>NOT (Counter IN [MinValue..MaxValue])</tt></dt>
4465: <dd>
4466: the box is created only if the value of the counter does not fall in the range
4467: bounded by MinValue and MaxValue (inclusive).
4468: </dd>
4469: </dl>
4470: <p>
4471: <strong>Note:</strong> the <tt>NOT Even</tt> and <tt>NOT Odd</tt> conditions
4472: are syntactically correct but can be expressed more simply by <tt>Odd</tt> and
4473: <tt>Even</tt>, respectively.</p>
4474: </div>
4475: </div>
1.1 cvs 4476:
1.18 cvs 4477: <div class="subsection">
1.1 cvs 4478:
1.18 cvs 4479: <h3><a name="sectc4215">A presentation rule</a></h3>
4480: <p>
1.1 cvs 4481: A presentation rule defines either a presentation parameter or presentation
1.18 cvs 4482: function. The parameters are:</p>
4483: <ul>
4484: <li>
4485: the position of the vertical and horizontal reference axes of the box,
1.19 ! cvs 4486: </li>
1.18 cvs 4487: <li>
4488: the position of the box in relation to other boxes,
1.19 ! cvs 4489: </li>
1.18 cvs 4490: <li>
4491: the height or width of the box, with overflow exceptions,
1.19 ! cvs 4492: </li>
1.18 cvs 4493: <li>
4494: the characteristics of the lines contained in the box: linespacing,
1.1 cvs 4495: indentation of the first line, justification, hyphenation,
1.19 ! cvs 4496: </li>
1.18 cvs 4497: <li>
4498: the conditions for breaking the box across pages,
1.19 ! cvs 4499: </li>
1.18 cvs 4500: <li>
4501: the characteristics of the characters contained in the box: size, font, style,
4502: underlining,
1.19 ! cvs 4503: </li>
1.18 cvs 4504: <li>
4505: the depth of the box among overlapping boxes (often called stacking order),
1.19 ! cvs 4506: </li>
1.18 cvs 4507: <li>
4508: the characteristics of graphic elements contained in the box: style and
1.1 cvs 4509: thickness of lines, fill pattern for closed objects,
1.19 ! cvs 4510: </li>
1.18 cvs 4511: <li>
4512: the colors in text, graphics, pictures, and symbols contained in the box are
4513: displayed or printed,
1.19 ! cvs 4514: </li>
1.18 cvs 4515: <li>
4516: for presentation boxes only, the contents of the box.
1.19 ! cvs 4517: </li>
1.18 cvs 4518: </ul>
4519: <p>
4520: The <a name="presfunct">presentation functions</a> are:</p>
4521: <ul>
4522: <li>
4523: the creation of a presentation box
1.19 ! cvs 4524: </li>
1.18 cvs 4525: <li>
4526: the line-breaking or page-breaking style,
1.19 ! cvs 4527: </li>
1.18 cvs 4528: <li>
4529: the copying of another box,
1.19 ! cvs 4530: </li>
1.18 cvs 4531: <li>
4532: the display of the box background and border,
1.19 ! cvs 4533: </li>
1.18 cvs 4534: <li>
4535: the display of a background picture and its aspect.
1.19 ! cvs 4536: </li>
1.18 cvs 4537: </ul>
4538: <p>
1.1 cvs 4539: For each box and each view, every presentation parameter is defined once and
1.18 cvs 4540: only once, either explicitly or by the <a href="#sectc427">default rules</a>.
4541: In contrast, presentation functions are not obligatory and can appear many
4542: times for the same element. for example an element can create many
4543: presentation boxes. Another element may not use any presentation
4544: functions.</p>
4545: <p>
1.1 cvs 4546: Each rule defining a presentation parameter begins with a keyword followed by
1.18 cvs 4547: a colon. The keyword indicates the parameter which is the subject of the
4548: rule. After the keyword and the colon, the remainder of the rule varies. All
4549: rules are terminated by a semicolon.</p>
4550: <pre> Rule = PresParam ';' / PresFunc ';' .
1.6 cvs 4551: PresParam ='VertRef' ':' PositionHoriz /
4552: 'HorizRef' ':' PositionVert /
4553: 'VertPos' ':' VPos /
4554: 'HorizPos' ':' HPos /
4555: 'Height' ':' Dimension /
4556: 'Width' ':' Dimension /
4557: 'VertOverflow' ':' Boolean /
1.1 cvs 4558: 'HorizOverflow' ':' Boolean /
1.6 cvs 4559: 'LineSpacing' ':' DistanceInherit /
4560: 'Indent' ':' DistanceInherit /
4561: 'Adjust' ':' AdjustInherit /
4562: 'Justify' ':' BoolInherit /
4563: 'Hyphenate' ':' BoolInherit /
4564: 'PageBreak' ':' Boolean /
4565: 'LineBreak' ':' Boolean /
4566: 'InLine' ':' Boolean /
4567: 'NoBreak1' ':' AbsDist /
4568: 'NoBreak2' ':' AbsDist /
4569: 'Gather' ':' Boolean /
4570: 'Visibility' ':' NumberInherit /
4571: 'Size' ':' SizeInherit /
4572: 'Font' ':' NameInherit /
4573: 'Style' ':' StyleInherit /
4574: 'Underline' ':' UnderLineInherit /
4575: 'Thickness' ':' ThicknessInherit /
4576: 'Depth' ':' NumberInherit /
4577: 'LineStyle' ':' LineStyleInherit /
4578: 'LineWeight' ':' DistanceInherit /
4579: 'FillPattern' ':' NameInherit /
4580: 'Background' ':' NameInherit /
1.13 cvs 4581: 'Foreground' ':' NameInherit /
1.6 cvs 4582: 'Content' ':' VarConst .
1.1 cvs 4583: PresFunc = Creation '(' BoxID ')' /
4584: 'Line' /
4585: 'NoLine' /
4586: 'Page' '(' BoxID ')' /
1.13 cvs 4587: 'Copy' '(' BoxTypeToCopy ')' /
4588: 'ShowBox' /
1.18 cvs 4589: 'BackgroundPicture' ':' FileName /
4590: 'PictureMode' ':' PictMode /</pre>
4591: </div>
4592:
4593: <div class="subsection">
4594:
4595: <h3><a name="sectc4216">Box axes</a></h3>
4596: <p>
4597: The position of the middle axes <tt>VMiddle</tt> and <tt>HMiddle</tt> in
1.1 cvs 4598: relation to their box is always calculated automatically as a function of the
4599: height and width of the box and is not specified by the presentation rules. In
4600: the presentation schema, these middle axes are used only to position their box
4601: with respect to another by specifying the distance between the middle axis and
1.18 cvs 4602: an axis or a side of another box (see the <a href="#sectc4218">relative
4603: position</a>).</p>
4604: <p>
1.1 cvs 4605: The reference axes of a box are also used to position their box in relation to
4606: another, but in contrast to the middle axes, the presentation schema must make
4607: their position explicit, either in relation to a side or the middle axis of
1.18 cvs 4608: the box itself, or in relation to an axis of an enclosed box.</p>
4609: <p>
1.1 cvs 4610: Only boxes of base elements have predefined reference axes. For character
4611: string boxes, the horizontal reference axis is the baseline of the characters
4612: (the line which passes immediately under the upper-case letters, ignoring the
4613: letter Q) and the vertical reference axis is at the left edge of the first
1.18 cvs 4614: character of the string.</p>
4615: <p>
4616: The positions of a box's reference axes are defined by the <tt>VertRef</tt>
4617: and <tt>HorizRef</tt> rules which specify the <a href="#distance">distance</a>
1.1 cvs 4618: between the reference axis and an axis or parallel side of the same box or of
1.18 cvs 4619: an enclosed box.</p>
4620: <pre> 'VertRef' ':' PositionHoriz
4621: 'HorizRef' ':' PositionVert</pre>
4622: <blockquote class="example">
4623: <p>
4624: <strong>Example:</strong></p>
4625: <p>
1.3 cvs 4626: If, in the structure schema for mathematical formulas, the fraction element is
1.18 cvs 4627: defined by</p>
4628: <pre>Fraction = BEGIN
1.1 cvs 4629: Numerator = Expression;
4630: Denominator = Expression;
1.18 cvs 4631: END;</pre>
4632: <p>
1.3 cvs 4633: then the horizontal reference axis of the fraction can be positioned on top of
1.18 cvs 4634: the denominator by the rule:</p>
4635: <pre>Fraction :
1.1 cvs 4636: BEGIN
4637: HorizRef : Enclosed Denominator . Top;
4638: ...
1.18 cvs 4639: END;</pre>
4640: <p>
4641: To put the horizontal reference axis of a column at its middle:</p>
4642: <pre>Column :
1.1 cvs 4643: BEGIN
4644: HorizRef : * . HMiddle;
4645: ...
1.18 cvs 4646: END;</pre>
4647: </blockquote>
4648: </div>
1.1 cvs 4649:
1.18 cvs 4650: <div class="subsection">
1.1 cvs 4651:
1.18 cvs 4652: <h3><a name="sectc4217">Distance units</a></h3>
4653: <p>
1.1 cvs 4654: Some distances and dimensions appear in many rules of a presentation schema,
1.18 cvs 4655: especially in position rules (<tt>VertPos, HorizPos</tt>), in extent rules for
4656: boxes (<tt>Height, Width</tt>), in rules defining lines (<tt>LineSpacing,
4657: Indent</tt>), in rules controlling pagination (<tt>NoBreak1, NoBreak2</tt>)
4658: and in rules specifying the thickness of strokes (<tt>LineWeight</tt>).</p>
4659: <p>
4660: In all these rules, the distance or extent can be expressed</p>
4661: <ul>
4662: <li>
4663: either in relative units, which depend on the size of the characters in the
4664: current font: height of the element's font or height of the letter 'x',
1.19 ! cvs 4665: </li>
1.18 cvs 4666: <li>
4667: or in absolute units: centimeter, millimeter, inch, typographer's point, pica
4668: or pixel.
1.19 ! cvs 4669: </li>
1.18 cvs 4670: </ul>
4671: <p>
1.5 cvs 4672: Units can be chosen freely. Thus, it is possible to use relative units in one
1.18 cvs 4673: rule, centimeters in the next rule, and typographer's points in another.</p>
4674: <p>
1.1 cvs 4675: Absolute units are used to set rigid rules for the appearance of documents. In
4676: contrast, relative units allow changes of scale. The editor lets the value of
4677: relative units be changed dynamically. Such changes affect every box using
4678: relative units simultaneously and in the same proportion. Changing the value
4679: of the relative units affects the size of the characters and graphical
1.18 cvs 4680: elements, and the size of the boxes and the distances between them.</p>
4681: <p>
4682: A <a name="distance">distance</a> or extent is specified by a number, which
1.1 cvs 4683: may be followed by one or more spaces and a units keyword. When there is no
4684: units keyword, the number specifies the number of relative units, where a
4685: relative unit is the height of a character in the current font (an em). When
4686: the number is followed by a units keyword, the keyword indicates the type of
1.18 cvs 4687: absolute units:</p>
4688: <ul>
4689: <li>
4690: <tt>em</tt>: height of the element's font,
1.19 ! cvs 4691: </li>
1.18 cvs 4692: <li>
4693: <tt>ex</tt>: height of the letter 'x',
1.19 ! cvs 4694: </li>
1.18 cvs 4695: <li>
4696: <tt>cm</tt>: centimeter,
1.19 ! cvs 4697: </li>
1.18 cvs 4698: <li>
4699: <tt>mm</tt>: millimeter,
1.19 ! cvs 4700: </li>
1.18 cvs 4701: <li>
4702: <tt>in</tt>: inch (1 in = 2.54 cm),
1.19 ! cvs 4703: </li>
1.18 cvs 4704: <li>
4705: <tt>pt</tt>: point (1 pt = 1/72 in),
1.19 ! cvs 4706: </li>
1.18 cvs 4707: <li>
4708: <tt>pc</tt>: pica (1 pc = 12 pt),
1.19 ! cvs 4709: </li>
1.18 cvs 4710: <li>
4711: <tt>px</tt>: pixel.
1.19 ! cvs 4712: </li>
1.18 cvs 4713: </ul>
4714: <p>
1.1 cvs 4715: Whatever the chosen unit, relative or absolute, the number is not necessarily
4716: an integer and may be expressed in fixed point notation (using the American
1.18 cvs 4717: convention of a period to express the decimal point).</p>
4718: <p>
1.1 cvs 4719: If the distance appears in a presentation rule for a numeric attribute, the
4720: number can be replaced by the name of an attribute. In this case, the value
4721: of the attribute is used. Obviously, the attribute name cannot be followed by
4722: a decimal point and a fractional part, but it can be followed a units keyword.
1.18 cvs 4723: However, the choice of units is limited to em, ex, pt and px.</p>
4724: <pre> Distance = [ Sign ] AbsDist .
1.1 cvs 4725: Sign ='+' / '-' .
4726: AbsDist = IntegerOrAttr [ '.' DecimalPart ]
4727: [ Unit ].
4728: IntegerOrAttr = IntegerPart / AttrID .
4729: IntegerPart = NUMBER .
4730: DecimalPart = NUMBER .
4731: Unit ='em' / 'ex' / 'cm' / 'mm' / 'in' / 'pt' /
1.18 cvs 4732: 'pc' / 'px' / '%' .</pre>
4733: <blockquote class="example">
4734: <p>
4735: <strong>Example:</strong></p>
4736: <p>
1.3 cvs 4737: The following rules specify that a box has a height of 10.5 centimeters and a
1.18 cvs 4738: width of 5.3 ems:</p>
4739: <pre>Height : 10.5 cm;
4740: Width : 5.3;</pre>
4741: </blockquote>
4742: </div>
1.1 cvs 4743:
1.18 cvs 4744: <div class="subsection">
1.1 cvs 4745:
1.18 cvs 4746: <h3><a name="sectc4218">Relative positions</a></h3>
4747: <p>
1.1 cvs 4748: The positioning of boxes uses the eight axes and sides, the sides generally
4749: being used to define the juxtapositioning (vertical or horizontal) of boxes,
4750: the middle axes being used to define centering, and the reference axes being
1.18 cvs 4751: used for alignment.</p>
4752: <p>
4753: Two rules allow a box to be placed relative to other boxes. The
4754: <tt>VertPos</tt> rule positions the box vertically. The <tt>HorizPos</tt>
4755: rule positions the box horizontally. It is possible that a box's position
4756: could be entirely determined by other boxes positioned relative to it. In this
4757: case, the position is implicit and the word <tt>nil</tt> can be used to
4758: specify that no position rule is needed. Otherwise, an explicit rule must be
4759: given by indicating the axis or side which defines the position of the box,
4760: followed by an equals sign and the distance between between this axis or side
4761: and a parallel axis or side of another box, called the reference box. The box
4762: for which the rule is written will be positioned relative to the reference
4763: box.</p>
4764: <pre> 'VertPos' ':' VPos
1.6 cvs 4765: 'HorizPos' ':' HPos
4766: HPos = 'nil' / VertAxis '=' HorizPosition
4767: [ 'UserSpecified' ].
4768: VPos = 'nil' / HorizAxis '=' VertPosition
4769: [ 'UserSpecified' ].
1.1 cvs 4770: VertAxis = 'Left' / 'VMiddle' / 'VRef' / 'Right' .
1.18 cvs 4771: HorizAxis = 'Top' / 'HMiddle' / 'HRef' / 'Bottom' .</pre>
4772: <p>
1.1 cvs 4773: The reference box is an adjacent box: enclosing, enclosed or adjacent. When a
4774: rule is associated with a reference type attribute (and only in this case), it
4775: can be a box of the element designated by the attribute. The reference box
1.18 cvs 4776: can be either a presentation box previously defined in the <tt>BOXES</tt>
1.1 cvs 4777: section of the schema and created by a creation function, or the box
1.18 cvs 4778: associated with a structured element.</p>
4779: <p>
1.1 cvs 4780: The structural position of the reference box (relative to the box for which
1.18 cvs 4781: the rule is being written) is indicated by a keyword: <tt>Enclosing</tt>,
4782: <tt>Enclosed</tt>, or, for sibling boxes, <tt>Previous</tt> or <tt>Next</tt>.
1.1 cvs 4783: The reference attributes, or presentation boxes created by a reference
1.18 cvs 4784: attribute, the <tt>Referred</tt> keyword may be used to designate the element
4785: which the reference points to. The keyword <tt>Creator</tt> can be used in
1.1 cvs 4786: rules for presentation boxes to designate the box of the element which created
1.18 cvs 4787: the presentation box. Finally, the <tt>Root</tt> keyword can be used to
4788: designate the root of the document.</p>
4789: <p>
4790: When the keyword is ambiguous, it is followed by the name of an element type
4791: or presentation box which resolves the ambiguity (the <tt>Creator</tt> and
4792: <tt>Root</tt> keywords are never ambiguous). If this name is not given, then
1.1 cvs 4793: the first box encountered is used as the reference box. It is also possible to
1.18 cvs 4794: use just the name of an element type or presentation box without an initial
4795: keyword. In this case, a sibling having that name will be used. If the name
4796: is preceded by the keyword <tt>NOT</tt>, then the reference box will be the
4797: first box whose type is not the named one.</p>
4798: <p>
4799: In place of the box or type name, the keywords <tt>AnyElem</tt>,
4800: <tt>AnyBox</tt> and <tt>ElemWithAttr</tt> can be used, representing
1.17 cvs 4801: respectively, any structured element box, any presentation box, and the box
4802: corresponding to any structured element having a particular attribute,
4803: whatever its value; the name of this attribute must follow the keyword
1.18 cvs 4804: <tt>ElemWithAttr</tt>.</p>
4805: <p>
1.17 cvs 4806: A type name may be preceded by a star in order to resolve the ambiguity in the
1.18 cvs 4807: special case where the structure schema defines an <a
4808: href="#sectd3284">inclusion</a> without expansion (or with partial expansion)
4809: of the same type as an element of the scheme. For mark pairs (and only for <a
4810: href="#sectd3285">mark pairs</a>) the type name <em>must</em> be preceded by
4811: the <tt>First</tt> or <tt>Second</tt> keyword, which indicates which of the
4812: two marks of the pair should be used as the reference box.</p>
4813: <p>
4814: The star character ('<tt>*</tt>') used alone designates the box to which the
1.1 cvs 4815: rule applies (in this case, it is obviously useless to specify the type of the
1.18 cvs 4816: reference box).</p>
4817: <p>
4818: The keywords <tt>Enclosing</tt> and <tt>Enclosed</tt> can be used no matter
1.1 cvs 4819: what constructor defines the type to which the rule applies. When applied to
1.18 cvs 4820: the element which represents the entire document, <tt>Enclosing</tt>
1.1 cvs 4821: designates the window or page in which the document's image is displayed for
4822: the view to which the rule applies. A box or type name without a keyword is
4823: used for aggregate elements and designates another element of the same
4824: aggregate. It can also be used to designate a presentation or page layout
1.18 cvs 4825: box. The keywords <tt>Previous</tt> and <tt>Next</tt> are primarily used to
1.1 cvs 4826: denote list elements, but can also be used to denote elements of an
1.18 cvs 4827: aggregate.</p>
4828: <p>
1.1 cvs 4829: In the position rule, the structural position relative to the reference box is
4830: followed, after a period, by the name of an axis or side. The rule specifies
4831: its node's position as being some distance from this axis or side of the
4832: reference box. If this distance is zero, then the distance does not appear in
4833: the rule. Otherwise, it does appear as a positive or negative number (the
4834: sign is required for negative numbers). The sign takes into account the
4835: orientation of the coordinate axes: for top to bottom for the vertical axis
4836: and from left to right for the horizontal axis. Thus, a negative distance in
4837: a vertical position indicates that the side or axis specified in the rule is
1.18 cvs 4838: above the side or axis of the reference box.</p>
4839: <p>
4840: The distance can be followed by the <tt>UserSpecified</tt> keyword (even if
4841: the distance is nil and does not appear, the <tt>UserSpecified</tt> keyword
1.1 cvs 4842: can be used). It indicates that when the element to which the rule applies is
4843: being created, the editor will ask the user to specify the distance himself,
4844: using the mouse. In this case, the distance specified in the rule is a
4845: default distance which is suggested to the user but can be modified. The
1.18 cvs 4846: <tt>UserSpecified</tt> keyword can be used either in the vertical position
4847: rule, the horizontal position rule, or both.</p>
4848: <pre> VertPosition = Reference '.' HorizAxis [ Distance ] .
1.1 cvs 4849: HorizPosition = Reference '.' VertAxis [ Distance ] .
4850: Reference ='Enclosing' [ BoxTypeNot ] /
4851: 'Enclosed' [ BoxTypeNot ] /
4852: 'Previous' [ BoxTypeNot ] /
4853: 'Next' [ BoxTypeNot ] /
4854: 'Referred' [ BoxTypeNot ] /
4855: 'Creator' /
4856: 'Root' /
4857: '*' /
4858: BoxOrType .
4859: BoxOrType = BoxID /
4860: [ '*' ] [ FirstSec ] ElemID /
1.17 cvs 4861: 'AnyElem' / 'AnyBox' /
4862: 'ElemWithAttr' AttrID .
1.18 cvs 4863: BoxTypeNot = [ 'NOT' ] BoxOrType .</pre>
4864: <blockquote class="example">
4865: <p>
4866: <strong>Example:</strong></p>
4867: <p>
4868: If a <a name="expos1">report</a> is defined by the following structure
4869: schema:</p>
4870: <pre>Report = BEGIN
1.6 cvs 4871: Title = Text;
4872: Summary = Text;
4873: Keywords = Text;
4874: ...
1.18 cvs 4875: END;</pre>
4876: <p>
4877: then the presentation schema could contain the rules:</p>
4878: <pre>Report : BEGIN
1.6 cvs 4879: VertPos : Top = Enclosing . Top;
4880: HorizPos : Left = Enclosing . Left;
4881: ...
1.18 cvs 4882: END;</pre>
4883: <p>
4884: These rules place the <a name="reportexample">report</a> in the upper left
4885: corner of the enclosing box, which is the window in which the document is
4886: being edited.</p>
4887: <pre>Title : BEGIN
1.6 cvs 4888: VertPos : Top = Enclosing . Top + 1;
4889: HorizPos : VMiddle = Enclosing . VMiddle;
4890: ...
1.18 cvs 4891: END;</pre>
4892: <p>
1.3 cvs 4893: The top of the title is one line (a line has the height of the characters of
4894: the title) from the top of the report, which is also the top of the editing
1.18 cvs 4895: window. The title is centered horizontally in the window (see <a
4896: href="#posdim">figure</a>).</p>
4897: <pre>Summary : BEGIN
1.1 cvs 4898: VertPos : Top = Title . Bottom + 1.5;
4899: HorizPos : Left = Enclosing . Left + 2 cm;
4900: ...
1.18 cvs 4901: END;</pre>
4902: <p>
4903: The top of the summary is place a line and a half below the bottom of the
4904: title and is shifted two centimeters from the side of the window.</p>
4905: </blockquote>
4906: <blockquote class="example">
4907: <p>
4908: <strong>Example:</strong></p>
4909: <p>
4910: Suppose there is a <a name="expos2">Design</a> logical structure which
4911: contains graphical elements:</p>
4912: <pre>Design = LIST OF (ElemGraph = GRAPHICS);</pre>
4913: <p>
1.3 cvs 4914: The following rules allow the user to freely choose the position of each
1.18 cvs 4915: element when it is created:</p>
4916: <pre>ElemGraph =
1.1 cvs 4917: BEGIN
4918: VertPos : Top = Enclosing . Top + 1 cm UserSpecified;
4919: HorizPos: Left = Enclosing . Left UserSpecified;
4920: ...
1.18 cvs 4921: END;</pre>
4922: <p>
4923: Thus, when a graphical element is created, its default placement is at the
4924: left of the window and 1 cm from the top, but the user can move it
4925: immediately, simply by moving the mouse.</p>
4926: </blockquote>
4927: </div>
1.1 cvs 4928:
1.18 cvs 4929: <div class="subsection">
1.1 cvs 4930:
1.18 cvs 4931: <h3><a name="sectc4219">Box extents</a></h3>
4932: <p>
1.1 cvs 4933: The extents (height and width) of each box are defined by the two rules
1.18 cvs 4934: <tt>Height</tt> and <tt>Width</tt>. There are three types of extents: fixed,
4935: relative, and elastic.</p>
1.1 cvs 4936:
1.18 cvs 4937: <div class="subsubsection">
1.1 cvs 4938:
1.18 cvs 4939: <h4><a name="sectd42191">Fixed extents</a></h4>
4940: <p>
1.1 cvs 4941: A fixed dimension sets the height or width of the box independently of all
1.18 cvs 4942: other boxes. It is expressed in <a href="#sectc4217">distance units</a>. The
4943: extent can be followed by the <tt>UserSpecified</tt> keyword which indicates
1.1 cvs 4944: that when the element to which the rule applies is being created, the editor
4945: will ask the user to specify the extent himself, using the mouse. In this
4946: case, the extent specified in the rule is a default extent which is suggested
1.18 cvs 4947: to the user but can be modified. The <tt>UserSpecified</tt> keyword can be
4948: used either in the <tt>Height</tt> rule, the <tt>Width</tt> rule, or both.</p>
4949: <p>
4950: A fixed extent rule can be ended by the <tt>Min</tt> keyword, which signifies
1.1 cvs 4951: that the indicated value is a minimum, and that, if the contents of the box
1.18 cvs 4952: require it, a larger extent is possible.</p>
4953: <pre> 'Height' ':' Dimension
1.1 cvs 4954: 'Width' ':' Dimension
4955: Dimension = AbsDist [ 'UserSpecified' ] [ 'Min' ] /
1.18 cvs 4956: ...</pre>
4957: <blockquote class="example">
4958: <p>
4959: <strong>Example:</strong></p>
4960: <p>
4961: Continuing with the <a href="#expos2">previous example</a>, it is possible to
1.3 cvs 4962: allow the user to choose the size of each graphical element as it is
1.18 cvs 4963: created:</p>
4964: <pre>ElemGraph : BEGIN
1.6 cvs 4965: Width : 2 cm UserSpecified;
1.1 cvs 4966: Height : 1 cm UserSpecified;
4967: ...
1.18 cvs 4968: END;</pre>
4969: <p>
1.1 cvs 4970: Thus, when a graphical element is create, it is drawn by default with a width
4971: of 2 cm and a height of 1 cm, but the user is free to resize it immediately
1.18 cvs 4972: with the mouse.</p>
4973: <pre>Summary : BEGIN
1.1 cvs 4974: Height : 5 cm Min;
4975: ...
4976: END;
4977: Keywords : BEGIN
4978: VertPos : Top = Summary . Bottom;
4979: ...
1.18 cvs 4980: END;</pre>
4981: </blockquote>
4982: </div>
1.1 cvs 4983:
1.18 cvs 4984: <div class="subsubsection">
1.1 cvs 4985:
1.18 cvs 4986: <h4><a name="sectd42192">Relative extents</a></h4>
4987: <p>
1.1 cvs 4988: A relative extent determines the extent as a function of the extent of another
4989: box, just as a relative position places a box in relation to another. The
4990: reference box in an extent rule is designated using the same syntax as is used
1.18 cvs 4991: in a relative position rule. It is followed by a period and a <tt>Height</tt>
4992: or <tt>Width</tt> keyword, depending on the extent being referred to. Next
1.1 cvs 4993: comes the relation between the extent being defined and the extent of the
1.18 cvs 4994: reference box. This relation can be either a percentage or a difference.</p>
4995: <p>
1.1 cvs 4996: A percentage is indicated by a star (the multiplication symbol) followed by
4997: the numeric percentage value (which may be greater than or less than 100) and
4998: the percent (`%') character. A difference is simply indicated by a signed
1.18 cvs 4999: difference.</p>
5000: <p>
1.1 cvs 5001: If the rule appears in the presentation rules of a numeric attribute, the
5002: percentage value can be replaced by the name of the attribute. This attribute
1.18 cvs 5003: is then used as a percentage. The attribute can also be used as part of a <a
5004: href="#distance">difference</a>.</p>
5005: <p>
1.1 cvs 5006: Just as with a fixed extent, a relative extent rule can end with the
1.18 cvs 5007: <tt>Min</tt> keyword, which signifies that the extent is a minimum and that,
5008: if the contents of the box require it, a larger extent is possible.</p>
5009: <p>
5010: A special case of relative extent rules is:</p>
5011: <pre>Height : Enclosed . Height;</pre>
5012: <p>
5013: or</p>
5014: <pre>Width : Enclosed . Width;</pre>
5015: <p>
1.5 cvs 5016: which specifies that the box has a height (or width) such that it encloses all
1.18 cvs 5017: the boxes which it contains, excluding boxes having a rule <tt>VertOverflow:
5018: Yes;</tt> or <tt>HorizOverflow: Yes;</tt>.</p>
5019: <p>
5020: <strong>Note:</strong> character strings (type <tt>TEXT_UNIT</tt>) generally
1.1 cvs 5021: must use the sum of the widths of the characters which compose them as their
1.18 cvs 5022: width, which is expressed by the rule:</p>
5023: <pre>TEXT_UNIT :
5024: Width : Enclosed . Width;</pre>
5025: <p>
5026: If this rule is not the default <tt>Width</tt> rule, it must be given
5027: explicitly in the <tt>RULES</tt> section which defines the presentation rules
5028: of the logical elements.</p>
5029: <pre> 'Height' ':' Extent
1.1 cvs 5030: 'Width' ':' Extent
5031: Extent = Reference '.' HeightWidth [ Relation ]
5032: [ 'Min' ] / ...
5033: HeightWidth ='Height' / 'Width' .
5034: Relation ='*' ExtentAttr '%' / Distance .
5035: ExtentAttr = ExtentVal / AttrID .
1.18 cvs 5036: ExtentVal = NUMBER .</pre>
5037: <blockquote class="example">
5038: <p>
5039: <strong>Example:</strong></p>
5040: <p>
5041: Completing the <a href="#expos1">above example</a>, it is possible to specify
5042: that the report takes its width from the editing window and its height from
5043: the size of its contents (this can obviously be greater than that of the
5044: window):</p>
5045: <pre>Report : BEGIN
1.1 cvs 5046: Width : Enclosing . Width;
5047: Height : Enclosed . Height;
5048: ...
1.18 cvs 5049: END;</pre>
5050: <p>
1.3 cvs 5051: Then, the following rules make the title occupy 60% of the width of the report
5052: (which is that of the window) and is broken into centered lines of this width
1.18 cvs 5053: (see the <a href="#sectc4222"><tt>Line</tt> rule</a>).</p>
5054: <pre>Title : BEGIN
1.1 cvs 5055: Width : Enclosing . Width * 60%;
5056: Height : Enclosed . Height;
5057: Line;
5058: Adjust : VMiddle;
5059: ...
1.18 cvs 5060: END;</pre>
5061: <p>
5062: The summary occupy the entire width of the window, with the exception of a 2
5063: cm margin reserved by the horizontal position rule:</p>
5064: <pre>Summary : BEGIN
1.1 cvs 5065: Width : Enclosing . Width - 2 cm;
5066: Height : Enclosed . Height;
5067: ...
1.18 cvs 5068: END;</pre>
5069: <p>
5070: This set of rules, plus the <a href="#reportexample">position rules given
5071: above</a>, produce the layout of boxes shown in the following<a
5072: href="#posdim">figure</a>.</p>
5073:
5074: <div class="figure">
5075: <hr>
1.19 ! cvs 5076:
1.18 cvs 5077: <pre>-------------------------------------------------------------
1.1 cvs 5078: | Window and Report ^ |
5079: | | 1 line |
5080: | v |
5081: | ------------------------------------- |
5082: | | | |
5083: : 20% : Title : 20% :
5084: :<--------->: :<--------->:
5085: : : 60% : :
5086: : :<--------------------------------->: :
5087: | | | |
5088: | ------------------------------------- |
5089: | ^ |
5090: | | 1.5 line |
5091: | | |
5092: | v |
5093: | ---------------------------------------------------|
5094: | 2 cm | |
5095: |<------>| Summary |
1.18 cvs 5096: : : :</pre>
1.19 ! cvs 5097: <p align="center">
1.18 cvs 5098: <em><a name="posdim">Box position and extent</a><em></em></em></p>
5099: <hr>
1.19 ! cvs 5100:
1.18 cvs 5101: </div>
5102: </blockquote>
5103: </div>
1.1 cvs 5104:
1.18 cvs 5105: <div class="subsubsection">
1.1 cvs 5106:
1.18 cvs 5107: <h4><a name="sectd42193">Elastic extents</a></h4>
5108: <p>
1.1 cvs 5109: The last type of extent is the elastic extent. Either one or both extents can
5110: be elastic. A box has an elastic extent when two opposite sides are linked by
1.18 cvs 5111: distance constraints to two sides or axes of other boxes.</p>
5112: <p>
1.1 cvs 5113: One of the sides of the elastic box is linked by a position rule
1.18 cvs 5114: (<tt>VertPos</tt> or <tt>HorizPos</tt>) to a neighboring box. The other side
5115: is link to another box by a <tt>Height</tt> or <tt>Width</tt> rule, which
1.1 cvs 5116: takes the same form as the position rule. For the elastic box itself, the
5117: notions of sides (left or right, top or bottom) are fuzzy, since the movement
5118: of either one of the two reference boxes can, for example, make the left side
5119: of the elastic box move to the right of its right side. This is not
5120: important. The only requirement is that the two sides of the elastic box used
1.18 cvs 5121: in the position and extent rule are opposite sides of the box.</p>
5122: <pre> 'Height' ':' Extent
1.6 cvs 5123: 'Width' ':' Extent
1.18 cvs 5124: Extent = HPos / VPos / ...</pre>
5125: <blockquote class="example">
5126: <p>
5127: <strong>Example:</strong></p>
5128: <p>
1.3 cvs 5129: Suppose we want to draw an elastic arrow or line between the middle of the
5130: bottom side of box A and the upper left corner of box B. To do this, we would
5131: define a graphics box whose upper left corner coincides with the middle of the
5132: bottom side of A (a position rule) and whose lower right corner coincides with
1.18 cvs 5133: with the upper left corner of B (dimension rules):</p>
5134: <pre>LinkedBox :
1.1 cvs 5135: BEGIN
1.6 cvs 5136: VertPos : Top = A .Bottom;
1.1 cvs 5137: HorizPos : Left = A . VMiddle;
1.6 cvs 5138: Height : Bottom = B . Top;
5139: Width : Right = B . Left;
1.18 cvs 5140: END;</pre>
5141: </blockquote>
5142: <blockquote class="example">
5143: <p>
5144: <strong>Example:</strong></p>
5145: <p>
1.3 cvs 5146: The element SectionTitle creates a presentation box called SectionNum which
5147: contains the number of the section. Suppose we want to align the SectionNum
5148: and SectionTitle horizontally, have the SectionNum take its width from its
5149: contents (the section number), have the SectionTitle box begin 0.5 cm to the
5150: right of the SectionNum box and end at the right edge of its enclosing box.
1.18 cvs 5151: This would make the SectionTitle box elastic, since its width is defined by
5152: the position of its left and right sides. The following rules produce this
5153: effect:</p>
5154: <pre>SectionNum :
1.1 cvs 5155: BEGIN
5156: HorizPos : Left = Enclosing . Left;
5157: Width : Enclosed . Width;
5158: ...
5159: END;
5160:
5161: SectionTitle :
5162: BEGIN
5163: HorizPos : Left = SectionNum . Right + 0.5 cm;
5164: Width : Right = Enclosing . Right;
5165: ...
1.18 cvs 5166: END;</pre>
5167: </blockquote>
5168: </div>
5169: </div>
1.1 cvs 5170:
1.18 cvs 5171: <div class="subsection">
1.1 cvs 5172:
1.18 cvs 5173: <h3><a name="sectc4220">Overflow</a></h3>
5174: <p>
1.1 cvs 5175: A boxes corresponding to a structural element normally contain all boxes
5176: corresponding to the elements of its subtree. However, in some cases, it
5177: could be necessary to allow a box to jut out from its parent box. Two
5178: presentation rules indicate that such an overflow is allowed, one for
1.18 cvs 5179: horizontal overflow, one for vertical overflow.</p>
5180: <p>
1.1 cvs 5181: Each of these rules is expressed by a keyword followed by a colon and the
1.18 cvs 5182: keyword <tt>Yes</tt> or <tt>No</tt>.</p>
5183: <pre> 'VertOverflow' ':' Boolean /
1.1 cvs 5184: 'HorizOverflow' ':' Boolean .
1.18 cvs 5185: Boolean = 'Yes' / 'No' .</pre>
5186: </div>
1.1 cvs 5187:
1.18 cvs 5188: <div class="subsection">
1.1 cvs 5189:
1.18 cvs 5190: <h3><a name="sectc4221">Inheritance</a></h3>
5191: <p>
1.1 cvs 5192: A presentation parameter can be defined by reference to the same parameter of
5193: another box in the tree of boxes. These structural links are expressed by
5194: kinship. The reference box can be that of the element immediately above in
1.18 cvs 5195: the structure (<tt>Enclosing</tt>), two levels above (<tt>GrandFather</tt>),
5196: immediately below (<tt>Enclosed</tt>) or immediately before
5197: (<tt>Previous</tt>). In the case of a presentation box, and only in that
1.1 cvs 5198: case, the reference box may be the element which created the presentation box
1.18 cvs 5199: (<tt>Creator</tt>).</p>
5200: <p>
1.1 cvs 5201: Kinship is expressed in terms of the logical structure of the document and not
5202: in terms of the tree of boxes. The presentation box cannot transmit any of
5203: their parameters by inheritance; only structured element boxes can do so. As
5204: an example, consider an element B which follows an element A in the logical
5205: structure. The element B creates a presentation box P in front of itself,
1.18 cvs 5206: using the <tt>CreateBefore</tt> rule (see the <a href="#sectc4232">creation
5207: rules</a>). If element B's box inherits its character style using the
5208: <tt>Previous</tt> kinship operation, it gets its character style from A's box,
1.1 cvs 5209: not from P's box. Inheritance works differently for positions and extents,
1.18 cvs 5210: which can refer to presentation boxes.</p>
5211: <p>
1.1 cvs 5212: The inherited parameter value can be the same as that of the reference box.
5213: This is indicated by an equals sign. However, for numeric parameters, a
5214: different value can be obtained by adding or subtracting a number from the
5215: reference box's parameter value. Addition is indicated by a plus sign before
5216: the number, while subtraction is specified with a minus sign. The value of a
5217: parameter can also be given a maximum (if the sign is a plus) or minimum (if
1.18 cvs 5218: the sign is a minus).</p>
5219: <p>
1.1 cvs 5220: If the rule is being applied to a numeric attribute, the number to add or
5221: subtract can be replaced by the attribute name. The value of a maximum or
5222: minimum may also be replaced by an attribute name. In these cases, the value
1.18 cvs 5223: of the attribute is used.</p>
5224: <pre> Inheritance = Kinship InheritedValue .
1.6 cvs 5225: Kinship ='Enclosing' / 'GrandFather' / 'Enclosed' /
5226: 'Previous' / 'Creator' .
1.1 cvs 5227: InheritedValue ='+' PosIntAttr [ 'Max' maximumA ] /
1.6 cvs 5228: '-' NegIntAttr [ 'Min' minimumA ] /
5229: '=' .
5230: PosIntAttr = PosInt / AttrID .
5231: PosInt = NUMBER .
5232: NegIntAttr = NegInt / AttrID .
5233: NegInt = NUMBER .
5234: maximumA = maximum / AttrID .
5235: maximum = NUMBER .
5236: minimumA = minimum / AttrID .
1.18 cvs 5237: minimum = NUMBER .</pre>
5238: <p>
1.1 cvs 5239: The parameters which can be obtained by inheritance are justification,
5240: hyphenation, interline spacing, character font (font family), font style, font
5241: size, visibility, indentation, underlining, alignment of text, stacking order
5242: of objects, the style and thickness of lines, fill pattern and the colors of
1.18 cvs 5243: lines and characters.</p>
5244: </div>
1.1 cvs 5245:
1.18 cvs 5246: <div class="subsection">
1.1 cvs 5247:
1.18 cvs 5248: <h3><a name="sectc4222">Line breaking</a></h3>
5249: <p>
5250: The <tt>Line</tt> rule specifies that the contents of the box should be broken
1.1 cvs 5251: into lines: the boxes included in the box to which this rule is attached are
5252: displayed one after the other, from left to right, with their horizontal
5253: reference axes aligned so that they form a series of lines. The length of
1.18 cvs 5254: these lines is equal to the width of the box to which the <tt>Line</tt> rule
5255: is attached.</p>
5256: <p>
1.1 cvs 5257: When an included box overflows the current line, it is either carried forward
1.18 cvs 5258: to the next line, cur, or left the way it is. The <a
5259: href="#sectc4223"><tt>LineBreak</tt> rule</a> is used to allow or prevent the
1.1 cvs 5260: breaking of included boxes. If the included box is not breakable but is
5261: longer than the space remaining on the line, it is left as is. When a
5262: character string box is breakable, the line is broken between words or, if
1.18 cvs 5263: necessary, by <a href="#sectd42225">hyphenating a word</a>. When a compound
5264: box is breakable, the box is transparent in regard to line breaking. The boxes
5265: included in the compound box are treated just like included boxes which have
5266: the <tt>LineBreak</tt> rule. Thus, it is possible to traverse a complete
5267: subtree of boxes to line break the text leaves of a complex structure.</p>
5268: <p>
1.1 cvs 5269: The relative position rules of the included boxes are ignored, since the boxes
1.18 cvs 5270: will be placed according to the line breaking rules.</p>
5271: <p>
5272: The <tt>Line</tt> rule does not have a parameter. The characteristics of the
5273: lines that will be constructed are determined by the <tt>LineSpacing</tt>,
5274: <tt>Indent</tt>, <tt>Adjust</tt>, <tt>Justify</tt>, and <tt>Hyphenate</tt>
5275: rules. Moreover, the <a href="#insectd42226"><tt>Inline</tt> rule</a> permits
5276: the exclusion of certain elements from the line breaking process.</p>
5277: <p>
5278: When the <tt>Line</tt> rule appears in the rules sequence of a non-primary
5279: view, it applies only to that view, but when the <tt>Line</tt> rule appears in
1.1 cvs 5280: the rules sequence of the primary view, it also applies to the other views by
1.18 cvs 5281: default, except for those views which explicitly invoke the <tt>NoLine</tt>
5282: rule. Thus, the <tt>NoLine</tt> rule can be used in a non-primary view to
5283: override the primary view's <tt>Line</tt> rule. The <tt>NoLine</tt> rule must
5284: not be used with the primary view because the absence of the <tt>Line</tt>
5285: rule has the same effect. Like the <tt>Line</tt> rule, the <tt>NoLine</tt>
5286: rule does not take any parameters.</p>
5287: <pre> 'Line'
5288: 'NoLine'</pre>
5289:
5290: <div class="subsubsection">
5291:
5292: <h4><a name="sectd42221">Line spacing</a></h4>
5293: <p>
5294: The <tt>LineSpacing</tt> rule defines the line spacing to be used in the line
1.1 cvs 5295: breaking process. The line spacing is the distance between the baselines
5296: (horizontal reference axis) of the successive lines produced by the
1.18 cvs 5297: <tt>Line</tt> rule. The value of the line spacing can be specified as a
5298: constant or by inheritance. It is expressed in any of the available <a
5299: href="#sectc4217">distance units</a>.</p>
5300: <p>
1.1 cvs 5301: Inheritance allows the value to be obtained from a relative in the structure
5302: tree, either without change (an equals sign appears after the inheritance
5303: keyword), with a positive difference (a plus sign), or a negative difference
5304: (a minus sign). When the rule uses a difference, the value of the difference
1.18 cvs 5305: follows the sign and is expressed as a <a href="#sectc4217">distance</a>.</p>
5306: <pre> 'LineSpacing' ':' DistOrInherit
1.6 cvs 5307: DistOrInherit = Kinship InheritedDist / Distance .
1.18 cvs 5308: InheritedDist = '=' / '+' AbsDist / '-' AbsDist .</pre>
5309: <p>
1.1 cvs 5310: When the line spacing value (or its difference from another element) is
5311: expressed in relative units, it changes with the size of the characters. Thus,
5312: when a larger font is chosen for a part of the document, the line spacing of
5313: that part expands proportionally. In contrast, when the line spacing value is
5314: expressed in absolute units (centimeters, inches, typographer's points), it is
5315: independent of the characters, which permits the maintenance of a consistent
5316: line spacing, whatever the character font. Either approach can be taken,
1.18 cvs 5317: depending on the desired effect.</p>
5318: </div>
1.1 cvs 5319:
1.18 cvs 5320: <div class="subsubsection">
1.1 cvs 5321:
1.18 cvs 5322: <h4><a name="sectd42222">First line indentation</a></h4>
5323: <p>
5324: The <tt>Indent</tt> rule is used to specify the indentation of the first line
5325: of the elements broken into lines by the <tt>Line</tt> function. The
1.1 cvs 5326: indentation determines how far the first line of the element is shifted with
5327: respect to the other lines of the same element. It can be specified as a
5328: constant or by inheritance. The constant value is a positive integer (shifted
5329: to the right; the sign is optional), a negative integer (shifted to the left)
1.18 cvs 5330: or zero (no shift). All available <a href="#sectc4217">units</a> can be
5331: used.</p>
5332: <p>
1.1 cvs 5333: Indentation can be defined for any box, regardless of whether the box is line
5334: broken, and transmitted by inheritance to elements that are line broken. The
1.18 cvs 5335: size of the indentation is specified in the same manner as the <a
5336: href="#sectd42221">line spacing</a>.</p>
5337: <pre> 'Indent' ':' DistOrInherit</pre>
5338: </div>
1.1 cvs 5339:
1.18 cvs 5340: <div class="subsubsection">
1.1 cvs 5341:
1.18 cvs 5342: <h4><a name="sectd42223">Alignment</a></h4>
5343: <p>
1.1 cvs 5344: The alignment style of the lines constructed during line breaking is defined
1.18 cvs 5345: by the <tt>Adjust</tt> rule. The alignment value can be a constant or
5346: inherited. A constant value is specified by a keyword:</p>
5347: <ul>
5348: <li>
5349: <tt>Left</tt>: at the left edge,
1.19 ! cvs 5350: </li>
1.18 cvs 5351: <li>
5352: <tt>Right</tt>: at the right edge,
1.19 ! cvs 5353: </li>
1.18 cvs 5354: <li>
5355: <tt>VMiddle</tt>: centered
1.19 ! cvs 5356: </li>
1.18 cvs 5357: <li>
5358: <tt>LeftWithDots</tt>: at the left edge with a dotted line filling out the
1.1 cvs 5359: last line up to the right edge of the line breaking box.
1.19 ! cvs 5360: </li>
1.18 cvs 5361: </ul>
5362: <p>
1.1 cvs 5363: An inherited value can only be the same as that of the reference box and is
1.18 cvs 5364: specified by a kinship keyword followed by an equals sign.</p>
5365: <pre> 'Adjust' ':' AlignOrInherit
1.1 cvs 5366: AlignOrInherit = Kinship '=' / Alignment .
5367: Alignment = 'Left' / 'Right' / 'VMiddle' /
1.18 cvs 5368: 'LeftWithDots' .</pre>
5369: </div>
1.1 cvs 5370:
1.18 cvs 5371: <div class="subsubsection">
1.1 cvs 5372:
1.18 cvs 5373: <h4><a name="sectd42224">Justification</a></h4>
5374: <p>
5375: The <tt>Justify</tt> rule indicates whether the lines contained in the box and
5376: produced by a <tt>Line</tt> rule should be extended horizontally to occupy the
1.1 cvs 5377: entire width of their enclosing box. The first and last lines are treated
5378: specially: the position of the beginning of the first line is fixed by the
1.18 cvs 5379: <tt>Indent</tt> rule and last line is not extended. The justification
1.1 cvs 5380: parameter defined by this rule takes a boolean value, which can be a constant
5381: or inherited. A constant boolean value is expressed by either the
1.18 cvs 5382: <tt>Yes</tt> or the <tt>No</tt> keyword. An inherited value can only be the
1.1 cvs 5383: same as that of the reference box and is specified by a kinship keyword
1.18 cvs 5384: followed by an equals sign.</p>
5385: <pre> 'Justify' ':' BoolInherit
1.1 cvs 5386: BoolInherit = Boolean / Kinship '=' .
1.18 cvs 5387: Boolean ='Yes' / 'No' .</pre>
5388: <p>
1.1 cvs 5389: When the lines are justified, the alignment parameter specified in the
1.18 cvs 5390: <tt>Adjust</tt> rule has no influence, other than on the last line produced.
1.1 cvs 5391: This occurs because, when the other are extended to the limits of the box, the
1.18 cvs 5392: alignment style is no longer perceptible.</p>
5393: <blockquote class="example">
5394: <p>
5395: <strong>Example:</strong></p>
5396: <p>
1.3 cvs 5397: An important use of inheritance is to vary the characteristics of lines for an
5398: element type (for example, Paragraph) according to the enclosing environment
5399: (for example, Summary or Section), and thus obtain different line breaking
5400: styles for the same elements when they appear in different environments. The
1.18 cvs 5401: following rules specify that paragraphs inherit their alignment,
5402: justification, and line spacing:</p>
5403: <pre>Paragraph :
1.1 cvs 5404: BEGIN
5405: Justify : Enclosing = ;
5406: LineSpacing : Enclosing = ;
5407: Adjust : Enclosing =;
5408: Line;
1.18 cvs 5409: END;</pre>
5410: <p>
1.5 cvs 5411: If the alignment, justification, and line spacing of the Section and Summary
1.18 cvs 5412: elements is fixed:</p>
5413: <pre>Section :
1.1 cvs 5414: BEGIN
5415: Adjust : Left;
5416: Justify : Yes;
5417: LineSpacing : 1;
5418: END;
5419: Summary :
5420: BEGIN
5421: Adjust : VMiddle;
5422: Justify : No;
5423: LineSpacing : 1.3;
1.18 cvs 5424: END;</pre>
5425: <p>
1.4 cvs 5426: then the paragraphs appearing in sections are justified with a simple line
5427: spacing while those appearing in summaries are centered and not justified and
5428: have a larger line spacing. These are nevertheless the very same type of
1.18 cvs 5429: paragraph defined in the logical structure schema.</p>
5430: </blockquote>
5431: </div>
5432:
5433: <div class="subsubsection">
5434:
5435: <h4><a name="sectd42225">Hyphenation</a></h4>
5436: <p>
5437: The <tt>Hyphenate</tt> rule indicates whether or not words should be broken by
1.1 cvs 5438: hyphenation at the end of lines. It affects the lines produced by the
1.18 cvs 5439: <tt>Line</tt> rule and contained in the box carrying the <tt>Hyphenate</tt>
5440: rule.</p>
5441: <p>
1.1 cvs 5442: The hyphenation parameter takes a boolean value, which can be either constant
5443: or inherited. A constant boolean value is expressed by either the
1.18 cvs 5444: <tt>Yes</tt> or the <tt>No</tt> keyword. An inherited value can only be the
1.1 cvs 5445: same as that of the reference box and is specified by a kinship keyword
1.18 cvs 5446: followed by an equals sign.</p>
5447: <pre> 'Hyphenate' ':' BoolInherit
1.1 cvs 5448: BoolInherit = Boolean / Kinship '=' .
1.18 cvs 5449: Boolean = 'Yes' / 'No' .</pre>
5450: </div>
5451:
5452: <div class="subsubsection">
5453:
5454: <h4><a name="sectd42226">Avoiding line breaking</a></h4>
5455: <p>
5456: The <tt>InLine</tt> rule is used to specify that a box that would otherwise
5457: participate in line breaking asked for by the <tt>Line</tt> rule of an
1.1 cvs 5458: enclosing box, instead avoids the line breaking process and positions itself
1.18 cvs 5459: according to the <tt>HorizPos</tt> and <tt>VertPos</tt> rules that apply to
5460: it. When the <tt>InLine</tt> rule applies to a box which would not be line
5461: broken, it has no effect.</p>
5462: <p>
5463: The rule is expressed by the <tt>InLine</tt> keyword followed by a colon and
5464: the keyword <tt>Yes</tt>, if the box should participate in line breaking, or
5465: the keyword <tt>No</tt>, if it should not. This is the only form possible:
1.1 cvs 5466: this rule cannot be inherited. Moreover, it can only appear in the rules of
5467: the primary view and applies to all views defined in the presentation
1.18 cvs 5468: schema.</p>
5469: <pre> 'InLine' ':' Boolean .
5470: Boolean = 'Yes' / 'No' .</pre>
5471: <blockquote class="example">
5472: <p>
5473: <strong>Example:</strong></p>
5474: <p>
5475: Suppose the structure schema defines a logical attribute called <tt>New</tt>
5476: which is used to identify the passages in a document which were recently
5477: modified. It would be nice to have the presentation schema make a bar appear
5478: in the left margin next to each passage having the <tt>New</tt> attribute. A
5479: new passage can be an entire element, such as a paragraph or section, or it
5480: can be some words in the middle of a paragraph. To produce the desired
5481: effect, the <tt>New</tt> attribute is given a creation rule which generates a
5482: <tt>VerticalBar</tt> presentation box.</p>
5483: <p>
5484: When the <tt>New</tt> attribute is attached to a character string which is
1.1 cvs 5485: inside a line broken element (inside a paragraph, for example), the bar is one
5486: of the elements which participates in line breaking and it is placed normally
5487: in the current line, at the end of the character string which has the
1.18 cvs 5488: attribute. To avoid this, the <tt>InLine</tt> rule is used in the following
5489: way:</p>
5490: <pre>BOXES
1.1 cvs 5491: VerticalBar:
5492: BEGIN
5493: Content: Graphics 'l';
5494: HorizPos: Left = Root . Left;
5495: VertPos: Top = Creator . Top;
5496: Height: Bottom = Creator . Bottom;
5497: Width: 1 pt;
5498: InLine: No;
5499: ...
5500: END;
5501: ...
5502: ATTRIBUTES
5503: Nouveau:
5504: BEGIN
5505: CreateAfter(VerticalBar);
1.18 cvs 5506: END;</pre>
5507: </blockquote>
5508: </div>
5509: </div>
1.1 cvs 5510:
1.18 cvs 5511: <div class="subsection">
1.1 cvs 5512:
1.18 cvs 5513: <h3><a name="sectc4223">Page breaking and line breaking conditions</a></h3>
5514: <p>
1.1 cvs 5515: Pages are constructed by the editor in accordance with the model specified by
1.18 cvs 5516: a <a href="#sectc4233"><tt>Page</tt> rule</a>. The page model describes only
5517: the composition of the pages but does not give any rules for breaking
5518: different element types across pages. Now, it is possible that certain
5519: elements must not be cut by page breaks, while others can be cut anywhere. The
5520: <tt>PageBreak</tt>, <tt>NoBreak1</tt>, and <tt>NoBreak2</tt> rules are used to
5521: specify the conditions under which each element type can be cut.</p>
5522: <p>
5523: The <tt>PageBreak</tt> rule is used to indicate whether or not the box can be
1.1 cvs 5524: cut during the construction of pages. If cutting is authorized, the box can
5525: be cut, with one part appearing at the bottom of a page and the other part
5526: appearing at the top of the next page. The rule is formed by the
1.18 cvs 5527: <tt>PageBreak</tt> keyword followed by a colon and a constant boolean value
5528: (<tt>Yes</tt> or <tt>No</tt>). This is the only form possible: this rule
1.1 cvs 5529: cannot be inherited. Moreover, it can only appear in the rules of the primary
1.18 cvs 5530: view and applies to all views defined in the presentation schema.</p>
5531: <p>
1.1 cvs 5532: Whether objects can be cut by line breaks can be controlled in a similar way
1.18 cvs 5533: using the <tt>LineBreak</tt> rule. This rule allows the specification of
1.1 cvs 5534: whether or not the box can be cut during the construction of lines. If
5535: cutting is authorized, the box can be cut, with one part appearing at the end
5536: of a line and the other part appearing at the beginning of the next line. The
1.18 cvs 5537: rule is formed by the <tt>LineBreak</tt> keyword followed by a colon and a
5538: constant boolean value (<tt>Yes</tt> or <tt>No</tt>). This is the only form
1.1 cvs 5539: possible: this rule cannot be inherited. Moreover, it can only appear in the
5540: rules of the primary view and applies to all views defined in the presentation
1.18 cvs 5541: schema.</p>
5542: <pre> 'PageBreak' ':' Boolean .
1.1 cvs 5543: 'LineBreak' ':' Boolean .
1.18 cvs 5544: Boolean = 'Yes' / 'No' .</pre>
5545: <p>
1.1 cvs 5546: When a box can be cut by a page break, it is possible that a page break will
5547: fall an inappropriate spot, creating, for example, a widow or orphan, or
5548: separating the title of a section from the first paragraph of the section. The
1.18 cvs 5549: <tt>NoBreak1</tt> and <tt>NoBreak2</tt> rules are used to avoid this. They
5550: specify that the box of the element to which they apply cannot be cut within a
5551: certain zone at the top (<tt>NoBreak1</tt> rule) or at the bottom
5552: (<tt>NoBreak2</tt> rule). These two rules specify the height of the zones in
5553: which page breaks are prohibited.</p>
5554: <p>
5555: The <tt>NoBreak1</tt> and <tt>NoBreak2</tt> rules give the height of the zone
1.1 cvs 5556: in which page breaking is prohibited. The height is given as a constant value
1.18 cvs 5557: using any of the <a href="#sectc4217">available units</a>, absolute or
5558: relative. The value may not be inherited.</p>
5559: <pre> 'NoBreak1' ':' AbsDist .
5560: 'NoBreak2' ':' AbsDist .</pre>
5561: <blockquote class="example">
5562: <p>
5563: <strong>Example:</strong></p>
5564: <p>
5565: The following rules prevent widows and orphans in a paragraph:</p>
5566: <pre>Paragraph :
1.1 cvs 5567: BEGIN
5568: NoBreak1 : 2;
5569: NoBreak2 : 2;
1.18 cvs 5570: END;</pre>
5571: <p>
1.3 cvs 5572: This rule prevents a section title from becoming separated from the first
5573: paragraph of the section by prohibiting page breaks at the beginning of the
1.18 cvs 5574: section rule:</p>
5575: <pre>Section :
5576: NoBreak1 : 1.5 cm;</pre>
5577: <p>
5578: Finally, this rule prevents a figure from being page broken in any way:</p>
5579: <pre>Figure :
5580: PageBreak : No;</pre>
5581: </blockquote>
5582: <p>
1.1 cvs 5583: The Thot editor constructs the document images displayed on the screen
5584: dynamically. As the user moves in the document or makes the document scroll
5585: in a window, the editor constructs the image to be displayed in little bits,
5586: filling the gaps which are produced in the course of these operations. It
5587: stops filling in the image when an element reaches the edge of the window in
5588: which the gap appears. If the appearance of the document is complex, it is
5589: possible that the image in incomplete, even though the edge of the window was
5590: reached. For example, an element might need to be presented to the side of
5591: the last element displayed, but its image was not constructed. The user will
5592: not know whether the element is really absent or if its image has simply not
1.18 cvs 5593: been constructed.</p>
5594: <p>
5595: The <tt>Gather</tt> rule is used to remedy this problem. When the rule
5596: <tt>Gather : Yes;</tt> is associated with an element type, the image of such
5597: elements is constructed as a block by the editor: it is never split up.</p>
5598: <p>
5599: The <tt>Gather</tt> rule may not appear in the <a href="#sectc427">default
5600: rules</a>. Elements which do not have the <tt>Gather</tt> rule are considered
5601: susceptible to being split up during display. Thus, it is not necessary to
5602: use the <tt>Gather : No;</tt> form. This rule must be used prudently and only
5603: for those elements which truly need it. If used incorrectly, it can
5604: pointlessly increase the size of the image constructed by the editor and lead
5605: to excessive memory consumption by the editor.</p>
5606: <p>
5607: Like the <tt>PageBreak</tt> and <tt>LineBreak</tt> rules, the <tt>Gather</tt>
1.1 cvs 5608: rule can only appear in rules of the primary view and applies to all views
1.18 cvs 5609: defined in the presentation schema.</p>
5610: <pre> 'Gather' ':' Boolean .</pre>
5611: </div>
1.1 cvs 5612:
1.18 cvs 5613: <div class="subsection">
1.1 cvs 5614:
1.18 cvs 5615: <h3><a name="sectc4224">Visibility</a></h3>
5616: <p>
1.1 cvs 5617: The visibility parameter is used to control which elements should or should
5618: not be displayed, based on context. An element can have different
5619: visibilities in different views. If an element's visibility is zero for a
5620: view, that element is not displayed in that view and does not occupy any space
1.18 cvs 5621: (its extents are zero).</p>
5622: <p>
1.1 cvs 5623: Visibility takes non-negative integer values (positive or zero). If values
5624: greater than 1 are used, they allow the user to choose a degree of visibility
5625: and, thus, to see only those boxes whose visibility parameter exceeds a
5626: certain threshold. This gives the user control over the granularity of the
1.18 cvs 5627: displayed pictures.</p>
5628: <p>
1.1 cvs 5629: The visibility parameter can be defined as a constant or by inheritance. If
5630: defined by inheritance, it cannot be based on the value of the next or
1.18 cvs 5631: previous box. Visibility can only be inherited from above.</p>
5632: <p>
1.1 cvs 5633: If it is a numeric attribute's presentation rule, the visibility can be
5634: specified by the attribute's name, in which case the value of the attribute is
1.18 cvs 5635: used.</p>
5636: <pre> 'Visibility' ':' NumberInherit
1.1 cvs 5637: NumberInherit = Integer / AttrID / Inheritance .
1.18 cvs 5638: Integer = NUMBER .</pre>
5639: <blockquote class="example">
5640: <p>
5641: <strong>Example:</strong></p>
5642: <p>
5643: Suppose that only <tt>Formula</tt> elements should be displayed in the
5644: <tt>MathView</tt> view. Then, the default rules should include:</p>
5645: <pre>DEFAULT
5646: IN MathView Visibility:0;</pre>
5647: <p>
5648: which makes all elements invisible in the <tt>MathView</tt> view. However,
5649: the <tt>Formula</tt> element also has a <tt>Visibility</tt> rule:</p>
5650: <pre>Formula :
5651: IN MathView Visibility:5;</pre>
5652: <p>
5653: which makes formulas, and only formulas, visible.</p>
5654: </blockquote>
5655: </div>
1.1 cvs 5656:
1.18 cvs 5657: <div class="subsection">
1.1 cvs 5658:
1.18 cvs 5659: <h3><a name="sectc4225">Character style parameters</a></h3>
5660: <p>
1.1 cvs 5661: Four parameters are used to determine which characters are used to display
1.18 cvs 5662: text. They are size, font, style, and underlining.</p>
1.1 cvs 5663:
1.18 cvs 5664: <div class="subsubsection">
1.1 cvs 5665:
1.18 cvs 5666: <h4><a name="sectd42251">Character size</a></h4>
5667: <p>
1.1 cvs 5668: The size parameter has two effects. First, it is used to specify the actual
1.18 cvs 5669: size and distance units for boxes defined in <a href="#sectc4217">relative
5670: units</a>. Second, it defines the size of the characters contained in the
5671: box.</p>
5672: <p>
1.1 cvs 5673: As a distance or length, the size can be expressed in abstract or absolute
5674: units. It can also be inherited. If it is not inherited, it is expressed
1.18 cvs 5675: simply as an integer followed by the <tt>pt</tt> keyword, which indicates that
5676: the size is expressed in typographer's points. The absence of the <tt>pt</tt>
1.1 cvs 5677: keyword indicates that it is in abstract units in which the value 1 represents
5678: the smallest size while the value 16 is the largest size. The relationship
5679: between these abstract sizes and the real character sizes is controlled by a
5680: table which can be modified statically or even dynamically during the
1.18 cvs 5681: execution of the Thot editor.</p>
5682: <p>
1.1 cvs 5683: If it is a numeric attribute's presentation rule, the value of the size
5684: parameter can be specified by the attribute's name, in which case the value of
1.18 cvs 5685: the attribute is used.</p>
5686: <p>
5687: <strong>Note:</strong> the only unit available for defining an absolute size
5688: is the typographer's point. Centimeters and inches may not be used.</p>
5689: <p>
1.1 cvs 5690: If the size is inherited, the rule must specify the relative from which to
5691: inherit and any difference from that relative's value. The difference can be
5692: expressed in either typographer's points or in abstract units. The maximum or
5693: minimum size can also be specified, but without specifying the type of unit:
1.18 cvs 5694: it is the same as was specified for the difference.</p>
5695: <p>
1.1 cvs 5696: In a numeric attribute's presentation rule, the difference in size can be
5697: indicated by the attribute's name, which means that the attribute's value
5698: should be used as the difference. The attribute can also be used as the
1.18 cvs 5699: minimum or maximum size.</p>
5700: <pre> 'Size' ':' SizeInherit
1.1 cvs 5701: SizeInherit = SizeAttr [ 'pt' ] /
5702: Kinship InheritedSize .
5703: InheritedSize ='+' SizeAttr [ 'pt' ]
5704: [ 'Max' MaxSizeAttr ] /
5705: '-' SizeAttr [ 'pt' ]
5706: [ 'Min' MinSizeAttr ] /
5707: '=' .
1.6 cvs 5708: SizeAttr = Size / AttrID .
5709: Size = NUMBER .
5710: MaxSizeAttr = MaxSize / AttrID .
5711: MaxSize = NUMBER .
5712: MinSizeAttr = MinSize / AttrID .
1.18 cvs 5713: MinSize = NUMBER .</pre>
5714: <blockquote class="example">
5715: <p>
5716: <strong>Example:</strong></p>
5717: <p>
5718: The rule</p>
5719: <pre>Size : Enclosing - 2 pt Min 7;</pre>
5720: <p>
5721: states that the character size is 2 points less than that of the enclosing
5722: box, but that it may not be less than 7 points, whatever the enclosing box's
5723: value.</p>
5724: <p>
1.1 cvs 5725: The following rules make the text of a report be displayed with medium-sized
5726: characters (for example, size 5), while the title is displayed with larger
1.18 cvs 5727: characters and the summary is displayed with smaller characters:</p>
5728: <pre>Report :
1.1 cvs 5729: Size : 5;
5730: Title :
5731: Size : Enclosing + 2;
5732: Summary :
1.18 cvs 5733: Size : Enclosing - 1;</pre>
5734: <p>
5735: Thus, the character sizes in the entire document can be changed by changing
5736: the size parameter of the Report element, while preserving the relationships
5737: between the sizes of the different elements.</p>
5738: </blockquote>
5739: </div>
5740:
5741: <div class="subsubsection">
5742:
5743: <h4><a name="sectd42252">Font and character style</a></h4>
5744: <p>
5745: The <tt>Font</tt> rule determines the font family to be used to display the
5746: characters contained in the box, while the <tt>Style</tt> rule determines
1.1 cvs 5747: their style. Thot recognizes three character fonts (Times, Helvetica, and
5748: Courier) and six styles: Roman, Italics, Bold, BoldItalics, Oblique, and
1.18 cvs 5749: BoldOblique.</p>
5750: <p>
1.1 cvs 5751: The font family and style can specified by a named constant or can be
5752: inherited. For the name of the font family only the first character is
1.18 cvs 5753: used.</p>
5754: <p>
1.1 cvs 5755: Only identical inheritance is allowed: the box takes the same font or style as
5756: the box from which it inherits. This is indicated by an equals sign after the
1.18 cvs 5757: kinship specification.</p>
5758: <blockquote class="example">
5759: <p>
5760: <strong>Example:</strong></p>
5761: <p>
1.3 cvs 5762: To specify that the summary uses the font family of the rest of the document,
1.18 cvs 5763: but in the italic style, the following rules are used:</p>
5764: <pre>Summary :
1.1 cvs 5765: BEGIN
5766: Font : Enclosing =;
5767: Style : Italics;
1.18 cvs 5768: END;</pre>
5769: </blockquote>
5770: </div>
5771:
5772: <div class="subsubsection">
5773:
5774: <h4><a name="sectd42253">Underlining</a></h4>
5775: <p>
5776: The <tt>Underline</tt> rule is used to specify if the characters contained in
1.1 cvs 5777: a box should have lines drawn on or near them. There are four underlining
1.18 cvs 5778: styles: <tt>Underlined</tt>, <tt>Overlined</tt>, <tt>CrossedOut</tt>, and
5779: <tt>NoUnderline</tt>. The <tt>Thickness</tt> rule specifies the thickness of
5780: the line, <tt>Thin</tt> or <tt>Thick</tt>.</p>
5781: <p>
1.1 cvs 5782: As with font family and style, only identical inheritance is allowed: the box
5783: has the same underlining type as the box from which it inherits the value.
1.18 cvs 5784: This is indicated by an equals sign after the kinship specification.</p>
5785: <pre> 'Underline' ':' UnderLineInherit /
1.1 cvs 5786: 'Thickness' ':' ThicknessInherit /
5787:
5788: UnderLineInherit = Kinship '=' / 'NoUnderline' /
5789: 'Underlined' /
5790: 'Overlined' / 'CrossedOut' .
1.18 cvs 5791: ThicknessInherit = Kinship '=' / 'Thick' / 'Thin' .</pre>
5792: </div>
5793: </div>
5794:
5795: <div class="subsection">
5796:
5797: <h3><a name="sectc4226">Stacking order</a></h3>
5798: <p>
5799: The <tt>Depth</tt> rule is used to define the stacking order of terminal boxes
1.1 cvs 5800: when multiple boxes at least partially overlap. This rule defines how the
5801: depth parameter, which is zero or a positive integer, is calculated. The
5802: depth parameter has a value for all boxes. For terminal boxes in the
5803: structure and for presentation boxes, the depth value is used during display
5804: and printing: the boxes with the lowest value overlap those with higher
5805: depths. For non-terminal boxes, the depth is not interpreted during display,
1.18 cvs 5806: but it is used to calculate the depth of terminal boxes by inheritance.</p>
5807: <p>
5808: Like most other rules, the depth rule is defined in the <a
5809: href="#sectc427">default rules</a> of each presentation schema. Thus, there
5810: is always a depth value, even when it is not necessary because there is no
5811: overlapping. To avoid useless operations, a zero value can be given to the
5812: depth parameter, which signifies that overlapping is never a problem.</p>
5813: <p>
5814: The depth rule has the same form as the <a href="#sectc4224">visibility
5815: rule</a>. It can be defined by inheritance or by a constant numeric value.
5816: When the rule is attached to a numeric attribute, it can take the value of
5817: that attribute.</p>
5818: <pre> 'Depth' ':' NumberInherit</pre>
5819: <blockquote class="example">
5820: <p>
5821: <strong>Example:</strong></p>
5822: <p>
1.3 cvs 5823: For a purely textual document, in which overlapping never poses a problem, a
1.18 cvs 5824: single default <tt>Depth</tt> rule in the presentation schema is
5825: sufficient:</p>
5826: <pre>DEFAULT
1.1 cvs 5827: Depth : 0;
1.18 cvs 5828: ...</pre>
5829: <p>
1.1 cvs 5830: To make the text of examples appear on a light blue background, a presentation
1.18 cvs 5831: box is defined:</p>
5832: <pre>BOXES
1.1 cvs 5833: BlueBG :
5834: BEGIN
5835: Content : Graphics 'R';
5836: Background : LightBlue3;
5837: FillPattern: backgroundcolor;
5838: Depth : 2;
5839: ...
1.18 cvs 5840: END;</pre>
5841: <p>
5842: and is created by the <tt>Example</tt> element, which has the rules:</p>
5843: <pre>RULES
1.1 cvs 5844: Example :
5845: BEGIN
5846: CreateFirst (BlueBG);
5847: Depth : 1;
5848: ...
1.18 cvs 5849: END;</pre>
5850: <p>
5851: In this way, the text of an example (if it inherits its depth from its
5852: ancestor) will be superimposed on a light blue background, and not the
5853: reverse).</p>
5854: </blockquote>
5855: </div>
5856:
5857: <div class="subsection">
5858:
5859: <h3><a name="sectc4227">Line style</a></h3>
5860: <p>
5861: The <tt>LineStyle</tt> rule determines the style of line which should be used
5862: to draw all the elements contained in the box and the box itself, if it has a
5863: <a href="#sectc4230a"><tt>ShowBox</tt> rule</a>. The line style can be
5864: indicated by a name (<tt>Solid</tt>, <tt>Dashed</tt>, <tt>Dotted</tt>) or it
1.13 cvs 5865: can be inherited. All elements of the graphic base type are affected by this
1.1 cvs 5866: rule, but it can be attached to any box and transmitted by inheritance to the
1.18 cvs 5867: graphic elements. The border of elements having a <a
5868: href="#sectc4230a"><tt>ShowBox</tt> rule</a> is drawn according to the line
5869: style specified by this rule.</p>
5870: <p>
1.1 cvs 5871: Only identical inheritance is allowed: the box takes the same line style as
5872: the box from which it inherits. This is indicated by an equals sign after the
1.18 cvs 5873: kinship specification.</p>
5874: <pre> 'LineStyle' ':' LineStyleInherit
1.1 cvs 5875: LineStyleInherit = Kinship '=' /
1.18 cvs 5876: 'Solid' / 'Dashed' / 'Dotted' .</pre>
5877: <blockquote class="example">
5878: <p>
5879: <strong>Example:</strong></p>
5880: <p>
1.3 cvs 5881: To specify that, in Figures, the graphical parts should be drawn in solid
1.18 cvs 5882: lines, the Figure element is given a rule using the <tt>Solid</tt> name:</p>
5883: <pre>Figure :
5884: LineStyle : Solid;</pre>
5885: <p>
5886: and the elements composing figures are given an inheritance rule:</p>
5887: <pre> LineStyle : Enclosing =;</pre>
5888: </blockquote>
5889: </div>
5890:
5891: <div class="subsection">
5892:
5893: <h3><a name="sectc4228">Line thickness</a></h3>
5894: <p>
5895: The <tt>LineWeight</tt> rule determines the thickness of the lines of all
1.1 cvs 5896: graphical elements which appear in the box, no matter what their line style.
5897: Line thickness can be specified by a constant value or by inheritance. A
5898: constant value is a positive number followed by an optional unit specification
1.18 cvs 5899: (which is absent when using relative units). All available <a
5900: href="#sectc4217">distance units</a> can be used. Line thickness is expressed
5901: in the same way as <a href="#sectd42221">line spacing</a>.</p>
5902: <pre> 'LineWeight' ':' DistOrInherit</pre>
5903: <p>
5904: All elements of the graphic base type are affected by this rule, but it can be
5905: attached to any box and transmitted by inheritance to the graphic elements.
5906: The border of element having a <a href="#sectc4230a"><tt>ShowBox</tt> rule</a>
5907: is also drawn according to the thickness specified by this rule.</p>
5908: <blockquote class="example">
5909: <p>
5910: <strong>Example:</strong></p>
5911: <p>
5912: To specify that, in Figures, the graphical parts should be drawn with lines
5913: 0.3 pt thick, the Figure element is given this rule:</p>
5914: <pre>Figure :
5915: LineWeight : 0.3 pt;</pre>
5916: <p>
5917: and the elements composing figures are given an inheritance rule:</p>
5918: <pre> LineWeight : Enclosing =;</pre>
5919: </blockquote>
5920: </div>
5921:
5922: <div class="subsection">
5923:
5924: <h3><a name="sectc4229">Fill pattern</a></h3>
5925: <p>
5926: The <tt>FillPattern</tt> rule determines the pattern used to fill closed
1.1 cvs 5927: graphical elements (circles, rectangles, etc.) which appear in the box. This
1.18 cvs 5928: rule also specifies the pattern used to fill the box associated with elements
5929: having a <a href="#sectc4230a"><tt>ShowBox</tt> rule</a><a>. This pattern can
5930: be indicated by a named constant or by inheritance. The named constant
5931: identifies one of the patterns available in Thot. The names of the available
5932: patterns are: nopattern, foregroundcolor, backgroundcolor, gray1, gray2,
5933: gray3, gray4, gray5, gray6, gray7, horiz1, horiz2, horiz3, vert1, vert2,
5934: vert3, left1, left2, left3, right1, right2, right3, square1, square2, square3,
5935: lozenge, brick, tile, sea, basket.</a></p>
5936: <p>
5937: Like the other rules peculiar to graphics, <tt>LineStyle</tt> and
5938: <tt>LineWeight</tt>, only elements of the graphic base type are affected by
5939: the <tt>FillPattern</tt> rule, but the rule can be attached to any box and
1.1 cvs 5940: transmitted by inheritance to the graphic elements. As with the other rules
1.18 cvs 5941: specific to graphics, only identical inheritance is allowed.</p>
5942: <p>
5943: The <tt>FillPattern</tt> rule can also be used to determine whether or not
1.12 cvs 5944: text characters, symbols and pictures should be colored. For these element
5945: types (text, symbols, and pictures), the only valid values are
1.18 cvs 5946: <tt>nopattern</tt>, <tt>foregroundcolor</tt>, and <tt>backgroundcolor</tt>.
5947: When <tt>FillPattern</tt> has the value <tt>backgroundcolor</tt>, text
5948: characters, symbols, and bitmaps are given the color specified by the <a
5949: href="#sectc4230"><tt>Background</tt> rule</a> which applies to these
5950: elements. When <tt>FillPattern</tt> has the value <tt>foregroundcolor</tt>,
5951: these same elements are given the color specified by the <a
5952: href="#sectc4230"><tt>Foreground</tt> rule</a> which applies to these
5953: elements. In all other case, text characters are not colored.</p>
5954: <pre> 'FillPattern' ':' NameInherit</pre>
5955: <blockquote class="example">
5956: <p>
5957: <strong>Example:</strong></p>
5958: <p>
1.3 cvs 5959: To specify that, in Figures, the closed graphical elements should be filled
5960: with a pattern resembling a brick wall, the Figure element is given this
1.18 cvs 5961: rule:</p>
5962: <pre>Figure :
5963: FillPattern : brick;</pre>
5964: <p>
5965: and the elements composing figures are given an inheritance rule:</p>
5966: <pre> FillPattern : Enclosing =;</pre>
5967: </blockquote>
5968: </div>
5969:
5970: <div class="subsection">
5971:
5972: <h3><a name="sectc4230">Colors</a></h3>
5973: <p>
5974: The <tt>Foreground</tt> and <tt>Background</tt> rules determine the foreground
1.13 cvs 5975: and background colors of the base elements which appear in the box. They also
1.18 cvs 5976: control the color of boxes associated with elements having a <a
5977: href="#sectc4230a"><tt>ShowBox</tt> rule</a>. These colors can be specified
5978: with a named constant or by inheritance. The named constants specify one of
5979: the available colors in Thot. The available color names can be found in the
5980: file <tt>thot.color</tt>.</p>
5981: <p>
5982: The color rules affect the same way all base elements and elements having a <a
5983: href="#sectc4230a"><tt>ShowBox</tt> rule</a>, no matter what their type (text,
5984: graphics, pictures, symbols). The color rules can be associated with any box
5985: and can be transmitted by inheritance to the base elements or the elements
5986: having a <a href="#sectc4230a"><tt>ShowBox</tt> rule</a>. Like the preceding
5987: rules, only inheritance of the same value is allowed.</p>
5988: <pre> 'Foreground' ':' NameInherit
5989: 'Background' ':' NameInherit</pre>
5990: <p>
5991: <strong>Note:</strong> text colors only appear for text elements whose <a
5992: href="#sectc4229">fill pattern</a> does not prevent the use of color.</p>
5993: <blockquote class="example">
5994: <p>
5995: <strong>Example:</strong></p>
5996: <p>
1.3 cvs 5997: To specify that, in Figures, everything must be drawn in blue on a background
1.18 cvs 5998: of yellow, the Figure element is given these rules:</p>
5999: <pre>Figure :
1.1 cvs 6000: BEGIN
6001: Foreground : Blue;
6002: Background : Yellow;
6003: Fillpattern : backgroundcolor;
1.18 cvs 6004: END;</pre>
6005: <p>
6006: and the elements composing figures are given inheritance rules:</p>
6007: <pre> Foreground : Enclosing =;
1.1 cvs 6008: Background : Enclosing =;
1.18 cvs 6009: FillPattern : Enclosing =;</pre>
6010: </blockquote>
6011: </div>
6012:
6013: <div class="subsection">
6014:
6015: <h3><a name="sectc4230a">Background color and border</a></h3>
6016: <p>
6017: Boxes associated with structural elements are normally not visible, but it is
6018: possible to draw their border and/or to paint their area when it is needed.
6019: This is achieved by associating the <tt>ShowBox</tt> rule with the concerned
1.13 cvs 6020: element. This rule has no parameter and no value. It is simply written
1.18 cvs 6021: <tt>Showbox;</tt>. It is not inherited nor transmitted to any other element.
6022: It applies only to the element with which it is associated.</p>
6023: <pre> 'ShowBox'</pre>
6024: <p>
6025: When an element has a <tt>ShowBox</tt> rule, the border is drawn only if the
6026: <tt>LineWeight</tt> rule that applies to that element has a non-zero value
6027: (this value can be inherited). The color, style and thickness of the border
6028: are defined by the <tt>Foreground</tt>, <tt>LineStyle</tt>, and
6029: <tt>LineWeight</tt> rules that apply to the element.</p>
6030: <p>
6031: When an element has a <tt>ShowBox</tt> rule, the background of this element is
6032: paint only if the value of the <tt>FillPattern</tt> rule that applies to that
6033: element is not <tt>nopattern</tt>. The pattern and color(s) of the background
6034: are defined by the <tt>FillPattern</tt>, <tt>Background</tt>, and
6035: <tt>Foreground</tt> rules that apply to the element.</p>
6036: </div>
6037:
6038: <div class="subsection">
6039:
6040: <h3><a name="sectc4230b">Background pictures</a></h3>
6041: <p>
6042: The <tt>BackgroundPicture</tt> rule allows to display a picture as the
1.13 cvs 6043: background of an element. It has a single parameter, the file name of the
1.18 cvs 6044: picture. This is a string delimited by single quotes. If the first character
6045: in this string is '/', it is considered as an absolute path, otherwise the
6046: file is searched for along the schema directory path. This file may contain a
6047: picture in any format accepted by Thot (xbm, xpm, gif, jpeg, png, etc.)</p>
6048: <p>
6049: The <tt>BackgroundPicture</tt> and <tt>PictureMode</tt> rules apply only to
1.13 cvs 6050: the element with which they are associated. They are not inherited nor
1.18 cvs 6051: transmitted to children elements.</p>
6052: <p>
1.13 cvs 6053: The background picture has not always the same size as the element's box.
6054: There are diffrent ways to fill the element box with the picture. This is
1.18 cvs 6055: specified by the <tt>PictureMode</tt> rule, which should be associated to the
6056: same element. This rule may take one of the following values:</p>
6057: <dl>
6058: <dt><tt>NormalSize</tt></dt>
6059: <dd>
6060: The picture is centered in the box, and clipped if it is too large.
6061: </dd>
6062: <dt><tt>Scale</tt></dt>
6063: <dd>
6064: The picture is zoomed to fit the box size.
6065: </dd>
6066: <dt><tt>RepeatX</tt></dt>
6067: <dd>
6068: The picture is repeated horizontally to fit the box width.
6069: </dd>
6070: <dt><tt>RepeatY</tt></dt>
6071: <dd>
6072: The picture is repeated vertically to fit the box height.
6073: </dd>
6074: <dt><tt>RepeatXY</tt></dt>
6075: <dd>
6076: The picture is repeated both horizontally and vertically to fill the box.
6077: </dd>
6078: </dl>
6079: <p>
6080: If an element has a <tt>BackgroundPicture</tt> rule and no
6081: <tt>PictureMode</tt> rule, the <tt>NormalSize</tt> value is assumed.</p>
6082: <pre> 'BackgroundPicture' ':' FileName /
1.13 cvs 6083: 'PictureMode' ':' PictMode .
6084:
6085: FileName = STRING .
1.18 cvs 6086: PictMode = 'NormalSize' / 'Scale' / 'RepeatXY' / 'RepeatX' / 'RepeatY' .</pre>
6087: <p>
6088: The <tt>BackgroundPicture</tt> and <tt>PictureMode</tt> rules apply only to
1.13 cvs 6089: the element with which they are associated. They are not inherited nor
1.18 cvs 6090: transmitted to children elements.</p>
6091: </div>
1.13 cvs 6092:
1.18 cvs 6093: <div class="subsection">
1.1 cvs 6094:
1.18 cvs 6095: <h3><a name="sectc4231">Presentation box content</a></h3>
6096: <p>
6097: The <tt>Content</tt> rule applies to presentation boxes. It indicates the
1.1 cvs 6098: content given to a box. This content is either a variable's value or a
1.18 cvs 6099: constant value. In the special case of <a href="#sectc4233">header or footer
6100: boxes</a>, the content can also be a structured element type.</p>
6101: <p>
1.1 cvs 6102: If the content is a constant, it can be specified, as in a variable
1.18 cvs 6103: declaration, either by the name of a constant declared in the <tt>CONST</tt>
1.1 cvs 6104: section or by direct specification of the type and value of the box's
1.18 cvs 6105: content.</p>
6106: <p>
1.1 cvs 6107: Similarly, if it is a variable, the name of a variable declared in
1.18 cvs 6108: <tt>VAR</tt> section can be given or the variable may be defined within
6109: parentheses. The content inside the parentheses has the same syntax as a <a
6110: href="#sectc426">variable declaration</a>.</p>
6111: <p>
1.1 cvs 6112: When the content is a structured element type, the name of the element type is
6113: given after the colon. In this case, the box's content is all elements of
6114: the named type which are designated by references which are part of the page
1.18 cvs 6115: on which the header or footer with this <tt>Content</tt> rule appears. Only
6116: associated elements can appear in a <tt>Content</tt> rule and the structure
1.1 cvs 6117: must provide references to these elements. Moreover, the box whose content
6118: they are must be a header or footer box generated by a page box of the primary
1.18 cvs 6119: view.</p>
6120: <pre> 'Content' ':' VarConst
1.1 cvs 6121: VarConst = ConstID / ConstType ConstValue /
6122: VarID / '(' FunctionSeq ')' /
1.18 cvs 6123: ElemID .</pre>
6124: <p>
6125: A presentation box can have only one <tt>Content</tt> rule, which means that
1.1 cvs 6126: the content of a presentation box cannot vary from view to view. However, such
6127: an effect can be achieved by creating several presentation boxes, each with
1.18 cvs 6128: different content and visible in different views.</p>
6129: <p>
6130: The <tt>Content</tt> rule also applies to elements defined as references in
1.1 cvs 6131: the structure schema. In this case, the content defined by the rule must be
6132: a constant. It is this content which appears on the screen or paper to
6133: represent references of the type to which the rule applies. A reference can
1.18 cvs 6134: have a <tt>Content</tt> rule or a <a href="#sectc4234"><tt>Copy</tt> rule</a>
1.1 cvs 6135: for each view. If neither of these rules appears, the reference is displayed
1.18 cvs 6136: as <tt>[*]</tt>, which is equivalent to the rule:</p>
6137: <pre> Content: Text '[*]';</pre>
6138: <blockquote class="example">
6139: <p>
6140: <strong>Example:</strong></p>
6141: <p>
1.3 cvs 6142: The content of the presentation box created to make the chapter number and
1.18 cvs 6143: section number appear before each section title can be defined by:</p>
6144: <pre>BOXES
1.1 cvs 6145: SectionNumBox :
6146: BEGIN
6147: Content : NumSection;
6148: ...
1.18 cvs 6149: END;</pre>
6150: <p>
6151: if the <tt>NumSection</tt> variable has been defined in the variable
6152: definition section of the presentation schema. Otherwise the <tt>Content</tt>
6153: would be written:</p>
6154: <pre>BOXES
1.1 cvs 6155: SectionNumBox :
6156: BEGIN
6157: Content : (VALUE (ChapterCtr, Roman) TEXT '.'
6158: VALUE (SectionCtr, Arabic));
6159: ...
1.18 cvs 6160: END;</pre>
6161: <p>
6162: To specify that a page footer should contain all elements of the <tt>Note</tt>
6163: type are referred to in the page, the following rule is written:</p>
6164: <pre>BOXES
1.1 cvs 6165: NotesFooterBox :
6166: BEGIN
6167: Content : Note;
6168: ...
1.18 cvs 6169: END;</pre>
6170: <p>
6171: <tt>Note</tt> is defined as an associated element in the structure schema and
6172: NotesFooterBox is created by a page box of the primary view.</p>
6173: </blockquote>
6174: </div>
1.1 cvs 6175:
1.18 cvs 6176: <div class="subsection">
1.1 cvs 6177:
1.18 cvs 6178: <h3><a name="sectc4232">Presentation box creation</a></h3>
6179: <p>
1.1 cvs 6180: A creation rule specifies that a presentation box should be created when an
1.18 cvs 6181: element of the type to which the rule is attached appears in the document.</p>
6182: <p>
1.1 cvs 6183: A keyword specifies the position, relative to the creating box, at which the
1.18 cvs 6184: created box will be placed in the structure:</p>
6185: <dl>
6186: <dt><tt>CreateFirst</tt></dt>
6187: <dd>
6188: specifies that the box should be created as the first box of the next lower
1.2 cvs 6189: level, before any already existing boxes, and only if the beginning of the
1.1 cvs 6190: creating element is visible;
1.18 cvs 6191: </dd>
6192: <dt><tt>CreateLast</tt></dt>
6193: <dd>
6194: specifies that the box should be created as the last box of the next lower
6195: level, after any existing boxes, and only if the end of the creating element
6196: is visible;
6197: </dd>
6198: <dt><tt>CreateBefore</tt></dt>
6199: <dd>
6200: specifies that the box should be created before the creating box, on the same
6201: level as the creating box, and only if the beginning of the creating element
6202: is visible;
6203: </dd>
6204: <dt><tt>CreateAfter</tt></dt>
6205: <dd>
6206: specifies that the box should be created after the creating box, on the same
6207: level as the creating box, and only if the beginning of the creating element
6208: is visible;
6209: </dd>
6210: <dt><tt>CreateEnclosing</tt></dt>
6211: <dd>
6212: specifies that the box should be created at the upper level relatively to the
6213: creating box, and that it must contain that creating box and all presentation
6214: boxes created by the same creating box.
6215: </dd>
6216: </dl>
6217: <p>
6218: This keyword can be followed by the <tt>Repeated</tt> keyword to indicate that
1.1 cvs 6219: the box must be created for each part of the creating element. These parts
6220: result from the division of the element by page breaks or column changes. If
1.18 cvs 6221: the <tt>Repeated</tt> keyword is missing, the box is only created for the
6222: first part of the creating element (<tt>CreateFirst</tt> and
6223: <tt>CreateBefore</tt> rules) or for the last part (<tt>CreateLast</tt> and
6224: <tt>CreateAfter</tt> rules).</p>
6225: <p>
1.1 cvs 6226: The type of presentation to be created is specified at the end of the rule
1.18 cvs 6227: between parentheses.</p>
6228: <p>
6229: Creation rules cannot appear in the <a href="#sectc427">default presentation
6230: rules</a>. The boxes being created should have a <tt>Content</tt> rule which
6231: indicates their <a href="#sectc4231">content</a>.</p>
6232: <p>
1.1 cvs 6233: Creation rules can only appear in the block of rules for the primary view;
6234: creation is provoked by a document element for all views. However, for each
6235: view, the presentation box is only created if the creating element is itself a
6236: box in the view. Moreover, the visibility parameter of the presentation box
6237: can be adjusted to control the creation of the box on a view-by-view
1.18 cvs 6238: basis.</p>
6239: <pre> Creation '(' BoxID ')'
1.1 cvs 6240: Creation = Create [ 'Repeated' ] .
6241: Create ='CreateFirst' / 'CreateLast' /
6242: 'CreateBefore' / 'CreateAfter' /
1.18 cvs 6243: 'CreateEnclosing' .</pre>
6244: <blockquote class="example">
6245: <p>
6246: <strong>Example:</strong></p>
6247: <p>
1.3 cvs 6248: Let us define an object type, called Table, which is composed of a sequence of
6249: columns, all having the same fixed width, where the columns are separated by
1.18 cvs 6250: vertical lines. There is a line to the left of the first column and one to
6251: the right of the last. Each column has a variable number of cells, placed one
6252: on top of the other and separated by horizontal lines. There are no
6253: horizontal lines above the first cell or below the last cell. The text
6254: contained in each cell is broken into lines and these lines are centered
6255: horizontally in the cell. The logical structure of this object is defined
6256: by:</p>
6257: <pre>Table = LIST OF (Column);
6258: Column = LIST OF (Cell = Text);</pre>
6259:
6260: <div class="figure">
6261: <hr>
1.19 ! cvs 6262:
1.18 cvs 6263: <pre>| | | |
1.1 cvs 6264: | xx xxxx xxxx |x xxxx xxx xxxxx| x xxx x xxx |
6265: | xxx xxx xxxx x | x xx x xxx | xxxxx xxxx xx |
6266: | xxxxx xxxx |----------------| xxx xxxxx x |
6267: | xxxxx xxx xxxx | xxxx xx xx xxx | xx xx |
6268: | xxx xxxx x xxx | xxxx x xxx x |---------------|
6269: |----------------| xxx xxxx xxxxx | xxxxx xxxxx |
6270: | xxx xxx xxxxxx |----------------| xxx xxxx xxxx |
6271: | xxxx xxxx xx | xxxx xx x xx | xxx xx x xx |
6272: |----------------| xxx xxxxx xxxx | xxxx xxxx xxx |
6273: | xxxxx xxx xxxx | xxxx xx x xx | xxxxx xxx |
1.18 cvs 6274: |xxxx xx x xxxxxx| xxxx xx xxxxxx | xxxxx xxxxx |</pre>
1.19 ! cvs 6275: <p align="center">
1.18 cvs 6276: <em><a name="table">The design of a table</a></em></p>
6277: <hr>
1.19 ! cvs 6278:
1.18 cvs 6279: </div>
6280: <p>
6281: The presentation of the table should resemble the design of the above <a
6282: href="#table">figure</a>. It is defined by the following presentation schema
6283: fragment:</p>
6284: <pre>BOXES
1.1 cvs 6285: VertLine : BEGIN
6286: Width : 0.3 cm;
6287: Height : Enclosing . Height;
6288: VertPos : Top = Enclosing . Top;
6289: HorizPos : Left = Previous . Right;
6290: Content : Graphics 'v';
6291: END;
6292:
6293: HorizLine: BEGIN
6294: Width : Enclosing . Width;
6295: Height : 0.3 cm;
6296: VertPos : Top = Previous . Bottom;
6297: HorizPos : Left = Enclosing . Left;
6298: Content : Graphics 'h';
6299: END;
6300:
6301: RULES
1.6 cvs 6302: Column : BEGIN
6303: CreateBefore (VertLine);
6304: IF LAST CreateAfter (VertLine);
6305: Width : 2.8 cm;
6306: Height : Enclosed . Height;
6307: VertPos : Top = Enclosing . Top;
6308: HorizPos : Left = Previous . Right;
6309: END;
6310:
6311: Cell : BEGIN
6312: IF NOT FIRST CreateBefore (HorizLine);
6313: Width : Enclosing . Width;
6314: Height : Enclosed . Height;
6315: VertPos : Top = Previous . Bottom;
6316: HorizPos : Left = Enclosing . Left;
6317: Line;
6318: Adjust : VMiddle;
1.18 cvs 6319: END;</pre>
6320: <p>
1.1 cvs 6321: It is useful to note that the horizontal position rule of the first vertical
6322: line will not be applied, since there is no preceding box. In this case, the
1.18 cvs 6323: box is simply placed on the left side of the enclosing box.</p>
6324: </blockquote>
6325: </div>
6326:
6327: <div class="subsection">
6328:
6329: <h3><a name="sectc4233">Page layout</a></h3>
6330: <p>
6331: The page models specified in the <tt>Page</tt> rule are defined by boxes
6332: declared in the <tt>BOXES</tt> section of the presentation schema. Pages are
1.1 cvs 6333: not described as frames which will be filled by the document's text, but as
6334: element are inserted in the flow of the document and which mark the page
6335: breaks. Each of these page break elements contains presentation boxes which
6336: represent the footer boxes of a page followed by header boxes of the next
6337: page. The page box itself is the simple line which separates two pages on the
6338: screen. Both the footer and header boxes placed themselves with respect to
6339: this page box, with the footer being placed above it and the header boxes
1.18 cvs 6340: being placed above it.</p>
6341: <p>
1.1 cvs 6342: The boxes created by a page box are headers and footers and can only place
6343: themselves vertically with respect to the page box itself (which is in fact
6344: the separation between two pages). Besides, it is their vertical position
6345: rule which determines whether they are header or footer boxes. Header and
6346: footer boxes must have an explicit vertical position rule (they must not use
1.18 cvs 6347: the default rule).</p>
6348: <p>
1.1 cvs 6349: Footer boxes must have an absolute height or inherit the height of their
1.18 cvs 6350: contents:</p>
6351: <pre>Height : Enclosed . Height;</pre>
6352: <p>
1.1 cvs 6353: A page box must have height and width rules and these two rules must be
6354: specified with constant values, expressed in centimeters, inches, or
6355: typographer's points. These two rules are interpreted in a special way for
6356: page boxes: they determine the width of the page and the vertical distance
6357: between two page separators, which is the height of the page and its header
1.18 cvs 6358: and footer together.</p>
6359: <p>
1.1 cvs 6360: A page box should also have vertical and horizontal position rules and these
6361: two rules should specify the position on the sheet of paper of the rectangle
6362: enclosing the page's contents. These two rules must position the upper left
6363: corner of the enclosing rectangle in relation to the upper left corner of the
6364: sheet of paper, considered to be the enclosing element. In both rules,
1.18 cvs 6365: distances must be expressed in fixed units: centimeters (<tt>cm</tt>), inches
6366: (<tt>in</tt>), or typographer's points (<tt>pt</tt>). Thus, rules similar to
6367: the following should be found in the rules for a page box:</p>
6368: <pre>BOXES
1.1 cvs 6369: ThePage :
6370: BEGIN
6371: VertPos : Top = Enclosing . Top + 3 cm;
6372: HorizPos : Left = Enclosing . Left + 2.5 cm;
6373: Width : 16 cm;
6374: Height : 22.5 cm;
1.18 cvs 6375: END;</pre>
6376: <p>
1.1 cvs 6377: When a document must be page broken, the page models to be constructed are
1.18 cvs 6378: defined in the <tt>BOXES</tt> section of the presentation schema by declaring
6379: page boxes and header and footer boxes. Also, the <tt>Page</tt> rule is used
1.1 cvs 6380: to specify to which parts of the document and to which views each model should
1.18 cvs 6381: be applied.</p>
6382: <p>
6383: The <tt>Page</tt> rule has only one parameter, given between parentheses after
6384: the <tt>Page</tt> keyword. This parameter is the name of the box which must
6385: serve as the model for page construction. When a <tt>Page</tt> rule is
1.1 cvs 6386: attached to an element type, each time such an element appears in a document,
6387: a page break takes place and the page model indicated in the rule is applied
6388: to all following pages, until reaching the next element which has a
1.18 cvs 6389: <tt>Page</tt> rule.</p>
6390: <p>
6391: The <tt>Page</tt> rule applies to only one view; if it appears in the primary
6392: view's block of rules, a <tt>Page</tt> rule applies only to that view. Thus,
1.1 cvs 6393: different page models can be defined for the full document and for its table
6394: of contents, which is another view of the same document. Some views can be
6395: specified with pages, and other views of the same document can be specified
1.18 cvs 6396: without pages.</p>
6397: <pre> 'Page' '(' BoxID ')'</pre>
6398: </div>
6399:
6400: <div class="subsection">
6401:
6402: <h3><a name="sectc4234">Box copies</a></h3>
6403: <p>
6404: The <tt>Copy</tt> rule can be used for an element which is defined as a
1.7 cvs 6405: reference in the structure schema. In this case, the rule specifies, between
1.18 cvs 6406: parenthesis, the name of the box (declared in the <tt>BOXES</tt> section)
1.1 cvs 6407: which must be produced when this reference appears in the structure of a
6408: document. The box produced is a copy (same contents, but possible different
6409: presentation) of the box type indicated by the parameter between parentheses,
6410: and which is in the element designated by the reference. The name of a box
6411: can be replaced by type name. Then what is copied is the contents of the
1.18 cvs 6412: element of this type which is inside the referenced element.</p>
6413: <p>
1.1 cvs 6414: Whether a box name or type name is given, it may be followed by the name of a
6415: structure schema between parentheses. This signifies that the box or type is
6416: defined in the indicated structure schema and not in the structure schema with
1.18 cvs 6417: which the rule's presentation schema is associated.</p>
6418: <p>
6419: The <tt>Copy</tt> rule can also be applied to a presentation box. If the
1.1 cvs 6420: presentation box was created by a reference attribute, the rule is applied as
6421: in the case of a reference element: the contents of the box having the
1.18 cvs 6422: <tt>Copy</tt> rule are based on the element designated by the reference
6423: attribute. For other presentation boxes, the <tt>Copy</tt> rule takes a type
1.1 cvs 6424: name parameter which can be followed, between parentheses, by the name of the
6425: structure schema in which the type is defined, if it is not defined in the
6426: same schema. The contents of the box which has this rule are a copy of the
6427: element of this type which is in the element creating the presentation box, or
6428: by default, the box of this type which precedes the presentation box. This
6429: last facility is used, for example, to define the running titles in headers or
1.18 cvs 6430: footers.</p>
6431: <pre> 'Copy' '(' BoxTypeToCopy ')' .
1.1 cvs 6432: BoxTypeToCopy = BoxID [ ExtStruct ] /
1.6 cvs 6433: ElemID [ ExtStruct ] .
1.18 cvs 6434: ExtStruct = '(' ElemID ')' .</pre>
6435: <p>
6436: Like the creation rules, the <tt>Copy</tt> rule cannot appear in the <a
6437: href="#sectc427">default presentation rules</a>. Moreover, this rule can only
6438: appear in the primary view's block of rules; the copy rule is applied to all
6439: views.</p>
6440: <blockquote class="example">
6441: <p>
6442: <strong>Example:</strong></p>
6443: <p>
6444: If the following definitions are in the structure schema:</p>
6445: <pre>Body = LIST OF (Chapter =
1.1 cvs 6446: BEGIN
6447: ChapterTitle = Text;
6448: ChapterBody = SectionSeq;
6449: END);
1.18 cvs 6450: RefChapter = REFERENCE (Chapter);</pre>
6451: <p>
6452: then the following presentation rules (among many other rules in the
6453: presentation schema) can be specified:</p>
6454: <pre>COUNTERS
1.1 cvs 6455: ChapterCtr : RANK OF Chapter;
6456: BOXES
6457: ChapterNumber :
6458: BEGIN
6459: Content : (VALUE (ChapterCtr, URoman));
6460: ...
6461: END;
6462: RULES
6463: Chapter :
6464: BEGIN
6465: CreateFirst (ChapterNumber);
6466: ...
6467: END;
6468: RefChapter :
6469: BEGIN
6470: Copy (ChapterNumber);
6471: ...
1.18 cvs 6472: END;</pre>
6473: <p>
1.4 cvs 6474: which makes the number of the chapter designated by the reference appear in
6475: uppercase roman numerals, in place of the reference to a chapter itself.
6476: Alternatively, the chapter title can be made to appear in place of the
1.18 cvs 6477: reference by writing this <tt>Copy</tt>rule:</p>
6478: <pre> Copy (ChapterTitle);</pre>
6479: <p>
6480: To define a header box, named <tt>RunningTitle</tt>, which contains the title
6481: of the current chapter, the box's contents are defined in this way:</p>
6482: <pre>BOXES
1.1 cvs 6483: RunningTitle :
1.18 cvs 6484: Copy (ChapterTitle);</pre>
6485: </blockquote>
6486: </div>
6487: </div>
6488: <hr>
1.19 ! cvs 6489:
1.18 cvs 6490: </div>
1.1 cvs 6491:
1.18 cvs 6492: <div class="chapter">
1.1 cvs 6493:
1.18 cvs 6494: <h1><a name="sect5">The T language</a></h1>
1.1 cvs 6495:
1.18 cvs 6496: <div class="section">
1.1 cvs 6497:
1.18 cvs 6498: <h2><a name="sectb51">Document translation</a></h2>
6499: <p>
1.1 cvs 6500: Because of its document model, Thot can produce documents in a high-level
1.18 cvs 6501: abstract form. This form, called the <em>canonical form</em> is specific to
1.1 cvs 6502: Thot; it is well suited to the editor's manipulations, but it does not
6503: necessarily suit other operations which might be applied to documents. Because
6504: of this, the Thot editor offers the choice of saving documents in its own form
6505: (the canonical form) or a format defined by the user. In the latter case, the
6506: Thot document is transformed by the translation program. This facility can
6507: also be used to export documents from Thot to systems using other
1.18 cvs 6508: formalisms.</p>
1.1 cvs 6509:
1.18 cvs 6510: <div class="subsection">
1.1 cvs 6511:
1.18 cvs 6512: <h3><a name="sectc511">Translation principles</a></h3>
6513: <p>
1.1 cvs 6514: Document translation allows the export of documents to other systems which do
6515: not accept Thot's canonical form. Translation can be used to export document
1.18 cvs 6516: to source-based formatters like T<sub><big>E</big></sub>X,
6517: L<sup>A</sup>T<sub><big>E</big></sub>X, and <tt>troff</tt>. It can also be
1.1 cvs 6518: used to translate documents into interchange formats like SGML or HTML. To
6519: allow the widest range of possible exports, Thot does not limit the choice of
6520: translations, but rather allows the user to define the formalisms into which
1.18 cvs 6521: documents can be translated.</p>
6522: <p>
1.1 cvs 6523: For each document or object class, a set of translation rules can be defined,
6524: specifying how the canonical form should be transformed into a given
1.18 cvs 6525: formalism. These translation rules are grouped into <em>translation
6526: schemas</em>, each schema containing the rules necessary to translate a
1.1 cvs 6527: generic logical structure (document or object structure) into a particular
6528: formalism. The same generic logical structure can have several different
6529: translation schemas, each defining translation rules for a different
1.18 cvs 6530: formalism.</p>
6531: <p>
1.1 cvs 6532: Like presentation schemas, translation schemas are generic. Thus, they apply
6533: to an entire object or document class and permit translation of all documents
1.18 cvs 6534: or objects of that class.</p>
6535: </div>
1.1 cvs 6536:
1.18 cvs 6537: <div class="subsection">
1.1 cvs 6538:
1.18 cvs 6539: <h3><a name="sectc512">Translation procedure</a></h3>
6540: <p>
1.1 cvs 6541: The translator works on the specific logical structure of the document being
6542: translated. It traverses the primary tree of this logical structure in
6543: pre-order and, at each node encountered, it applies the corresponding
6544: translation rules defined in the translation schema. Translation can be
1.18 cvs 6545: associated:</p>
6546: <ul>
6547: <li>
6548: with element types defined in the structure schema,
1.19 ! cvs 6549: </li>
1.18 cvs 6550: <li>
6551: with global or local attributes defined in the structure schema,
1.19 ! cvs 6552: </li>
1.18 cvs 6553: <li>
6554: with specific presentation rules,
1.19 ! cvs 6555: </li>
1.18 cvs 6556: <li>
6557: with the content of the leaves of the structure (characters, symbols and
1.1 cvs 6558: graphical elements)
1.19 ! cvs 6559: </li>
1.18 cvs 6560: </ul>
6561: <p>
1.1 cvs 6562: Thus, for each node, the translator applies all rules associated with the
6563: element type, all rules associated with each attribute (local or global)
6564: carried by the element, and if the element is a leaf of the tree, it also
1.10 cvs 6565: applies translation rules for characters, symbols, or graphical elements,
1.18 cvs 6566: depending on the type of the leaf.</p>
6567: <p>
1.1 cvs 6568: Rules associated with the content of leaves are different from all other
6569: rules: they specify only how to translate character strings, symbols, and
6570: graphical elements. All other rules, whether associated with element types,
6571: with specific presentation rules or with attributes, are treated similarly.
1.18 cvs 6572: These rules primarily allow:</p>
6573: <ul>
6574: <li>
6575: generation of a text constant or variable before or after the contents of an
6576: element,
1.19 ! cvs 6577: </li>
1.18 cvs 6578: <li>
6579: modification of the order in which elements appear after translation,
1.19 ! cvs 6580: </li>
1.18 cvs 6581: <li>
6582: removal of an element in the translated document,
1.19 ! cvs 6583: </li>
1.18 cvs 6584: <li>
6585: and writing messages on the user's terminal during translation.
1.19 ! cvs 6586: </li>
1.18 cvs 6587: </ul>
6588: </div>
6589: </div>
1.1 cvs 6590:
1.18 cvs 6591: <div class="section">
1.1 cvs 6592:
1.18 cvs 6593: <h2><a name="sectb52">Translation definition language</a></h2>
6594: <p>
1.1 cvs 6595: Translation schemas are written in a custom language, called T, which is
6596: described in the rest of this chapter. The grammar of T is specified using
1.18 cvs 6597: the same <a href="#sectc321">meta-language</a> as was used for the S and P
1.1 cvs 6598: languages and the translation schemas are written using the same conventions
6599: as the structure and presentation schemas. In particular, the keywords of the
6600: T language (the stings between apostrophes in the following syntax rules) can
6601: be written in any combination of upper-case and lower-case letters, but
6602: identifiers created by the programmer must always be written in the same
1.18 cvs 6603: way.</p>
1.1 cvs 6604:
1.18 cvs 6605: <div class="subsection">
1.1 cvs 6606:
1.18 cvs 6607: <h3><a name="sectc521">Organization of a translation schema</a></h3>
6608: <p>
6609: A translation schema is begun by the <tt>TRANSLATION</tt> keyword and is
6610: terminated by the <tt>END</tt> keyword. The <tt>TRANSLATION</tt> keyword is
1.1 cvs 6611: followed by the name of the generic structure for which a translation is being
6612: defined and a semicolon. This name must be identical to the name which
1.18 cvs 6613: appears after the <tt>STRUCTURE</tt> keyword in the corresponding structure
6614: schema.</p>
6615: <p>
1.1 cvs 6616: After this declaration of the structure, the following material appears in
1.18 cvs 6617: order:</p>
6618: <ul>
6619: <li>
6620: the length of lines produced by the translation,
1.19 ! cvs 6621: </li>
1.18 cvs 6622: <li>
6623: the character delimiting the end of the line,
1.19 ! cvs 6624: </li>
1.18 cvs 6625: <li>
6626: the character string which the translator will insert if it must line-break
6627: the translated text,
1.19 ! cvs 6628: </li>
1.18 cvs 6629: <li>
6630: declarations of
6631: <ul>
6632: <li>
6633: buffers,
1.19 ! cvs 6634: </li>
1.18 cvs 6635: <li>
6636: counters,
1.19 ! cvs 6637: </li>
1.18 cvs 6638: <li>
6639: constants,
1.19 ! cvs 6640: </li>
1.18 cvs 6641: <li>
6642: variables,
1.19 ! cvs 6643: </li>
1.18 cvs 6644: </ul>
1.19 ! cvs 6645: </li>
1.18 cvs 6646: <li>
6647: translation rules associated with element types,
1.19 ! cvs 6648: </li>
1.18 cvs 6649: <li>
6650: translation rules associated with attributes,
1.19 ! cvs 6651: </li>
1.18 cvs 6652: <li>
6653: translation rules associated with specific presentation rules,
1.19 ! cvs 6654: </li>
1.18 cvs 6655: <li>
6656: translation rules associated with characters strings, symbols and graphical
6657: elements.
1.19 ! cvs 6658: </li>
1.18 cvs 6659: </ul>
6660: <p>
1.1 cvs 6661: Each of these sections is introduced by a keyword followed by a sequence of
6662: declarations. All of these sections are optional, expect for the translation
1.18 cvs 6663: rules associated with element types. Many <tt>TEXTTRANSLATE</tt> sections can
1.1 cvs 6664: appear, each defining the rules for translating character strings of a
1.18 cvs 6665: particular alphabet.</p>
6666: <pre> TransSchema ='TRANSLATION' ElemID ';'
1.1 cvs 6667: [ 'LINELENGTH' LineLength ';' ]
6668: [ 'LINEEND' CHARACTER ';' ]
6669: [ 'LINEENDINSERT' STRING ';' ]
6670: [ 'BUFFERS' BufferSeq ]
6671: [ 'COUNTERS' CounterSeq ]
6672: [ 'CONST' ConstSeq ]
6673: [ 'VAR' VariableSeq ]
6674: 'RULES' ElemSeq
6675: [ 'ATTRIBUTES' AttrSeq ]
6676: [ 'PRESENTATION' PresSeq ]
6677: < 'TEXTTRANSLATE' TextTransSeq >
6678: [ 'SYMBTRANSLATE' TransSeq ]
6679: [ 'GRAPHTRANSLATE' TransSeq ]
1.18 cvs 6680: 'END' .</pre>
6681: </div>
1.1 cvs 6682:
1.18 cvs 6683: <div class="subsection">
1.1 cvs 6684:
1.18 cvs 6685: <h3><a name="sectc522">Line length</a></h3>
6686: <p>
6687: If a <tt>LINELENGTH</tt> instruction is present after the structure
1.1 cvs 6688: declaration, the translator divides the text it produces into lines, each line
6689: having a length less than or equal to the integer which follows the
1.18 cvs 6690: <tt>LINELENGTH</tt> keyword. This maximum line length is expressed as a
1.1 cvs 6691: number of characters. The end of the line is marked by the character defined
1.18 cvs 6692: by the <tt>LINEEND</tt> instruction. When the translator breaks the lines on
1.1 cvs 6693: a space character in generated text, this space will be replaced by the
1.18 cvs 6694: character string defined by the <tt>LINEENDINSERT</tt> instruction.</p>
6695: <p>
6696: If the <tt>LINEEND</tt> instruction is not defined then the linefeed character
1.1 cvs 6697: (octal code 12) is used as the default line end character. If the
1.18 cvs 6698: <tt>LINEENDINSERT</tt> instruction is not defined, the linefeed character is
6699: inserted at the end of the produced lines. If there is no <tt>LINELENGTH</tt>
1.1 cvs 6700: instruction, the translated text is not divided into lines. Otherwise, if the
6701: translation rules generate line end marks, these marks remain in the
6702: translated text, but the length of the lines is not controlled by the
1.18 cvs 6703: translator.</p>
6704: <pre> LineLength = NUMBER .</pre>
6705: <blockquote class="example">
6706: <p>
6707: <strong>Example:</strong></p>
6708: <p>
6709: To limit the lines produced by the translator to a length of 80 characters,
6710: the following rule is written at the beginning of the translation schema.</p>
6711: <pre>LineLength 80;</pre>
6712: </blockquote>
6713: </div>
1.1 cvs 6714:
1.18 cvs 6715: <div class="subsection">
1.1 cvs 6716:
1.18 cvs 6717: <h3><a name="sectc523">Buffers</a></h3>
6718: <p>
1.1 cvs 6719: A buffer is a unit of memory managed by the translator, which can either
1.18 cvs 6720: contain text read from the terminal during the translation (see the <a
6721: href="#sectc5212"><tt>Read</tt> rule</a>), or the name of the last picture
1.1 cvs 6722: (bit-map) encountered by the translator in its traversal of the document.
1.2 cvs 6723: Remember the pictures are stored in files that are separate for the document
1.1 cvs 6724: files and that the canonical form contains only the names of the files in
1.18 cvs 6725: which the pictures are found.</p>
6726: <p>
1.1 cvs 6727: Thus, there are two types of buffers: buffers for reading from the terminal
1.18 cvs 6728: (filled by the <tt>Read</tt> rule) and the buffer of picture names (containing
1.2 cvs 6729: the name of the last picture encountered). A translation schema can use
6730: either type, one or several read buffers and one (and only one) picture name
1.18 cvs 6731: buffer.</p>
6732: <p>
6733: If any buffers are used, the <tt>BUFFERS</tt> keyword must be present,
1.1 cvs 6734: followed by declarations of every buffer used in the translation schema. Each
6735: buffer declaration is composed only of the name of the buffer, chosen freely
1.2 cvs 6736: by the programmer. The picture name buffer is identified by the
1.18 cvs 6737: <tt>Picture</tt> keyword, between parentheses, following the buffer name. The
6738: <tt>Picture</tt> keyword may only appear once. Each buffer declaration is
6739: terminated by a semicolon.</p>
6740: <pre> BufferSeq = Buffer < Buffer > .
1.1 cvs 6741: Buffer = BufferID [ '(' 'Picture' ')' ] ';' .
1.18 cvs 6742: BufferID = NAME .</pre>
6743: <blockquote class="example">
6744: <p>
6745: <strong>Example:</strong></p>
6746: <p>
1.3 cvs 6747: The following buffer declarations create a picture name buffer named
1.18 cvs 6748: <tt>pictureName</tt> and a read buffer named <a
6749: name="destname"><tt>DestName</tt></a>:</p>
6750: <pre>BUFFERS
6751: pictureName (Picture); DestName;</pre>
6752: </blockquote>
6753: </div>
1.1 cvs 6754:
1.18 cvs 6755: <div class="subsection">
1.1 cvs 6756:
1.18 cvs 6757: <h3><a name="sectc524">Counters</a></h3>
6758: <p>
1.1 cvs 6759: Certain translation rules generate text that varies according to the context
6760: of the element to which the rules apply. Variable text is defined either in
1.18 cvs 6761: the <a href="#sectc526"><tt>VAR</tt> section</a> of the translation schema or
6762: in the rule itself (see the <tt>Create</tt> and <tt>Write</tt> rules). Both
1.1 cvs 6763: types of definition rely on counters for the calculation of variable
1.18 cvs 6764: material.</p>
6765: <p>
1.1 cvs 6766: There are two types of counter: counters whose value is explicitely computed
1.18 cvs 6767: by applying <a href="#sectc5221"><tt>Set</tt> and <tt>Add</tt> rules</a>, and
1.1 cvs 6768: counters whose value is computed by a function associated with the counter.
6769: Those functions allow the same calculations as can be used in presentation
6770: schemas. As in a presentation schema, counters must be defined in the
1.18 cvs 6771: <tt>COUNTERS</tt> section of the translation schema before they are used.</p>
6772: <p>
6773: When counters are used in a translation schema, the <tt>COUNTERS</tt> keyword
1.1 cvs 6774: is followed by the declarations of every counter used. Each declaration is
6775: composed of the counter's name possibly followed by a colon and the counting
6776: function to be used for the counter. The declaration is terminated by a
1.18 cvs 6777: semi-colon. If the counter is explicitely computed by <tt>Set</tt> and
6778: <tt>Add</tt> rules, no counting function is indicated. If a counting function
6779: is indicated, <tt>Set</tt> and <tt>Add</tt> rules cannot be applied to that
6780: counter.</p>
6781: <p>
1.1 cvs 6782: The counting function indicates how the counter's value will be computed.
1.18 cvs 6783: Three functions are available: <tt>Rank</tt>, <tt>Rlevel</tt>, and
6784: <tt>Set</tt>.</p>
6785: <ul>
6786: <li>
6787: <tt>Rank of ElemID</tt> indicates that the counter's value is the rank of the
6788: element of type <tt>ElemID</tt> which encloses the element for which the
1.2 cvs 6789: counter is being evaluated. For the purposes of this function, an element of
1.18 cvs 6790: type <tt>ElemID</tt> is considered to enclose itself. This function is
6791: primarily used when the element of type <tt>ElemID</tt> is part of an
1.2 cvs 6792: aggregate or list, in which case the counter's value is the element's rank in
1.18 cvs 6793: its list or aggregate. Note that, unlike the <tt>Rank</tt> function for
6794: presentation schemas, the <tt>Page</tt> keyword cannot be used in place of the
6795: <tt>ElemID</tt>.
6796: <p>
6797: The type name <tt>ElemID</tt> can be followed by an integer. That number
1.1 cvs 6798: represents the relative level, among the ancestors of the concerned element,
1.18 cvs 6799: of the element whose rank is asked. If that relative level <i>n</i> is
6800: unsigned, the <i>n<sup>th</sup></i> element of type <tt>ElemID</tt>
6801: encountered when travelling the logical structure from the root to the
6802: concerned element is taken into account. If the relative level is negative,
6803: the logical structure is travelled in the other direction, from the concerned
6804: element to the root.</p>
1.19 ! cvs 6805: </li>
1.18 cvs 6806: <li>
6807: <tt>Rlevel of ElemID</tt> indicates that the counter's values is the relative
6808: level in the tree of the element for which the counter is being evaluated. The
6809: counter counts the number of elements of type <tt>ElemID</tt> which are found
6810: on the path between the root of the document's logical structure tree and the
6811: element (inclusive).
1.19 ! cvs 6812: </li>
1.18 cvs 6813: <li>
6814: <tt>Set n on Type1 Add m on Type2</tt> indicates that the counter's value is
6815: calculated as follows: in traversing the document from the beginning to the
6816: element for which the counter is being evaluated, the counter is set to the
6817: value <tt>n</tt> each time a <tt>Type1</tt> element is encountered and is
6818: incremented by the amount <tt>m</tt> each time a <tt>Type2</tt> element is
6819: encountered. The initial value <tt>n</tt> and the increment <tt>m</tt> are
1.1 cvs 6820: integers.
1.19 ! cvs 6821: </li>
1.18 cvs 6822: </ul>
6823: <p>
6824: As in a presentation schema, the <tt>Rank</tt> and <tt>Set</tt> functions can
1.1 cvs 6825: be modified by a numeric attribute which changes their initial value. This is
1.18 cvs 6826: indicated by the <tt>Init</tt> keyword followed by the numeric attribute's
6827: name. The <tt>Set</tt> function takes the value of the attribute instead of
6828: the <tt>InitValue</tt> (<tt>n</tt>). For the <tt>Rank</tt> function, the
1.1 cvs 6829: value of the attribute is considered to be the rank of the first element of
6830: the list (rather than the normal value of 1). Subsequent items in the list
6831: have their ranks shifted accordingly. In both cases, the attribute must be
1.18 cvs 6832: numeric and must be a local attribute of the root of the document itself.</p>
6833: <pre> CounterSeq = Counter < Counter > .
1.1 cvs 6834: Counter = CounterID [ ':' CounterFunc ] ';' .
6835: CounterID = NAME .
6836: CounterFunc = 'Rank' 'of' ElemID [ SLevelAsc ]
6837: [ 'Init' AttrID ] /
6838: 'Rlevel' 'of' ElemID /
6839: 'Set' InitValue 'On' ElemID
6840: 'Add' Increment 'On' ElemID
6841: [ 'Init' AttrID ] .
6842: SLevelAsc = [ '-' ] LevelAsc .
6843: LevelAsc = NUMBER .
6844: InitValue = NUMBER .
6845: Increment = NUMBER .
6846: ElemID = NAME .
1.18 cvs 6847: AttrID = NAME .</pre>
6848: <blockquote class="example">
6849: <p>
6850: <strong>Example:</strong></p>
6851: <p>
6852: If the body of a chapter is defined in the structure schema by:</p>
6853: <pre>Chapter_Body = LIST OF
1.1 cvs 6854: (Section = BEGIN
6855: Section_Title = Text;
6856: Section_Body = BEGIN
6857: Paragraphs;
6858: Section;
6859: END;
6860: END
1.18 cvs 6861: );</pre>
6862: <p>
6863: (sections are defined recursively), a counter can be defined giving the <a
6864: name="sectnum">number of a section</a> within its level in the hierarchy:</p>
6865: <pre>COUNTERS
6866: SectionNumber : Rank of Section;</pre>
6867: <p>
6868: A counter holding the hierarchic level of a section:</p>
6869: <pre> SectionLevel : Rlevel of Section;</pre>
6870: <p>
6871: A <a name="uniquenum">counter</a> which sequentially numbers all the
6872: document's sections, whatever their hierarchic level:</p>
6873: <pre> UniqueSectNum : Set 0 on Document Add 1 on Section;</pre>
6874: </blockquote>
6875: </div>
1.1 cvs 6876:
1.18 cvs 6877: <div class="subsection">
1.1 cvs 6878:
1.18 cvs 6879: <h3><a name="sectc525">Constants</a></h3>
6880: <p>
1.1 cvs 6881: A common feature of translation rules is the generation of constant text. This
1.18 cvs 6882: text can be defined in the rule that generates it (see for example the <a
6883: href="#sectc5210"><tt>Create</tt></a> and <a
6884: href="#sectc5211"><tt>Write</tt></a> rules); but it can also be defined once
6885: in the constant declaration section and used many times in different rules.
6886: The latter option is preferable when the same text is used in several rules or
6887: several <a href="#sectc526">variables</a>.</p>
6888: <p>
6889: The <tt>CONST</tt> keyword begins the constant declaration section of the
1.1 cvs 6890: translation schema. It must be omitted if no constants are declared. Each
6891: constant declaration is composed of the constant name, an equals sign, and the
6892: constant's value, which is a character string between apostrophes. A constant
1.18 cvs 6893: declaration is terminated by a semicolon.</p>
6894: <pre> ConstSeq = Const < Const > .
1.1 cvs 6895: Const = ConstID '=' ConstValue ';' .
6896: ConstID = NAME .
1.18 cvs 6897: ConstValue = STRING .</pre>
6898: <blockquote class="example">
6899: <p>
6900: <strong><a name="levelexample">Example:</a></strong></p>
6901: <p>
6902: The following rule assigns the name <tt>TxtLevel</tt> to the character string
6903: ``Level'':</p>
6904: <pre>CONST
6905: TxtLevel = 'Level';</pre>
6906: </blockquote>
6907: </div>
1.1 cvs 6908:
1.18 cvs 6909: <div class="subsection">
1.1 cvs 6910:
1.18 cvs 6911: <h3><a name="sectc526">Variables</a></h3>
6912: <p>
1.10 cvs 6913: Variables allow to define variable text which is generated by the
1.18 cvs 6914: <tt>Create</tt> and <tt>Write</tt> rules. They are also used to define file
6915: names which are used in the <tt>Create</tt>, <tt>ChangeMainFile</tt>,
6916: <tt>RemoveFile</tt>, and <tt>Indent</tt> rules. Variables can be defined
6917: either in the <tt>VAR</tt> section of the translation schema or directly in
6918: the rules which use them. Variables that define file names must be declared
6919: in the <tt>VAR</tt> section, and when the same variable is used several times
6920: in the translation schema, it makes sense to define it globally in the
6921: <tt>VAR</tt> section. This section is only present if at least one variable
6922: is defined globally.</p>
6923: <p>
6924: After the <tt>VAR</tt> keyword, each global variable is defined by its name, a
1.1 cvs 6925: colon separator and a sequence of functions (at least one function). Each
6926: variable definition is terminated by a semicolon. Functions determine the
6927: different parts which together give the value of the variable. The value is
6928: obtained by concatenating the strings produced by each of the functions. Seven
6929: types of functions are available. Each variable definition may use any number
1.18 cvs 6930: of functions of each type.</p>
6931: <ul>
6932: <li>
6933: The function <tt>Value(Counter)</tt>returns a string representing the value
6934: taken by the counter when it is evaluated for the element in whose rule the
6935: variable is used. The counter must have been declared in the
6936: <tt>COUNTERS</tt> section of the translation schema. When the counter is
1.2 cvs 6937: expressed in arabic numerals, the counter name can be followed by a colon and
6938: an integer indicating a minimum length (number of characters) for the string;
6939: if the counter's value is normally expressed with fewer characters than the
6940: required minimum, zeroes are added to the front of the string to achieve the
1.5 cvs 6941: minimum length.
1.18 cvs 6942: <p>
1.1 cvs 6943: By default, the counter value is written in arabic digits. If another
6944: representation of that value is needed, the counter name must be followed by a
1.18 cvs 6945: comma and one of the following keywords:</p>
6946: <ul>
6947: <li>
6948: <tt>Arabic</tt>: arabic numerals (default value),
1.19 ! cvs 6949: </li>
1.18 cvs 6950: <li>
6951: <tt>LRoman</tt>: lower-case roman numerals,
1.19 ! cvs 6952: </li>
1.18 cvs 6953: <li>
6954: <tt>URoman</tt>: upper-case roman numerals,
1.19 ! cvs 6955: </li>
1.18 cvs 6956: <li>
6957: <tt>Uppercase</tt>: upper-case letter,
1.19 ! cvs 6958: </li>
1.18 cvs 6959: <li>
6960: <tt>Lowercase</tt>: lower-case letter.
1.19 ! cvs 6961: </li>
1.18 cvs 6962: </ul>
1.19 ! cvs 6963: </li>
1.18 cvs 6964: <li>
6965: The function <tt>FileDir</tt>, without parameter, returns a string
1.2 cvs 6966: representing the name of the directory of the output file that has been given
6967: as a parameter to the translation program. The string includes a character '/'
6968: at the end.
1.19 ! cvs 6969: </li>
1.18 cvs 6970: <li>
6971: The function <tt>FileName</tt>, without parameter, returns a string
1.2 cvs 6972: representing the name of the output file that has been given as a parameter to
6973: the translation program. The file extension (the character string that
6974: terminate the file name, after a dot) is not part of that string.
1.19 ! cvs 6975: </li>
1.18 cvs 6976: <li>
6977: The function <tt>Extension</tt>, without parameter, returns a string
1.2 cvs 6978: representing the extension of the file name. That string is empty if the file
6979: name that has been given as a parameter to the translation program has no
6980: extension. If there is an extension, its first character is a dot.
1.19 ! cvs 6981: </li>
1.18 cvs 6982: <li>
6983: The function <tt>DocumentName</tt>, without parameter, returns a string
1.2 cvs 6984: representing the name of the document being translated.
1.19 ! cvs 6985: </li>
1.18 cvs 6986: <li>
6987: The function <tt>DocumentDir</tt>, without parameter, returns a string
1.2 cvs 6988: representing the directory containing the document being translated.
1.19 ! cvs 6989: </li>
1.18 cvs 6990: <li>
6991: The function formed by the name of a constant returns that constant's value.
1.19 ! cvs 6992: </li>
1.18 cvs 6993: <li>
6994: The function formed by a character string between apostrophes returns that
1.1 cvs 6995: string.
1.19 ! cvs 6996: </li>
1.18 cvs 6997: <li>
6998: The function formed by the name of a buffer returns the contents of that
1.2 cvs 6999: buffer. If the named buffer is the picture buffer, then the name of the last
7000: picture encountered is returned. Otherwise, the buffer is a read buffer and
7001: the value returned is text previously read from the terminal. If the buffer
1.18 cvs 7002: is empty (no picture has been encountered or the <tt>Read</tt> rule has not
1.2 cvs 7003: been executed for the buffer), then the empty string is returned.
1.19 ! cvs 7004: </li>
1.18 cvs 7005: <li>
7006: The function formed by an attribute name takes the value of the indicated
1.2 cvs 7007: attribute for the element to which the variable applies. If the element does
7008: not have that attribute, then the element's ancestor are searched toward the
7009: root of the tree. If one of the ancestors does have the attribute then its
7010: value is used. If no ancestors have the attribute, then the value of the
1.1 cvs 7011: function is the empty string.
1.19 ! cvs 7012: </li>
1.18 cvs 7013: </ul>
7014: <pre> VariableSeq = Variable < Variable > .
1.1 cvs 7015: Variable = VarID ':' Function < Function > ';' .
7016: VarID = NAME .
7017: Function ='Value' '(' CounterID [ ':' Length ]
7018: [ ',' CounterStyle ] ')' /
7019: 'FileDir' / 'FileName' / 'Extension' /
7020: 'DocumentName' / 'DocumentDir' /
7021: ConstID / CharString /
7022: BufferID / AttrID .
7023: Length = NUMBER .
7024: CounterStyle= 'Arabic' / 'LRoman' / 'URoman' /
7025: 'Uppercase' / 'Lowercase' .
1.18 cvs 7026: CharString = STRING .</pre>
7027: <blockquote class="example">
7028: <p>
7029: <strong>Example:</strong></p>
7030: <p>
1.3 cvs 7031: To create, at the beginning of each section of the translated document, text
7032: composed of the string ``Section'' followed by the section number, the
1.18 cvs 7033: following <a name="varsectexample">variable definition</a> might be used:</p>
7034: <pre>VAR
7035: SectionVar : 'Section' Value(SectionNumber);</pre>
7036: <p>
7037: (see the definition of <a href="#sectnum"><tt>SectionNumber</tt></a>).</p>
7038: <p>
1.1 cvs 7039: The following variable definition can be used to create, at the beginning of
7040: each section, the text ``Level'' followed by the hierarchical level of the
1.18 cvs 7041: section. It used the constant defined above.</p>
7042: <pre> LevelVar : TxtLevel Value(SectionLevel);</pre>
7043: <p>
7044: (see the definitions of <a href="#sectnum"><tt>SectionLevel</tt></a> and of <a
7045: href="#levelexample"><tt>TxtLevel</tt></a>).</p>
7046: <p>
7047: To generate the translation of each section in a different file (see <a
7048: href="#sectc5220">rule <tt>ChangeMainFile</tt></a>), the name of these files
7049: might be defined by the following variable:</p>
7050: <pre> VarOutpuFile : FileName Value(SectionNumber)
7051: Extension;</pre>
7052: <p>
7053: If <tt>output.txt</tt> is the name of the <a name="varoutputfile">output
7054: file</a> specified when starting the translation program, translated sections
7055: are written in files <tt>output1.txt</tt>, <tt>output2.txt</tt>, etc.</p>
7056: </blockquote>
7057: </div>
7058:
7059: <div class="subsection">
7060:
7061: <h3><a name="sectc527">Translating structure elements</a></h3>
7062: <p>
7063: The <tt>RULES</tt> keyword introduces the translation rules which will be
1.1 cvs 7064: applied to the various structured element types. Translation rules can be
7065: specified for each element type defined in the structure schema, including the
1.18 cvs 7066: base types defined implicitly, whose names are <tt>TEXT_UNIT</tt>,
7067: <tt>PICTURE_UNIT</tt>, <tt>SYMBOL_UNIT</tt>, <tt>GRAPHIC_UNIT</tt> and
7068: <tt>PAGE_UNIT</tt>. But it is not necessary to specify rules for every
7069: defined type.</p>
7070: <p>
1.1 cvs 7071: If there are no translation rules for an element type, the elements that it
7072: contains (and which may have rules themselves) will still be translated, but
7073: the translator will produce nothing for the element itself. To make the
1.18 cvs 7074: translator completely ignore the content of an element the <a
7075: href="#sectc5217"><tt>Remove</tt> rule</a> must be used.</p>
7076: <p>
1.1 cvs 7077: The translation rules for an element type defined in the structure schema are
7078: written using the name of the type followed by a colon and the list of
1.18 cvs 7079: applicable rules. When the element type is a <a href="#sectd3285">mark
7080: pair</a>, but only in this case, the type name must be preceded by the
7081: <tt>First</tt> or <tt>Second</tt> keyword. This keyword indicates whether the
7082: rules that follow apply to the first or second mark of the pair.</p>
7083: <p>
1.1 cvs 7084: The list of rules can take several forms. It may be a simple non-conditional
7085: rule. It can also be formed by a condition followed by one or more simple
1.18 cvs 7086: rules. Or it can be a block of rules beginning with the <tt>BEGIN</tt>
7087: keyword and ending with the <tt>END</tt> keyword and a semicolon. This block
1.1 cvs 7088: of rules can contain one or more simple rules and/or one or more conditions,
1.18 cvs 7089: each followed by one or more simple rules.</p>
7090: <pre> ElemSeq = TransType < TransType > .
1.1 cvs 7091: TransType = [ FirstSec ] ElemID ':' RuleSeq .
7092: FirstSec = 'First' / 'Second' .
7093: RuleSeq = Rule / 'BEGIN' < Rule > 'END' ';' .
7094: Rule = SimpleRule / ConditionBlock .
7095: ConditionBlock = 'IF' ConditionSeq SimpleRuleSeq .
7096: SimpleRuleSeq = 'BEGIN' < SimpleRule > 'END' ';' /
1.18 cvs 7097: SimpleRule .</pre>
7098: </div>
1.1 cvs 7099:
1.18 cvs 7100: <div class="subsection">
1.1 cvs 7101:
1.18 cvs 7102: <h3><a name="sectc528">Conditional rules</a></h3>
7103: <p>
1.1 cvs 7104: In a translation schema, the translation rules are either associated with
7105: element types or with attribute values or with a specific presentation. They
7106: are applied by the translator each time an element of the corresponding type
7107: is encountered in the translated document or each time the attribute value is
7108: carried by an element or also, each time the specific translation is attached
7109: to an element. This systematic application of the rules can be relaxed: it is
7110: possible to add a condition to one or more rules, so that these rules are only
1.18 cvs 7111: applied when the condition is true.</p>
7112: <p>
7113: A condition begins with the keyword <tt>IF</tt>, followed by a sequence of
1.1 cvs 7114: elementary conditions. Elementary conditions are separated from each other by
1.18 cvs 7115: the <tt>AND</tt> keyword. If there is only one elementary condition, this
1.1 cvs 7116: keyword is absent. The rules are only applied if all the elementary
7117: conditions are true. The elementary condition can be negative; it is then
1.18 cvs 7118: preceded by the <tt>NOT</tt> keyword.</p>
7119: <p>
1.1 cvs 7120: When the translation rule(s) controlled by the condition apply to a reference
7121: element or a reference attribute, an elementary condition can also apply to
1.18 cvs 7122: element referred by this reference. The <tt>Target</tt> keyword is used for
1.1 cvs 7123: that purpose. It must appear before the keyword defining the condition
1.18 cvs 7124: type.</p>
7125: <p>
1.1 cvs 7126: Depending on their type, some conditions may apply either to the element with
1.5 cvs 7127: which they are associated, or to one of its ancestor. In the case of an
1.18 cvs 7128: ancestor, the key word <tt>Ancestor</tt> must be used, followed by</p>
7129: <ul>
7130: <li>
7131: either an integer which represents the number of levels in the tree between
7132: the element and the ancestor of interest,
1.19 ! cvs 7133: </li>
1.18 cvs 7134: <li>
7135: or the type name of the ancestor of interest. If that type is defined in a
7136: separate structure schema, the name of that schema must follow between
1.1 cvs 7137: parentheses.
1.19 ! cvs 7138: </li>
1.18 cvs 7139: </ul>
7140: <p>
1.2 cvs 7141: There is a special case for the parent element, which can be simply written
1.18 cvs 7142: <tt>Parent</tt> instead of <tt>Ancestor 1</tt>.</p>
7143: <p>
7144: Only conditions <tt>First</tt>, <tt>Last</tt>, <tt>Referred</tt>,
7145: <tt>Within</tt>, <tt>Attributes</tt>, <tt>Presentation</tt>, <tt>Comment</tt>
1.1 cvs 7146: and those concerning an attribute or a specific presentation can apply to an
1.18 cvs 7147: ancestor. Conditions <tt>Defined</tt>, <tt>FirstRef</tt>, <tt>LastRef</tt>,
7148: <tt>ExternalRef</tt>, <tt>Alphabet</tt>, <tt>FirstAttr</tt>,
7149: <tt>LastAttr</tt>, <tt>ComputedPage</tt>, <tt>StartPage</tt>,
7150: <tt>UserPage</tt>, <tt>ReminderPage</tt>, <tt>Empty</tt> cannot be preceded by
7151: keywords <tt>Parent</tt> or <tt>Ancestor</tt>.</p>
7152: <p>
7153: In condition <tt>Referred</tt> and in the condition that applies to a named
7154: attribute, a symbol '<tt>*</tt>' can indicate that the condition is related
1.5 cvs 7155: only to the element itself. If this symbol is not present, not only the
1.18 cvs 7156: element is considered, but also its ancestor, at any level.</p>
7157: <p>
1.1 cvs 7158: The form of an elementary condition varies according to the type of
1.18 cvs 7159: condition.</p>
1.1 cvs 7160:
1.18 cvs 7161: <div class="subsubsection">
1.1 cvs 7162:
1.18 cvs 7163: <h4><a name="sectd5281">Conditions based on the logical position of the
7164: element</a></h4>
7165: <p>
1.1 cvs 7166: The condition can be on the position of the element in the document's logical
7167: structure tree. It is possible to test whether the element is the first
1.18 cvs 7168: (<tt>First</tt>) or last (<tt>Last</tt>) among its siblings or if it is not
7169: the first (<tt>NOT First</tt>) or not the last (<tt>NOT Last</tt>).</p>
7170: <p>
1.1 cvs 7171: It is also possible to test if the element is contained in an element of a
1.18 cvs 7172: given type (<tt>Within</tt>) or if it is not (<tt>NOT Within</tt>). If that
1.1 cvs 7173: element type is defined in a structure schema which is not the one which
7174: corresponds to the translation schema, the type name of this element must be
7175: followed, between parentheses, by the name of the structure schema which
1.18 cvs 7176: defines it.</p>
7177: <p>
7178: If the keyword <tt>Within</tt> is preceded by <tt>Immediately</tt>, the
7179: condition is satisfied only if the <em>parent</em> element has the type
7180: indicated. If the word <tt>Immediately</tt> is missing, the condition is
7181: satisfied if any <em>ancestor</em> has the type indicated.</p>
7182: <p>
7183: An integer <i>n</i> can appear between the keyword <tt>Within</tt> and the
1.1 cvs 7184: type. It specifies the number of ancestors of the indicated type that must be
7185: present for the condition to be satisfied. If the keyword
1.18 cvs 7186: <tt>Immediately</tt> is also present, the <i>n</i> immediate ancestors of the
7187: element must have the indicated type. The integer <i>n</i> must be positive
7188: or zero. It can be preceded by <tt><</tt> or <tt>></tt> to indicate a
1.1 cvs 7189: maximum or minimum number of ancestors. If these symbols are missing, the
1.18 cvs 7190: condition is satisfied only if it exists exactly <i>n</i> ancestors. When
7191: this number is missing, it is equivalent to > 0.</p>
7192: <p>
1.11 cvs 7193: If the condition applies to translation rules associated with an attribute,
1.18 cvs 7194: i.e. if it is in the <tt>ATTRIBUTES</tt> section of the presentation schema,
1.11 cvs 7195: the condition can be simply an element name. Translation rules are then
1.18 cvs 7196: executed only if the attribute is attached to an element of that type. The
7197: keyword <tt>NOT</tt> before the element name indicates that the translation
7198: rules must be executed only if the element is not of the type indicated.</p>
7199: </div>
1.1 cvs 7200:
1.18 cvs 7201: <div class="subsubsection">
1.1 cvs 7202:
1.18 cvs 7203: <h4><a name="sectd5282">Conditions on references</a></h4>
7204: <p>
1.1 cvs 7205: References may be taken into account in conditions, which can be based on the
1.18 cvs 7206: fact that the element, or one of its ancestors (unless symbol <tt>*</tt> is
7207: present), is designated by a at least one reference (<tt>Referred</tt>) or by
7208: none (<tt>NOT Referred</tt>). If the element or attribute to which the
1.1 cvs 7209: condition is attached is a reference, the condition can be based on the fact
7210: that it acts as the first reference to the designated element
1.18 cvs 7211: (<tt>FirstRef</tt>), or as the last (<tt>LastRef</tt>), or as a reference to
7212: an element located in another document (<tt>ExternalRef</tt>). Like all
7213: conditions, conditions on references can be inverted by the <tt>NOT</tt>
7214: keyword.</p>
7215: </div>
7216:
7217: <div class="subsubsection">
7218:
7219: <h4><a name="sectd5283">Conditions on the parameters</a></h4>
7220: <p>
7221: Elements which are <a href="#sectc326">parameters</a> can be given a
7222: particular condition which is based on whether or not the parameter is given a
7223: value in the document (<tt>Defined</tt> or <tt>NOT Defined</tt>,
7224: respectively).</p>
7225: </div>
1.1 cvs 7226:
1.18 cvs 7227: <div class="subsubsection">
1.1 cvs 7228:
1.18 cvs 7229: <h4><a name="sectd5284">Conditions on the alphabets</a></h4>
7230: <p>
1.1 cvs 7231: The character string base type (and only this type) can use the condition
1.18 cvs 7232: <tt>Alphabet = a</tt> which indicates that the translation rule(s) should only
1.1 cvs 7233: apply if the alphabet of the character string is the one whose name appears
1.18 cvs 7234: after the equals sign (or is not, if there is a preceding <tt>NOT</tt>
1.1 cvs 7235: keyword). This condition cannot be applied to translation rules of an
1.18 cvs 7236: attribute.</p>
7237: <p>
1.1 cvs 7238: In the current implementation of Thot, the available alphabets are the
1.18 cvs 7239: <tt>Latin</tt> alphabet and the <tt>Greek</tt> alphabet.</p>
7240: </div>
1.1 cvs 7241:
1.18 cvs 7242: <div class="subsubsection">
1.1 cvs 7243:
1.18 cvs 7244: <h4><a name="sectd5285">Conditions on page breaks</a></h4>
7245: <p>
1.1 cvs 7246: The page break base type (and only this type) can use the following
1.18 cvs 7247: conditions: <tt>ComputedPage</tt>, <tt>StartPage</tt>, <tt>UserPage</tt>, and
7248: <tt>ReminderPage</tt>. The <tt>ComputedPage</tt> condition indicates that the
1.1 cvs 7249: translation rule(s) should apply if the page break was created automatically
1.18 cvs 7250: by Thot; the <tt>StartPage</tt> condition is true if the page break is
7251: generated before the element by the <tt>Page</tt> rule of the P language; the
7252: <tt>UserPage</tt> condition applies if the page break was inserted by the
7253: user; and the <tt>ReminderPage</tt> is applied if the page break is a reminder
7254: of page breaking.</p>
7255: </div>
1.1 cvs 7256:
1.18 cvs 7257: <div class="subsubsection">
1.1 cvs 7258:
1.18 cvs 7259: <h4><a name="sectd5286">Conditions on the element's content</a></h4>
7260: <p>
1.1 cvs 7261: The condition can be based on whether or not the element is empty. An element
7262: which has no children or whose leaves are all empty is considered to be empty
1.18 cvs 7263: itself. This condition is expressed by the <tt>Empty</tt> keyword, optionally
7264: preceded by the <tt>NOT</tt> keyword.</p>
7265: </div>
1.1 cvs 7266:
1.18 cvs 7267: <div class="subsubsection">
1.1 cvs 7268:
1.18 cvs 7269: <h4><a name="sectd5287">Conditions on the presence of comments</a></h4>
7270: <p>
1.1 cvs 7271: The condition can be based on the presence or absence of comments associated
7272: with the translated element. This condition is expressed by the keyword
1.18 cvs 7273: <tt>Comment</tt>, optionally preceded by the keyword <tt>NOT</tt>.</p>
7274: </div>
1.1 cvs 7275:
1.18 cvs 7276: <div class="subsubsection">
1.1 cvs 7277:
1.18 cvs 7278: <h4><a name="sectd5288">Conditions on the presence of specific presentation
7279: rules</a></h4>
7280: <p>
1.1 cvs 7281: The condition can be based on the presence or absence of specific presentation
7282: rules associated with the translated element, whatever the rules, their value
7283: or their number. This condition is expressed by the keyword
1.18 cvs 7284: <tt>Presentation</tt>, optionally preceded by the <tt>NOT</tt> keyword.</p>
7285: </div>
1.1 cvs 7286:
1.18 cvs 7287: <div class="subsubsection">
1.1 cvs 7288:
1.18 cvs 7289: <h4><a name="sectd5289">Conditions on the presence of logical
7290: attributes</a></h4>
7291: <p>
1.1 cvs 7292: In the same way, the condition can be based on the presence or absence of
7293: attributes associated with the translated elements, no matter what the
1.18 cvs 7294: attributes or their values. The <tt>Attributes</tt> keyword expresses this
7295: condition.</p>
7296: </div>
1.1 cvs 7297:
1.18 cvs 7298: <div class="subsubsection">
1.1 cvs 7299:
1.18 cvs 7300: <h4><a name="sectd52810">Conditions on logical attributes</a></h4>
7301: <p>
1.1 cvs 7302: If the condition appears in the translation rules of an attribute, the
1.18 cvs 7303: <tt>FirstAttr</tt> and <tt>LastAttr</tt> keywords can be used to indicate that
1.1 cvs 7304: the rules must only be applied if this attribute is the first attribute for
7305: the translated element or if it is the last (respectively). These conditions
1.18 cvs 7306: can also be inverted by the <tt>NOT</tt> keyword.</p>
7307: <p>
1.1 cvs 7308: Another type of condition can only be applied to the translation rules when
1.18 cvs 7309: the element being processed (or one of its ancestors if symbol <tt>*</tt> is
1.1 cvs 7310: missing) has a certain attribute, perhaps with a certain value or, in
7311: contrast, when the element does not have this attribute with this value. The
7312: condition is specified by writing the name of the attribute after the keyword
1.18 cvs 7313: <tt>IF</tt> or <tt>AND</tt>. The <tt>NOT</tt> keyword can be used to invert
1.1 cvs 7314: the condition. If the translation rules must be applied to any element which
7315: has this attribute (or does not have it, if the condition is inverted) no
7316: matter what the attribute's value, the condition is complete. If, in
7317: contrast, the condition applies to one or more values of the attribute, these
7318: are indicated after the name of the attribute, except for reference attributes
1.18 cvs 7319: which do not have values.</p>
7320: <p>
7321: The representation of the values of an <a name="relattr">attribute</a> in a
1.1 cvs 7322: condition depends on the attribute's type. For attributes with enumerated or
7323: textual types, the value (a name or character string between apostrophes,
7324: respectively) is simply preceded by an equals sign. For numeric attributes,
7325: the condition can be based on a single value or on a range of values. In the
7326: case of a unique value, this value (an integer) is simply preceded by an
1.18 cvs 7327: equals sign. Conditions based on ranges of values have several forms:</p>
7328: <ul>
7329: <li>
7330: all values less than a given value (the value is preceded by a ``less than''
7331: sign).
1.19 ! cvs 7332: </li>
1.18 cvs 7333: <li>
7334: all values greater than a given value (the value is preceded by a ``greater
1.1 cvs 7335: than'' sign).
1.19 ! cvs 7336: </li>
1.18 cvs 7337: <li>
7338: all values falling in an interval, bounds included. The range of values is
7339: then specified <tt>IN [</tt>Minimum <tt>..</tt>Maximum<tt>]</tt>, where
1.2 cvs 7340: Minimum and Maximum are integers.
1.19 ! cvs 7341: </li>
1.18 cvs 7342: </ul>
7343: <p>
1.2 cvs 7344: All numeric values may be negative. The integer is simply preceded by a minus
1.18 cvs 7345: sign.</p>
7346: <p>
7347: Both local and global attributes can be used in conditions.</p>
7348: </div>
1.1 cvs 7349:
1.18 cvs 7350: <div class="subsubsection">
1.1 cvs 7351:
1.18 cvs 7352: <h4><a name="sectd52811">Conditions on specific presentation rules</a></h4>
7353: <p>
1.1 cvs 7354: It is possible to apply translation rules only when the element being
7355: processed has or does not have a specific presentation rule, possibly with a
7356: certain value. The condition is specified by writing the name of the
1.18 cvs 7357: presentation rule after the keyword <tt>IF</tt> or <tt>AND</tt>. The
7358: <tt>NOT</tt> keyword can be used to invert the condition. If the translation
1.1 cvs 7359: rules must be applied to any element which has this presentation rule (or does
7360: not have it, if the condition is inverted) no matter what the rule's value,
7361: the condition is complete. If, in contrast, the condition applies to one or
7362: more values of the rule, these are indicated after the name of the
1.18 cvs 7363: attribute.</p>
7364: <p>
1.1 cvs 7365: The representation of presentation rule values in a condition is similar to
7366: that for attribute values. The representation of these values depend on the
7367: type of the presentation rule. There are three categories of presentation
1.18 cvs 7368: rules:</p>
7369: <ul>
7370: <li>
7371: those taking numeric values (<tt>Size, Indent, LineSpacing, LineWeight</tt>),
1.19 ! cvs 7372: </li>
1.18 cvs 7373: <li>
7374: those with values taken from a predefined list (<tt>Adjust, Justify,
7375: Hyphenate, Style, Font, UnderLine, Thickness, LineStyle</tt>),
1.19 ! cvs 7376: </li>
1.18 cvs 7377: <li>
7378: those whose value is a name (<tt>FillPattern, Background, Foreground</tt>).
1.19 ! cvs 7379: </li>
1.18 cvs 7380: </ul>
7381: <p>
1.1 cvs 7382: For presentation rules which take numeric values, the condition can take a
7383: unique value or a range of values. In the case of a unique value, this value
7384: (an integer) is simply preceded by an equals sign. Conditions based on ranges
1.18 cvs 7385: of values have several forms:</p>
7386: <ul>
7387: <li>
7388: all values less than a given value (the value is preceded by a ``less than''
7389: sign).
1.19 ! cvs 7390: </li>
1.18 cvs 7391: <li>
7392: all values greater than a given value (the value is preceded by a ``greater
1.1 cvs 7393: than'' sign).
1.19 ! cvs 7394: </li>
1.18 cvs 7395: <li>
7396: all values falling in an interval, bounds included. The range of values is
7397: then specified <tt>IN [</tt>Minimum <tt>..</tt>Maximum<tt>]</tt>, where
1.2 cvs 7398: Minimum and Maximum are integers.
1.19 ! cvs 7399: </li>
1.18 cvs 7400: </ul>
7401: <p>
7402: Values for the <tt>Indent</tt>rule may be negative. The integer is then
1.2 cvs 7403: simply preceded by a minus sign and represents how far the first line starts
1.18 cvs 7404: to the left of the other lines.</p>
7405: <p>
1.1 cvs 7406: For presentation rules whose values are taken from predefined lists, the value
7407: which satisfies the condition is indicated by an equals sign followed by the
1.18 cvs 7408: name of the value.</p>
7409: <p>
1.1 cvs 7410: For presentation rule whose values are names, the value which satisfies the
7411: condition is indicated by the equals sign followed by the value's name. The
1.18 cvs 7412: names of fill patterns (the <tt>FillPattern</tt> rule) and of colors (the
7413: <tt>Foreground</tt> and <tt>Background</tt> rules) known to Thot are the same
7414: as in the P language.</p>
7415: <p>
1.1 cvs 7416: The syntax of conditions based on the specific presentation is the same as the
1.18 cvs 7417: syntax used to express the <a href="#sectc5224">translation of specific
7418: presentation rules</a>.</p>
7419: <p>
1.1 cvs 7420: When a condition has only one rule, the condition is simply followed by that
7421: rule. If it has several rules, they are placed after the condition between
1.18 cvs 7422: the keywords <tt>BEGIN</tt> and <tt>END</tt>.</p>
7423: <pre> ConditionSeq = Condition [ 'AND' Condition ] .
1.1 cvs 7424: Condition = [ 'NOT' ] [ 'Target' ] Cond .
7425: Cond = CondElem / CondAscend .
7426: CondElem ='FirstRef' / 'LastRef' /
7427: 'ExternalRef' /
7428: 'Defined' /
7429: 'Alphabet' '=' Alphabet /
7430: 'ComputedPage' / 'StartPage' /
7431: 'UserPage' / 'ReminderPage' /
7432: 'Empty' /
1.11 cvs 7433: ElemID /
1.1 cvs 7434: 'FirstAttr' / 'LastAttr' .
7435: CondAscend = [ Ascend ] CondOnAscend .
7436: Ascend = '*' / 'Parent' / 'Ancestor' LevelOrType .
7437: LevelOrType = CondRelLevel / ElemID [ ExtStruct ] .
7438: CondRelLevel = NUMBER .
7439: CondOnAscend ='First' / 'Last' /
7440: 'Referred' /
7441: [ 'Immediately' ] 'Within' [ NumParent ]
7442: ElemID [ ExtStruct ] /
7443: 'Attributes' /
7444: AttrID [ RelatAttr ] /
7445: 'Presentation' /
7446: PresRule /
7447: 'Comment' .
7448: NumParent = [ GreaterLess ] NParent .
7449: GreaterLess = '>' / '<' .
7450: NParent = NUMBER.
7451: ExtStruct = '(' ElemID ')' .
7452: Alphabet = NAME .
7453: RelatAttr ='=' Value /
7454: '>' [ '-' ] Minimum /
7455: '<' [ '-' ] Maximum /
7456: 'IN' '[' [ '-' ] MinInterval '..'
7457: [ '-' ] MaxInterval ']' .
7458: Value = [ '-' ] IntegerVal / TextVal / AttrValue .
7459: Minimum = NUMBER .
7460: Maximum = NUMBER .
7461: MinInterval = NUMBER .
7462: MaxInterval = NUMBER .
7463: IntegerVal = NUMBER .
7464: TextVal = STRING .
1.18 cvs 7465: AttrValue = NAME .</pre>
7466: <blockquote class="example">
7467: <p>
7468: <strong>Example:</strong></p>
7469: <p>
1.3 cvs 7470: Suppose that after each element of type Section_Title it is useful to produce
1.18 cvs 7471: the text <tt>\label{SectX}</tt> where <tt>X</tt> represents the section
7472: number, but only if the section is designated by one or more references in the
7473: document. The following conditional rule produces this effect:</p>
7474: <pre>RULES
1.1 cvs 7475: Section_Title :
7476: IF Referred
1.18 cvs 7477: Create ('\label{Sect' Value(UniqueSectNum) '}\12') After;</pre>
7478: <p>
7479: (the declaration of the <a href="#sectc5224"><tt>UniqueSectNum</tt>
7480: counter</a> is given above). The string <tt>\12</tt> represents a line
7481: break.</p>
7482: </blockquote>
7483: <blockquote class="example">
7484: <p>
7485: <strong>Example:</strong></p>
7486: <p>
1.3 cvs 7487: Suppose that for elements of the Elmnt type it would be useful to produce a
7488: character indicating the value of the numeric attribute Level associated with
7489: the element: an ``A'' for all values of Level less than 3, a ``B'' for values
7490: between 3 and 10 and a ``C'' for values greater than 10. This can be achieved
1.18 cvs 7491: by writing the following rules for the Elmnt type:</p>
7492: <pre>RULES
1.1 cvs 7493: Elmnt :
7494: BEGIN
7495: IF Level < 3
7496: Create 'A';
7497: IF Level IN [3..10]
7498: Create 'B';
7499: IF Level > 10
7500: Create 'C';
1.18 cvs 7501: END;</pre>
7502: </blockquote>
7503: </div>
7504: </div>
1.1 cvs 7505:
1.18 cvs 7506: <div class="subsection">
1.1 cvs 7507:
1.18 cvs 7508: <h3><a name="sectc529">Translation rules</a></h3>
7509: <p>
1.14 cvs 7510: Fifteen types of translation rules can be associated with element types and
1.18 cvs 7511: attribute values. They are the <tt>Create</tt>, <tt>Write</tt>,
7512: <tt>Read</tt>, <tt>Include</tt>, <tt>Get</tt>, <tt>Copy</tt>, <tt>Use</tt>,
7513: <tt>Remove</tt>, <tt>NoTranslation</tt>, <tt>NoLineBreak</tt>,
7514: <tt>ChangeMainFile</tt>, <tt>RemoveFile</tt>, <tt>Set</tt>, <tt>Add</tt>,
7515: <tt>Indent</tt>, rules. Each rule has its own syntax, although they are all
7516: based on very similar models.</p>
7517: <pre> SimpleRule = 'Create' [ 'IN' VarID ] Object
1.1 cvs 7518: [ Position ] ';' /
7519: 'Write' Object [ Position ] ';' /
7520: 'Read' BufferID [ Position ] ';' /
7521: 'Include' File [ Position ] ';' /
7522: 'Get' [ RelPosition ] ElemID
7523: [ ExtStruct ]
7524: [ Position ] ';' /
7525: 'Copy' [ RelPosition ] ElemID
7526: [ ExtStruct ]
7527: [ Position ] ';' /
7528: 'Use' TrSchema [ 'For' ElemID ] ';' /
7529: 'Remove' ';' /
7530: 'NoTranslation' ';' /
7531: 'NoLineBreak' ';' /
7532: 'ChangeMainFile' VarID [ Position ] ';' /
1.14 cvs 7533: 'RemoveFile' VarID [ Position ] ';' /
1.10 cvs 7534: 'Set' CounterID InitValue [ Position ] ';' /
7535: 'Add' CounterID Increment [ Position ] ';' /
7536: 'Indent' [ 'IN' VarID ] [ IndentSign ]
1.18 cvs 7537: IndentValue [ Position ] ';' .</pre>
7538: </div>
7539:
7540: <div class="subsection">
7541:
7542: <h3><a name="sectc5210">The <tt>Create</tt> rule</a></h3>
7543: <p>
7544: The most frequently used rule is undoubtedly the <tt>Create</tt> rule, which
7545: generates fixed or variable text (called an <em>object</em>) in the output
1.1 cvs 7546: file. The generated text can be made to appear either before or after the
7547: content of the element to which the rule applies. The rule begins with the
1.18 cvs 7548: <tt>Create</tt> keyword, followed by a specifier for the object and a keyword
7549: (<tt>Before</tt> or <tt>After</tt>) indicating the position of the generated
7550: text (<a href="#sectc5222">before or after</a> the element's content). If the
1.1 cvs 7551: position is not indicated, the object will be generated before the element's
7552: content. This rule, like all translation rules, is terminated by a
1.18 cvs 7553: semicolon.</p>
7554: <p>
7555: The <tt>Create</tt> keyword can be followed by the <tt>IN</tt> keyword and by
1.1 cvs 7556: the name of a variable. This means that the text generated by the rule must
7557: not be written in the main output file, but in the file whose name is
1.18 cvs 7558: specified by the variable.</p>
7559: <p>
1.1 cvs 7560: This allows the translation program to generate text in different files during
1.14 cvs 7561: the same run. These files do not need to be explicitely declared or opened.
1.18 cvs 7562: They do not need to be closed either, but if they contain temporary data, they
7563: can be removed (see the <a href="#sectc5220a"><tt>RemoveFile</tt> rule</a>).
7564: As soon as the translation program executes a <tt>Create</tt> rule for a file
7565: that is not yet open, it opens the file. These files are closed when the
7566: translation is finished.</p>
7567: <pre> 'Create' [ 'IN' VarID ] Object
1.1 cvs 7568: [ Position ] ';'
7569: Object = ConstID / CharString /
7570: BufferID /
7571: VarID /
7572: '(' Function < Function > ')' /
7573: AttrID /
7574: 'Value' /
7575: 'Content' /
7576: 'Comment' /
7577: 'Attributes' /
7578: 'Presentation' /
7579: 'RefId' /
7580: 'PairId' /
7581: 'FileDir' /
7582: 'FileName' /
7583: 'Extension' /
7584: 'DocumentName' /
7585: 'DocumentDir' /
7586: [ 'Referred' ] ReferredObject .
7587: Position ='After' / 'Before' .
7588:
7589: ReferredObject = VarID /
7590: ElemID [ ExtStruct ] /
7591: 'RefId' /
7592: 'DocumentName' /
1.18 cvs 7593: 'DocumentDir' .</pre>
7594: <p>
7595: The object to be generated can be:</p>
7596: <ul>
7597: <li>
7598: a constant string, specified by its name if it is declared in the schema's
7599: <tt>CONST</tt> section, or given directly as a value between apostrophes;
1.19 ! cvs 7600: </li>
1.18 cvs 7601: <li>
7602: the contents of a buffer, designated by the name of the buffer;
1.19 ! cvs 7603: </li>
1.18 cvs 7604: <li>
7605: a variable, designated by its name if it is declared in the translation
7606: schema's <tt>VAR</tt> section, or given directly between parentheses. The
7607: text generated is the value of that variable evaluated for the element to
7608: which the rule applies.
1.19 ! cvs 7609: </li>
1.18 cvs 7610: <li>
7611: the value of an attribute, if the element being translated has this attribute.
7612: The attribute is specified by its name;
1.19 ! cvs 7613: </li>
1.18 cvs 7614: <li>
7615: the value of a specific presentation rule. This object can only be generated
7616: if the translation rule is for a <a href="#prestransl">specific presentation
7617: rule</a>. It is specified by the <tt>Value</tt> keyword;
1.19 ! cvs 7618: </li>
1.18 cvs 7619: <li>
7620: the element's content. That is, the content of the leaves of the subtree of
7621: the translated element. This is specified by the <tt>Content</tt> keyword;
1.19 ! cvs 7622: </li>
1.18 cvs 7623: <li>
7624: the comment attached to the element. When the element doesn't have a comment,
7625: nothing is generated. This is indicated by the <tt>Comment</tt> keyword;
1.19 ! cvs 7626: </li>
1.18 cvs 7627: <li>
7628: the translation of all attributes of the element (which is primarily used to
7629: apply the attribute translation rules <a href="#sectc5222">before</a> those of
7630: the element type). This is specified by the <tt>Attributes</tt> keyword.
1.19 ! cvs 7631: </li>
1.18 cvs 7632: <li>
7633: the translation of all of the element's specific presentation rules (which is
7634: primarily used to apply the translation rules for the specific presentation
7635: rules <a href="#sectc5222">before</a> those of the element or its attributes).
7636: This option is specified by the <tt>Presentation</tt> keyword;
1.19 ! cvs 7637: </li>
1.18 cvs 7638: <li>
7639: The value of the reference's identifier.<br>
7640: Thot associates a unique identifier with each element in a document. This
7641: identifier (called <em>reference's identifier</em> or <em>label</em>) is a
7642: character string containing the letter `L' followed by digits. Thot uses it
7643: in references for identifying the referred element.<br>
7644: The <tt>RefId</tt> keyword produces the reference's identifier of the element
7645: to which the translation rule is applied, or the reference's identifier of its
7646: first ancestor that is referred by a reference or that can be referred by a
7647: reference.
1.19 ! cvs 7648: </li>
1.18 cvs 7649: <li>
7650: the value of a mark pair's unique identifier. This may only be used for <a
7651: href="#sectd3285">mark pairs</a> and is indicated by the <tt>PairId</tt>
1.2 cvs 7652: keyword.
1.19 ! cvs 7653: </li>
1.18 cvs 7654: <li>
7655: the directory containing the file being generated (this string includes an
7656: ending '/', if it is not empty). This is indicated by the <tt>FileDir</tt>
1.2 cvs 7657: keyword.
1.19 ! cvs 7658: </li>
1.18 cvs 7659: <li>
7660: the name of the file being generated (only the name, without the directory and
7661: without the extension). This is indicated by the <tt>FileName</tt> keyword.
1.19 ! cvs 7662: </li>
1.18 cvs 7663: <li>
7664: the extension of the file being generated (this string starts with a dot, if
7665: it is not empty). This is indicated by the <tt>Extension</tt> keyword.
1.19 ! cvs 7666: </li>
1.18 cvs 7667: <li>
7668: the name of the document being translated. This is indicated by the
7669: <tt>DocumentName</tt> keyword.
1.19 ! cvs 7670: </li>
1.18 cvs 7671: <li>
7672: the directory containing the document being translated. This is indicated by
7673: the <tt>DocumentDir</tt> keyword.
1.19 ! cvs 7674: </li>
1.18 cvs 7675: </ul>
7676: <p>
1.1 cvs 7677: When the rule applies to a reference (an element or an attribute defined as a
7678: reference in the structure schema), it can generate a text related to the
7679: element referred by that reference. The rule name is then followed the
1.18 cvs 7680: <tt>Referred</tt> keyword and a specification of the object to be generated
7681: for the referred element. This specification can be:</p>
7682: <ul>
7683: <li>
7684: the name of a variable. The rule generates the value of that variable,
1.1 cvs 7685: computed for the referred element.
1.19 ! cvs 7686: </li>
1.18 cvs 7687: <li>
7688: an element type. The rule generates the translation of the element of that
7689: type, which is in the subtree of the referred element. If this element is not
7690: defined in the structure schema which corresponds to the translation schema
7691: (that is, an object defined in another schema), the element's type name must
7692: be followed by the name of its structure schema between parentheses.
1.19 ! cvs 7693: </li>
1.18 cvs 7694: <li>
7695: the <tt>RefId</tt> keyword. The rule generates the reference's identifier of
7696: the referred element.
1.19 ! cvs 7697: </li>
1.18 cvs 7698: <li>
7699: the <tt>DocumentName</tt> keyword. The rule generates the name of the
1.1 cvs 7700: document to which the referred element belongs.
1.19 ! cvs 7701: </li>
1.18 cvs 7702: <li>
7703: the <tt>DocumentDir</tt> keyword. The rule generates the name of the
1.1 cvs 7704: directory that contains the document of the referred element.
1.19 ! cvs 7705: </li>
1.18 cvs 7706: </ul>
7707: </div>
1.1 cvs 7708:
1.18 cvs 7709: <div class="subsection">
1.1 cvs 7710:
1.18 cvs 7711: <h3><a name="sectc5211">The <tt>Write</tt> rule</a></h3>
7712: <p>
7713: The <tt>Write</tt> has the same syntax as the <tt>Create</tt> rule. It also
1.1 cvs 7714: produces the same effect, but the generated text is displayed on the user's
7715: terminal during the translation of the document, instead of being produced in
7716: the translated document. This is useful for helping the user keep track of
7717: the progress of the translation and for prompting the user on the terminal for
1.18 cvs 7718: input required by the <tt>Read</tt> rule.</p>
7719: <pre> 'Write' Object [ Position ] ';'</pre>
7720: <p>
1.1 cvs 7721: Notice: if the translator is launched by the editor (by the ``Save as''
1.18 cvs 7722: command), messages produced by the <tt>Write</tt> rule are not displayed.</p>
7723: <blockquote class="example">
7724: <p>
7725: <strong>Example:</strong></p>
7726: <p>
1.3 cvs 7727: To make the translator display the number of each section being translated on
1.18 cvs 7728: the user's terminal, the following rule is specified for the <tt>Section</tt>
7729: element type:</p>
7730: <pre>Section : BEGIN
1.1 cvs 7731: Write VarSection;
7732: ...
1.18 cvs 7733: END;</pre>
7734: <p>
7735: (see <a href="#varsectexample">above</a> for the definition of the
7736: <tt>VarSection</tt> variable).</p>
7737: <p>
1.1 cvs 7738: To display text on the terminal before issuing a read operation with the
1.18 cvs 7739: <tt>Read</tt> rule, the following rule is used:</p>
7740: <pre>BEGIN
1.1 cvs 7741: Write 'Enter the name of the destination: ';
7742: ...
1.18 cvs 7743: END;</pre>
7744: </blockquote>
7745: </div>
7746:
7747: <div class="subsection">
7748:
7749: <h3><a name="sectc5212">The <tt>Read</tt> rule</a></h3>
7750: <p>
7751: The <tt>Read</tt> rule reads text from the terminal during the translation of
1.1 cvs 7752: the document and saves the text read in one of the buffers declared in the
1.18 cvs 7753: <tt>BUFFERS</tt> section of the schema. The buffer to be used is indicated by
7754: its name, after the <tt>READ</tt> keyword. This name can be followed, as in
7755: the <tt>Create</tt> and <tt>Write</tt> rules, by a keyword indicating if the
7756: read operation must be performed <tt>Before</tt> or <tt>After</tt> the
1.1 cvs 7757: translation of the element's content. If this keyword is absent, the read
7758: operation is done beforehand. The text is read into the buffer and remains
1.5 cvs 7759: there until a rule using the same buffer - possibly the same rule - is
1.18 cvs 7760: applied.</p>
7761: <pre> 'Read' BufferID [ Position ] ';'</pre>
7762: <blockquote class="example">
7763: <p>
7764: <strong>Example:</strong></p>
7765: <p>
1.3 cvs 7766: The following set of rules tells the user that the translator is waiting for
7767: the entry of some text, reads this text into a buffer and copies the text into
1.18 cvs 7768: the translated document.</p>
7769: <pre>BEGIN
1.1 cvs 7770: Write 'Enter the name of the destination: ';
7771: Read DestName;
7772: Create DestName;
7773: ...
1.18 cvs 7774: END;</pre>
7775: <p>
7776: (see <a href="#destname">above</a> the definition of <tt>DestName</tt>).</p>
7777: </blockquote>
7778: </div>
7779:
7780: <div class="subsection">
7781:
7782: <h3><a name="sectc5213">The <tt>Include</tt> rule</a></h3>
7783: <p>
7784: The <tt>Include</tt> rule, like the <tt>Create</tt> rule, is used to produce
1.1 cvs 7785: text in the translated document. It inserts constant text which is not
7786: defined in the translation schema, but is instead taken from a file. The
1.18 cvs 7787: file's name is specified after the <tt>Include</tt> keyword, either directly
1.1 cvs 7788: as a character string between apostrophes or as the name of one of the buffers
1.18 cvs 7789: declared in the <tt>BUFFERS</tt> section of the schema. In the latter case,
1.1 cvs 7790: the buffer is assumed to contain the file's name. This can be used when the
7791: included file's name is known only at the moment of translation. This only
1.18 cvs 7792: requires that the <tt>Include</tt> rule is preceded by a <tt>Read</tt> rule
7793: which puts the name of the file desired by the user into the buffer.</p>
7794: <p>
1.1 cvs 7795: Like the other rules, it is possible to specify whether the inclusion will
7796: occur before or after the element's content, with the default being before.
7797: The file inclusion is only done at the moment of translation, not during the
7798: compilation of the translation schema. Thus, the file to be included need not
7799: exist during the compilation, but it must be accessible at the time of
7800: translation. Its contents can also be modified between two translations, thus
7801: producing different results, even if neither the document or the translation
1.18 cvs 7802: schema are modified.</p>
7803: <p>
1.1 cvs 7804: During translation, the file to be included is searched for along the schema
1.18 cvs 7805: directory path (indicated by the environment variable <tt>THOTSCH</tt>). The
1.1 cvs 7806: file name is normally only composed of a simple name, without specification of
1.12 cvs 7807: a complete file path. However, if the filename starts with a '/', it is
1.18 cvs 7808: considered as an absolute path.</p>
7809: <pre> 'Include' File [ Position ] ';'
1.6 cvs 7810: File = FileName / BufferID .
1.18 cvs 7811: FileName = STRING .</pre>
7812: <blockquote class="example">
7813: <p>
7814: <strong>Example:</strong></p>
7815: <p>
1.3 cvs 7816: Suppose that it is desirable to print documents of the Article class with a
7817: formatter which requires a number of declarations and definitions at the
1.18 cvs 7818: beginning of the file. The <tt>Include</tt>rule can be used to achieve this.
1.3 cvs 7819: All the declarations and definitions a replaced in a file called
1.18 cvs 7820: <tt>DeclarArt</tt> and then the <tt>Article</tt> element type is given the
7821: following rule:</p>
7822: <pre>Article : BEGIN
1.1 cvs 7823: Include 'DeclarArt' Before;
7824: ...
1.18 cvs 7825: END;</pre>
7826: </blockquote>
7827: </div>
7828:
7829: <div class="subsection">
7830:
7831: <h3><a name="sectc5214">The <tt>Get</tt> rule</a></h3>
7832: <p>
7833: The <tt>Get</tt> rule is used to change the order in which the elements appear
1.1 cvs 7834: in the translated document. More precisely, it produces the translation of a
7835: specified element before or after the translation of the content of the
1.18 cvs 7836: element to which the rule applies. The <tt>Before</tt> and <tt>After</tt>
1.1 cvs 7837: keywords are placed at the end of the rule to specify whether the operation
7838: should be performed before or after translation of the rule's element (the
7839: default is before). The type of the element to be moved must be specified
1.18 cvs 7840: after the <tt>Get</tt> keyword, optionally preceded by a keyword indicating
7841: where the element will be found in the logical structure of the document:</p>
7842: <dl>
7843: <dt><tt>Included</tt></dt>
7844: <dd>
7845: The element to be moved is the first element of the indicated type which is
1.1 cvs 7846: found inside the element to which the rule applies.
1.18 cvs 7847: </dd>
7848: <dt><tt>Referred</tt></dt>
7849: <dd>
7850: This keyword can only be used if the rule applies to a reference element. The
7851: element to be moved is either the element designated by the reference (if that
7852: element is of the specified type), or the first element of the desired type
7853: contained within the element designated by the reference.
7854: </dd>
7855: <dt>no keyword</dt>
7856: <dd>
7857: If the element to be moved is an associated element, defined in the <a
7858: href="#sectc314"><tt>ASSOC</tt> section</a> of the structure schema, all
1.2 cvs 7859: associated elements of this type which have not been translated yet are then
7860: translated. Certain elements may in fact have already been translated by a
1.18 cvs 7861: <tt>Get Referred</tt> rule.
7862: <p>
1.1 cvs 7863: If the element to be moved is not an associated element, the translator takes
7864: the first element of the indicated type from among the siblings of the rule's
7865: element. This is primarily used to change the order of the components of an
1.18 cvs 7866: aggregate.</p>
7867: </dd>
7868: </dl>
7869: <p>
1.1 cvs 7870: If the element to be moved is defined in a structure schema which is not the
7871: one which corresponds to the translation schema (in the case of an included
7872: object with a different schema), the type name of this element must be
7873: followed, between parentheses, by the name of the structure schema which
1.18 cvs 7874: defines it.</p>
7875: <pre> 'Get' [ RelPosition ] ElemID
1.6 cvs 7876: [ ExtStruct ]
7877: [ Position ] ';' /
7878: RelPosition = 'Included' / 'Referred' .
1.18 cvs 7879: ExtStruct = '(' ElemID ')' .</pre>
7880: <p>
7881: The <tt>Get</tt> rule has no effect if the element which it is supposed to
1.1 cvs 7882: move has already been translated. Thus, the element will not be duplicated.
7883: It is generally best to associate the rule with the first element which will
7884: be encountered by the translator in its traversal of the document. Suppose an
1.18 cvs 7885: aggregate has two elements <tt>A</tt> and <tt>B</tt>, with <tt>A</tt>
1.1 cvs 7886: appearing first in the logical structure. To permute these two elements, a
1.18 cvs 7887: <tt>Get B before</tt> rule should be associated with the <tt>A</tt> element
7888: type, not the inverse. Similarly, a rule of the form <tt>Get Included X
7889: After</tt>, even though syntactically correct, makes no sense since, by the
1.1 cvs 7890: time it will be applied, after the translation of the contents of the element
1.18 cvs 7891: to which it is attached, the <tt>X</tt> element will already have been
7892: translated.</p>
7893: <p>
7894: The <tt>Get</tt> rule is the only way to obtain the translation of the
1.1 cvs 7895: associated elements. In fact, the translator only traverses the primary tree
7896: of the document and thus does not translate the associated elements, except
1.18 cvs 7897: when the translation is explicitly required by a <tt>Get Referred Type</tt> or
7898: <tt>Get Type</tt> rule where <tt>Type</tt> is an associated element type.</p>
7899: <blockquote class="example">
7900: <p>
7901: <strong>Example:</strong></p>
7902: <p>
1.3 cvs 7903: The structure schema defined figures as associated element which are composed
7904: of some content and a caption. Moreover, it is possible to make references to
1.18 cvs 7905: figures, using elements of the <tt>RefFigure</tt> type:</p>
7906: <pre> ...
1.1 cvs 7907: RefFigure = REFERENCE(Figure);
7908: ASSOC
1.6 cvs 7909: Figure = BEGIN
7910: Content = NATURE;
7911: Caption = Text;
7912: END;
1.18 cvs 7913: ...</pre>
7914: <p>
1.3 cvs 7915: Suppose it would be useful to make a figure appear in the translated document
7916: at the place in the text where the first reference to the figure is made. If
7917: some figures are not referenced, then they would appear at the end of the
7918: document. Also, each figure's caption should appear before the content. The
1.18 cvs 7919: following rules in the translation schema will produce this result:</p>
7920: <pre>Article : BEGIN
1.1 cvs 7921: ...
7922: Get Figures After;
7923: END;
7924: RefFigure : BEGIN
7925: If FirstRef Get Referred Figure;
7926: ...
7927: END;
7928: Content : BEGIN
7929: Get Caption Before;
7930: ...
1.18 cvs 7931: END;</pre>
7932: </blockquote>
7933: </div>
7934:
7935: <div class="subsection">
7936:
7937: <h3><a name="sectc5215">The <tt>Copy</tt> rule</a></h3>
7938: <p>
7939: Like the <tt>Get</tt> rule, the <tt>Copy</tt> rule generates the translation
1.1 cvs 7940: of a specified element, but it acts even if the element has already been
7941: translated and it allows to copy it or to translate it later. Both rules have
1.18 cvs 7942: the same syntax.</p>
7943: <pre> 'Copy' [ RelPosition ] ElemID
7944: [ ExtStruct ] [ Position ] ';'</pre>
7945: </div>
7946:
7947: <div class="subsection">
7948:
7949: <h3><a name="sectc5216">The <tt>Use</tt> rule</a></h3>
7950: <p>
7951: The <tt>Use</tt> rule specifies the translation schema to be applied to
1.1 cvs 7952: objects of a certain class that are part of the document. This rule only
7953: appears in the rules for the root element of the document (the first type
1.18 cvs 7954: defined after the <tt>STRUCT</tt> keyword in the structure schema) or the
1.1 cvs 7955: rules of an element defined by an external structure (by another structure
1.18 cvs 7956: schema). Also, the <tt>Use</tt> rule cannot be conditional.</p>
7957: <p>
1.1 cvs 7958: If the rule is applied to an element defined by an external structure, the
1.18 cvs 7959: <tt>Use</tt> keyword is simply followed by the name of the translation schema
1.1 cvs 7960: to be used for element constructed according to that external structure. If
7961: the rule is applied to the document's root element, it is formed by the
1.18 cvs 7962: <tt>Use</tt> keyword followed by the translation schema's name, the
7963: <tt>For</tt> keyword and the name of the external structure to which the
7964: indicated translation schema should be applied.</p>
7965: <pre> 'Use' TrSchema [ 'For' ElemID ] ';'
7966: TrSchema = NAME .</pre>
7967: <p>
7968: If no <tt>Use</tt> rule defines the translation schema to be used for an
1.1 cvs 7969: external structure which appears in a document, the translator asks the user,
7970: during the translation process, which schema should be used. Thus, it is not
1.18 cvs 7971: necessary to give the translation schema a <tt>Use</tt> rule for every
1.1 cvs 7972: external structure used, especially when the choice of translation schemas is
1.18 cvs 7973: to be left to the user.</p>
7974: <p>
1.1 cvs 7975: Notice: if the translator is launched by the editor (by the ``Save as''
1.18 cvs 7976: command), prompts are not displayed.</p>
7977: <blockquote class="example">
7978: <p>
7979: <strong>Example:</strong></p>
7980: <p>
7981: The <tt>Article</tt> structure schema uses the <tt>Formula</tt> external
7982: structure, defined by another structure schema, for mathematical formulas:</p>
7983: <pre>STRUCTURE Article;
1.1 cvs 7984: ...
7985: STRUCT
7986: Article = ...
7987: ...
7988: Formula_in_text = Formula;
7989: Isolated_formula = Formula;
7990: ...
1.18 cvs 7991: END</pre>
7992: <p>
7993: Suppose that it would be useful to use the <tt>FormulaT</tt> translation
7994: schema for the formulas of an article. This can be expressed in two different
7995: ways in the <tt>Article</tt> class translation schema, using the rules:</p>
7996: <pre>RULES
1.1 cvs 7997: Article :
1.18 cvs 7998: Use FormulaT for Formula;</pre>
7999: <p>
8000: or:</p>
8001: <pre>RULES
1.1 cvs 8002: ...
8003: Formula :
1.18 cvs 8004: Use FormulaT;</pre>
8005: </blockquote>
8006: </div>
8007:
8008: <div class="subsection">
8009:
8010: <h3><a name="sectc5217">The <tt>Remove</tt> rule</a></h3>
8011: <p>
8012: The <tt>Remove</tt> rule indicates that nothing should be generated, in the
1.1 cvs 8013: translated document, for the content of the element to which the rule applies.
8014: The content of that element is simply ignored by the translator. This does
8015: not prevent the generation of text for the element itself, using the
1.18 cvs 8016: <tt>Create</tt> or <tt>Include</tt> rules, for example.</p>
8017: <p>
8018: The <tt>Remove</tt> rule is simply written with the <tt>Remove</tt> keyword.
8019: It is terminated, like all rules, by a semicolon.</p>
8020: <pre> 'Remove' ';'</pre>
8021: </div>
8022:
8023: <div class="subsection">
8024:
8025: <h3><a name="sectc5218">The <tt>NoTranslation</tt> rule</a></h3>
8026: <p>
8027: The <tt>NoTranslation</tt> rule indicates to the translator that it must not
1.1 cvs 8028: translate the content of the leaves of the element to which it applies. In
1.18 cvs 8029: contrast to the <tt>Remove</tt> rule, it does not suppress the content of the
1.1 cvs 8030: element, but it inhibits the translation of character strings, symbols, and
8031: graphical elements contained in the element. These are retrieved so that
1.18 cvs 8032: after the translation of the document, the rules of the <a
8033: href="#sectc5225"><tt>TEXTTRANSLATE</tt>, <tt>SYMBTRANSLATE</tt> and
8034: <tt>GRAPHTRANSLATE</tt> sections</a> will not be applied to them.</p>
8035: <p>
8036: The <tt>NoTranslation</tt> rule is written with the <tt>NoTranslation</tt>
8037: keyword followed by a semicolon.</p>
8038: <pre> 'NoTranslation' ';'</pre>
8039: </div>
8040:
8041: <div class="subsection">
8042:
8043: <h3><a name="sectc5219">The <tt>NoLineBreak</tt> rule</a></h3>
8044: <p>
8045: The <tt>NoLineBreak</tt> rule indicates to the translator that it must not
1.1 cvs 8046: generate additional line breaks in the output produced for the element to
1.18 cvs 8047: which it applies. This is as if it was an <a href="#sectc522">instruction
8048: <tt>LINELENGTH 0;</tt></a> at the beginning of the translation schema, but
8049: only for the current element.</p>
8050: <p>
8051: The <tt>NoLineBreak</tt> rule is written with the <tt>NoLineBreak</tt> keyword
8052: followed by a semicolon.</p>
8053: <pre> 'NoLineBreak' ';'</pre>
8054: </div>
1.1 cvs 8055:
1.18 cvs 8056: <div class="subsection">
1.1 cvs 8057:
1.18 cvs 8058: <h3><a name="sectc5220">The <tt>ChangeMainFile</tt> rule</a></h3>
8059: <p>
1.1 cvs 8060: When the translation program starts, it opens a main output file, whose name
1.18 cvs 8061: is given as a parameter of the translator. All <a
8062: href="#sectc5210"><tt>Create</tt> rules</a> without explicit indication of the
8063: output file write sequentially in this file. When a <tt>ChangeMainFile</tt>
8064: rule is executed, the main output file is closed and it is replaced by a new
8065: one, whose name is specified in the <tt>ChangeMainFile</tt> rule. The
8066: <tt>Create</tt> rules without indication of the output file that are then
8067: executed write in this new file. Several <tt>ChangeMainFile</tt> rules can be
8068: executed during the same translation, for dividing the main output into
8069: several files.</p>
8070: <p>
8071: This rule is written with the <tt>ChangeMainFile</tt> keyword followed by the
1.14 cvs 8072: name of a variable that specifies the name of the new main file. The keyword
1.18 cvs 8073: <tt>Before</tt> or <tt>After</tt> can be placed at the end of the rule to
1.1 cvs 8074: specify whether the operation should be performed before or after translation
8075: of the rule's element (the default is before). This rule, like all translation
1.18 cvs 8076: rules, is terminated by a semicolon.</p>
8077: <pre> 'ChangeMainFile' VarID [ Position ] ';'</pre>
8078: <blockquote class="example">
8079: <p>
8080: <strong>Example:</strong></p>
8081: <p>
1.3 cvs 8082: To generate the translation of each section in a different file, the following
1.18 cvs 8083: rule can be associated with type <tt>Section</tt>. That rule uses the <a
8084: href="#varoutputfile"><tt>VarOutpuFile</tt> variable</a> defined above.</p>
8085: <pre> Section:
8086: ChangeMainFile VarOutpuFile Before;</pre>
8087: <p>
8088: If <tt>output.txt</tt> is the name of the output file specified when starting
1.3 cvs 8089: the translation program, translated sections are written in files
1.18 cvs 8090: <tt>output1.txt</tt>, <tt>output2.txt</tt>, etc.</p>
8091: </blockquote>
8092: </div>
1.1 cvs 8093:
1.18 cvs 8094: <div class="subsection">
1.14 cvs 8095:
1.18 cvs 8096: <h3><a name="sectc5220a">The <tt>RemoveFile</tt> rule</a></h3>
8097: <p>
1.14 cvs 8098: Files may be used for storing temporary data that are no longer needed when
1.18 cvs 8099: the translation of a document is complete. These files may be removed by the
8100: <tt>RemoveFile</tt> rule.</p>
8101: <p>
8102: This rule is written with the <tt>RemoveFile</tt> keyword followed by the name
8103: of a variable that specifies the name of the file to be removed. The keyword
8104: <tt>Before</tt> or <tt>After</tt> can be placed at the end of the rule to
8105: specify whether the operation should be performed before or after translation
8106: of the rule's element (the default is before). This rule, like all
8107: translation rules, is terminated by a semicolon.</p>
8108: <pre> 'RemoveFile' VarID [ Position ] ';'</pre>
8109: </div>
8110:
8111: <div class="subsection">
8112:
8113: <h3><a name="sectc5221">The <tt>Set</tt> and <tt>Add</tt> rules</a></h3>
8114: <p>
8115: The <tt>Set</tt> and <tt>Add</tt> rules are used for modifying the value of
8116: counters that have no <a href="#sectc524">counting function</a>. Only this
8117: type of counter can be used in the <tt>Set</tt> and <tt>Add</tt> rules.</p>
8118: <p>
8119: Both rules have the same syntax: after the keyword <tt>Set</tt> or
8120: <tt>Add</tt> appear the counter name and the value to assign to the counter
8121: (<tt>Set</tt> rule) or the value to be added to the counter (<tt>Add</tt>
8122: rule). The keyword <tt>Before</tt> or <tt>After</tt> can follow that value to
1.1 cvs 8123: indicate when the rule must be applied: before or after the element's content
1.18 cvs 8124: is translated. By default, <tt>Before</tt> is assumed. A semicolon terminates
8125: the rule.</p>
8126: <pre> 'Set' CounterID InitValue [ Position ] ';' /
8127: 'Add' CounterID Increment [ Position ] ';'</pre>
8128: </div>
8129:
8130: <div class="subsection">
8131:
8132: <h3><a name="sectc5221a">The <tt>Indent</tt> rule</a></h3>
8133: <p>
8134: The <tt>Indent</tt> rule is used to modify the value of text indentation in
8135: the output files.</p>
8136: <p>
8137: Each time the translator creates a new line in an output file, it generates a
8138: variable number of space characters at the beginning of the new line. By
1.10 cvs 8139: default, the number of these characters (the indentation) is 0. It can be
1.18 cvs 8140: changed with the <tt>Indent</tt> rule.</p>
8141: <p>
8142: The rule begins with the <tt>Indent</tt> keyword, followed by the indentation
8143: sign (optional) and value and a keyword <tt>Before</tt> or <tt>After</tt>
8144: indicating that the indentation should be changed <a href="#sectc5222">before
8145: or after</a> the element's content is generated. If the position is not
1.10 cvs 8146: indicated, the indentation is changed before the element's content is
8147: generated. This rule, like all translation rules, is terminated by a
1.18 cvs 8148: semicolon.</p>
8149: <p>
8150: The indentation value is indicated by an integer, which is the number of space
8151: characters to be generated at the beginning of each new line. A sign
8152: (<tt>+</tt> or <tt>-</tt>) can appear before the integer to indicate that the
8153: value is relative: the current value of indentation is incremented (if sign is
8154: <tt>+</tt>) or decremented (if sign is <tt>-</tt>) by the specified value.</p>
8155: <p>
8156: Like the <a href="#sectc5210"><tt>Create</tt> rule</a>, the <tt>Indent</tt>
8157: keyword can be followed by the <tt>IN</tt> keyword and by the name of a <a
8158: href="#sectc526">variable</a>. This means that the rule must not change
1.10 cvs 8159: indentation in the main output file, but in the file whose name is specified
8160: by the variable (by default, indentation is changed in the main output
1.18 cvs 8161: file).</p>
8162: <pre> 'Indent' [ 'IN' VarID ] [ IndentSign ]
1.10 cvs 8163: IndentValue [ Position ] ';' .
8164:
8165: IndentSign = '+' / '-' .
1.18 cvs 8166: IndentValue = NUMBER .</pre>
8167: </div>
1.10 cvs 8168:
1.18 cvs 8169: <div class="subsection">
1.1 cvs 8170:
1.18 cvs 8171: <h3><a name="sectc5222">Rule application order</a></h3>
8172: <p>
1.1 cvs 8173: The translator translates the elements which comprise the document in the
1.18 cvs 8174: order induced by the tree structure, except when the <tt>Get</tt> rule is used
1.1 cvs 8175: to change the order of translation. For each element, the translator first
8176: applies the rules specified for the element's type that must be applied before
1.18 cvs 8177: translation of the element's content (rules ending with the <tt>Before</tt>
1.1 cvs 8178: keyword or which have no position keyword). If several rules meet these
8179: criteria, the translator applies them in the order in where they appear in the
1.18 cvs 8180: translation schema.</p>
8181: <p>
8182: It then applies all <a href="#sectc5223">rules for the attributes</a> which
1.1 cvs 8183: the element has and which must be applied before the translation of the
1.18 cvs 8184: element's content (rules ending with the <tt>Before</tt> keyword or which have
1.1 cvs 8185: no position keyword). For one attribute value, the translator applies the
1.18 cvs 8186: rules in the order in which they are defined in the translation schema.</p>
8187: <p>
1.1 cvs 8188: The same procedure is followed with translation rules for specific
1.18 cvs 8189: presentations.</p>
8190: <p>
8191: Next, the element's content is translated, as long as a <tt>Remove</tt> rule
8192: does not apply.</p>
8193: <p>
1.1 cvs 8194: In the next step, the translator applies rules for the specific presentation
8195: of the element that are to be applied after translation of the content (rules
1.18 cvs 8196: which end with the <tt>After</tt> keyword). The rules for each type of
1.1 cvs 8197: presentation rule or each value are applied in the order in which the
1.18 cvs 8198: translation appear in the schema.</p>
8199: <p>
1.1 cvs 8200: Then, the same procedure is followed for translation rules for attributes of
1.18 cvs 8201: the element.</p>
8202: <p>
1.1 cvs 8203: Finally, the translator applies rules for the element which must be applied
8204: after translation of the element's content. These rules are applied in the
8205: order that they appear in the translation schema. When the translation of an
8206: element is done, the translator procedes to translate the following
1.18 cvs 8207: element.</p>
8208: <p>
8209: This order can be changed with the <tt>Attributes</tt> and
8210: <tt>Presentation</tt> options of the <a href="#sectc5210"><tt>Create</tt>
8211: rule</a>.</p>
8212: </div>
1.1 cvs 8213:
1.18 cvs 8214: <div class="subsection">
1.1 cvs 8215:
1.18 cvs 8216: <h3><a name="sectc5223">Translation of logical attributes</a></h3>
8217: <p>
1.1 cvs 8218: After the rules for the element types, the translation schema defines rules
1.18 cvs 8219: for attribute values. This section begins with the <tt>ATTRIBUTES</tt>
1.1 cvs 8220: keyword and is composed of a sequence of rule blocks each preceded by an
1.18 cvs 8221: attribute name and an optional value or value range.</p>
8222: <p>
1.1 cvs 8223: If the attribute's name appears alone before the rule block, the rule are
8224: applied to all element which have the attribute, no matter what value the
8225: attribute has. In this case, the attribute name is followed by a colon before
1.18 cvs 8226: the beginning of the rule block.</p>
8227: <p>
1.1 cvs 8228: The attribute's name can be followed by the name of an element type between
8229: parentheses. This says, as in presentation schemas, that the rule block which
8230: follows applies not to the element which has the attribute, but to its
1.18 cvs 8231: descendants of the type indicated between the parentheses.</p>
8232: <p>
1.1 cvs 8233: If values are given after the attribute name (or after the name of the element
8234: type), the rules are applied only when the attribute has the indicated values.
8235: The same attribute can appear several times, with different values and
8236: different translation rules. Attribute values are indicated in the same way
1.18 cvs 8237: as in <a href="#sectc528">conditions</a> and are followed by a colon before
8238: the block of rules.</p>
8239: <p>
1.1 cvs 8240: The rule block associated with an attribute is either a simple rule or a
1.18 cvs 8241: sequence of rules delimited by the <tt>BEGIN</tt> and <tt>END</tt> keywords.
8242: Note that rules associated with attribute values cannot be conditional.</p>
8243: <p>
1.1 cvs 8244: Translation rules are not required for all attributes (or their values)
8245: defined in a structure schema. Only those attributes for which a particular
8246: action must be performed by the translator must have such rules. The rules
1.18 cvs 8247: that can be used are those described above, from <a
8248: href="#sectc5210"><tt>Create</tt></a> to <a
8249: href="#sectc5218"><tt>NoTranslation</tt></a>.</p>
8250: <pre> AttrSeq = TransAttr < TransAttr > .
1.1 cvs 8251: TransAttr = AttrID [ '(' ElemID ')' ]
8252: [ RelatAttr ] ':' RuleSeq .
8253: AttrID = NAME .
1.18 cvs 8254: ElemID = NAME .</pre>
8255: <blockquote class="example">
8256: <p>
8257: <strong>Example:</strong></p>
8258: <p>
1.3 cvs 8259: The structure defined the ``Language'' attribute which can take the values
8260: ``French'' and ``English''. To have the French parts of the original document
8261: removed and prevent the translation of the leaves of the English parts, the
1.18 cvs 8262: following rules would be used:</p>
8263: <pre>ATTRIBUTES
1.1 cvs 8264: Language=French :
8265: Remove;
8266: Language=English :
1.18 cvs 8267: NoTranslation;</pre>
8268: </blockquote>
8269: </div>
1.1 cvs 8270:
1.18 cvs 8271: <div class="subsection">
1.1 cvs 8272:
1.18 cvs 8273: <h3><a name="sectc5224">Translation of specific presentations</a></h3>
8274: <p>
1.1 cvs 8275: After the rules for attributes, the translation schema defines rules for the
1.18 cvs 8276: specific presentation. This section begins with the <tt>PRESENTATION</tt>
1.1 cvs 8277: keyword and is composed of a sequence of translation rule blocks each preceded
8278: by a presentation rule name, optionally accompanied by a part which depends on
1.18 cvs 8279: the particular presentation rule.</p>
8280: <p>
1.1 cvs 8281: Each of these translation rule blocks is applied when the translator operates
8282: on an element which has a specific presentation rule of the type indicated at
8283: the head of the block. Depending on the type of the specific presentation
8284: rule, it is possible to specify values of the presentation rule for which the
1.18 cvs 8285: translation rule block should be applied.</p>
8286: <p>
8287: There are three categories of the presentation rules:</p>
8288: <ul>
8289: <li>
8290: rules taking numeric values: <tt>Size</tt>, <tt>Indent</tt>,
8291: <tt>LineSpacing</tt>, <tt>LineWeight</tt>,
1.19 ! cvs 8292: </li>
1.18 cvs 8293: <li>
8294: rules whose values are taken from a predefined list (i.e. whose type is an
8295: enumeration): <tt>Adjust</tt>, <tt>Justify</tt>, <tt>Hyphenate,/TT>,
8296: <tt>Style</tt>, <tt>Font</tt>, <tt>UnderLine</tt>, <tt>Thickness</tt>,
8297: <tt>LineStyle</tt>,</tt>
1.19 ! cvs 8298: </li>
1.18 cvs 8299: <li>
8300: rules whose value is a name: <tt>FillPattern</tt>, <tt>Background</tt>,
8301: <tt>Foreground</tt>.
1.19 ! cvs 8302: </li>
1.18 cvs 8303: </ul>
8304: <p>
1.1 cvs 8305: For presentation rules of the first category, the values which provoke
8306: application of the translation rules are indicated in the same manner as for
1.18 cvs 8307: <a href="#relattr">numeric attributes</a>. This can be either a unique value
1.1 cvs 8308: or range of values. For a unique value, the value (an integer) is simply
8309: preceded by an equals sign. Value ranges can be specified in one of three
1.18 cvs 8310: ways:</p>
8311: <ul>
8312: <li>
8313: all values less than a given value (this value is preceded by a ``less than''
8314: sign '<tt><</tt>'),
1.19 ! cvs 8315: </li>
1.18 cvs 8316: <li>
8317: all values greater than a given value (this value is preceded by a` `greater
8318: than'' sign '<tt>></tt>'),
1.19 ! cvs 8319: </li>
1.18 cvs 8320: <li>
8321: all values falling in an interval, bounds included. The range of values is
8322: then specified <tt>IN [</tt>Minimum<tt>..</tt>Maximum<tt>]</tt>, where Minimum
8323: and Maximum are integers.
1.19 ! cvs 8324: </li>
1.18 cvs 8325: </ul>
8326: <p>
1.2 cvs 8327: All numeric values can be negative, in which case the integer is preceded by a
1.18 cvs 8328: minus sign. All values must be given in typographers points.</p>
8329: <p>
1.1 cvs 8330: For presentation rules whose values are taken from a predefined list, the
8331: value which provokes application of the translation rules is simply indicated
1.18 cvs 8332: by the equals sign followed by the name of the value.</p>
8333: <p>
1.1 cvs 8334: For presentation rules whose values are names, the value which provokes the
8335: application of translation rules is simply indicated by the equals sign
8336: followed by the name of the value. The names of the fill patterns (the
1.18 cvs 8337: <tt>FillPattern</tt> rule) and of the colors (the <tt>Foreground</tt> and
8338: <tt>Background</tt> rules) used in Thot are the same as in the P language.</p>
8339: <pre> PresSeq = PresTrans < PresTrans > .
1.1 cvs 8340: PresTrans = PresRule ':' RuleSeq .
8341: PresRule = 'Size' [ PresRelation ] /
8342: 'Indent' [ PresRelation ] /
8343: 'LineSpacing' [ PresRelation ] /
8344: 'Adjust' [ '=' AdjustVal ] /
8345: 'Justify' [ '=' BoolVal ] /
8346: 'Hyphenate' [ '=' BoolVal ] /
8347: 'Style' [ '=' StyleVal ] /
8348: 'Font' [ '=' FontVal ] /
8349: 'UnderLine' [ '=' UnderLineVal ] /
8350: 'Thickness' [ '=' ThicknessVal ] /
8351: 'LineStyle' [ '=' LineStyleVal ] /
8352: 'LineWeight' [ PresRelation ] /
8353: 'FillPattern' [ '=' Pattern ] /
8354: 'Background' [ '=' Color ] /
8355: 'Foreground' [ '=' Color ] .
8356:
8357: PresRelation = '=' PresValue /
8358: '>' [ '-' ] PresMinimum /
8359: '<' [ '-' ] PresMaximum /
8360: 'IN' '[' [ '-' ] PresIntervalMin '..'
8361: [ '-' ] PresIntervalMax ']' .
8362: AdjustVal = 'Left' / 'Right' / 'VMiddle' /
8363: 'LeftWithDots' .
8364: BoolVal = 'Yes' / 'No' .
8365: StyleVal = 'Bold' / 'Italics' / 'Roman' /
8366: 'BoldItalics' / 'Oblique' /
8367: 'BoldOblique' .
8368: FontVal = 'Times' / 'Helvetica' / 'Courier' .
8369: UnderLineVal = 'NoUnderline' / 'UnderLined' /
8370: 'OverLined' / 'CrossedOut' .
8371: ThicknessVal = 'Thick' / 'Thin' .
1.6 cvs 8372: LineStyleVal = 'Solid' / 'Dashed' / 'Dotted' .
1.1 cvs 8373: Pattern = NAME .
8374: Color = NAME .
8375: PresMinimum = NUMBER .
8376: PresMaximum = NUMBER .
8377: PresIntervalMin= NUMBER .
8378: PresIntervalMax= NUMBER .
8379: PresValue = [ '-' ] PresVal .
1.18 cvs 8380: PresVal = NUMBER .</pre>
8381: <p>
8382: The <a name="prestransl">translation rules associated with specific
8383: presentation rules</a> can use the value of the specific presentation rule
1.1 cvs 8384: that causes them to be applied. This behavior is designated by the keyword
1.18 cvs 8385: <tt>Value</tt>. For numerically-valued presentation rules, the numeric value
1.1 cvs 8386: is produced. For other presentation rules, the name of the value is
1.18 cvs 8387: produced.</p>
8388: <p>
1.1 cvs 8389: It should be noted that modifications to the layout of the document's elements
8390: that are made using the combination of the control key and a mouse button will
1.18 cvs 8391: have no effect on the translation of the document.</p>
8392: <blockquote class="example">
8393: <p>
8394: <strong>Example:</strong></p>
8395: <p>
1.3 cvs 8396: Suppose that it is desirable to use the same font sizes as in the specific
1.18 cvs 8397: presentation, but the font size must be between 10 and 18 typographer's
8398: points. If font size is set in the translated document by the string
8399: <tt>pointsize=n</tt> where <tt>n</tt> is the font size in typographer's points
8400: then the following rules will suffice:</p>
8401: <pre>PRESENTATION
1.1 cvs 8402: Size < 10 :
8403: Create 'pointsize=10';
8404: Size in [10..18] :
8405: BEGIN
8406: Create 'pointsize=';
8407: Create Value;
8408: END;
8409: Size > 18 :
1.18 cvs 8410: Create 'pointsize=18';</pre>
8411: </blockquote>
8412: </div>
1.1 cvs 8413:
1.18 cvs 8414: <div class="subsection">
1.1 cvs 8415:
1.18 cvs 8416: <h3><a name="sectc5225">Recoding of characters, symbols and graphics</a></h3>
8417: <p>
1.1 cvs 8418: The coding of characters, graphical elements and symbols as defined in Thot
8419: does not necessarily correspond to what is required by an application to which
8420: a Thot document must be exported. Because of this the translator can recode
8421: these terminal elements of the documents structure. The last sections of a
8422: translation schema are intended for this purpose, each specifying the recoding
1.18 cvs 8423: rules for one type of terminal element.</p>
8424: <p>
1.1 cvs 8425: The recoding rules for character strings are grouped by alphabets. There is a
8426: group of rules for each alphabet of the Thot document that must be translated.
1.18 cvs 8427: Each such group of rules begins with the <tt>TEXTTRANSLATE</tt> keyword,
1.1 cvs 8428: followed by the specification of the alphabet to translate and the recoding
1.18 cvs 8429: rules, between the <tt>BEGIN</tt> and <tt>END</tt> keywords unless there is
1.1 cvs 8430: only one recoding rule for the alphabet. The specification of the alphabet is
8431: not required: by default it is assumed to the Latin alphabet (the ISO Latin-1
1.18 cvs 8432: character set).</p>
8433: <p>
1.1 cvs 8434: Each recoding rule is formed by a source string between apostrophes and a
8435: target string, also between apostrophes, the two strings being separated by
1.18 cvs 8436: the arrow symbol (<tt>-></tt>), formed by the ``minus'' and ``greater than''
8437: characters. The rule is terminated by a semi-colon.</p>
8438: <pre> TextTransSeq = [ Alphabet ] TransSeq .
1.1 cvs 8439: Alphabet = NAME .
8440: TransSeq ='BEGIN' < Translation > 'END' ';' /
8441: Translation .
8442: Translation = Source [ '->' Target ] ';' .
8443: Source = STRING .
1.18 cvs 8444: Target = STRING .</pre>
8445: <p>
1.1 cvs 8446: One such rule signifies that when the source string appears in a text leaf of
8447: the document being translated, the translator must replace it, in the
8448: translated document, with the target string. The source string and the target
8449: string can have different lengths and the target string can be empty. In this
8450: last case, the translator simply suppresses every occurrence of the source
1.18 cvs 8451: string in the translated document.</p>
8452: <p>
1.1 cvs 8453: For a given alphabet, the order of the rules is not important and has no
8454: significance because the T language compiler reorders the rules in ways that
8455: speed up the translator's work. The total number of recoding rules is limited
1.18 cvs 8456: by the compiler as is the maximum length of the source and target strings.</p>
8457: <p>
1.1 cvs 8458: The recoding rules for symbols and graphical elements are written in the same
8459: manner as the recoding rules for character strings. They are preceded,
1.18 cvs 8460: respectively, by the <tt>SYMBTRANSLATE</tt> and <tt>GRAPHTRANSLATE</tt> and so
1.1 cvs 8461: not require a specification of the alphabet. Their source string is limited to
8462: one character, since, in Thot, each symbol and each graphical element is
8463: represented by a single character. The symbol and graphical element codes are
1.18 cvs 8464: defined along with the <a href="#sect7">non-standard character codes</a>.</p>
8465: <blockquote class="example">
8466: <p>
8467: <strong>Example:</strong></p>
8468: <p>
8469: In a translation schema producing documents destined for use with the
8470: L<sup>A</sup>T<sub><big>E</big></sub>X formatter, the Latin
1.1 cvs 8471: characters``é'' (octal code 351 in Thot) and ``è'' (octal code
1.18 cvs 8472: 350 in Thot) must be converted to their representation in
8473: L<sup>A</sup>T<sub><big>E</big></sub>X:</p>
8474: <pre>TEXTTRANSLATE Latin
1.1 cvs 8475: BEGIN
8476: '\350' -> '\`{e}'; { e grave }
8477: '\351' -> '\''{e}'; { e acute }
1.18 cvs 8478: END;</pre>
8479: </blockquote>
8480: </div>
8481: </div>
8482: <hr>
1.19 ! cvs 8483:
1.18 cvs 8484: </div>
1.1 cvs 8485:
1.18 cvs 8486: <div class="chapter">
1.1 cvs 8487:
1.18 cvs 8488: <h1><a name="sect6">Language grammars</a></h1>
8489: <p>
1.1 cvs 8490: This chapter gives the complete grammars of the languages of Thot. The
8491: grammars were presented and described in the preceding chapters, which also
8492: specify the semantics of the languages. This section gives only the
1.18 cvs 8493: syntax.</p>
1.1 cvs 8494:
1.18 cvs 8495: <div class="section">
1.1 cvs 8496:
1.18 cvs 8497: <h2><a name="sectb61">The M meta-language</a></h2>
8498: <p>
1.1 cvs 8499: The language grammars are all expressed in the same formalism, the M
1.18 cvs 8500: meta-language, which is defined in this section.</p>
8501: <pre>{ Any text between braces is a comment. }
1.1 cvs 8502: Grammar = Rule < Rule > 'END' .
8503: { The < and > signs indicate zero }
8504: { or more repetitions. }
8505: { END marks the end of the grammar. }
8506: Rule = Ident '=' RightPart '.' .
8507: { The period indicates the end of a rule }
8508: RightPart = RtTerminal / RtIntermed .
8509: { The slash indicates a choice }
8510: RtTerminal ='NAME' / 'STRING' / 'NUMBER' .
8511: { Right part of a terminal rule }
8512: RtIntermed = Possibility < '/' Possibility > .
8513: { Right part of an intermediate rule }
8514: Possibility = ElemOpt < ElemOpt > .
8515: ElemOpt = Element / '[' Element < Element > ']' /
8516: '<' Element < Element > '>' .
8517: { Brackets delimit optional parts }
8518: Element = Ident / KeyWord .
8519: Ident = NAME .
8520: { Identifier, sequence of characters
8521: KeyWord = STRING .
8522: { Character string delimited by apostrophes }
1.18 cvs 8523: END</pre>
8524: </div>
1.1 cvs 8525:
1.18 cvs 8526: <div class="section">
1.1 cvs 8527:
1.18 cvs 8528: <h2><a name="sectb62">The S language</a></h2>
8529: <p>
1.1 cvs 8530: The S language is used to write structure schemas, which contain the generic
8531: logical structures of document and object classes. It is described here in
1.18 cvs 8532: the M meta-language.</p>
8533: <pre>StructSchema = 'STRUCTURE' [ 'EXTENSION' ] ElemID ';'
1.1 cvs 8534: 'DEFPRES' PresID ';'
8535: [ 'ATTR' AttrSeq ]
8536: [ 'PARAM' RulesSeq ]
8537: [ 'STRUCT' RulesSeq ]
8538: [ 'EXTENS' ExtensRuleSeq ]
8539: [ 'ASSOC' RulesSeq ]
8540: [ 'UNITS' RulesSeq ]
8541: [ 'EXPORT' SkeletonSeq ]
8542: [ 'EXCEPT' ExceptSeq ]
8543: 'END' .
8544:
8545: ElemID = NAME .
8546: PresID = NAME .
8547:
8548: AttrSeq = Attribute < Attribute > .
8549: Attribute = AttrID '=' AttrType ';' .
8550: AttrType = 'INTEGER' / 'TEXT' /
8551: 'REFERENCE' '(' RefType ')' /
8552: ValueSeq .
8553: RefType = 'ANY' /
8554: [ FirstSec ] ElemID [ ExtStruct ] .
8555: ValueSeq = AttrVal < ',' AttrVal > .
8556: AttrID = NAME .
8557: FirstSec = 'First' / 'Second' .
8558: ExtStruct = '(' ElemID ')' .
8559: AttrVal = NAME .
8560:
8561: RulesSeq = Rule < Rule > .
8562: Rule = ElemID [ LocAttrSeq ] '='
8563: DefWithAttr ';' .
8564: LocAttrSeq = '(' 'ATTR' LocalAttr
8565: < ';' LocalAttr > ')' .
8566: LocalAttr = [ '!' ] AttrID [ '=' AttrType ] .
8567: DefWithAttr = Definition
8568: [ '+' '(' ExtensionSeq ')' ]
8569: [ '-' '(' RestrictSeq ')' ]
8570: [ 'WITH' FixedAttrSeq ] .
8571: ExtensionSeq = ExtensionElem < ',' ExtensionElem > .
8572: ExtensionElem = ElemID / 'TEXT' / 'GRAPHICS' /
8573: 'SYMBOL' / 'PICTURE' .
8574: RestrictSeq = RestrictElem < ',' RestrictElem > .
8575: RestrictElem = ElemID / 'TEXT' / 'GRAPHICS' /
8576: 'SYMBOL' / 'PICTURE' .
8577: FixedAttrSeq = FixedAttr < ',' FixedAttr > .
8578: FixedAttr = AttrID [ FixedOrModifVal ] .
8579: FixedOrModifVal= [ '?' ] '=' FixedValue .
8580: FixedValue = [ '-' ] NumValue / TextValue / AttrVal .
8581: NumValue = NUMBER .
8582: TextValue = STRING .
8583:
8584: Definition = BaseType [ LocAttrSeq ] / Constr /
8585: Element .
8586: BaseType = 'TEXT' / 'GRAPHICS' / 'SYMBOL' /
8587: 'PICTURE' / 'UNIT' / 'NATURE' .
8588: Element = ElemID [ ExtOrDef ] .
8589: ExtOrDef = 'EXTERN' / 'INCLUDED' /
8590: [ LocAttrSeq ] '=' Definition .
8591:
8592: Constr = 'LIST' [ '[' min '..' max ']' ] 'OF'
8593: '(' DefWithAttr ')' /
8594: 'BEGIN' DefOptSeq 'END' /
8595: 'AGGREGATE' DefOptSeq 'END' /
8596: 'CASE' 'OF' DefSeq 'END' /
8597: 'REFERENCE' '(' RefType ')' /
8598: 'PAIR' .
8599:
8600: min = Integer / '*' .
8601: max = Integer / '*' .
8602: Integer = NUMBER .
8603:
8604: DefOptSeq = DefOpt ';' < DefOpt ';' > .
8605: DefOpt = [ '?' ] DefWithAttr .
8606:
8607: DefSeq = DefWithAttr ';' < DefWithAttr ';' > .
8608:
8609: SkeletonSeq = SkeletonElem < ',' SkeletonElem > ';' .
8610: SkeletonElem = ElemID [ 'WITH' Contents ] .
8611: Contents = 'Nothing' / ElemID [ ExtStruct ] .
8612:
8613: ExceptSeq = Except ';' < Except ';' > .
8614: Except = [ 'EXTERN' ] [ FirstSec ] ExcTypeOrAttr ':'
8615: ExcValSeq .
8616: ExcTypeOrAttr = ElemID / AttrID .
8617: ExcValSeq = ExcValue < ',' ExcValue > .
8618: ExcValue = 'NoCut' / 'NoCreate' /
8619: 'NoHMove' / 'NoVMove' / 'NoMove' /
8620: 'NoHResize' / 'NoVResize' / 'NoResize' /
1.18 cvs 8621: 'MoveResize' /
1.1 cvs 8622: 'NewWidth' / 'NewHeight' /
8623: 'NewHPos' / 'NewVPos' /
8624: 'Invisible' / 'NoSelect' /
8625: 'Hidden' / 'ActiveRef' /
8626: 'ImportLine' / 'ImportParagraph' /
1.9 cvs 8627: 'NoPaginate' / 'ParagraphBreak' /
8628: 'HighlightChildren' / 'ExtendedSelection' /
8629: 'ReturnCreateNL' .
1.1 cvs 8630:
8631: ExtensRuleSeq = ExtensRule ';' < ExtensRule ';' > .
8632: ExtensRule = RootOrElem [ LocAttrSeq ]
8633: [ '+' '(' ExtensionSeq ')' ]
8634: [ '-' '(' RestrictSeq ')' ]
8635: [ 'WITH' FixedAttrSeq ] .
8636: RootOrElem = 'Root' / ElemID .
8637:
1.18 cvs 8638: END</pre>
8639: </div>
1.1 cvs 8640:
1.18 cvs 8641: <div class="section">
1.1 cvs 8642:
1.18 cvs 8643: <h2><a name="sectb63">The P language</a></h2>
8644: <p>
1.1 cvs 8645: The P language is used to write presentation schemas, which define the
8646: graphical presentation rules to be applied to different classes of documents
1.18 cvs 8647: and objects. It is described here in the M meta-language.</p>
8648: <pre>PresSchema = 'PRESENTATION' ElemID ';'
1.1 cvs 8649: [ 'VIEWS' ViewSeq ]
8650: [ 'PRINT' PrintViewSeq ]
8651: [ 'COUNTERS' CounterSeq ]
8652: [ 'CONST' ConstSeq ]
8653: [ 'VAR' VarSeq ]
8654: [ 'DEFAULT' ViewRuleSeq ]
8655: [ 'BOXES' BoxSeq ]
8656: [ 'RULES' PresentSeq ]
8657: [ 'ATTRIBUTES' PresAttrSeq ]
8658: [ 'TRANSMIT' TransmitSeq ]
8659: 'END' .
8660:
8661: ElemID = NAME .
8662:
8663: ViewSeq = ViewDeclaration
8664: < ',' ViewDeclaration > ';' .
8665: ViewDeclaration = ViewID [ 'EXPORT' ] .
8666: ViewID = NAME .
8667:
8668: PrintViewSeq = PrintView < ',' PrintView > ';' .
8669: PrintView = ViewID / ElemID .
8670:
8671: CounterSeq = Counter < Counter > .
8672: Counter = CounterID ':' CounterFunc ';' .
8673: CounterID = NAME .
8674: CounterFunc = 'RANK' 'OF' TypeOrPage [ SLevelAsc ]
8675: [ 'INIT' AttrID ] [ 'REINIT' AttrID ] /
8676: SetFunction < SetFunction >
8677: AddFunction < AddFunction >
8678: [ 'INIT' AttrID ] /
1.16 cvs 8679: 'RLEVEL' 'OF' ElemID .
1.1 cvs 8680: SLevelAsc = [ '-' ] LevelAsc .
8681: LevelAsc = NUMBER .
8682: SetFunction = 'SET' CounterValue 'ON' TypeOrPage .
8683: AddFunction = 'ADD' CounterValue 'ON' TypeOrPage .
8684: TypeOrPage = 'Page' [ '(' ViewID ')' ] /
1.16 cvs 8685: [ '*' ] ElemID .
1.1 cvs 8686: CounterValue = NUMBER .
8687:
8688: ConstSeq = Const < Const > .
8689: Const = ConstID '=' ConstType ConstValue ';' .
8690: ConstID = NAME .
8691: ConstType = 'Text' [ Alphabet ] / 'Symbol' /
8692: 'Graphics' / 'Picture' .
8693: ConstValue = STRING .
8694: Alphabet = NAME .
8695:
8696: VarSeq = Variable < Variable > .
8697: Variable = VarID ':' FunctionSeq ';' .
8698: VarID = NAME .
8699: FunctionSeq = Function < Function > .
8700: Function = 'DATE' / 'FDATE' /
8701: 'DocName' / 'DirName' /
8702: 'ElemName' / 'AttributeName' /
8703: ConstID / ConstType ConstValue /
8704: AttrID /
8705: 'VALUE' '(' PageAttrCtr ','
8706: CounterStyle ')' .
8707: PageAttrCtr = 'PageNumber' [ '(' ViewID ')' ] /
8708: [ MinMax ] CounterID / AttrID .
8709: CounterStyle = 'Arabic' / 'LRoman' / 'URoman' /
8710: 'Uppercase' / 'Lowercase' .
8711: MinMax = 'MaxRangeVal' / 'MinRangeVal' .
8712:
8713: BoxSeq = Box < Box > .
8714: Box = 'FORWARD' BoxID ';' /
8715: BoxID ':' ViewRuleSeq .
8716: BoxID = NAME .
8717:
8718: PresentSeq = Present < Present > .
8719: Present = [ '*' ] [ FirstSec ] ElemID ':'
8720: ViewRuleSeq .
8721: FirstSec = 'First' / 'Second' .
8722:
8723: PresAttrSeq = PresAttr < PresAttr > .
8724: PresAttr = AttrID [ '(' [ FirstSec ] ElemID ')' ]
8725: [ AttrRelation ] ':' ViewRuleSeq .
8726: AttrID = NAME .
8727: AttrRelation = '=' AttrVal /
8728: '>' [ '-' ] MinValue /
8729: '<' [ '-' ] MaxValue /
8730: 'IN' '[' [ '-' ] LowerBound '..'
8731: [ '-' ] UpperBound ']' /
8732: 'GREATER' AttrID /
8733: 'EQUAL' AttrID /
8734: 'LESS' AttrID .
8735: AttrVal = [ '-' ] EqualNum / EqualText / AttrValue .
8736: MinValue = NUMBER .
8737: MaxValue = NUMBER .
8738: LowerBound = NUMBER .
8739: UpperBound = NUMBER.
8740: EqualNum = NUMBER .
8741: EqualText = STRING .
8742: AttrValue = NAME .
8743:
8744: ViewRuleSeq = 'BEGIN' < RulesAndCond > < ViewRules >
8745: 'END' ';' /
8746: ViewRules / CondRules / Rule .
8747: RulesAndCond = CondRules / Rule .
8748: ViewRules = 'IN' ViewID CondRuleSeq .
8749: CondRuleSeq = 'BEGIN' < RulesAndCond > 'END' ';' /
8750: CondRules / Rule .
8751: CondRules = CondRule < CondRule >
8752: [ 'Otherwise' RuleSeq ] .
8753: CondRule = 'IF' ConditionSeq RuleSeq .
8754: RulesSeq = 'BEGIN' Rule < Rule > 'END' ';' / Rule .
8755:
1.6 cvs 8756: ConditionSeq = Condition < 'AND' Condition > .
8757: Condition = [ 'NOT' ] [ 'Target' ] ConditionElem .
8758: ConditionElem = 'First' / 'Last' /
8759: [ 'Immediately' ] 'Within' [ NumParent ]
8760: ElemID [ ExtStruct ] /
8761: ElemID /
8762: 'Referred' / 'FirstRef' / 'LastRef' /
8763: 'ExternalRef' / 'InternalRef' / 'CopyRef' /
8764: 'AnyAttributes' / 'FirstAttr' / 'LastAttr' /
8765: 'UserPage' / 'StartPage' / 'ComputedPage' /
8766: 'Empty' /
8767: '(' [ MinMax ] CounterName CounterCond ')' /
8768: CondPage '(' CounterID ')' .
8769: NumParent = [ GreaterLess ] NParent .
8770: GreaterLess = '>' / '<' .
8771: NParent = NUMBER.
8772: CounterCond = '<' MaxCtrVal / '>' MinCtrVal /
8773: '=' EqCtrVal /
8774: 'IN' '[' ['-'] MinCtrBound '..'
8775: ['-'] MaxCtrBound ']' .
8776: PageCond = 'Even' / 'Odd' / 'One' .
8777: MaxCtrVal = NUMBER .
8778: MinCtrVal = NUMBER .
8779: EqCtrVal = NUMBER .
8780: MaxCtrBound = NUMBER .
8781: MinCtrBound = NUMBER .
1.1 cvs 8782:
8783: Rule = PresParam ';' / PresFunc ';' .
8784: PresParam = 'VertRef' ':' HorizPosition /
8785: 'HorizRef' ':' VertPosition /
8786: 'VertPos' ':' VPos /
8787: 'HorizPos' ':' HPos /
8788: 'Height' ':' Extent /
8789: 'Width' ':' Extent /
8790: 'VertOverflow' ':' Boolean /
8791: 'HorizOverflow' ':' Boolean /
8792: 'LineSpacing' ':' DistOrInherit /
8793: 'Indent' ':' DistOrInherit /
8794: 'Adjust' ':' AlignOrInherit /
8795: 'Justify' ':' BoolInherit /
8796: 'Hyphenate' ':' BoolInherit /
8797: 'PageBreak' ':' Boolean /
8798: 'LineBreak' ':' Boolean /
8799: 'InLine' ':' Boolean /
8800: 'NoBreak1' ':' AbsDist /
8801: 'NoBreak2' ':' AbsDist /
8802: 'Gather' ':' Boolean /
8803: 'Visibility' ':' NumberInherit /
8804: 'Size' ':' SizeInherit /
8805: 'Font' ':' NameInherit /
8806: 'Style' ':' StyleInherit /
8807: 'Underline' ':' UnderLineInherit /
8808: 'Thickness' ':' ThicknessInherit /
8809: 'Depth' ':' NumberInherit /
8810: 'LineStyle' ':' LineStyleInherit /
8811: 'LineWeight' ':' DistOrInherit /
8812: 'FillPattern' ':' NameInherit /
8813: 'Background' ':' NameInherit /
1.13 cvs 8814: 'Foreground' ':' NameInherit /
1.1 cvs 8815: 'Content' ':' VarConst .
8816: PresFunc = Creation '(' BoxID ')' /
8817: 'Line' /
8818: 'NoLine' /
8819: 'Page' '(' BoxID ')' /
1.13 cvs 8820: 'Copy' '(' BoxTypeToCopy ')' /
8821: 'ShowBox' /
1.18 cvs 8822: 'BackgroundPicture' ':' FileName /
8823: 'PictureMode' ':' PictMode .
1.1 cvs 8824:
8825: BoxTypeToCopy = BoxID [ ExtStruct ] /
8826: ElemID [ ExtStruct ] .
8827: ExtStruct = '(' ElemID ')' .
8828:
8829: Distance = [ Sign ] AbsDist .
8830: Sign = '+' / '-' .
8831: AbsDist = IntegerOrAttr [ '.' DecimalPart ]
8832: [ Unit ] .
8833: IntegerOrAttr = IntegerPart / AttrID .
8834: IntegerPart = NUMBER .
8835: DecimalPart = NUMBER .
8836: Unit = 'em' / 'ex' / 'cm' / 'mm' / 'in' / 'pt' /
8837: 'pc' / 'px' / '%' .
8838:
8839: HPos = 'nil' / VertAxis '=' HorizPosition
8840: [ 'UserSpecified' ] .
8841: VPos = 'nil' / HorizAxis '=' VertPosition
8842: [ 'UserSpecified' ] .
8843: VertAxis = 'Left' / 'VMiddle' / 'VRef' / 'Right' .
8844: HorizAxis = 'Top' / 'HMiddle' / 'HRef' / 'Bottom' .
8845:
1.6 cvs 8846: VertPosition = Reference '.' HorizAxis [ Distance ] .
8847: HorizPosition = Reference '.' VertAxis [ Distance ] .
8848: Reference = 'Enclosing' [ BoxTypeNot ] /
8849: 'Enclosed' [ BoxTypeNot ] /
8850: 'Previous' [ BoxTypeNot ] /
8851: 'Next' [ BoxTypeNot ] /
8852: 'Referred' [ BoxTypeNot ] /
8853: 'Creator' /
8854: 'Root' /
8855: '*' /
8856: BoxOrType .
8857: BoxOrType = BoxID /
8858: [ '*' ] [ FirstSec ] ElemID /
1.17 cvs 8859: 'AnyElem' / 'AnyBox' /
8860: 'ElemWithAttr' AttrID .
1.6 cvs 8861: BoxTypeNot = [ 'NOT' ] BoxOrType .
8862:
8863: Extent = Reference '.' HeightWidth
8864: [ Relation ] [ 'Min' ] /
8865: AbsDist [ 'UserSpecified' ] [ 'Min' ] /
8866: HPos / VPos .
8867: HeightWidth = 'Height' / 'Width' .
8868: Relation = '*' ExtentAttr '%' / Distance .
8869: ExtentAttr = ExtentVal / AttrID .
8870: ExtentVal = NUMBER .
8871:
8872: Inheritance = Kinship InheritedValue .
8873: Kinship = 'Enclosing' / 'GrandFather'/ 'Enclosed' /
8874: 'Previous' / 'Creator' .
8875: InheritedValue = '+' PosIntAttr [ 'Max' maximumA ] /
8876: '-' NegIntAttr [ 'Min' minimumA ] /
8877: '=' .
8878: PosIntAttr = PosInt / AttrID .
8879: PosInt = NUMBER .
8880: NegIntAttr = NegInt / AttrID .
8881: NegInt = NUMBER .
8882: maximumA = maximum / AttrID .
8883: maximum = NUMBER .
8884: minimumA = minimum / AttrID .
8885: minimum = NUMBER .
8886:
8887: AlignOrInherit = Kinship '=' / Alignment .
8888: Alignment = 'Left' / 'Right' / 'VMiddle' /
8889: 'LeftWithDots' .
1.1 cvs 8890:
1.6 cvs 8891: DistOrInherit = Kinship InheritedDist / Distance .
8892: InheritedDist = '=' / '+' AbsDist / '-' AbsDist .
1.1 cvs 8893:
1.6 cvs 8894: BoolInherit = Boolean / Kinship '=' .
8895: Boolean = 'Yes' / 'No' .
1.1 cvs 8896:
1.6 cvs 8897: NumberInherit = Integer / AttrID / Inheritance .
8898: Integer = NUMBER .
1.1 cvs 8899:
8900: LineStyleInherit= Kinship '=' / 'Solid' / 'Dashed' /
8901: 'Dotted' .
8902:
1.6 cvs 8903: SizeInherit = SizeAttr [ 'pt' ] / Kinship InheritedSize .
8904: InheritedSize = '+' SizeAttr [ 'pt' ]
8905: [ 'Max' MaxSizeAttr ] /
8906: '-' SizeAttr [ 'pt' ]
8907: [ 'Min' MinSizeAttr ] /
8908: '=' .
8909: SizeAttr = Size / AttrID .
8910: Size = NUMBER .
8911: MaxSizeAttr = MaxSize / AttrID .
8912: MaxSize = NUMBER .
8913: MinSizeAttr = MinSize / AttrID .
8914: MinSize = NUMBER .
8915:
8916: NameInherit = Kinship '=' / FontName .
8917: FontName = NAME .
8918: StyleInherit = Kinship '=' /
8919: 'Roman' / 'Bold' / 'Italics' /
8920: 'BoldItalics' / 'Oblique' / 'BoldOblique' .
1.1 cvs 8921: UnderLineInherit= Kinship '=' /
1.6 cvs 8922: 'NoUnderline' / 'Underlined' /
8923: 'Overlined' / 'CrossedOut' .
1.1 cvs 8924: ThicknessInherit= Kinship '=' / 'Thick' / 'Thin' .
1.13 cvs 8925:
8926: FileName = STRING .
8927: PictMode = 'NormalSize' / 'Scale' /
8928: 'RepeatXY' / 'RepeatX' / 'RepeatY' .
1.1 cvs 8929:
1.6 cvs 8930: VarConst = ConstID / ConstType ConstValue /
8931: VarID / '(' FunctionSeq ')' /
8932: ElemID .
8933:
8934: Creation = Create [ 'Repeated' ] .
8935: Create = 'CreateFirst' / 'CreateLast' /
8936: 'CreateBefore' / 'CreateAfter' /
8937: 'CreateEnclosing' .
8938:
8939: TransmitSeq = Transmit < Transmit > .
8940: Transmit = TypeOrCounter 'To' ExternAttr
8941: '(' ElemID ')' ';' .
8942: TypeOrCounter = CounterID / ElemID .
8943: ExternAttr = NAME .
1.1 cvs 8944:
1.18 cvs 8945: END</pre>
8946: </div>
1.1 cvs 8947:
1.18 cvs 8948: <div class="section">
1.1 cvs 8949:
1.18 cvs 8950: <h2><a name="sectb64">The T language</a></h2>
8951: <pre>TransSchema = 'TRANSLATION' ElemID ';'
1.1 cvs 8952: [ 'LINELENGTH' LineLength ';' ]
8953: [ 'LINEEND' CHARACTER ';' ]
8954: [ 'LINEENDINSERT' STRING ';' ]
8955: [ 'BUFFERS' BufferSeq ]
8956: [ 'COUNTERS' CounterSeq ]
8957: [ 'CONST' ConstSeq ]
8958: [ 'VAR' VariableSeq ]
8959: 'RULES' ElemSeq
8960: [ 'ATTRIBUTES' AttrSeq ]
8961: [ 'PRESENTATION' PresSeq ]
8962: < 'TEXTTRANSLATE' TextTransSeq >
8963: [ 'SYMBTRANSLATE' TransSeq ]
8964: [ 'GRAPHTRANSLATE' TransSeq ]
8965: 'END' .
8966:
8967: LineLength = NUMBER .
8968:
8969: BufferSeq = Buffer < Buffer > .
8970: Buffer = BufferID [ '(' 'Picture' ')' ] ';' .
8971: BufferID = NAME .
8972:
8973: CounterSeq = Counter < Counter > .
8974: Counter = CounterID [ ':' CounterFunc ] ';' .
8975: CounterID = NAME .
8976: CounterFunc = 'Rank' 'of' ElemID [ SLevelAsc ]
8977: [ 'Init' AttrID ] /
8978: 'Rlevel' 'of' ElemID /
8979: 'Set' InitValue 'On' ElemID
8980: 'Add' Increment 'On' ElemID
8981: [ 'Init' AttrID ] .
8982: SLevelAsc = [ '-' ] LevelAsc .
8983: LevelAsc = NUMBER .
8984: InitValue = NUMBER .
8985: Increment = NUMBER .
8986: ElemID = NAME .
8987: AttrID = NAME .
8988:
8989: ConstSeq = Const < Const > .
8990: Const = ConstID '=' ConstValue ';' .
8991: ConstID = NAME .
8992: ConstValue = STRING .
8993:
8994: VariableSeq = Variable < Variable > .
8995: Variable = VarID ':' Function < Function > ';' .
8996: VarID = NAME .
8997: Function = 'Value' '(' CounterID [ ':' Length ]
8998: [ ',' CounterStyle ] ')' /
8999: 'FileDir' / 'FileName' / 'Extension' /
9000: 'DocumentName' / 'DocumentDir' /
9001: ConstID / CharString /
9002: BufferID / AttrID .
9003: Length = NUMBER .
9004: CounterStyle= 'Arabic' / 'LRoman' / 'URoman' /
9005: 'Uppercase' / 'Lowercase' .
9006: CharString = STRING .
9007:
9008: ElemSeq = TransType < TransType > .
9009: TransType = [ FirstSec ] ElemID ':' RuleSeq .
9010: FirstSec = 'First' / 'Second' .
9011: RuleSeq = Rule / 'BEGIN' < Rule > 'END' ';' .
9012: Rule = SimpleRule / ConditionBlock .
9013: ConditionBlock= 'IF' ConditionSeq SimpleRuleSeq .
9014: SimpleRuleSeq = 'BEGIN' < SimpleRule > 'END' ';' /
9015: SimpleRule .
9016:
9017: ConditionSeq = Condition [ 'AND' Condition ] .
9018: Condition = [ 'NOT' ] [ 'Target' ] Cond .
9019: Cond = CondElem / CondAscend .
9020: CondElem = 'FirstRef' / 'LastRef' /
9021: 'ExternalRef' /
9022: 'Defined' /
9023: 'Alphabet' '=' Alphabet /
9024: 'ComputedPage' / 'StartPage' /
9025: 'UserPage' / 'ReminderPage' /
9026: 'Empty' /
1.18 cvs 9027: ElemID /
1.1 cvs 9028: 'FirstAttr' / 'LastAttr' .
9029: CondAscend = [ Ascend ] CondOnAscend .
9030: Ascend = '*' / 'Parent' / 'Ancestor' LevelOrType .
9031: LevelOrType = CondRelLevel / ElemID [ ExtStruct ] .
9032: CondRelLevel = NUMBER .
9033: CondOnAscend = 'First' / 'Last' /
9034: 'Referred' /
9035: [ 'Immediately' ] 'Within' [ NumParent ]
9036: ElemID [ ExtStruct ] /
9037: 'Attributes' /
9038: AttrID [ RelatAttr ] /
9039: 'Presentation' /
9040: PresRule /
9041: 'Comment' .
9042: NumParent = [ GreaterLess ] NParent .
9043: GreaterLess = '>' / '<' .
9044: NParent = NUMBER.
9045: Alphabet = NAME .
9046: RelatAttr = '=' Value /
9047: '>' [ '-' ] Minimum /
9048: '<' [ '-' ] Maximum /
9049: 'IN' '[' [ '-' ] MinInterval '..'
9050: [ '-' ] MaxInterval ']' .
9051: Value = [ '-' ] IntegerVal / TextVal / AttrValue .
9052: Minimum = NUMBER .
9053: Maximum = NUMBER .
9054: MinInterval = NUMBER .
9055: MaxInterval = NUMBER .
9056: IntegerVal = NUMBER .
9057: TextVal = STRING .
9058: AttrValue = NAME .
9059:
9060: SimpleRule = 'Create' [ 'IN' VarID ] Object
9061: [ Position ] ';' /
9062: 'Write' Object [ Position ] ';' /
9063: 'Read' BufferID [ Position ] ';' /
9064: 'Include' File [ Position ] ';' /
1.6 cvs 9065: 'Get' [ RelPosition ] ElemID
9066: [ ExtStruct ]
9067: [ Position ] ';' /
1.1 cvs 9068: 'Copy' [ RelPosition ] ElemID
9069: [ ExtStruct ]
9070: [ Position ] ';' /
9071: 'Use' TrSchema [ 'For' ElemID ] ';' /
9072: 'Remove' ';' /
9073: 'NoTranslation' ';' /
9074: 'NoLineBreak' ';' /
9075: 'ChangeMainFile' VarID [ Position ] ';' /
1.14 cvs 9076: 'RemoveFile' VarID [ Position ] ';' /
1.10 cvs 9077: 'Set' CounterID InitValue [ Position ] ';' /
9078: 'Add' CounterID Increment [ Position ] ';' /
9079: 'Indent' [ 'IN' VarID ] [ IndentSign ]
9080: IndentValue [ Position ] ';' .
9081:
9082: IndentSign = '+' / '-' .
9083: IndentValue = NUMBER .
1.1 cvs 9084:
9085: Object = ConstID / CharString /
9086: BufferID /
9087: VarID /
9088: '(' Function < Function > ')' /
9089: AttrID /
9090: 'Value' /
9091: 'Content' /
9092: 'Comment' /
9093: 'Attributes' /
9094: 'Presentation' /
9095: 'RefId' /
9096: 'PairId' /
9097: 'FileDir' / 'FileName' / 'Extension' /
9098: 'DocumentName' / 'DocumentDir' /
9099: [ 'Referred' ] ReferredObject .
9100: Position = 'After' / 'Before' .
9101:
1.6 cvs 9102: ReferredObject= VarID /
9103: ElemID [ ExtStruct ] /
9104: 'RefId' /
9105: 'DocumentName' / 'DocumentDir' .
1.1 cvs 9106:
1.6 cvs 9107: File = FileName / BufferID .
9108: FileName = STRING .
1.1 cvs 9109:
1.6 cvs 9110: RelPosition = 'Included' / 'Referred' .
9111: ExtStruct = '(' ElemID ')' .
1.1 cvs 9112:
1.6 cvs 9113: TrSchema = NAME .
9114:
9115: AttrSeq = TransAttr < TransAttr > .
9116: TransAttr = AttrID [ '(' ElemID ')' ]
9117: [ RelatAttr ] ':' RuleSeq .
9118:
9119: PresSeq = PresTrans < PresTrans > .
9120: PresTrans = PresRule ':' RuleSeq .
9121: PresRule = 'Size' [ PresRelation ] /
9122: 'Indent' [ PresRelation ] /
9123: 'LineSpacing' [ PresRelation ] /
9124: 'Adjust' [ '=' AdjustVal ] /
9125: 'Justify' [ '=' BoolVal ] /
9126: 'Hyphenate' [ '=' BoolVal ] /
9127: 'Style' [ '=' StyleVal ] /
9128: 'Font' [ '=' FontVal ] /
9129: 'UnderLine' [ '=' UnderLineVal ] /
9130: 'Thickness' [ '=' ThicknessVal ] /
9131: 'LineStyle' [ '=' LineStyleVal ] /
9132: 'LineWeight' [ PresRelation ] /
9133: 'FillPattern' [ '=' Pattern ] /
9134: 'Background' [ '=' Color ] /
9135: 'Foreground' [ '=' Color ] .
9136:
9137: PresRelation = '=' PresValue /
9138: '>' [ '-' ] PresMinimum /
9139: '<' [ '-' ] PresMaximum /
9140: 'IN' '[' [ '-' ] PresIntervalMin '..'
9141: [ '-' ] PresIntervalMax ']' .
9142: AdjustVal = 'Left' / 'Right' / 'VMiddle' /
9143: 'LeftWithDots' .
9144: BoolVal = 'Yes' / 'No' .
9145: StyleVal = 'Bold' / 'Italics' / 'Roman' /
9146: 'BoldItalics' / 'Oblique' /
9147: 'BoldOblique' .
9148: FontVal = 'Times' / 'Helvetica' / 'Courier' .
9149: UnderLineVal = 'NoUnderline' / 'UnderLined' /
9150: 'OverLined' / 'CrossedOut' .
9151: ThicknessVal = 'Thick' / 'Thin' .
9152: LineStyleVal = 'Solid' / 'Dashed' / 'Dotted' .
9153: Pattern = NAME .
9154: Color = NAME .
9155: PresMinimum = NUMBER .
9156: PresMaximum = NUMBER .
1.1 cvs 9157: PresIntervalMin= NUMBER .
9158: PresIntervalMax= NUMBER .
1.6 cvs 9159: PresValue = [ '-' ] PresVal .
9160: PresVal = NUMBER .
1.1 cvs 9161:
1.6 cvs 9162: TextTransSeq = [ Alphabet ] TransSeq .
9163: Alphabet = NAME .
9164: TransSeq = 'BEGIN' < Translation > 'END' ';' /
9165: Translation .
9166: Translation = Source [ '->' Target ] ';' .
9167: Source = STRING .
1.18 cvs 9168: Target = STRING .</pre>
9169: </div>
9170: <hr>
1.19 ! cvs 9171:
1.18 cvs 9172: </div>
1.1 cvs 9173:
1.18 cvs 9174: <div class="chapter">
1.1 cvs 9175:
1.18 cvs 9176: <h1><a name="sect7">Character coding</a></h1>
1.1 cvs 9177:
1.18 cvs 9178: <div class="section">
1.1 cvs 9179:
1.18 cvs 9180: <h2><a name="sectb71">Characters</a></h2>
9181: <p>
1.1 cvs 9182: The characters of the Latin alphabet follow the encoding defined in the ISO
1.5 cvs 9183: 8859-1 (ISO Latin-1) standard. The characters of the Greek alphabet follow
1.18 cvs 9184: the encoding defined by Adobe for its Symbol font (Adobe FontSpecific).</p>
9185: <p>
1.1 cvs 9186: Characters whose octal code is greater than 0200 are written in the form of
9187: their octal code preceded by a backslash character (``\''). For example, the
1.18 cvs 9188: French word 'Résumé' is written <tt>R\351sum\351</tt>.</p>
9189: <p>
1.2 cvs 9190: To the ISO 8859-1 encoding four characters with the following codes have been
1.18 cvs 9191: added:<br>
9192: <tt>212</tt>: line break<br>
9193: <tt>240</tt>: sticky space<br>
9194: <tt>201</tt>: thin space<br>
9195: <tt>202</tt>: en space</p>
9196: <p>
9197: The <tt>212</tt> character is a ``line break'' character which forces a line
9198: break. The <tt>240</tt> character is a ``sticky space'', which cannot be
9199: replaced by a line break.</p>
9200: </div>
1.1 cvs 9201:
1.18 cvs 9202: <div class="section">
1.1 cvs 9203:
1.18 cvs 9204: <h2><a name="sectb72">Symbols</a></h2>
9205: <p>
1.1 cvs 9206: The table below gives the codes for the symbols of Thot. Symbols can be used
9207: in presentation schemas constants and in transcoding rules of translation
1.18 cvs 9208: schemas. Each symbol is represented by a single character.</p>
9209: <ul>
9210: <li>
9211: <tt>r</tt>: a radical
1.19 ! cvs 9212: </li>
1.18 cvs 9213: <li>
9214: <tt>i</tt>: a simple integral
1.19 ! cvs 9215: </li>
1.18 cvs 9216: <li>
9217: <tt>c</tt>: a curvilinear integral
1.19 ! cvs 9218: </li>
1.18 cvs 9219: <li>
9220: <tt>d</tt>: a double integral
1.19 ! cvs 9221: </li>
1.18 cvs 9222: <li>
9223: <tt>t</tt>: a triple integral
1.19 ! cvs 9224: </li>
1.18 cvs 9225: <li>
9226: <tt>S</tt>: the summation symbol
1.19 ! cvs 9227: </li>
1.18 cvs 9228: <li>
9229: <tt>P</tt>: the product symbol
1.19 ! cvs 9230: </li>
1.18 cvs 9231: <li>
9232: <tt>U</tt>: the union symbol
1.19 ! cvs 9233: </li>
1.18 cvs 9234: <li>
9235: <tt>I</tt>: the intersection symbol
1.19 ! cvs 9236: </li>
1.18 cvs 9237: <li>
9238: <tt>></tt>: a right arrow
1.19 ! cvs 9239: </li>
1.18 cvs 9240: <li>
9241: <tt><</tt>: a left arrow
1.19 ! cvs 9242: </li>
1.18 cvs 9243: <li>
9244: <tt>^</tt>: an up arrow
1.19 ! cvs 9245: </li>
1.18 cvs 9246: <li>
9247: <tt>V</tt>: a down arrow
1.19 ! cvs 9248: </li>
1.18 cvs 9249: <li>
9250: <tt>(</tt>: an opening parenthesis
1.19 ! cvs 9251: </li>
1.18 cvs 9252: <li>
9253: <tt>)</tt>: a closing parenthesis
1.19 ! cvs 9254: </li>
1.18 cvs 9255: <li>
9256: <tt>{</tt>: an opening brace
1.19 ! cvs 9257: </li>
1.18 cvs 9258: <li>
9259: <tt>}</tt>: a closing brace
1.19 ! cvs 9260: </li>
1.18 cvs 9261: <li>
9262: <tt>[</tt>: an opening bracket
1.19 ! cvs 9263: </li>
1.18 cvs 9264: <li>
9265: <tt>]</tt>: a closing bracket
1.19 ! cvs 9266: </li>
1.18 cvs 9267: </ul>
9268: </div>
1.1 cvs 9269:
1.18 cvs 9270: <div class="section">
1.1 cvs 9271:
1.18 cvs 9272: <h2><a name="sectb73">Graphical elements</a></h2>
9273: <p>
1.1 cvs 9274: The table below gives the codes for the graphical elements of Thot. These
9275: elements can be used in presentation schemas constants and in transcoding
9276: rules of translation schemas. Each graphical element is represented by a
1.18 cvs 9277: single character.</p>
9278: <ul>
9279: <li>
9280: a: a circle
1.19 ! cvs 9281: </li>
1.18 cvs 9282: <li><p>
9283: <tt>A</tt>: an open curve with an arrow head at the end</p>
1.19 ! cvs 9284: </li>
1.18 cvs 9285: <li>
9286: <tt>b</tt>: a horizontal line along the lower side of the box
1.19 ! cvs 9287: </li>
1.18 cvs 9288: <li>
9289: <tt>B</tt>: an open curve
1.19 ! cvs 9290: </li>
1.18 cvs 9291: <li>
9292: <tt>c</tt>: an ellipse inscribed in the box
1.19 ! cvs 9293: </li>
1.18 cvs 9294: <li>
9295: <tt>C</tt>: a rectangle with rounded corners
1.19 ! cvs 9296: </li>
1.18 cvs 9297: <li>
9298: <tt>D</tt>: an open curve with two arrow heads
1.19 ! cvs 9299: </li>
1.18 cvs 9300: <li>
9301: <tt>e</tt>: The northwest/southeast diagonal of the box with an arrowhead at
9302: the bottom
1.19 ! cvs 9303: </li>
1.18 cvs 9304: <li>
9305: <tt>E</tt>: The southwest/northeast diagonal of the box with an arrowhead at
9306: the top
1.19 ! cvs 9307: </li>
1.18 cvs 9308: <li>
9309: <tt>F</tt>: an open curve with an arrow head at start
1.19 ! cvs 9310: </li>
1.18 cvs 9311: <li>
9312: <tt>h</tt>: a horizontal line as wide as the box and placed in its middle
1.19 ! cvs 9313: </li>
1.18 cvs 9314: <li>
9315: <tt>l</tt>: a vertical line on the left side of the box
1.19 ! cvs 9316: </li>
1.18 cvs 9317: <li>
9318: <tt>L</tt>: a lozenge
1.19 ! cvs 9319: </li>
1.18 cvs 9320: <li>
9321: <tt>M</tt>: an open broken line with two arrow heads
1.19 ! cvs 9322: </li>
1.18 cvs 9323: <li>
9324: <tt>N</tt>: an open broken line with an arrow head at start
1.19 ! cvs 9325: </li>
1.18 cvs 9326: <li>
9327: <tt>o</tt>: The southwest/northeast diagonal of the box with an arrowhead at
9328: the bottom
1.19 ! cvs 9329: </li>
1.18 cvs 9330: <li>
9331: <tt>O</tt>: The northwest/southeast diagonal of the box with an arrowhead at
9332: the top
1.19 ! cvs 9333: </li>
1.18 cvs 9334: <li>
9335: <tt>p</tt>: a polygon
1.19 ! cvs 9336: </li>
1.18 cvs 9337: <li>
9338: <tt>P</tt>: a rectangle with round corners and a horizontal bar at the top
1.19 ! cvs 9339: </li>
1.18 cvs 9340: <li>
9341: <tt>Q</tt>: an ellipse with a horizontal bar at the top
1.19 ! cvs 9342: </li>
1.18 cvs 9343: <li>
9344: <tt>r</tt>: a vertical line on the right side of the box
1.19 ! cvs 9345: </li>
1.18 cvs 9346: <li>
9347: <tt>R</tt>: a rectangle which is the shape of the box
1.19 ! cvs 9348: </li>
1.18 cvs 9349: <li>
9350: <tt>s</tt>: a closed curve
1.19 ! cvs 9351: </li>
1.18 cvs 9352: <li>
9353: <tt>S</tt>: an open broken line
1.19 ! cvs 9354: </li>
1.18 cvs 9355: <li>
9356: <tt>t</tt>: a horizontal line along the upper side of the box
1.19 ! cvs 9357: </li>
1.18 cvs 9358: <li>
9359: <tt>U</tt>: an open broken line with an arrow head at the end
1.19 ! cvs 9360: </li>
1.18 cvs 9361: <li>
9362: <tt>v</tt>: a vertical line as tall as the box and placed in its middle
1.19 ! cvs 9363: </li>
1.18 cvs 9364: <li>
9365: <tt>V</tt>: a down arrow as tall as the box and in its middle
1.19 ! cvs 9366: </li>
1.18 cvs 9367: <li>
9368: w: a segment (2 points)
1.19 ! cvs 9369: </li>
1.18 cvs 9370: <li>
9371: <tt>W</tt>: the upper right corner
1.19 ! cvs 9372: </li>
1.18 cvs 9373: <li>
9374: x: a segment (2 points) with an arrow head at the end
1.19 ! cvs 9375: </li>
1.18 cvs 9376: <li>
9377: <tt>X</tt>: the lower right corner
1.19 ! cvs 9378: </li>
1.18 cvs 9379: <li>
9380: y: a segment (2 points) with an arrow head at the end
1.19 ! cvs 9381: </li>
1.18 cvs 9382: <li>
9383: <tt>Y</tt>: the lower left corner
1.19 ! cvs 9384: </li>
1.18 cvs 9385: <li>
9386: z: a segment (2 points) with an arrow head at the end
1.19 ! cvs 9387: </li>
1.18 cvs 9388: <li>
9389: <tt>Z</tt>: the upper left corner
1.19 ! cvs 9390: </li>
1.18 cvs 9391: <li>
9392: <tt>space</tt>: a transparent element
1.19 ! cvs 9393: </li>
1.18 cvs 9394: <li>
9395: <tt>^</tt>: an up arrow as tall as the box and in its middle
1.19 ! cvs 9396: </li>
1.18 cvs 9397: <li>
9398: <tt>></tt>: a right arrow as long as the box's width and in its middle
1.19 ! cvs 9399: </li>
1.18 cvs 9400: <li>
9401: <tt>></tt>: a left arrow as long as the box's width and in its middle
1.19 ! cvs 9402: </li>
1.18 cvs 9403: <li>
9404: <tt>/</tt>: The southwest/northeast diagonal of the box
1.19 ! cvs 9405: </li>
1.18 cvs 9406: <li>
9407: <tt>\</tt>: the northwest/southeast diagonal of the box
1.19 ! cvs 9408: </li>
1.18 cvs 9409: </ul>
9410: <hr>
1.19 ! cvs 9411:
1.18 cvs 9412: </div>
9413: </div>
9414: </body>
9415: </html>
Webmaster