home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / APPS / lout2.lzh / LOUT2 / LIB / include / tl < prev   
Text File  |  1994-02-26  |  4KB  |  103 lines

  1.  
  2. ###############################################################################
  3. #                                                                             #
  4. #  Lout @ToyLayout package (Jeff Kingston, July 1993)                         #
  5. #                                                                             #
  6. #  In response to a user request I have put together this tiny package for    #
  7. #  people to play with who want to start learning how to do page layout and   #
  8. #  galleys with Lout.  It produces a very simple sequence of pages.  To       #
  9. #  invoke the package, run "lout myfile > op" where myfile looks like this:   #
  10. #                                                                             #
  11. #     @SysInclude { tl }                                                      #
  12. #     @Use { @ToyLayout }                                                     #
  13. #     @Document                                                               #
  14. #     //                                                                      #
  15. #     @Text {                                                                 #
  16. #     Any text you like here, using @I, @B, @Heading, @PP, @LP, @DP,          #
  17. #     @LeftDisplay, @IndentedDisplay, and @CenteredDisplay just as in         #
  18. #     DocumentLayout.                                                         #
  19. #     }                                                                       #
  20. #                                                                             #
  21. ###############################################################################
  22.  
  23. @SysInclude { ft }
  24.  
  25. export @I @B @Heading @PP @LP @DP @NP
  26.        @LeftDisplay @IndentedDisplay @CenteredDisplay
  27.        @Text @Document
  28.  
  29. def @ToyLayout
  30.     named @PageWidth  { 21.0c }
  31.     named @PageHeight { 29.7c }
  32. @Begin
  33.  
  34.     ###########################################################################
  35.     #                                                                         #
  36.     #  Font changes, headings, and paragraphs.                                #
  37.     #                                                                         #
  38.     ###########################################################################
  39.  
  40.     def @I       right x { Slope @Font x      }
  41.     def @B       right x { Bold @Font x       }
  42.     def @Heading right x { ragged @Break @B x }
  43.  
  44.     macro @PP        { //1.3vx 1.0f @Wide &0i }
  45.     macro @LP        { //1.3vx                }
  46.     macro @DP        { //0.5v                 }
  47.     macro @NP        { //1.1b                 }
  48.  
  49.  
  50.     ###########################################################################
  51.     #                                                                         #
  52.     #  Displays.                                                              #
  53.     #                                                                         #
  54.     ###########################################################################
  55.  
  56.     def @DispPlace { @Galley }
  57.  
  58.     def @Disp into { @DispPlace&&preceding }
  59.     right x
  60.     {
  61.     @OneRow x
  62.     }
  63.  
  64.     macro @LeftDisplay     { @DP |       @DispPlace  |  @DP // @Disp   }
  65.     macro @IndentedDisplay { @DP |2f     @DispPlace  |  @DP // @Disp   }
  66.     macro @CenteredDisplay { @DP |0.5rt  @DispPlace  |  @DP // @Disp   }
  67.  
  68.  
  69.     ###########################################################################
  70.     #                                                                         #
  71.     #  Page layout.                                                           #
  72.     #                                                                         #
  73.     ###########################################################################
  74.  
  75.     def @TextPlace { @Galley }
  76.  
  77.     def @Text force into { @TextPlace&&preceding }
  78.         right x
  79.     {
  80.     x
  81.     }
  82.  
  83.     def @Page right x
  84.     {    @PageWidth @Wide @PageHeight @High
  85.     { Times Base 12p } @Font
  86.     { adjust nohyphen 14px } @Break
  87.     {   //1i ||1i
  88.         @HExpand @VExpand x
  89.         ||1i //1i
  90.     }
  91.     }
  92.  
  93.     def @PageList right num
  94.     {
  95.     @Page { |0.5rt - num - //0.4i @TextPlace }
  96.     //
  97.     @PageList @Next num
  98.     }
  99.  
  100.     def @Document { @PageList 1 }
  101.  
  102. @End @ToyLayout
  103.