# @DumbSetup - an @OrdinarySetup severly dumbed down. # For the explanatory purposes only (though it kinda works). # @DumbSetup acts like a module, i.e. only internal definitions, # its body (the Lout object) is empty. # "extend" takes a pathname to the symbol we are extending. extend @BasicSetup @DocumentSetup # Symbols that are exported from @DumbSetup and will be visible after # we @Use it. export @Document @Text def @DumbSetup @Begin # In this dumb example this extra level of indirecton via # @TextPlace is redundant, but see "docf" where we add all kinds # of interesting stuff to @TextPlace invocation. def @TextPlace { @Galley } def @Document # Customizaton. Defaults come from @BasicSetup and @DocumentSetup # Initial (dominant) style information. named @InitialFont { @InitialFont } named @InitialBreak { @InitialBreak } named @InitialSpace { @InitialSpace } named @InitialLanguage { @InitialLanguage } # Parameters to our virtual stack of paper. named @PageOrientation { @PageOrientation } named @PageHeaders { @PageHeaders } named @ColumnNumber { @ColumnNumber } named @FirstPageNumber { @FirstPageNumber } named @OptimizePages { @OptimizePages } { # In "docf" @DocumentBody is more elaborate, we add # some stuff besides the @TextPlace, like runners etc. def @DocumentBody force into { @ColPlace&&preceding } named @Optimize { @OptimizePages } { @TextPlace } # End of nested definitions in @Document. Here's what # @Document actually is (the Lout object). # Set up style information. This might look like imperative # commands, but these are function calls in fact, i.e. # X @Font { X @Break { ... } } @InitialFont @Font @InitialBreak @Break @InitialLanguage @Language @InitialSpace @Space { @ColourCommand @InitialColour } @SetColour # This is the innermost argument to the above { # Init internal counters. These will manifest empty but # will set important xref targets. Yes @BeginAllCounters {} Yes @BeginDisplayCounter {} Yes @BeginFigureCounter {} Yes @BeginTableCounter {} # Your virtual stack of paper. It has a place for # incoming material called @ColPlace and that's # where @DocumentBody manifests itself. // @PageList # propagate @Document paramters: @ColumnNumber { @ColumnNumber } @PageHeaders { @PageHeaders } @Orient { @PageOrientation } extra { Yes } @FirstPageNumber # Stuff that goes on to the paper (in this case it's a # simple indirection: @Text goes into @TextPlace that goes # into the @ColPlace). // @DocumentBody } } def @Text force into { @TextPlace&&preceding } body @Body { @Body } @End @DumbSetup