lout-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: How do I equally space?


From: mzukowski
Subject: RE: How do I equally space?
Date: Thu, 21 Oct 1999 13:23:49 -0700

> The @High and @VAdjust symbols are from raw Lout, they are not really
> advertised in the User's Guide, but if you need more you can find them
> in the Expert's Guide.

Thanks for the help Jeff!  I was actually trying to use raw lout.  If
anybody on the list would care to critique my code I would greatly
appreciate it.  My main questions follow the code, which is a complete
runnable lout document:

@SysInclude { fontdefs  } # font definitions
@SysInclude { langdefs  } # language definitions
@SysInclude { tbl       } # Table definitions
@SysInclude { bsf       } # BasicSetup package
@Use { @BasicSetup }

def @CellWidth { 1.25i }
def @CellHeight { 1.25i }

{Times Base 7p} @Font
{lines 1.2fx nohyphen} @Break 
{0.0 0.0 0.0 setrgbcolor} @SetColor

11i @High 8.5i @Wide # letter size
English @Language
{   
  //1.0ie ||1.0ie { #one inch left and top margin on page

    #set font and size of cell
    @CellHeight @High @CellWidth @Wide {Times Base 7p} @Font { 

      //0.0575i ||0.0575i  #small margin from cell wall

      #the Expands are needed to make this object take all available space
      @HExpand @VExpand @VAdjust { 
        ||0.5rx {December 1999}  # a centered heading

        // @HAdjust {  # makes HAdjust apply to all columns
              {^} | {^} | {^} | {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^} 
        }

      }
      ||0.0575i //0.0575i #bottom and right margin
    }
  }
}


Am I using HAdjust correctly?

How could I do the vertical strut trick that the tbl package uses?  This
code:
            def @Strut right x
            {
                def strutval right x
                {
                    x @Case {
                        { no No "" } @Yield "0.0f"
                        { yes Yes  } @Yield "1.0f"
                        else         @Yield x
                    }
                }

                def vs { "0.5w" @VShift { { strutval s  } @High } }
                def hs {                { strutval sh } @Wide   }

                @OneCol @OneRow { ^| hs ^/ vs | x }
            }

Seems like it would expand to this if I just want a vertical strut for my
December heading:

||0.5rx @OneCol @OneRow {^/ 0.5w @VShift 1.0f @High | {December 1999} }

Is that right?  Am I right in thinking that the @VShift and @High actually
apply to the object {December 1999}?  I'm not sure what the purpose of
having two horizontal concatenation marks is in the @Strut def if they just
have @Wide and @High inbetween them.  I thought objects were supposed to be
inbetween the concatenation marks.

Ideally I'd like to write this up as a def which somehow can take a
parameters like:

def @SmallMonth 
named title {}
named firstDayOfWeek {}
named lastDayOfMonth {}
...

Then I could do @SmallMonth title {December 1999} firstDayOfWeek {3}
lastDayOfMonth{31}.  What I can't really do is figure out how to use galleys
to create a new row every seven days.  Note that there can be either five or
six rows depending on the firstDayOfWeek and number of days in the month.
I'm not sure how to stop the recursion at the ending day either.

Thanks for any comments.  This list has been a big help for me.

Monty


reply via email to

[Prev in Thread] Current Thread [Next in Thread]