home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume38 / lout / part02 < prev    next >
Encoding:
Text File  |  1993-08-11  |  74.4 KB  |  2,213 lines

  1. Newsgroups: comp.sources.misc
  2. From: jeff@joyce.cs.su.oz.au (Jeff Kingston)
  3. Subject: v38i070:  lout - Lout document formatting system, v2.05, Part02/35
  4. Message-ID: <1993Aug8.180534.11107@sparky.sterling.com>
  5. X-Md4-Signature: 72d35a14a54e9f333bfc61b0497699f3
  6. Sender: kent@sparky.sterling.com (Kent Landfield)
  7. Organization: Sterling Software
  8. Date: Sun, 8 Aug 1993 18:05:34 GMT
  9. Approved: kent@sparky.sterling.com
  10.  
  11. Submitted-by: jeff@joyce.cs.su.oz.au (Jeff Kingston)
  12. Posting-number: Volume 38, Issue 70
  13. Archive-name: lout/part02
  14. Environment: UNIX
  15. Supersedes: lout: Volume 37, Issue 99-128
  16.  
  17. #! /bin/sh
  18. # This is a shell archive.  Remove anything before this line, then feed it
  19. # into a shell via "sh file" or similar.  To overwrite existing files,
  20. # type "sh file -c".
  21. # Contents:  doc/tr.lout/ch3.07 include/dl
  22. # Wrapped by kent@sparky on Sun Aug  8 12:29:20 1993
  23. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  24. echo If this archive is complete, you will see the following message:
  25. echo '          "shar: End of archive 2 (of 35)."'
  26. if test -f 'doc/tr.lout/ch3.07' -a "${1}" != "-c" ; then 
  27.   echo shar: Will not clobber existing file \"'doc/tr.lout/ch3.07'\"
  28. else
  29.   echo shar: Extracting \"'doc/tr.lout/ch3.07'\" \(977 characters\)
  30.   sed "s/^X//" >'doc/tr.lout/ch3.07' <<'END_OF_FILE'
  31. X@Section
  32. X   @Title { "@Wide" and "@High" }
  33. X   @Tag { wide }
  34. X@Begin
  35. X@PP
  36. XThe @@Wide symbol
  37. Xwide.sym @Index { @@Wide symbol }
  38. Xreturns its right parameter modified to have the width given by its left
  39. Xparameter, which must be a length (Section {@NumberOf concatenation})
  40. Xwhose unit of measurement is {@Code "c"}, {@Code "i"}, {@Code "p"},
  41. X{@Code "m"}, {@Code "f"}, {@Code "s"}, or {@Code "v"}.  If the right
  42. Xparameter is not as wide as required, white space is added at the right;
  43. Xif it is too wide, its paragraphs are broken (Section {@NumberOf break})
  44. Xso that it fits.  A @@OneCol operation is included in the effect of @@Wide,
  45. Xsince it does not make sense for an object of fixed width to have two column
  46. Xmarks.
  47. X@PP
  48. Xhigh.sym @Index { @@High symbol }
  49. XThe @@High symbol similarly ensures that its result is of a given height,
  50. Xby adding white space at the bottom.  In this case it is an error for the
  51. Xright parameter to be too large.  A @@OneRow operation is included.
  52. X@End @Section
  53. END_OF_FILE
  54.   if test 977 -ne `wc -c <'doc/tr.lout/ch3.07'`; then
  55.     echo shar: \"'doc/tr.lout/ch3.07'\" unpacked with wrong size!
  56.   fi
  57.   # end of 'doc/tr.lout/ch3.07'
  58. fi
  59. if test -f 'include/dl' -a "${1}" != "-c" ; then 
  60.   echo shar: Will not clobber existing file \"'include/dl'\"
  61. else
  62.   echo shar: Extracting \"'include/dl'\" \(70692 characters\)
  63.   sed "s/^X//" >'include/dl' <<'END_OF_FILE'
  64. X
  65. X###############################################################################
  66. X#                                                                             #
  67. X#  Lout @DocumentLayout package (Version 2.0)                                 #
  68. X#                                                                             #
  69. X#  Version 1.0 by Jeffrey H. Kingston, 17 July 1991.                          #
  70. X#  Version 2.0 by Jeffrey H. Kingston, 22 December 1992.                      #
  71. X#                                                                             #
  72. X#  This Lout package contains the basic definitions for documents, such as    #
  73. X#  simple documents, technical reports, and books.  See "A Beginners' Guide   #
  74. X#  to Lout" for user information.                                             #
  75. X#                                                                             #
  76. X#  Modified by Jeffrey H. Kingston, 22 June 1993, to (a) add an option to     #
  77. X#  turn off running titles; (b) fix a bug which was allowing an odd number    #
  78. X#  of introductory pages to be generated; (c) bring English-language          #
  79. X#  specific parts to the surface so that they can be changed easily; (d)      #
  80. X#  fix a bug with @BeginFigures and @BeginTables.                             #
  81. X#                                                                             #
  82. X###############################################################################
  83. X
  84. Xexport
  85. X    @InitialFont @InitialBreak @Hyphenate
  86. X    @MajorHeadingFont @HeadingFont @MinorHeadingFont @ParaGap @ParaIndent
  87. X    @DispGap @DispIndent @DefaultIndent @WideIndent @VeryWideIndent
  88. X
  89. X    @Roman @UCRoman @Alpha @UCAlpha @Months @ShortMonths
  90. X    @WeekDays @ShortWeekDays
  91. X
  92. X    "``" "''" "--" "---" @Bullet @ParSym @SectSym @Dagger @DaggerDbl @CDot
  93. X    @Sterling @Yen @Florin @Star @Degree @Minute @Second @Multiply @Divide
  94. X    @Lozenge @Register @CopyRight @TradeMark
  95. X
  96. X    @R @I @B @S @MajorHeading @Heading @MinorHeading "^" "&-" @Date
  97. X
  98. X    associate associates declination obligatory philanthropic present presents
  99. X    project projects reciprocity recognizance reformation retribution table
  100. X
  101. X    @Runner @PageMark @PageOf @NumberOf
  102. X
  103. X    @PP @LP @DP @NP @CNP
  104. X    
  105. X    @BAD     @BeginAlignedDisplays
  106. X    @EAD     @EndAlignedDisplays
  107. X    @BND     @BeginNumberedDisplays
  108. X    @END     @EndNumberedDisplays
  109. X
  110. X    @D       @Display
  111. X    @LD      @LeftDisplay
  112. X    @ID      @IndentedDisplay
  113. X    @CD      @CentredDisplay @CenteredDisplay
  114. X    @AD      @AlignedDisplay
  115. X    @LAD     @LeftAlignedDisplay
  116. X    @IAD     @IndentedAlignedDisplay
  117. X    @CAD     @CentredAlignedDisplay @CenteredAlignedDisplay
  118. X    @ND      @NumberedDisplay
  119. X    @LND     @LeftNumberedDisplay
  120. X    @IND     @IndentedNumberedDisplay
  121. X    @CND     @CentredNumberedDisplay @CenteredNumberedDisplay
  122. X    @AND     @AlignedNumberedDisplay
  123. X    @LAND    @LeftAlignedNumberedDisplay
  124. X    @IAND    @IndentedAlignedNumberedDisplay
  125. X    @CAND    @CentredAlignedNumberedDisplay @CenteredAlignedNumberedDisplay
  126. X
  127. X    @RD      @RawDisplay
  128. X    @RLD     @RawLeftDisplay
  129. X    @RID     @RawIndentedDisplay
  130. X    @RCD     @RawCentredDisplay @RawCenteredDisplay
  131. X    @RAD     @RawAlignedDisplay
  132. X    @RLAD    @RawLeftAlignedDisplay
  133. X    @RIAD    @RawIndentedAlignedDisplay
  134. X    @RCAD    @RawCentredAlignedDisplay @RawCenteredAlignedDisplay
  135. X    @RND     @RawNumberedDisplay
  136. X    @RLND    @RawLeftNumberedDisplay
  137. X    @RIND    @RawIndentedNumberedDisplay
  138. X    @RCND    @RawCentredNumberedDisplay @RawCenteredNumberedDisplay
  139. X    @RAND    @RawAlignedNumberedDisplay
  140. X    @RLAND   @RawLeftAlignedNumberedDisplay
  141. X    @RIAND   @RawIndentedAlignedNumberedDisplay
  142. X    @RCAND   @RawCentredAlignedNumberedDisplay
  143. X             @RawCenteredAlignedNumberedDisplay
  144. X    
  145. X    @LI      @ListItem
  146. X    @EL      @EndList
  147. X
  148. X    @RLL     @RawLeftList
  149. X    @RCL     @RawCentredList @RawCenteredList
  150. X
  151. X    @LL         @LeftList
  152. X    @CL         @CentredList @CenteredList
  153. X
  154. X    @RIL     @RawIndentedList
  155. X    @RNL     @RawNumberedList
  156. X    @RPNL    @RawParenNumberedList
  157. X    @RRL     @RawRomanList
  158. X    @RPRL    @RawParenRomanList
  159. X    @RUCRL   @RawUCRomanList
  160. X    @RPUCRL  @RawParenUCRomanList
  161. X    @RAL     @RawAlphaList
  162. X    @RPAL    @RawParenAlphaList
  163. X    @RUCAL   @RawUCAlphaList
  164. X    @RPUCAL  @RawParenUCAlphaList
  165. X    @RBL     @RawBulletList
  166. X    @RSL     @RawStarList
  167. X    @RDL     @RawDashList
  168. X
  169. X    @IL      @IndentedList
  170. X    @NL      @NumberedList 
  171. X    @PNL     @ParenNumberedList
  172. X    @RL      @RomanList
  173. X    @PRL     @ParenRomanList
  174. X    @UCRL    @UCRomanList
  175. X    @PUCRL   @ParenUCRomanList
  176. X    @AL      @AlphaList
  177. X    @PAL     @ParenAlphaList
  178. X    @UCAL    @UCAlphaList
  179. X    @PUCAL   @ParenUCAlphaList
  180. X    @BL      @BulletList 
  181. X    @SL      @StarList 
  182. X    @DL      @DashList
  183. X
  184. X    @TI      @TagItem
  185. X    @RTL     @RawTaggedList
  186. X    @RWTL    @RawWideTaggedList
  187. X    @RVWTL   @RawVeryWideTaggedList
  188. X
  189. X    @TL         @TaggedList
  190. X    @WTL     @WideTaggedList
  191. X    @VWTL    @VeryWideTaggedList
  192. X
  193. X    @Document @Doc @Report @Book            # root galley objects
  194. X    @Abstract @Preface @Introduction            # outer level galleys
  195. X    @Chapter @Section @Appendix @Text @ColText
  196. X    @Figure @EndFigures @Table @EndTables        # inner level galleys
  197. X    @Reference @RefStyle @RefPrint
  198. X    @ReferenceSection @Ref @ChapRefSection @ChapRef
  199. X    @IndexSection @Index @SubIndex @SubSubIndex @RawIndex
  200. X    @RawSubIndex @RawSubSubIndex @IndexBlanks
  201. X    @ContentsSection
  202. X
  203. X
  204. X
  205. Xdef @DocumentLayout
  206. X    named @InitialFont       {  Times Base 12p } # initial font
  207. X    named @InitialBreak      {  adjust 1.20fx  } # initial break
  208. X    named @Hyphenate         {  Yes            } # Want hyphenation? Yes or No
  209. X    named @MajorHeadingFont  {  Bold 2.0f      } # font for major headings
  210. X    named @HeadingFont       {  Bold           } # font for ordinary headings
  211. X    named @MinorHeadingFont  {  Bold           } # font for minor headings
  212. X    named @BookCoverFont     {  Helvetica Base } # font for book cover
  213. X
  214. X    named @ParaGap           {  1.30vx         } # gap between paragraphs
  215. X    named @ParaIndent        {  2.00f          } # paragraph first-line indent
  216. X
  217. X    named @DispGap           {  1.00v          } # gap above and below displays
  218. X    named @DispIndent        {  2.00f          } # @IndentedDisplay indent
  219. X    named @DefaultIndent     {  0.5rt          } # @Display indent
  220. X    named @WideIndent        {  4.00f          } # @WideTaggedList indent
  221. X    named @VeryWideIndent    {  8.00f          } # @VeryWideTaggedList indent
  222. X
  223. X    named @PageWidth         { 21.00c          } # width of page
  224. X    named @PageHeight        { 29.70c          } # height of page
  225. X    named @PageMargin        {  2.50c          } # size of all four margins
  226. X    named @Columns           {  Single         } # Single, Double, Multi
  227. X    named @DoubleColWidth    {  7.50c          } # column width used by Double
  228. X    named @MultiColWidth     {  4.67c          } # column width used by Multi
  229. X    named @ColGap            {  1.00c          } # gap between columns
  230. X    named @TopGap            {  0.75c          } # gap between figures
  231. X    named @MidGap            {  0.75c          } # gap above and below body text
  232. X
  233. X    named @FootNoteFont      {  0.80f          } # font for footnotes
  234. X    named @FootNoteBreak     {  1.20fx         } # break for footnotes
  235. X    named @FootLen           {  2.00c          } # footnote line and indent size
  236. X    named @ColFootLen        {  1.20c          } # @FootLen when Double, Multi
  237. X    named @FootGap           {  0.20c          } # gap between footnotes
  238. X
  239. X    named @MakeIndex         {  No             } # Want index? Yes or No
  240. X    named @IndexColumns      {  Double         } # Single, Double, Multi
  241. X
  242. X    named @TableOfContents   {  No             } # Want contents? Yes or No
  243. X    named @MajorContentsGap  {  1.30v          } # gap above major entry
  244. X    named @ContentsGap       {  1.00v          } # gap above ordinary entry
  245. X
  246. X    named @ChapterNumbers    {  Yes            } # Yes or No            
  247. X    named @SectionNumbers    {  Yes            } # Yes or No            
  248. X    named @SubSectionNumbers {  Yes            } # Yes or No            
  249. X    named @AppendixNumbers   {  Yes            } # Yes or No            
  250. X    named @SubAppendixNumbers{  Yes            } # Yes or No            
  251. X    named @ChapterGap        {  1.10b          } # gap before each chapter
  252. X    named @SectionGap        {  2.00v          } # gap before each section
  253. X    named @SubSectionGap     {  1.50v          } # gap before each subsection
  254. X    named @AppendixGap       {  2.00v          } # gap before each appendix
  255. X    named @SubAppendixGap    {  2.00v          } # gap before each subappendix
  256. X
  257. X    named @PageNumbers       {  Yes            } # Want page numbers? Yes or No
  258. X    named @FirstPageNumber   {  1              } # Number of first page 
  259. X    named @RunningTitles     {  Yes            } # Want running titles? Yes/No
  260. X    named @PageOneTopFormat  right @PageNum { @Null               }
  261. X    named @PageOneFootFormat right @PageNum { @Null               }
  262. X    named @PageTopFormat     right @PageNum { |0.5rt - @PageNum - }
  263. X    named @PageFootFormat    right @PageNum { @Null               }
  264. X    named @BookTitleFormat   right @Title   { Bold @Font @Title   } 
  265. X
  266. X@Begin
  267. X
  268. X    ###########################################################################
  269. X    #                                                                         #
  270. X    #  Complete list of English-language-specific output in this package.     #
  271. X    #  To translate to another language, change these but also change the     #
  272. X    #  "standard" database in $(LIBDIR)/data/standard.ld (don't forget to     #
  273. X    #  delete standard.li if you change standard.ld).                         #
  274. X    #                                                                         #
  275. X    ###########################################################################
  276. X
  277. X    def @ContentsWord        { Contents    }
  278. X    def @ReferencesWord        { References    }
  279. X    def @FigureWord        { Figure    }
  280. X    def @TableWord        { Table        }
  281. X    def @AbstractWord        { ABSTRACT    }
  282. X    def @PrefaceWord        { Preface    }
  283. X    def @IntroductionWord    { Introduction    }
  284. X    def @ChapterWord        { Chapter    }
  285. X    def @AppendixWord        { Appendix    }
  286. X    def @IndexWord        { Index        }
  287. X
  288. X
  289. X    ###########################################################################
  290. X    #                                                                         #
  291. X    #  @Protect x                                                             #
  292. X    #                                                                         #
  293. X    #  Like @CNP, this reserves space on the current page or else makes sure  #
  294. X    #  x appears on the following page.  Lookahead is proportional to font    #
  295. X    #  size.                                                                  #
  296. X    #                                                                         #
  297. X    ###########################################################################
  298. X
  299. X    def @Protect right x { 3.0f @High //0io // x }
  300. X
  301. X
  302. X    ###########################################################################
  303. X    #                                                                         #
  304. X    #   @HLine                                                                #
  305. X    #                                                                         #
  306. X    #   Draws a horizontal line to fill available space.                      #
  307. X    #                                                                         #
  308. X    ###########################################################################
  309. X
  310. X    def @HLine { {0 0 moveto xsize 0 lineto stroke} @Graphic {} }
  311. X
  312. X
  313. X    ###########################################################################
  314. X    #                                                                         #
  315. X    #  Symbols stored in the "standard" database:                             #
  316. X    #                                                                         #
  317. X    #    @Roman           lower case Roman numerals i, ii, ... , c            #
  318. X    #    @UCRoman         upper case Roman numerals I, II, ... , C            #
  319. X    #    @Alpha           lower case Roman alphabet a, b,  ... , z            #
  320. X    #    @UCAlpha         upper case Roman alphabet A, B,  ... , Z            #
  321. X    #    @Months          months of the year:  January, ... , December        #
  322. X    #    @ShortMonths     months of the year, abbreviated:  Jan, ... , Dec    #
  323. X    #    @WeekDays        days of the week:  Sunday, ... , Saturday           #
  324. X    #    @ShortWeekDays   days of the week, abbreviated:  Sun, ... , Sat      #
  325. X    #                                                                         #
  326. X    ###########################################################################
  327. X
  328. X    def @Roman        left @Tag right @Val { @Val }
  329. X    def @UCRoman    left @Tag right @Val { @Val }
  330. X    def @Alpha        left @Tag right @Val { @Val }
  331. X    def @UCAlpha    left @Tag right @Val { @Val }
  332. X    def @Months        left @Tag right @Val { @Val }
  333. X    def @ShortMonths    left @Tag right @Val { @Val }
  334. X    def @WeekDays    left @Tag right @Val { @Val }
  335. X    def @ShortWeekDays    left @Tag right @Val { @Val }
  336. X
  337. X    @SysDatabase @Roman @UCRoman @Alpha @UCAlpha @Months
  338. X         @ShortMonths @WeekDays @ShortWeekDays
  339. X    { standard  }
  340. X
  341. X
  342. X    ###########################################################################
  343. X    #                                                                         #
  344. X    #  Selected characters from Adobe's fonts.                                #
  345. X    #                                                                         #
  346. X    ###########################################################################
  347. X
  348. X    def "``"        { @Char "quotedblleft"                 }
  349. X    def "''"        { @Char "quotedblright"                }
  350. X    def "--"        { @Char "endash"                 }
  351. X    def "---"        { @Char "emdash"                 }
  352. X    def @Bullet        { @Char "bullet"                }
  353. X    def @ParSym        { @Char "paragraph"                }
  354. X    def @SectSym    { @Char "section"                }
  355. X    def @Dagger        { @Char "dagger"                }
  356. X    def @DaggerDbl    { @Char "daggerdbl"                }
  357. X    def @CDot        { @Char "periodcentered"            }
  358. X    def @Sterling    { @Char "sterling"                }
  359. X    def @Yen        { @Char "yen"                    }
  360. X    def @Florin        { @Char "florin"                }
  361. X    def @Star        { { Symbol Base } @Font @Char "asteriskmath"    }
  362. X    def @Degree        { { Symbol Base } @Font @Char "degree"        }
  363. X    def @Minute        { { Symbol Base } @Font @Char "minute"        }
  364. X    def @Second        { { Symbol Base } @Font @Char "second"        }
  365. X    def @Multiply    { { Symbol Base } @Font @Char "multiply"    }
  366. X    def @Divide        { { Symbol Base } @Font @Char "divide"        }
  367. X    def @Lozenge    { { Symbol Base } @Font @Char "lozenge"        }
  368. X    def @Register    { { Symbol Base } @Font @Char "registersans"    }
  369. X    def @CopyRight    { { Symbol Base } @Font @Char "copyrightsans"    }
  370. X    def @TradeMark    { { Symbol Base } @Font @Char "trademarksans"    }
  371. X
  372. X
  373. X    ###########################################################################
  374. X    #                                                                         #
  375. X    #  Miscellaneous.                                                         #
  376. X    #                                                                         #
  377. X    ###########################################################################
  378. X
  379. X    def @R             right x { Base @Font x                 }
  380. X    def @I             right x { Slope @Font x                 }
  381. X    def @B             right x { Bold @Font x                 }
  382. X    def @S             right x { @OneRow { //0.04fo 0.8f @Font x }     }
  383. X    def "^"               { {} ^& {}                 }
  384. X    def "&-"  left x   right y { x &0ch y                 }
  385. X    def @MajorHeading  right x { ragged @Break @MajorHeadingFont @Font x }
  386. X    def @Heading       right x { ragged @Break @HeadingFont      @Font x }
  387. X    def @MinorHeading  right x { ragged @Break @MinorHeadingFont @Font x }
  388. X    def @Date { @Moment&&now @Open {@Day {@Months&&@Month}, @Century{@Year}} }
  389. X
  390. X
  391. X    ###########################################################################
  392. X    #                                                                         #
  393. X    #  Exception list for hyphenation.                                        #
  394. X    #                                                                         #
  395. X    ###########################################################################
  396. X
  397. X    def associate     { "as" &- "so" &- "ciate"                }
  398. X    def associates    { "as" &- "so" &- "ciates"            }
  399. X    def declination   { "dec" &- "li" &- "na" &- "tion"            }
  400. X    def obligatory    { "oblig" &- "a" &- "tory"            }
  401. X    def philanthropic { "phil" &- "an" &- "thropic"            }
  402. X    def present       { "present"                    }
  403. X    def presents      { "presents"                    }
  404. X    def project       { "project"                    }
  405. X    def projects      { "projects"                    }
  406. X    def reciprocity   { "reci" &- "procity"                }
  407. X    def recognizance  { "re" &- "cog" &- "ni" &- "zance"        }
  408. X    def reformation   { "ref" &- "or" &- "ma" &- "tion"            }
  409. X    def retribution   { "ret" &- "ri" &- "bu" &- "tion"            }
  410. X    def table         { "ta" &- "ble"                    }
  411. X
  412. X    def Associate     { "As" &- "so" &- "ciate"                }
  413. X    def Associates    { "As" &- "so" &- "ciates"            }
  414. X    def Declination   { "Dec" &- "li" &- "na" &- "tion"            }
  415. X    def Obligatory    { "Oblig" &- "a" &- "tory"            }
  416. X    def Philanthropic { "Phil" &- "an" &- "thropic"            }
  417. X    def Present       { "Present"                    }
  418. X    def Presents      { "Presents"                    }
  419. X    def Project       { "Project"                    }
  420. X    def Projects      { "Projects"                    }
  421. X    def Reciprocity   { "Reci" &- "procity"                }
  422. X    def Recognizance  { "Re" &- "cog" &- "ni" &- "zance"        }
  423. X    def Reformation   { "Ref" &- "or" &- "ma" &- "tion"            }
  424. X    def Retribution   { "Ret" &- "ri" &- "bu" &- "tion"            }
  425. X    def Table         { "Ta" &- "ble"                    }
  426. X
  427. X
  428. X    ###########################################################################
  429. X    #                                                                         #
  430. X    #  Page and item markers.   @Runner is used only by books.                #
  431. X    #                                                                         #
  432. X    ###########################################################################
  433. X
  434. X    export @Tag
  435. X    def @PageMarker
  436. X    right @Tag
  437. X    {
  438. X    @Null
  439. X    }
  440. X
  441. X    def @PageMark
  442. X    right x
  443. X    {
  444. X    @PageMarker&&preceding @Tagged x
  445. X    }
  446. X
  447. X    def @PageOf
  448. X    right x
  449. X    {
  450. X    @PageMarker&&x @Open { @Tag }
  451. X    }
  452. X
  453. X    export @Tag
  454. X    def @NumberMarker
  455. X    right @Tag
  456. X    {
  457. X    @Null
  458. X    }
  459. X
  460. X    def @NumberOf
  461. X    right x
  462. X    {
  463. X    @NumberMarker&&x @Open { @Tag }
  464. X    }
  465. X
  466. X    export @TopOdd @TopEven @FootOdd @FootEven
  467. X    def @Runner
  468. X    named @TopOdd    right @PageNum { @Null }
  469. X    named @TopEven    right @PageNum { @Null }
  470. X    named @FootOdd    right @PageNum { @Null }
  471. X    named @FootEven    right @PageNum { @Null }
  472. X    named @Tag {}
  473. X    { @Null
  474. X    }
  475. X
  476. X
  477. X    ###########################################################################
  478. X    #                                                                         #
  479. X    #   @Hyph x                                                               #
  480. X    #                                                                         #
  481. X    #   Return "hyphen" if x is "Yes" or "yes", else "nohyphen".              #
  482. X    #                                                                         #
  483. X    ###########################################################################
  484. X
  485. X    def @Hyph right x
  486. X    {
  487. X    x @Case {
  488. X        {Yes yes} @Yield "hyphen"
  489. X        else      @Yield "nohyphen"
  490. X    }
  491. X    }
  492. X
  493. X
  494. X    ###########################################################################
  495. X    #                                                                         #
  496. X    #  x @OrElse y                                                            #
  497. X    #                                                                         #
  498. X    #  This returns x unless its value is "dft", in which case it returns y.  #
  499. X    #  Useful for defaulting the value of one parameter to another.           #
  500. X    #                                                                         #
  501. X    ###########################################################################
  502. X
  503. X    def @OrElse
  504. X    left x
  505. X    right y
  506. X    {
  507. X    x @Case {
  508. X        dft  @Yield y
  509. X        else @Yield x
  510. X    }
  511. X    }
  512. X
  513. X
  514. X    ###########################################################################
  515. X    #                                                                         #
  516. X    #  Paragraphs.                                                            #
  517. X    #                                                                         #
  518. X    ###########################################################################
  519. X
  520. X    macro @PP    { //@ParaGap @ParaIndent @Wide &0i }
  521. X    macro @LP    { //@ParaGap               }
  522. X    macro @DP    { //@DispGap               }
  523. X    macro @NP    { //1.1b               }
  524. X    macro @CNP    { // 3.2v @High //0io //           }
  525. X
  526. X
  527. X    ###########################################################################
  528. X    #                                                                         #
  529. X    #  Beginning and ending of aligned displays.                              #
  530. X    #                                                                         #
  531. X    ###########################################################################
  532. X
  533. X    def @APlace            { @Galley }
  534. X    def @EndAlignedPlace   { @Galley }
  535. X    def @AlignedPlace      { @Galley }
  536. X
  537. X    def @BAligned into { @APlace&&preceding }
  538. X    {
  539. X    def @AlignedList { @AlignedPlace /1.1b @AlignedList }
  540. X
  541. X    //1.1b @AlignedList
  542. X    //     @EndAlignedPlace
  543. X    }
  544. X
  545. X    macro @BAD { // @APlace | @BAligned }
  546. X    def   @EAD force into { @EndAlignedPlace&&preceding } {}
  547. X
  548. X    macro @BeginAlignedDisplays { @BAD }
  549. X    macro @EndAlignedDisplays   { @EAD }
  550. X
  551. X
  552. X    ###########################################################################
  553. X    #                                                                         #
  554. X    #  Beginning and ending of numbered displays.                             #
  555. X    #                                                                         #
  556. X    ###########################################################################
  557. X
  558. X    def @BeginNumberedPlace { @Galley }
  559. X    def @EndNumberedPlace   { @Galley }
  560. X    def @NextNumberPlace    { @Galley }
  561. X
  562. X    def @NNumber into { @NextNumberPlace&&following } {}
  563. X    macro @NN { @NNumber @BeginNumberedPlace }
  564. X
  565. X    def @BNumbered into { @BeginNumberedPlace&&preceding }
  566. X    named style right tag { (tag) }
  567. X    named start { 1 }
  568. X    {
  569. X    def @NList right num
  570. X    {
  571. X        |1rt style num & @NumberMarker num & @NextNumberPlace
  572. X        // @NList @Next num
  573. X    }
  574. X
  575. X    //  @NList start
  576. X    //  @EndNumberedPlace
  577. X    }
  578. X
  579. X    macro @BND { // @BeginNumberedPlace // @BNumbered }
  580. X    def   @END force into { @EndNumberedPlace&&preceding } {}
  581. X    
  582. X    macro @BeginNumberedDisplays { @BND }
  583. X    macro @EndNumberedDisplays   { @END }
  584. X
  585. X
  586. X    ###########################################################################
  587. X    #                                                                         #
  588. X    #  Galleys which carry displays to their places.                          #
  589. X    #                                                                         #
  590. X    ###########################################################################
  591. X
  592. X    def @DispPlace { @Galley }
  593. X
  594. X    def @Disp into { @DispPlace&&preceding }
  595. X    right x
  596. X    {
  597. X    @OneRow x
  598. X    }
  599. X
  600. X    def @NDisp into { @DispPlace&&preceding }
  601. X    named @Tag {}
  602. X    right x
  603. X    {
  604. X    @OneRow {
  605. X       @NumberMarker&&following @Tagged @Tag
  606. X       @PageMarker&&preceding @Tagged @Tag
  607. X       ^//
  608. X       @OneRow x
  609. X    }
  610. X    }
  611. X
  612. X    def @ADisp into { @AlignedPlace&&preceding }
  613. X    right x
  614. X    {
  615. X    @OneRow x
  616. X    }
  617. X
  618. X    def @ANDisp into { @AlignedPlace&&preceding }
  619. X    named @Tag {}
  620. X    right x
  621. X    {
  622. X    @OneRow {
  623. X       @NumberMarker&&following @Tagged @Tag
  624. X       @PageMarker&&preceding @Tagged @Tag
  625. X       ^/
  626. X       @OneRow x
  627. X    }
  628. X    }
  629. X
  630. X
  631. X    ###########################################################################
  632. X    #                                                                         #
  633. X    #  Displays and raw displays.                                             #
  634. X    #                                                                         #
  635. X    ###########################################################################
  636. X
  637. X    macro @G  { |@DefaultIndent }
  638. X    macro @LG { |               }
  639. X    macro @IG { |@DispIndent    }
  640. X    macro @CG { |0.5rt          }
  641. X
  642. X    macro @D     { @DP @G   @DispPlace  |        @DP // @Disp   }
  643. X    macro @LD    { @DP @LG  @DispPlace  |        @DP // @Disp   }
  644. X    macro @ID    { @DP @IG  @DispPlace  |        @DP // @Disp   }
  645. X    macro @CD    { @DP @CG  @DispPlace  |        @DP // @Disp   }
  646. X
  647. X    macro @AD    { @DP @G   @APlace     |        @DP // @ADisp  }
  648. X    macro @LAD   { @DP @LG  @APlace     |        @DP // @ADisp  }
  649. X    macro @IAD   { @DP @IG  @APlace     |        @DP // @ADisp  }
  650. X    macro @CAD   { @DP @CG  @APlace     |        @DP // @ADisp  }
  651. X
  652. X    macro @ND    { @DP @G   @DispPlace  |1rt @NN @DP // @NDisp  }
  653. X    macro @LND   { @DP @LG  @DispPlace  |1rt @NN @DP // @NDisp  }
  654. X    macro @IND   { @DP @IG  @DispPlace  |1rt @NN @DP // @NDisp  }
  655. X    macro @CND   { @DP @CG  @DispPlace  |1rt @NN @DP // @NDisp  }
  656. X
  657. X    macro @AND   { @DP @G   @APlace     |1rt @NN @DP // @ANDisp }
  658. X    macro @LAND  { @DP @LG  @APlace     |1rt @NN @DP // @ANDisp }
  659. X    macro @IAND  { @DP @IG  @APlace     |1rt @NN @DP // @ANDisp }
  660. X    macro @CAND  { @DP @CG  @APlace     |1rt @NN @DP // @ANDisp }
  661. X
  662. X
  663. X    macro @RD    {     @G   @DispPlace  |               @Disp   }
  664. X    macro @RLD   {     @LG  @DispPlace  |               @Disp   }
  665. X    macro @RID   {     @IG  @DispPlace  |               @Disp   }
  666. X    macro @RCD   {     @CG  @DispPlace  |               @Disp   }
  667. X
  668. X    macro @RAD   {     @G   @APlace     |               @ADisp  }
  669. X    macro @RLAD  {     @LG  @APlace     |               @ADisp  }
  670. X    macro @RIAD  {     @IG  @APlace     |               @ADisp  }
  671. X    macro @RCAD  {     @CG  @APlace     |               @ADisp  }
  672. X
  673. X    macro @RND   {     @G   @DispPlace  |1rt @NN        @NDisp  }
  674. X    macro @RLND  {     @LG  @DispPlace  |1rt @NN        @NDisp  }
  675. X    macro @RIND  {     @IG  @DispPlace  |1rt @NN        @NDisp  }
  676. X    macro @RCND  {     @CG  @DispPlace  |1rt @NN        @NDisp  }
  677. X
  678. X    macro @RAND  {     @G   @APlace     |1rt @NN        @ANDisp }
  679. X    macro @RLAND {     @LG  @APlace     |1rt @NN        @ANDisp }
  680. X    macro @RIAND {     @IG  @APlace     |1rt @NN        @ANDisp }
  681. X    macro @RCAND {     @CG  @APlace     |1rt @NN        @ANDisp }
  682. X
  683. X
  684. X    macro @Display                            { @D     }
  685. X    macro @LeftDisplay                        { @LD    }
  686. X    macro @IndentedDisplay                    { @ID    }
  687. X    macro @CentredDisplay                     { @CD    }
  688. X    macro @CenteredDisplay                    { @CD    }
  689. X
  690. X    macro @AlignedDisplay                     { @AD    }
  691. X    macro @LeftAlignedDisplay                 { @LAD   }
  692. X    macro @IndentedAlignedDisplay             { @IAD   }
  693. X    macro @CentredAlignedDisplay              { @CAD   }
  694. X    macro @CenteredAlignedDisplay             { @CAD   }
  695. X
  696. X    macro @NumberedDisplay                    { @ND    }
  697. X    macro @LeftNumberedDisplay                { @LND   }
  698. X    macro @IndentedNumberedDisplay            { @IND   }
  699. X    macro @CentredNumberedDisplay             { @CND   }
  700. X    macro @CenteredNumberedDisplay            { @CND   }
  701. X
  702. X    macro @AlignedNumberedDisplay             { @AND   }
  703. X    macro @LeftAlignedNumberedDisplay         { @LAND  }
  704. X    macro @IndentedAlignedNumberedDisplay     { @IAND  }
  705. X    macro @CentredAlignedNumberedDisplay      { @CAND  }
  706. X    macro @CenteredAlignedNumberedDisplay     { @CAND  }
  707. X
  708. X
  709. X    macro @RawDisplay                         { @RD    }
  710. X    macro @RawLeftDisplay                     { @RLD   }
  711. X    macro @RawIndentedDisplay                 { @RID   }
  712. X    macro @RawCentredDisplay                  { @RCD   }
  713. X    macro @RawCenteredDisplay                 { @RCD   }
  714. X
  715. X    macro @RawAlignedDisplay                  { @RAD   }
  716. X    macro @RawLeftAlignedDisplay              { @RLAD  }
  717. X    macro @RawIndentedAlignedDisplay          { @RIAD  }
  718. X    macro @RawCentredAlignedDisplay           { @RCAD  }
  719. X    macro @RawCenteredAlignedDisplay          { @RCAD  }
  720. X
  721. X    macro @RawNumberedDisplay                 { @RND   }
  722. X    macro @RawLeftNumberedDisplay             { @RLND  }
  723. X    macro @RawIndentedNumberedDisplay         { @RIND  }
  724. X    macro @RawCentredNumberedDisplay          { @RCND  }
  725. X    macro @RawCenteredNumberedDisplay         { @RCND  }
  726. X
  727. X    macro @RawAlignedNumberedDisplay          { @RAND  }
  728. X    macro @RawLeftAlignedNumberedDisplay      { @RLAND }
  729. X    macro @RawIndentedAlignedNumberedDisplay  { @RIAND }
  730. X    macro @RawCentredAlignedNumberedDisplay   { @RCAND }
  731. X    macro @RawCenteredAlignedNumberedDisplay  { @RCAND }
  732. X
  733. X
  734. X    ###########################################################################
  735. X    #                                                                         #
  736. X    #  Lists and raw lists (except indented lists).                           #
  737. X    #                                                                         #
  738. X    ###########################################################################
  739. X
  740. X    def   @ItemPlace { @Galley }
  741. X    def   @ListItem into { @ItemPlace&&preceding } right x { x }
  742. X    macro @LI { @ListItem }
  743. X
  744. X    def   @EndListPlace { @Galley }
  745. X    def   @EndList force into { @EndListPlace&&preceding } {}
  746. X    macro @EL { @EndList }
  747. X
  748. X    def @RLL
  749. X    named indent { @DispIndent }
  750. X    named gap    { @DispGap }
  751. X    {
  752. X    def @List { |indent @ItemPlace | //gap @List }
  753. X
  754. X    @List // @EndListPlace
  755. X    }
  756. X
  757. X    def   @RCL    { @RLL indent { 0.5rt     } }
  758. X    macro @LL    { @DP @RLL @DP    }
  759. X    macro @CL    { @DP @RCL @DP    }
  760. X
  761. X    macro @RawLeftList        { @RLL    }
  762. X    macro @RawCentredList    { @RCL    }
  763. X    macro @RawCenteredList    { @RCL    }
  764. X    macro @LeftList        { @LL    }
  765. X    macro @CentredList        { @CL    }
  766. X    macro @CenteredList        { @CL    }
  767. X
  768. X
  769. X    ###########################################################################
  770. X    #                                                                         #
  771. X    #  Indented lists and raw indented lists, tagged automatically.           #
  772. X    #                                                                         #
  773. X    ###########################################################################
  774. X
  775. X    def @RawIndentedList
  776. X       named style right tag    {               }
  777. X       named indent        { @DispIndent    }
  778. X       named gap        { @DispGap    }
  779. X       named start        { 1        }
  780. X    {
  781. X    def @IList right num
  782. X    {   indent @Wide {style num} | @ItemPlace |
  783. X        //gap @IList @Next num
  784. X    }
  785. X
  786. X    @IList start // @EndListPlace
  787. X    }
  788. X
  789. X    def @RawNumberedList      { @RawIndentedList style { tag.               } }
  790. X    def @RawParenNumberedList { @RawIndentedList style { (tag)               } }
  791. X    def @RawRomanList          { @RawIndentedList style { {@Roman&&tag}.    } }
  792. X    def @RawParenRomanList    { @RawIndentedList style { ({@Roman&&tag})   } }
  793. X    def @RawUCRomanList          { @RawIndentedList style { {@UCRoman&&tag}.  } }
  794. X    def @RawParenUCRomanList  { @RawIndentedList style { ({@UCRoman&&tag}) } }
  795. X    def @RawAlphaList          { @RawIndentedList style { {@Alpha&&tag}.    } }
  796. X    def @RawParenAlphaList    { @RawIndentedList style { ({@Alpha&&tag})   } }
  797. X    def @RawUCAlphaList          { @RawIndentedList style { {@UCAlpha&&tag}.  } }
  798. X    def @RawParenUCAlphaList  { @RawIndentedList style { ({@UCAlpha&&tag}) } }
  799. X    def @RawBulletList          { @RawIndentedList style { @Bullet       } }
  800. X    def @RawStarList          { @RawIndentedList style { @Star           } }
  801. X    def @RawDashList          { @RawIndentedList style { --            } }
  802. X
  803. X    macro @IndentedList          { @DP @RawIndentedList        @DP }
  804. X    macro @NumberedList          { @DP @RawNumberedList        @DP }
  805. X    macro @ParenNumberedList  { @DP @RawParenNumberedList    @DP }
  806. X    macro @RomanList          { @DP @RawRomanList        @DP }
  807. X    macro @ParenRomanList     { @DP @RawParenRomanList        @DP }
  808. X    macro @UCRomanList          { @DP @RawUCRomanList        @DP }
  809. X    macro @ParenUCRomanList   { @DP @RawParenUCRomanList    @DP }
  810. X    macro @AlphaList          { @DP @RawAlphaList        @DP }
  811. X    macro @ParenAlphaList     { @DP @RawParenAlphaList        @DP }
  812. X    macro @UCAlphaList          { @DP @RawUCAlphaList        @DP }
  813. X    macro @ParenUCAlphaList   { @DP @RawParenUCAlphaList    @DP }
  814. X    macro @BulletList          { @DP @RawBulletList        @DP }
  815. X    macro @StarList          { @DP @RawStarList        @DP }
  816. X    macro @DashList          { @DP @RawDashList        @DP }
  817. X
  818. X    macro @RIL        { @RawIndentedList    }
  819. X    macro @RNL        { @RawNumberedList    }
  820. X    macro @RPNL        { @RawParenNumberedList    }
  821. X    macro @RRL        { @RawRomanList        }
  822. X    macro @RPRL        { @RawParenRomanList    }
  823. X    macro @RUCRL    { @RawUCRomanList    }
  824. X    macro @RPUCRL    { @RawParenUCRomanList    }
  825. X    macro @RAL        { @RawAlphaList        }
  826. X    macro @RPAL        { @RawParenAlphaList    }
  827. X    macro @RUCAL    { @RawUCAlphaList    }
  828. X    macro @RPUCAL    { @RawParenUCAlphaList    }
  829. X    macro @RBL        { @RawBulletList    }
  830. X    macro @RSL        { @RawStarList        }
  831. X    macro @RDL        { @RawDashList        }
  832. X
  833. X    macro @IL        { @IndentedList        }
  834. X    macro @NL        { @NumberedList        }
  835. X    macro @PNL        { @ParenNumberedList    }
  836. X    macro @RL        { @RomanList        }
  837. X    macro @PRL        { @ParenRomanList    }
  838. X    macro @UCRL        { @UCRomanList        }
  839. X    macro @PUCRL    { @ParenUCRomanList    }
  840. X    macro @AL        { @AlphaList        }
  841. X    macro @PAL        { @ParenAlphaList    }
  842. X    macro @UCAL        { @UCAlphaList        }
  843. X    macro @PUCAL    { @ParenUCAlphaList    }
  844. X    macro @BL        { @BulletList        }
  845. X    macro @SL        { @StarList        }
  846. X    macro @DL        { @DashList        }
  847. X
  848. X
  849. X    ###########################################################################
  850. X    #                                                                         #
  851. X    #  Indented lists and raw indented lists, tagged by the author.           #
  852. X    #                                                                         #
  853. X    ###########################################################################
  854. X
  855. X    def @TagPlace    { @Galley }
  856. X
  857. X    def @TagItem into { @ItemPlace&&preceding }
  858. X       left x
  859. X       right y
  860. X    { 
  861. X       def senditem into { @TagPlace&&preceding } { x }
  862. X
  863. X       senditem | y
  864. X    }
  865. X
  866. X    macro @TI { @TagItem }
  867. X
  868. X    def @RawTaggedList
  869. X    named style right tag { tag }
  870. X    named indent { @DispIndent }
  871. X    named gap    { @DispGap }
  872. X    {
  873. X    def @LList
  874. X    {   indent @Wide {style @TagPlace} | @ItemPlace
  875. X        //gap @LList
  876. X    }
  877. X
  878. X    @LList // @EndListPlace
  879. X    }
  880. X
  881. X    def @RawWideTaggedList    { @RawTaggedList indent { @WideIndent       } }
  882. X    def @RawVeryWideTaggedList    { @RawTaggedList indent { @VeryWideIndent   } }
  883. X    macro @TaggedList        { @DP @RawTaggedList        @DP }
  884. X    macro @WideTaggedList    { @DP @RawWideTaggedList    @DP }
  885. X    macro @VeryWideTaggedList    { @DP @RawVeryWideTaggedList    @DP }
  886. X
  887. X    macro @RTL        { @RawTaggedList        }
  888. X    macro @RWTL        { @RawWideTaggedList        }
  889. X    macro @RVWTL    { @RawVeryWideTaggedList    }
  890. X    macro @TL        { @TaggedList            }
  891. X    macro @WTL        { @WideTaggedList        }
  892. X    macro @VWTL        { @VeryWideTaggedList        }
  893. X
  894. X
  895. X
  896. X    ###########################################################################
  897. X    #                                                                         #
  898. X    #  Definitions for laying out one general-purpose page.                   #
  899. X    #                                                                         #
  900. X    ###########################################################################
  901. X
  902. X    def @FullPlace        { @Galley }
  903. X    def @ColPlace         { @Galley }
  904. X    def @IndexPlace       { @Galley }
  905. X
  906. X    export @Tag
  907. X    def @TopList right @Tag
  908. X    {
  909. X           @Galley
  910. X    //@TopGap  @TopList @Next @Tag
  911. X    }
  912. X
  913. X    export @Tag
  914. X    def @FootList right @Tag
  915. X    {
  916. X            @Galley
  917. X    //@FootGap  @FootList @Next @Tag
  918. X    }
  919. X
  920. X    def @FootSect
  921. X    {
  922. X            @FootLen @Wide @HLine
  923. X    //@FootGap  @FootList 1 ||@FootLen
  924. X    }
  925. X
  926. X    export @Tag
  927. X    def @ColFootList right @Tag
  928. X    {
  929. X            @Galley
  930. X    //@FootGap  @ColFootList @Next @Tag
  931. X    }
  932. X
  933. X    def @ColFootSect
  934. X    {
  935. X            @ColFootLen @Wide @HLine
  936. X    //@FootGap  @ColFootList 1 ||@ColFootLen
  937. X    }
  938. X
  939. X    def @ColList right col
  940. X    {
  941. X    def @Column
  942. X    {
  943. X        @VExpand { @ColPlace //1rt @OneRow { //@MidGap @ColFootSect } }
  944. X    }
  945. X
  946. X    col @Case {
  947. X
  948. X        Single @Yield @Column
  949. X
  950. X        Double @Yield { @DoubleColWidth @Wide @Column
  951. X                ||@ColGap @ColList col }
  952. X
  953. X        Multi  @Yield { @MultiColWidth @Wide @Column
  954. X                ||@ColGap @ColList col }
  955. X
  956. X    }
  957. X    }
  958. X    
  959. X    def @IndexColList right col
  960. X    {
  961. X    col @Case {
  962. X
  963. X        Single @Yield @VExpand @IndexPlace
  964. X
  965. X        Double @Yield { @DoubleColWidth @Wide @VExpand @IndexPlace
  966. X                ||@ColGap @IndexColList col }
  967. X
  968. X        Multi  @Yield { @MultiColWidth @Wide @VExpand @IndexPlace
  969. X                ||@ColGap @IndexColList col }
  970. X
  971. X    }
  972. X    }
  973. X
  974. X    def @Page right x
  975. X    {    @PageWidth @Wide @PageHeight @High
  976. X    {   //@PageMargin ||@PageMargin
  977. X        @HExpand @VExpand x
  978. X        ||@PageMargin //@PageMargin
  979. X    }
  980. X    }
  981. X
  982. X    def @OnePage
  983. X    named @Columns {}
  984. X    named @PageTop {}
  985. X    named @PageFoot {}
  986. X    {
  987. X    @Page {
  988. X              @PageTop
  989. X        //@MidGap @TopList
  990. X        //@MidGap @FullPlace
  991. X        //@MidGap @ColList @Columns
  992. X        //@MidGap @IndexColList @IndexColumns
  993. X        // //1rt  @OneRow { //@MidGap @FootSect //@MidGap @PageFoot }
  994. X    }
  995. X    }
  996. X
  997. X
  998. X    ###########################################################################
  999. X    #                                                                         #
  1000. X    #  Definitions for laying out introductory pages.                         #
  1001. X    #                                                                         #
  1002. X    ###########################################################################
  1003. X
  1004. X    def @IntroFullPlace   { @Galley }
  1005. X    def @IntroColPlace    { @Galley }
  1006. X
  1007. X    def @IntroColList right col
  1008. X    {
  1009. X    def @Column
  1010. X    {
  1011. X        @VExpand { @IntroColPlace //1rt @OneRow { //@MidGap @ColFootSect } }
  1012. X    }
  1013. X
  1014. X    col @Case {
  1015. X
  1016. X        Single @Yield @Column
  1017. X
  1018. X        Double @Yield { @DoubleColWidth @Wide @Column
  1019. X                ||@ColGap @IntroColList col }
  1020. X
  1021. X        Multi  @Yield { @MultiColWidth @Wide @Column
  1022. X                ||@ColGap @IntroColList col }
  1023. X
  1024. X    }
  1025. X    }
  1026. X
  1027. X    ###########################################################################
  1028. X    #                                                                         #
  1029. X    #  Page layout for documents other than books (simple and tech. reports)  #
  1030. X    #                                                                         #
  1031. X    ###########################################################################
  1032. X
  1033. X    def @SimplePageList
  1034. X    named @Columns {}
  1035. X    named @PageNumbers {}
  1036. X    right @PageNum
  1037. X    {
  1038. X            @PageMarker @PageNum
  1039. X    //  @OnePage
  1040. X            @Columns { @Columns }
  1041. X            @PageTop {
  1042. X            @PageNumbers @Case
  1043. X            {
  1044. X                {Yes yes} @Yield
  1045. X                {
  1046. X                @PageNum @Case
  1047. X                {
  1048. X                    1    @Yield @PageOneTopFormat @PageNum
  1049. X                    else @Yield @PageTopFormat    @PageNum
  1050. X                }
  1051. X                }
  1052. X                else @Yield @Null
  1053. X            }
  1054. X            }
  1055. X            @PageFoot {
  1056. X            @PageNumbers @Case
  1057. X            {
  1058. X            {Yes yes} @Yield
  1059. X            {
  1060. X                @PageNum @Case
  1061. X                {
  1062. X                1    @Yield @PageOneFootFormat @PageNum
  1063. X                else @Yield @PageFootFormat    @PageNum
  1064. X                }
  1065. X            }
  1066. X            else @Yield @Null
  1067. X            }
  1068. X        }
  1069. X    //  @SimplePageList
  1070. X        @Columns { @Columns }
  1071. X        @PageNumbers { @PageNumbers }
  1072. X        @Next @PageNum
  1073. X    }
  1074. X
  1075. X
  1076. X    ###########################################################################
  1077. X    #                                                                         #
  1078. X    #  Page list for ordinary pages of books.                                 #
  1079. X    #                                                                         #
  1080. X    ###########################################################################
  1081. X
  1082. X    def @OddPageList
  1083. X    named @Columns {}
  1084. X    right @PageNum
  1085. X    {
  1086. X    def @EvenPageList
  1087. X        named @Columns {}
  1088. X        right @PageNum
  1089. X    {
  1090. X        @PageMarker @PageNum
  1091. X        //    @Runner&&following @Open
  1092. X        {
  1093. X            @OnePage
  1094. X            @Columns { @Columns }
  1095. X            @PageTop { @TopEven @PageNum }
  1096. X            @PageFoot { @FootEven @PageNum }
  1097. X        }
  1098. X        //    @OddPageList
  1099. X            @Columns { @Columns }
  1100. X            @Next @PageNum
  1101. X    }
  1102. X
  1103. X        @PageMarker @PageNum
  1104. X    //  @Runner&&following @Open
  1105. X        {
  1106. X        @OnePage
  1107. X            @Columns { @Columns }
  1108. X            @PageTop { @TopOdd @PageNum }
  1109. X            @PageFoot { @FootOdd @PageNum }
  1110. X        }
  1111. X    //  @EvenPageList
  1112. X        @Columns { @Columns }
  1113. X        @Next @PageNum
  1114. X    }
  1115. X
  1116. X
  1117. X    ###########################################################################
  1118. X    #                                                                         #
  1119. X    #  Page list for introductory pages of books.  Unlike @OddPageList and    #
  1120. X    #  @EvenPageList, this one always generates an even number of pages.      #
  1121. X    #                                                                         #
  1122. X    ###########################################################################
  1123. X
  1124. X    def @IntroOddPageList
  1125. X    named @Columns {}
  1126. X    right @PageNum
  1127. X    {
  1128. X        @PageMarker @Roman&&@PageNum
  1129. X    //  @Runner&&following @Open
  1130. X        {
  1131. X        @Page {
  1132. X            @TopOdd @Roman&&@PageNum
  1133. X            //@MidGap @TopList
  1134. X            //@MidGap @IntroFullPlace
  1135. X            //@MidGap @IntroColList @Columns
  1136. X            //@MidGap @IndexColList @IndexColumns
  1137. X            // //1rt @OneRow
  1138. X            {  //@MidGap @FootSect
  1139. X               //@MidGap @FootOdd @Roman&&@PageNum
  1140. X            }
  1141. X        }
  1142. X        }
  1143. X    //  @PageMarker @Roman&&{@Next @PageNum}
  1144. X    //  @Runner&&following @Open
  1145. X        {
  1146. X        @Page {
  1147. X            @TopEven @Roman&&{@Next @PageNum}
  1148. X            //@MidGap @TopList
  1149. X            //@MidGap @IntroFullPlace
  1150. X            //@MidGap @IntroColList @Columns
  1151. X            //@MidGap @IndexColList @IndexColumns
  1152. X            // //1rt @OneRow
  1153. X            {    //@MidGap @FootSect
  1154. X            //@MidGap @FootEven @Roman&&{@Next @PageNum}
  1155. X            }
  1156. X        }
  1157. X        }
  1158. X    //  @IntroOddPageList
  1159. X        @Columns { @Columns }
  1160. X        @Next @Next @PageNum
  1161. X    }
  1162. X
  1163. X
  1164. X    ###########################################################################
  1165. X    #                                                                         #
  1166. X    #  Table of contents.                                                     #
  1167. X    #                                                                         #
  1168. X    ###########################################################################
  1169. X
  1170. X    def @ContentsPlace { @Galley }
  1171. X
  1172. X    def @ContentsEntry
  1173. X    left lpart
  1174. X    named pregap { @ContentsGap }
  1175. X    right rpart
  1176. X    {
  1177. X    def @Leaders { .. &4s @Leaders }
  1178. X
  1179. X    def sendentry into { @ContentsPlace&&preceding }
  1180. X    {
  1181. X        //pregap
  1182. X        lpart |1rt &2s @Leaders & 2f @Wide {|1rt rpart}
  1183. X    }
  1184. X
  1185. X    @TableOfContents @Case {
  1186. X        {Yes yes} @Yield sendentry
  1187. X        else      @Yield @Null
  1188. X    }
  1189. X    }
  1190. X
  1191. X    def @MajorContentsEntry
  1192. X    left lpart
  1193. X    named pregap { @MajorContentsGap }
  1194. X    right rpart
  1195. X    {
  1196. X    {@B lpart} @ContentsEntry pregap { pregap } rpart
  1197. X    }
  1198. X
  1199. X    def @ContentsSection
  1200. X    {
  1201. X    def @ContentsList { @ContentsPlace // @ContentsList }
  1202. X
  1203. X    @TableOfContents @Case {
  1204. X        {Yes yes} @Yield { @BookTitleFormat @ContentsWord // @ContentsList }
  1205. X        else      @Yield @Null
  1206. X    }
  1207. X    }
  1208. X
  1209. X
  1210. X    ###########################################################################
  1211. X    #                                                                         #
  1212. X    #  Footnotes.                                                             #
  1213. X    #                                                                         #
  1214. X    ###########################################################################
  1215. X
  1216. X    def @FullFootNote
  1217. X    named @Tag {}
  1218. X    right x
  1219. X    {
  1220. X    def ftag
  1221. X    { @OneRow { @FootList&&@Tag @Open { 0.8f @Font @Tag } ^/0.3vo }
  1222. X    }
  1223. X
  1224. X    def fnote into { @FootList&&following }
  1225. X    {
  1226. X        @FootNoteFont @Font @FootNoteBreak @Break
  1227. X        { @FootList&&preceding @Tagged @Tag  ftag & x }
  1228. X    }
  1229. X
  1230. X    @Null & @FootNoteFont @Font ftag & fnote
  1231. X    }
  1232. X
  1233. X    def @ColFootNote
  1234. X    named @Tag {}
  1235. X    right x
  1236. X    {
  1237. X    def ftag
  1238. X    { @OneRow { @ColFootList&&@Tag @Open { 0.8f @Font @Tag } ^/0.3vo }
  1239. X    }
  1240. X
  1241. X    def fnote into { @ColFootList&&following }
  1242. X    {
  1243. X        @FootNoteFont @Font @FootNoteBreak @Break
  1244. X        { @ColFootList&&preceding @Tagged @Tag  ftag & x }
  1245. X    }
  1246. X
  1247. X    @Null & @FootNoteFont @Font ftag & fnote
  1248. X    }
  1249. X
  1250. X
  1251. X    ###########################################################################
  1252. X    #                                                                         #
  1253. X    #  References.                                                            #
  1254. X    #                                                                         #
  1255. X    ###########################################################################
  1256. X
  1257. X    export  @Type @Author @Title @Institution
  1258. X        @Number @Publisher @Year @Proceedings
  1259. X        @Journal @Volume @Pages @Comment
  1260. X
  1261. X    def @Reference
  1262. X    named @Tag          { TAG?         }
  1263. X    named @Type         { TYPE?        }
  1264. X    named @Author       { AUTHOR?      }
  1265. X    named @Title        { TITLE?       }
  1266. X    named @Institution  { INSTITUTION? }
  1267. X    named @Number       { NUMBER?      }
  1268. X    named @Publisher    { PUBLISHER?   }
  1269. X    named @Year         { YEAR?        }
  1270. X    named @Proceedings  { PROCEEDINGS? }
  1271. X    named @Journal      { JOURNAL?     }
  1272. X    named @Volume       { VOLUME?      }
  1273. X    named @Pages        { PAGES?       }
  1274. X    named @Comment      { @Null        }
  1275. X    { @Null }
  1276. X
  1277. X    export @Style
  1278. X    def @RefStyle
  1279. X    left @Tag
  1280. X    named @Style right reftag {}
  1281. X    {}
  1282. X
  1283. X    @SysDatabase @RefStyle { "refstyles" }
  1284. X
  1285. X    def @RefPrint right reftag
  1286. X    {    @RefStyle&&{ @Reference&&reftag @Open { @Type } }
  1287. X    @Open { @Style reftag }
  1288. X    }
  1289. X
  1290. X
  1291. X    ###########################################################################
  1292. X    #                                                                         #
  1293. X    #  Reference collection at end of chapter.                                #
  1294. X    #                                                                         #
  1295. X    ###########################################################################
  1296. X
  1297. X    def @ChapRefPlace { @Galley }
  1298. X
  1299. X    def @ChapRefSection
  1300. X    named @Title        { @ReferencesWord }
  1301. X    named style right tag    { tag. }
  1302. X    named indent        { @DispIndent }
  1303. X    named gap        { @DispGap }
  1304. X    named start        { 1 }
  1305. X    {
  1306. X    def @RefList right num
  1307. X    {
  1308. X        @NumberMarker num &
  1309. X        indent @Wide {style num}  |  @ChapRefPlace
  1310. X        //gap @RefList @Next num
  1311. X    }
  1312. X
  1313. X    @Heading @Protect @Title
  1314. X    //@DispGap
  1315. X    @RefList start
  1316. X    }
  1317. X
  1318. X    def @ChapRef right x
  1319. X    {
  1320. X    def sendref into { @ChapRefPlace&&following }
  1321. X        right @Key
  1322. X    {
  1323. X        @NumberMarker&&preceding @Tagged x &
  1324. X        @PageMarker&&preceding @Tagged x &
  1325. X        @RefPrint x
  1326. X    }
  1327. X
  1328. X    @NumberMarker&&x @Open { @Tag } sendref x
  1329. X    }
  1330. X
  1331. X
  1332. X    ###########################################################################
  1333. X    #                                                                         #
  1334. X    #  Reference collection at end of document.                               #
  1335. X    #                                                                         #
  1336. X    ###########################################################################
  1337. X
  1338. X    def @RefPlace { @Galley }
  1339. X
  1340. X    def @Ref right x
  1341. X    {
  1342. X    def sendref into { @RefPlace&&following }
  1343. X        right @Key
  1344. X    {
  1345. X        @NumberMarker&&preceding @Tagged x &
  1346. X        @PageMarker&&preceding @Tagged x &
  1347. X        @RefPrint x
  1348. X    }
  1349. X
  1350. X    @NumberMarker&&x @Open { @Tag } sendref x
  1351. X    }
  1352. X
  1353. X    def @ReferenceSection
  1354. X    named @Tag        {}
  1355. X    named @Title        { @ReferencesWord }
  1356. X    named @RunningTitle    { dft }
  1357. X    named style right tag    { tag. }
  1358. X    named headstyle right @Title { @Heading @Title }
  1359. X    named indent        { @DispIndent }
  1360. X    named gap        { @DispGap }
  1361. X    named start        { 1 }
  1362. X    {
  1363. X    def @RefList right num
  1364. X    {
  1365. X        @NumberMarker num &
  1366. X        indent @Wide {style num}  |  @RefPlace
  1367. X        //gap @RefList @Next num
  1368. X    }
  1369. X
  1370. X        @Protect headstyle @Title
  1371. X    //  @PageMarker&&preceding @Tagged @Tag
  1372. X    //  @Title @MajorContentsEntry {@PageOf @Tag}
  1373. X    //  @Runner
  1374. X        @FootEven { |0.5rt 0.8f @Font @B @PageNum }
  1375. X        @FootOdd  { |0.5rt 0.8f @Font @B @PageNum }
  1376. X    //@DispGap  @RefList start
  1377. X    //  @Runner
  1378. X        @TopEven { @B @PageNum }
  1379. X        @TopOdd  {
  1380. X          @RunningTitles @Case {
  1381. X            { Yes yes } @Yield @I {@RunningTitle @OrElse @Title}
  1382. X            else        @Yield {}
  1383. X          }
  1384. X          |1rt @B @PageNum
  1385. X        }
  1386. X    }
  1387. X
  1388. X
  1389. X    ###########################################################################
  1390. X    #                                                                         #
  1391. X    #  Floating figures.                                                      #
  1392. X    #                                                                         #
  1393. X    ###########################################################################
  1394. X
  1395. X    def @FigurePlace { @Galley }
  1396. X    def @EndFigurePlace { @Galley }
  1397. X
  1398. X    def @FigureGalley into { @TopList&&following }
  1399. X    right prefix
  1400. X    {
  1401. X    def @FigureList right x
  1402. X    {
  1403. X        @NumberMarker {prefix}x & ||0.5rt @FigurePlace ||
  1404. X        //@TopGap
  1405. X        @FigureList @Next x
  1406. X    }
  1407. X
  1408. X    @FigureList 1
  1409. X    //
  1410. X    @EndFigurePlace
  1411. X    }
  1412. X
  1413. X    def @EndFigures force into { @EndFigurePlace&&following } {}
  1414. X
  1415. X    def @Figure into { @FigurePlace&&following }
  1416. X    named @Caption {}
  1417. X    named @Tag {}
  1418. X    right @Body
  1419. X    {
  1420. X    @OneRow
  1421. X    {
  1422. X        ||0.5rt @HContract @Body
  1423. X        //@DispGap
  1424. X        ||0.5rt
  1425. X        @NumberMarker&&preceding @Tagged @Tag
  1426. X        @PageMarker&&preceding @Tagged @Tag
  1427. X        @B { @FigureWord {@NumberOf @Tag}. }  @Caption
  1428. X    }
  1429. X    }
  1430. X
  1431. X
  1432. X    ###########################################################################
  1433. X    #                                                                         #
  1434. X    #  Floating tables.                                                       #
  1435. X    #                                                                         #
  1436. X    ###########################################################################
  1437. X
  1438. X    def @TablePlace { @Galley }
  1439. X    def @EndTablePlace { @Galley }
  1440. X
  1441. X    def @TableGalley into { @TopList&&following }
  1442. X    right prefix
  1443. X    {
  1444. X    def @TableList right x
  1445. X    {
  1446. X        @NumberMarker {prefix}x & ||0.5rt @TablePlace ||
  1447. X        //@TopGap
  1448. X        @TableList @Next x
  1449. X    }
  1450. X
  1451. X    @TableList 1
  1452. X    //
  1453. X    @EndTablePlace
  1454. X    }
  1455. X
  1456. X    def @EndTables force into { @EndTablePlace&&following } {}
  1457. X
  1458. X    def @Table into { @TablePlace&&following }
  1459. X    named @Caption {}
  1460. X    named @Tag {}
  1461. X    right @Body
  1462. X    {
  1463. X    @OneRow
  1464. X    {
  1465. X        ||0.5rt @HContract @Body
  1466. X        //@DispGap
  1467. X        ||0.5rt
  1468. X        @NumberMarker&&preceding @Tagged @Tag
  1469. X        @PageMarker&&preceding @Tagged @Tag
  1470. X        @B { @TableWord {@NumberOf @Tag}. }  @Caption
  1471. X    }
  1472. X    }
  1473. X
  1474. X
  1475. X    ###########################################################################
  1476. X    #                                                                         #
  1477. X    #  Lists of chapters, sections, subsections, and appendices.              #
  1478. X    #                                                                         #
  1479. X    ###########################################################################
  1480. X
  1481. X    export @Tag
  1482. X    def @ChapterList right @Tag
  1483. X    {
  1484. X                @Galley
  1485. X    //@ChapterGap        @ChapterList @Next @Tag
  1486. X    }
  1487. X
  1488. X    export @Tag
  1489. X    def @SectionList right @Tag
  1490. X    {
  1491. X                @Galley
  1492. X        //@SectionGap        @SectionList @Next @Tag
  1493. X    }
  1494. X
  1495. X    export @Tag
  1496. X    def @SubSectionList right @Tag
  1497. X    {
  1498. X                @Galley
  1499. X    //@SubSectionGap    @SubSectionList @Next @Tag
  1500. X    }
  1501. X
  1502. X    export @Tag
  1503. X    def @AppendixList right @Tag
  1504. X    {
  1505. X                @Galley
  1506. X    //@AppendixGap        @AppendixList @Next @Tag
  1507. X    }
  1508. X
  1509. X    export @Tag
  1510. X    def @SubAppendixList right @Tag
  1511. X    {
  1512. X                @Galley
  1513. X    //@SubAppendixGap   @SubAppendixList @Next @Tag
  1514. X    }
  1515. X
  1516. X
  1517. X    ###########################################################################
  1518. X    #                                                                         #
  1519. X    #  Body text.                                                             #
  1520. X    #                                                                         #
  1521. X    ###########################################################################
  1522. X
  1523. X    export @ColText @FootNote
  1524. X       @BeginSections @EndSections @BeginAppendices @EndAppendices
  1525. X
  1526. X    def @Text force into { @FullPlace&&preceding }
  1527. X    body x
  1528. X    {
  1529. X    def @FootNote right x { @FullFootNote x }
  1530. X
  1531. X    def @EndSectionsPlace { @Galley }
  1532. X    def @EndSections force into { @EndSectionsPlace&&preceding }  {}
  1533. X    macro @BeginSections
  1534. X          { //@SectionGap @SectionList 1 // @EndSectionsPlace // }
  1535. X
  1536. X    def @EndAppendicesPlace { @Galley }
  1537. X    def @EndAppendices force into { @EndAppendicesPlace&&preceding }  {}
  1538. X    macro @BeginAppendices
  1539. X          { //@AppendixGap @AppendixList 1 // @EndAppendicesPlace //}
  1540. X
  1541. X
  1542. X    export @FootNote
  1543. X    def @ColText force into { @ColPlace&&following }
  1544. X        body x
  1545. X    {
  1546. X        def @FootNote right x { @ColFootNote x }
  1547. X    
  1548. X        x
  1549. X    }
  1550. X
  1551. X    x
  1552. X    }
  1553. X
  1554. X    export @FootNote
  1555. X       @BeginSections @EndSections @BeginAppendices @EndAppendices
  1556. X    def @ColText force into { @ColPlace&&preceding }
  1557. X    body x
  1558. X    {
  1559. X    def @FootNote right x { @ColFootNote x }
  1560. X
  1561. X    def @EndSectionsPlace { @Galley }
  1562. X    def @EndSections force into { @EndSectionsPlace&&preceding }  {}
  1563. X    macro @BeginSections
  1564. X          { //@SectionGap @SectionList 1 // @EndSectionsPlace // }
  1565. X
  1566. X    def @EndAppendicesPlace { @Galley }
  1567. X    def @EndAppendices force into { @EndAppendicesPlace&&preceding }  {}
  1568. X    macro @BeginAppendices
  1569. X          { //@AppendixGap @AppendixList 1 // @EndAppendicesPlace //}
  1570. X    x
  1571. X    }
  1572. X
  1573. X
  1574. X    ###########################################################################
  1575. X    #                                                                         #
  1576. X    #  Abstract.                                                              #
  1577. X    #                                                                         #
  1578. X    ###########################################################################
  1579. X
  1580. X    def @AbstractPlace { @Galley }
  1581. X
  1582. X    export @FootNote
  1583. X    def @Abstract into { @AbstractPlace&&preceding }
  1584. X    named @Title { @AbstractWord }
  1585. X    body x
  1586. X    {  
  1587. X    def @FootNote right x { @FullFootNote x }
  1588. X
  1589. X    |0.5rt @I @Title
  1590. X    //@DispGap x
  1591. X    }
  1592. X
  1593. X
  1594. X    ###########################################################################
  1595. X    #                                                                         #
  1596. X    #  Preface.                                                               #
  1597. X    #                                                                         #
  1598. X    ###########################################################################
  1599. X
  1600. X    def @PrefacePlace { @Galley }
  1601. X
  1602. X    export @FootNote @BeginFigures @BeginTables
  1603. X    def @Preface force into { @PrefacePlace&&preceding }
  1604. X    named @Tag {}
  1605. X    named @Title { @PrefaceWord }
  1606. X    named @RunningTitle { dft }
  1607. X    body @Body
  1608. X    {
  1609. X    def @FootNote right x { @ColFootNote x }
  1610. X    macro @BeginFigures { @FigureGalley {} }
  1611. X    macro @BeginTables  { @TableGalley  {} }
  1612. X
  1613. X        ragged @Break @BookTitleFormat @Title
  1614. X    //  @PageMarker&&preceding @Tagged @Tag
  1615. X    //  @Body
  1616. X    //@SectionGap    @ChapRefSection
  1617. X    }
  1618. X
  1619. X
  1620. X    ###########################################################################
  1621. X    #                                                                         #
  1622. X    #  Introduction.                                                          #
  1623. X    #                                                                         #
  1624. X    ###########################################################################
  1625. X
  1626. X    def @IntroductionPlace { @Galley }
  1627. X
  1628. X    export @FootNote @BeginFigures @BeginTables
  1629. X    def @Introduction force into { @IntroductionPlace&&preceding }
  1630. X    named @Tag {}
  1631. X    named @Title { @IntroductionWord }
  1632. X    named @RunningTitle { dft }
  1633. X    body @Body
  1634. X    {
  1635. X    def @FootNote right x { @ColFootNote x }
  1636. X    macro @BeginFigures { @FigureGalley {} }
  1637. X    macro @BeginTables  { @TableGalley  {} }
  1638. X
  1639. X        ragged @Break @BookTitleFormat @Title
  1640. X    //  @Runner
  1641. X        @FootEven { |0.5rt 0.8f @Font @B @PageNum }
  1642. X        @FootOdd  { |0.5rt 0.8f @Font @B @PageNum }
  1643. X    //  @PageMarker&&preceding @Tagged @Tag
  1644. X    //  @Title @MajorContentsEntry {@PageOf @Tag}
  1645. X    //  @Body
  1646. X    //@SectionGap    @ChapRefSection
  1647. X    //  @Runner
  1648. X        @TopEven { @B @PageNum }
  1649. X        @TopOdd  {
  1650. X          @RunningTitles @Case {
  1651. X            { Yes yes } @Yield @I {@RunningTitle @OrElse @Title}
  1652. X            else        @Yield {}
  1653. X          }
  1654. X          |1rt @B @PageNum
  1655. X        }
  1656. X    }
  1657. X
  1658. X
  1659. X    ###########################################################################
  1660. X    #                                                                         #
  1661. X    #  Chapters containing sections and subsections.                          #
  1662. X    #                                                                         #
  1663. X    ###########################################################################
  1664. X
  1665. X    export @FootNote @BeginFigures @BeginTables
  1666. X       @BeginSections @EndSections @Section
  1667. X    def @Chapter force into { @ChapterList&&preceding }
  1668. X    named @Tag {}
  1669. X    named @Title {}
  1670. X    named @RunningTitle { dft }
  1671. X    body @Body
  1672. X    {
  1673. X    def @FootNote right x { @ColFootNote x }
  1674. X    macro @BeginFigures { @FigureGalley {@NumberOf @Tag}. }
  1675. X    macro @BeginTables  { @TableGalley  {@NumberOf @Tag}. }
  1676. X
  1677. X    def @EndSectionsPlace { @Galley }
  1678. X    def @EndSections force into { @EndSectionsPlace&&preceding } {}
  1679. X    macro @BeginSections
  1680. X          { //@SectionGap @SectionList 1 // @EndSectionsPlace // }
  1681. X
  1682. X    export @BeginSubSections @EndSubSections @SubSection
  1683. X    def @Section force into { @SectionList&&preceding }
  1684. X        named @Tag {}
  1685. X        named @Title {}
  1686. X        named @RunningTitle { dft }
  1687. X        body @Body
  1688. X    {
  1689. X
  1690. X        def @EndSubSectsPlace { @Galley }
  1691. X        def @EndSubSections force into { @EndSubSectsPlace&&preceding } {}
  1692. X        macro @BeginSubSections
  1693. X         { //@SubSectionGap @SubSectionList 1// @EndSubSectsPlace//}
  1694. X
  1695. X        def @SubSection force into { @SubSectionList&&preceding }
  1696. X        named @Tag {}
  1697. X        named @Title {}
  1698. X            named @RunningTitle { dft }
  1699. X        body @Body
  1700. X        {
  1701. X        def @SubSectionTitle
  1702. X        {
  1703. X            @SubSectionNumbers @Case {
  1704. X            {Yes yes} @Yield { {@NumberOf @Tag}.  |2s  @Title }
  1705. X            else      @Yield @Title
  1706. X            }
  1707. X        }
  1708. X
  1709. X            @MinorHeading @Protect @SubSectionTitle
  1710. X        //  @NumberMarker {
  1711. X            {@ChapterList&&@Tag    @Open { @Tag }}.{
  1712. X             @SectionList&&@Tag    @Open { @Tag }}.{
  1713. X             @SubSectionList&&@Tag @Open { @Tag }}
  1714. X            }
  1715. X        //  @ChapterList&&preceding     @Tagged @Tag
  1716. X        //  @SectionList&&preceding     @Tagged @Tag
  1717. X        //  @SubSectionList&&preceding  @Tagged @Tag
  1718. X        //  @NumberMarker&&preceding    @Tagged @Tag
  1719. X        //  @PageMarker&&preceding      @Tagged @Tag
  1720. X        //  {&5f @SubSectionTitle} @ContentsEntry {@PageOf @Tag}
  1721. X        //  @Body
  1722. X        }
  1723. X
  1724. X        def @SectionTitle
  1725. X        {
  1726. X        @SectionNumbers @Case {
  1727. X            {Yes yes} @Yield { {@NumberOf @Tag}.  |2s  @Title }
  1728. X            else      @Yield @Title
  1729. X        }
  1730. X        }
  1731. X
  1732. X            @Heading @Protect @SectionTitle
  1733. X        //  @NumberMarker {
  1734. X            {@ChapterList&&@Tag @Open { @Tag }}.{
  1735. X             @SectionList&&@Tag @Open { @Tag }}
  1736. X        }
  1737. X        //  @ChapterList&&preceding  @Tagged @Tag
  1738. X        //  @SectionList&&preceding  @Tagged @Tag
  1739. X        //  @NumberMarker&&preceding @Tagged @Tag
  1740. X        //  @PageMarker&&preceding   @Tagged @Tag
  1741. X        //  { &3f @SectionTitle } @ContentsEntry {@PageOf @Tag}
  1742. X        //  @Body
  1743. X
  1744. X    }
  1745. X
  1746. X    def @ChapterTitle
  1747. X    {
  1748. X        @ChapterNumbers @Case {
  1749. X        {Yes yes} @Yield { @ChapterWord {@NumberOf @Tag}.  |2s  @Title }
  1750. X        else      @Yield @Title
  1751. X        }
  1752. X    }
  1753. X
  1754. X    def @ChapterNum
  1755. X    {
  1756. X        @ChapterNumbers @Case {
  1757. X        {Yes yes} @Yield { @ChapterWord {@NumberOf @Tag} }
  1758. X        else      @Yield @Null
  1759. X        }
  1760. X    }
  1761. X
  1762. X        ragged @Break @BookTitleFormat @ChapterTitle
  1763. X    //  @NumberMarker {
  1764. X        @ChapterList&&@Tag @Open { @Tag }
  1765. X        }
  1766. X    //  @ChapterList&&preceding  @Tagged @Tag
  1767. X    //  @NumberMarker&&preceding @Tagged @Tag
  1768. X    //  @PageMarker&&preceding   @Tagged @Tag
  1769. X    //  { @ChapterTitle } @MajorContentsEntry {@PageOf @Tag}
  1770. X    //  @Runner
  1771. X        @FootEven { |0.5rt 0.8f @Font @B @PageNum }
  1772. X        @FootOdd  { |0.5rt 0.8f @Font @B @PageNum }
  1773. X    //  @Body
  1774. X    //@SectionGap @ChapRefSection
  1775. X    //  @Runner
  1776. X        @TopEven { @B @PageNum |1rt @I @ChapterNum }
  1777. X        @TopOdd  {
  1778. X          @RunningTitles @Case {
  1779. X            { Yes yes } @Yield @I {@RunningTitle @OrElse @Title}
  1780. X            else        @Yield {}
  1781. X          }
  1782. X          |1rt @B @PageNum
  1783. X        }
  1784. X    }
  1785. X
  1786. X
  1787. X    ###########################################################################
  1788. X    #                                                                         #
  1789. X    #  Sections containing subsections.                                       #
  1790. X    #                                                                         #
  1791. X    ###########################################################################
  1792. X
  1793. X    export @FootNote @BeginFigures @BeginTables
  1794. X       @BeginSubSections @SubSection @EndSubSections
  1795. X    def @Section force into { @SectionList&&preceding }
  1796. X    named @Tag {}
  1797. X    named @Title {}
  1798. X    named @RunningTitle { dft }
  1799. X    body @Body
  1800. X    {
  1801. X    def @FootNote right x { @ColFootNote x }
  1802. X    macro @BeginFigures { @FigureGalley {@NumberOf @Tag}. }
  1803. X    macro @BeginTables  { @TableGalley  {@NumberOf @Tag}. }
  1804. X
  1805. X    def @EndSubSectsPlace { @Galley }
  1806. X    def @EndSubSections force into { @EndSubSectsPlace&&preceding }  {}
  1807. X    macro @BeginSubSections
  1808. X      { //@SubSectionGap @SubSectionList 1 // @EndSubSectsPlace // }
  1809. X
  1810. X    def @SubSection force into { @SubSectionList&&preceding }
  1811. X        named @Tag {}
  1812. X        named @Title {}
  1813. X        named @RunningTitle { dft }
  1814. X        right @Body
  1815. X    {
  1816. X        def @SubSectionTitle
  1817. X        {
  1818. X        @SubSectionNumbers @Case {
  1819. X            {Yes yes} @Yield { {@NumberOf @Tag}.  |2s  @Title }
  1820. X            else      @Yield @Title
  1821. X        }
  1822. X        }
  1823. X
  1824. X            @MinorHeading @Protect @SubSectionTitle
  1825. X        //    @NumberMarker {
  1826. X            {@SectionList&&@Tag @Open { @Tag }}.{
  1827. X             @SubSectionList&&@Tag @Open { @Tag }}
  1828. X        }
  1829. X        //    @SubSectionList&&preceding @Tagged @Tag
  1830. X        //    @SectionList&&preceding    @Tagged @Tag
  1831. X        //    @NumberMarker&&preceding   @Tagged @Tag
  1832. X        //    @PageMarker&&preceding     @Tagged @Tag
  1833. X        //  @Body
  1834. X    }
  1835. X
  1836. X    def @SectionTitle
  1837. X    {
  1838. X        @SectionNumbers @Case {
  1839. X        {Yes yes} @Yield { {@NumberOf @Tag}.  |2s  @Title }
  1840. X        else      @Yield @Title
  1841. X        }
  1842. X    }
  1843. X
  1844. X        @Heading @Protect @SectionTitle
  1845. X    //  @NumberMarker {
  1846. X        @SectionList&&@Tag @Open { @Tag }
  1847. X        }
  1848. X    //  @SectionList&&preceding  @Tagged @Tag
  1849. X    //  @NumberMarker&&preceding @Tagged @Tag
  1850. X    //  @PageMarker&&preceding   @Tagged @Tag
  1851. X    //  @Body
  1852. X    }
  1853. X
  1854. X
  1855. X    ###########################################################################
  1856. X    #                                                                         #
  1857. X    #  Appendices.                                                            #
  1858. X    #                                                                         #
  1859. X    ###########################################################################
  1860. X
  1861. X    export @FootNote @BeginFigures @BeginTables
  1862. X       @BeginSubAppendices @SubAppendix @EndSubAppendices
  1863. X    def @Appendix force into { @AppendixList&&preceding }
  1864. X    named @Tag {}
  1865. X    named @Title {}
  1866. X    named @RunningTitle { dft }
  1867. X    body  @Body
  1868. X    {
  1869. X    def @FootNote right x { @ColFootNote x }
  1870. X    macro @BeginFigures { @FigureGalley {@NumberOf @Tag}. }
  1871. X    macro @BeginTables  { @TableGalley  {@NumberOf @Tag}. }
  1872. X
  1873. X    def @EndSubAppendicesPlace { @Galley }
  1874. X    def @EndSubAppendices force into {@EndSubAppendicesPlace&&preceding} {}
  1875. X    macro @BeginSubAppendices
  1876. X      { //@SubAppendixGap @SubAppendixList 1 // @EndSubAppendicesPlace // }
  1877. X
  1878. X    def @SubAppendix force into { @SubAppendixList&&preceding }
  1879. X        named @Tag {}
  1880. X        named @Title {}
  1881. X        named @RunningTitle { dft }
  1882. X        right @Body
  1883. X    {
  1884. X        def @SubAppendixTitle
  1885. X        {
  1886. X        @SubAppendixNumbers @Case {
  1887. X            {Yes yes} @Yield { {@NumberOf @Tag}.  |2s  @Title }
  1888. X            else      @Yield @Title
  1889. X        }
  1890. X        }
  1891. X
  1892. X            @Heading @Protect @SubAppendixTitle
  1893. X        //    @NumberMarker {
  1894. X            {@AppendixList&&@Tag @Open { @Tag }}.{
  1895. X             @SubAppendixList&&@Tag @Open { @Tag }}
  1896. X        }
  1897. X        //    @SubAppendixList&&preceding @Tagged @Tag
  1898. X        //    @AppendixList&&preceding    @Tagged @Tag
  1899. X        //    @NumberMarker&&preceding   @Tagged @Tag
  1900. X        //    @PageMarker&&preceding     @Tagged @Tag
  1901. X        //    @SubAppendixTitle @ContentsEntry {@PageOf @Tag}
  1902. X        //  @Body
  1903. X    }
  1904. X
  1905. X    def @AppendixTitle
  1906. X    {
  1907. X        @AppendixNumbers @Case {
  1908. X        {Yes yes} @Yield { @AppendixWord {@NumberOf @Tag}. |2s @Title }
  1909. X        else      @Yield { @AppendixWord.  @Title }
  1910. X        }
  1911. X    }
  1912. X
  1913. X    def @AppendixNum
  1914. X    {
  1915. X        @AppendixNumbers @Case {
  1916. X        {Yes yes} @Yield { @NumberOf @Tag }
  1917. X        else      @Yield @Null
  1918. X        }
  1919. X    }
  1920. X
  1921. X        ragged @Break @BookTitleFormat @AppendixTitle
  1922. X    //  @NumberMarker {
  1923. X        @AppendixList&&@Tag @Open { @UCAlpha&&@Tag }
  1924. X        }
  1925. X    //  @AppendixList&&preceding @Tagged @Tag
  1926. X    //  @NumberMarker&&preceding @Tagged @Tag
  1927. X    //  @PageMarker&&preceding   @Tagged @Tag
  1928. X    //  @AppendixTitle @MajorContentsEntry {@PageOf @Tag}
  1929. X    //  @Runner
  1930. X        @FootEven { |0.5rt 0.8f @Font @B @PageNum }
  1931. X        @FootOdd  { |0.5rt 0.8f @Font @B @PageNum }
  1932. X    //  @Body
  1933. X    //@SectionGap @ChapRefSection
  1934. X    //  @Runner
  1935. X        @TopEven { @B @PageNum |1rt @I { @AppendixWord @AppendixNum } }
  1936. X        @TopOdd  {
  1937. X          @RunningTitles @Case {
  1938. X            { Yes yes } @Yield @I {@RunningTitle @OrElse @Title}
  1939. X            else        @Yield {}
  1940. X          }
  1941. X          |1rt @B @PageNum
  1942. X        }
  1943. X    }
  1944. X
  1945. X
  1946. X    ###########################################################################
  1947. X    #                                                                         #
  1948. X    #  Index.                                                                 #
  1949. X    #                                                                         #
  1950. X    ###########################################################################
  1951. X
  1952. X    def @IndexList { @Galley //1vx @IndexList }
  1953. X
  1954. X    def @IndexSection
  1955. X    named @Tag {}
  1956. X    named @Title { @IndexWord }
  1957. X    named @RunningTitle { dft }
  1958. X    named headstyle right @Title { @Heading @Title //@DispGap }
  1959. X    {
  1960. X
  1961. X    def @IndexBody into { @IndexPlace&&following }
  1962. X    { // @IndexList
  1963. X      // @Runner
  1964. X        @TopEven { @B @PageNum }
  1965. X        @TopOdd  {
  1966. X          @RunningTitles @Case {
  1967. X            { Yes yes } @Yield @I {@RunningTitle @OrElse @Title}
  1968. X            else        @Yield {}
  1969. X          }
  1970. X          |1rt @B @PageNum
  1971. X        }
  1972. X    }
  1973. X
  1974. X        def indexsection
  1975. X        {
  1976. X        headstyle @Title
  1977. X        //    @PageMarker&&preceding @Tagged @Tag
  1978. X        //    @Title @MajorContentsEntry {@PageOf @Tag}
  1979. X        //    @Runner
  1980. X            @FootEven { |0.5rt 0.8f @Font @B @PageNum }
  1981. X            @FootOdd  { |0.5rt 0.8f @Font @B @PageNum }
  1982. X        //    @IndexBody
  1983. X        }
  1984. X
  1985. X    @MakeIndex @Case {
  1986. X        {Yes yes} @Yield indexsection
  1987. X        else      @Yield @Null
  1988. X    }
  1989. X    }
  1990. X
  1991. X    def @SendIndex
  1992. X    left key
  1993. X    right @Body
  1994. X    {
  1995. X        def sendindex into { @IndexList&&following }
  1996. X        left @Key
  1997. X        right @Body
  1998. X    {
  1999. X        outdent @Break @Body
  2000. X    }
  2001. X
  2002. X    @MakeIndex @Case {
  2003. X        {Yes yes} @Yield {key sendindex @Body}
  2004. X        else      @Yield @Null
  2005. X    }
  2006. X    }
  2007. X
  2008. X    def @RawIndex       left x right y { {@PageMark x} x @SendIndex { &0f y } }
  2009. X    def @RawSubIndex    left x right y { {@PageMark x} x @SendIndex { &1f y } }
  2010. X    def @RawSubSubIndex left x right y { {@PageMark x} x @SendIndex { &2f y } }
  2011. X
  2012. X    def @Index       left x right y { x @RawIndex       { y, {@PageOf x} } }
  2013. X    def @SubIndex    left x right y { x @RawSubIndex    { y, {@PageOf x} } }
  2014. X    def @SubSubIndex left x right y { x @RawSubSubIndex { y, {@PageOf x} } }
  2015. X
  2016. X    def @IndexBlanks
  2017. X    {
  2018. X    b @RawIndex {} c @RawIndex {} d @RawIndex {} e @RawIndex {}
  2019. X    f @RawIndex {} g @RawIndex {} h @RawIndex {} i @RawIndex {}
  2020. X    j @RawIndex {} k @RawIndex {} l @RawIndex {} m @RawIndex {}
  2021. X    n @RawIndex {} o @RawIndex {} p @RawIndex {} q @RawIndex {}
  2022. X    r @RawIndex {} s @RawIndex {} t @RawIndex {} u @RawIndex {}
  2023. X    v @RawIndex {} w @RawIndex {} x @RawIndex {} y @RawIndex {}
  2024. X    z @RawIndex {}
  2025. X    }
  2026. X
  2027. X
  2028. X    ###########################################################################
  2029. X    #                                                                         #
  2030. X    #  Document.                                                              #
  2031. X    #                                                                         #
  2032. X    ###########################################################################
  2033. X
  2034. X    def @Document
  2035. X    named @InitialFont { @InitialFont }
  2036. X    named @InitialBreak { @InitialBreak }
  2037. X    named @Hyphenate { @Hyphenate }
  2038. X    named @PageNumbers { @PageNumbers }
  2039. X    named @FirstPageNumber { @FirstPageNumber }
  2040. X    named @Columns { @Columns }
  2041. X    {
  2042. X        { Times Base 12p } @Font @InitialFont @Font
  2043. X    { {@Hyph @Hyphenate} adjust 1.20fx } @Break @InitialBreak @Break
  2044. X    {
  2045. X        //  @FigureGalley {}
  2046. X        //  @TableGalley  {}
  2047. X        //  @SimplePageList
  2048. X            @Columns { @Columns }
  2049. X            @PageNumbers { @PageNumbers }
  2050. X            @FirstPageNumber
  2051. X    }
  2052. X    }
  2053. X
  2054. X    macro @Doc { @Document // }
  2055. X
  2056. X
  2057. X    ###########################################################################
  2058. X    #                                                                         #
  2059. X    #  Report.                                                                #
  2060. X    #                                                                         #
  2061. X    ###########################################################################
  2062. X
  2063. X    def @Report
  2064. X    named @Title {}
  2065. X    named @Author {}
  2066. X    named @Institution {}
  2067. X    named @DateLine { @Date }
  2068. X    named @InitialFont { @InitialFont }
  2069. X    named @InitialBreak { @InitialBreak }
  2070. X    named @Hyphenate { @Hyphenate }
  2071. X    named @PageNumbers { @PageNumbers }
  2072. X    named @Columns { @Columns }
  2073. X    {
  2074. X    def @TitleMaterial
  2075. X    {
  2076. X            |0.5rt @B {{clines 1.4vx} @Break @Title} |
  2077. X        //0.25i |0.5rt @I {clines @Break @Author} |
  2078. X        //0.25i |0.5rt clines @Break @Institution |
  2079. X    }
  2080. X
  2081. X    def @ReportContent force into { @ColPlace&&following }
  2082. X    {
  2083. X                    @SectionList 1
  2084. X        //@AppendixGap  @AppendixList 1
  2085. X        //@SectionGap   @ReferenceSection
  2086. X    }
  2087. X
  2088. X    { Times Base 12p } @Font @InitialFont @Font
  2089. X    { {@Hyph @Hyphenate} adjust 1.20fx } @Break @InitialBreak @Break
  2090. X    {
  2091. X        # cover sheet
  2092. X            //  @PageMarker 0
  2093. X        //  @Page {
  2094. X            //1i      @TitleMaterial
  2095. X            //0.5i      |0.5rt @OneCol { |0.5i @AbstractPlace |0.5i }
  2096. X            //1i      @DateLine
  2097. X            //1rt      @OneRow { //@MidGap @FootSect }
  2098. X        }
  2099. X
  2100. X        //  @FigureGalley {}
  2101. X        //  @TableGalley  {}
  2102. X        //  @ReportContent
  2103. X
  2104. X        # first page
  2105. X            //  @PageMarker 1
  2106. X        //  @Page
  2107. X        {
  2108. X          @PageNumbers @Case
  2109. X          {
  2110. X            {Yes yes} @Yield @PageOneTopFormat num
  2111. X            else      @Yield @Null
  2112. X          }
  2113. X          //
  2114. X          //0.5i    @TitleMaterial
  2115. X          //@MidGap    @ColList @Columns
  2116. X          //1rt @OneRow
  2117. X          {
  2118. X                //@MidGap
  2119. X                @PageNumbers @Case
  2120. X                {
  2121. X                    {Yes yes} @Yield @PageOneFootFormat num
  2122. X                    else      @Yield @Null
  2123. X                }
  2124. X          }
  2125. X        }
  2126. X
  2127. X        # subsequent pages
  2128. X        //    @SimplePageList
  2129. X          @Columns { @Columns }
  2130. X          @PageNumbers { @PageNumbers }
  2131. X          2
  2132. X    }
  2133. X    }
  2134. X
  2135. X
  2136. X    ###########################################################################
  2137. X    #                                                                         #
  2138. X    #  Book.                                                                  #
  2139. X    #                                                                         #
  2140. X    ###########################################################################
  2141. X
  2142. X    def @Book
  2143. X    named @Title {}
  2144. X    named @Author {}
  2145. X    named @Edition {}
  2146. X    named @Publisher {}
  2147. X    named @InitialFont { @InitialFont }
  2148. X    named @InitialBreak { @InitialBreak }
  2149. X    named @Hyphenate { @Hyphenate }
  2150. X    {
  2151. X    def @BookIntro force into { @IntroColPlace&&preceding }
  2152. X    {
  2153. X      @BookCoverFont @Font
  2154. X      { //1i    |0.5rt 2.5f @Font {1.2fx clines} @Break @Title |
  2155. X        //2i    |0.5rt clines @Break @Author |
  2156. X        //1i    |0.5rt clines @Break @Edition |
  2157. X        //1rt   @OneRow @Publisher
  2158. X      }
  2159. X        //        @Runner
  2160. X        //1.1b  @PrefacePlace
  2161. X        //1.1b  @ContentsSection
  2162. X    }
  2163. X
  2164. X    def @BookBody force into { @ColPlace&&preceding }
  2165. X    {
  2166. X            @IntroductionPlace
  2167. X        //@ChapterGap   @ChapterList 1
  2168. X        //@AppendixGap  @AppendixList 1
  2169. X        //1.1b  @ReferenceSection
  2170. X            headstyle { ragged @Break @BookTitleFormat @Title }
  2171. X        //1.1b  @IndexSection
  2172. X            headstyle { ragged @Break @BookTitleFormat @Title }
  2173. X    }
  2174. X
  2175. X    { Times Base 12p } @Font @InitialFont @Font
  2176. X    { {@Hyph @Hyphenate} adjust 1.20fx } @Break @InitialBreak @Break
  2177. X    {
  2178. X            @IntroOddPageList @Columns { Single } 1
  2179. X        //        @Runner
  2180. X                @FootEven { @PageNum }
  2181. X                @FootOdd  { |1rt @PageNum }
  2182. X        //        @OddPageList @Columns { Single } 1
  2183. X        //        @BookIntro
  2184. X        //        @BookBody
  2185. X        //        @Runner
  2186. X    }
  2187. X    }
  2188. X
  2189. X@End @DocumentLayout
  2190. END_OF_FILE
  2191.   if test 70692 -ne `wc -c <'include/dl'`; then
  2192.     echo shar: \"'include/dl'\" unpacked with wrong size!
  2193.   fi
  2194.   # end of 'include/dl'
  2195. fi
  2196. echo shar: End of archive 2 \(of 35\).
  2197. cp /dev/null ark2isdone
  2198. MISSING=""
  2199. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 ; do
  2200.     if test ! -f ark${I}isdone ; then
  2201.     MISSING="${MISSING} ${I}"
  2202.     fi
  2203. done
  2204. if test "${MISSING}" = "" ; then
  2205.     echo You have unpacked all 35 archives.
  2206.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2207. else
  2208.     echo You still must unpack the following archives:
  2209.     echo "        " ${MISSING}
  2210. fi
  2211. exit 0
  2212. exit 0 # Just in case...
  2213.