lout-users
[Top][All Lists]
Advanced

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

Re: Designing labels


From: Greg A. Woods
Subject: Re: Designing labels
Date: Mon, 6 Nov 2000 15:58:46 -0500 (EST)

[ On Thursday, November 2, 2000 at 17:07:30 (+0000), Dani Pardo wrote: ]
> Subject: Designing labels
>
>  I'm trying to get rid of Crystal Reports, and I've thought I could use
> Lout to design some labels, that should get printed in A4, where there are
> 3x5=15 labels per page. 

My partner and I did small mailing return labels with lout-3.12 some
time ago (i.e. using @Tab).  I haven't tried printing these in a long
time now though....  [another similar example for business cards follows]

#! lout
#
#       Planix mailing labels
#
#  @SysInclude commands for standard packages.
#

@SysInclude { fontdefs }        # font definitions
@SysInclude { langdefs }        # language definitions
@SysInclude { dl }              # DocumentLayout package
@SysInclude { tab }             # @Tab table formatter
@SysInclude { eq }              # @Eq equation formatter
@SysInclude { fig }             # @Fig advanced graphics
@SysInclude { graph }           # @Graph graph drawing
@SysInclude { docf }            # ReportLayout extension
@SysInclude { cprint }          # @CPrint C and C++ programs


def @UNIX { @S Unix }
def @Unix { @S Unix }
def @unix { @S Unix }

# import @DocumentLayout

def @CompanyLabel { 
        1.0i @High {
                2.425i @Wide {
                        @HScale {
                                /0.25w |0.5rt @HAdjust 24p @Font {
                                        P L A N I X
                                } |
                                #
                                # we can't use @HLine in here, as this is used 
in
                                # the @StartTop in place of pre-printed 
letterhead
                                # an @HLine isn't available for use in header
                                #
                                /4p {
                                        "0 0 moveto xsize 0 lineto stroke" 
@Graphic { }
                                } |
                                //0.25w |0.5rt @HAdjust 8p @Font {
                                        @UNIX -- Internet -- Security -- 
Administration
                                } |
                                //0.25w |0.5rt @HAdjust 8p @Font {
                                        Consulting -- Programming -- Design
                                } |
                                //0.25w |0.5rt @HAdjust 8p @Font {
                                        181 Dawlish Ave.
                                } |
                                //0.25w |0.5rt @HAdjust 8p @Font {
                                        Toronto, Ontario
                                } |
                                //0.25w |0.5rt @HAdjust 8p @Font {
                                        M4N 1H6 Canada
                                }
                        }
                }
        }
}

def @FooterString {
}
#
#  The @DocumentLayout @Use clause - overall document format options.
#

@Use { @DocumentLayout
        @InitialFont            { Times Base 10p }
        @HeadingFont            { Helvetica Bold 1.4f } # font for @Heading

        @ListGap                        { 0c }  # gap between list items
        @ListLabelWidth         { 0c }  # width allowed for list tag

        @TopMargin                      { 1.6c }        # top margin of all 
pages
        @FootMargin                     { 0.0c }        # bottom margin of all 
pages
        @OddLeftMargin          { 0.2i }        # left margin of odd pages
        @OddRightMargin         { 0.01c }       # right margin of odd pages
        @EvenLeftMargin         { 0.2i }        # left margin of even pages
        @EvenRightMargin        { 0.01c }       # right margin of even pages

        @PageHeaders            { None }        # None Simple Titles NoTitles

        @DisplayIndent          { 0i }
        @DisplayGap             { 0i }

}

#
#  The @ReportLayout @Use clause - options specific to technical reports.
#

@Use { @OrdinaryLayout
        @SectionNumbers                 { None }
        @SubSectionNumbers              { None }
        @SubSubSectionNumbers   { None }
 
        @SectionHeadingFont             { Helvetica Bold 1.4f } # section 
heading font
        @SubSectionHeadingFont  { Helvetica Bold 1.2f } # subsection heading 
font
        @SubSubSectionHeadingFont       { Helvetica Slope 1.0f } # 
sub-subsection heading font
 
        @SectionGap                             { 2.50v }
        @SubSectionGap                  { 2.00v }
}

@Document
        @InitialFont    { Times Base 10p }
//
@Text @Begin
@CD @Tab
        @Fmta {
                @Break A |
                @Break B |
                @Break C
        }
{
1.6c @High @Space

@Rowa
        A { @CD @CompanyLabel }
        B { @CD @CompanyLabel }
        C { @CD @CompanyLabel }

@Rowa
        A { 2.80i @Wide @CD @CompanyLabel }
        B { 2.80i @Wide @CD @CompanyLabel }
        C { 2.80i @Wide @CD @CompanyLabel }

@Rowa
        A { 2.80i @Wide @CD @CompanyLabel }
        B { 2.80i @Wide @CD @CompanyLabel }
        C { 2.80i @Wide @CD @CompanyLabel }

@Rowa
        A { 2.80i @Wide @CD @CompanyLabel }
        B { 2.80i @Wide @CD @CompanyLabel }
        C { 2.80i @Wide @CD @CompanyLabel }

@Rowa
        A { 2.80i @Wide @CD @CompanyLabel }
        B { 2.80i @Wide @CD @CompanyLabel }
        C { 2.80i @Wide @CD @CompanyLabel }

@Rowa
        A { 2.80i @Wide @CD @CompanyLabel }
        B { 2.80i @Wide @CD @CompanyLabel }
        C { 2.80i @Wide @CD @CompanyLabel }

@Rowa
        A { 2.80i @Wide @CD @CompanyLabel }
        B { 2.80i @Wide @CD @CompanyLabel }
        C { 2.80i @Wide @CD @CompanyLabel }

@Rowa
        A { 2.80i @Wide @CD @CompanyLabel }
        B { 2.80i @Wide @CD @CompanyLabel }
        C { 2.80i @Wide @CD @CompanyLabel }

@Rowa
        A { 2.80i @Wide @CD @CompanyLabel }
        B { 2.80i @Wide @CD @CompanyLabel }
        C { 2.80i @Wide @CD @CompanyLabel }

@Rowa
        A { 2.80i @Wide @CD @CompanyLabel }
        B { 2.80i @Wide @CD @CompanyLabel }
        C { 2.80i @Wide @CD @CompanyLabel }
}
@End @Text



-=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=-

More recently I did some business cards (that print onto that pre-scored
card stock available for laser printers), also using @Tab.  I still
haven't managed to convert either to use @Tbl....

#! lout
#
#       Planix Business Cards
#
# This document prepares an 8-1/2 x 11 sheet of ten identical business
# cards with "lout -a -s -o bus-cards.ps bus-cards.lout" intended for
# printing on www.geographics.com's pre-microperforated laser card
# stock....
#
#ident "@(#)p-samples:$Name:  $:$Id: bus-cards.lout,v 1.2 2000/11/06 20:54:20 
woods Exp $"

#
# parameters for personalising your card:
#

def @PersonName         { "Greg A. Woods" }
def @PersonEmail        { "address@hidden" }
def @PersonURL          { "www.planix.com" }

def @PersonStreetAddr   { "61 Lorraine Drive" }
def @PersonCityProv     { "North York, Ontario" }
def @PersonPostalCode   { "M2N 2E3" }
def @PersonCountry      { "CANADA" }

def @PersonVoicePhone   { "+1 416 218-0099" }
def @PersonFaxPhone     { "+1 416 489-5852" }

#  @SysInclude commands for standard packages required for this doc.
#
@SysInclude { langdefs }        # language definitions
@SysInclude { bsf }             # BasicSetup package
@SysInclude { dsf }             # DocumentSetup package
@SysInclude { docf }            # OrdinarySetup extension to DocumentSetup
@SysInclude { tab }             # @Tab -- the old table formatter

import @BasicSetup
def @UNIX { @S Unix }
import @BasicSetup
def @Unix { @S Unix }
import @BasicSetup
def @unix { @S Unix }

# These next four probably shouldn't be changed without also changing the
# @CompanyCard table layout too....
#
# LargeName has the letters concatenated so that @HAdjust will spread
# them apart to exactly fill the width of the @CompanyCard table.
#
def @CompanyLargeName   { P | L | A | N | I | X }
def @CompanyName        { "Planix, Inc." }
def @CompanySloganOne   { @UNIX @Char emdash Internet @Char emdash Security 
@Char emdash Administration }
def @CompanySloganTwo   { Consulting @Char emdash Training @Char emdash 
Programming @Char emdash Design }

# some handy tools:
#
import @BasicSetup
def @Code
        right x
{
        { Courier Bold 0.95f } @Font lines @Break x
}

#
# This definition is a table (or whatever) that describes a single card
#
import @BasicSetup @Tab
def @CompanyCard {
        # leave a bit of vertical & horizontal margin on the card
        1.7i @High 3.0i @Wide {
                @Tab
                        # reduce the default separation of rows...
                        vmargin { 0.1v }
                        @Fmta {
                                @Col @CC H @Over X
                        }
                        @Fmtb {
                                @Col @CC X @Over A,B
                        }
                        @Fmtc {
                                @Col A ! @Col @RR B
                        }
                {       
                        @Rowa
                                below { single }
                                vmargin { 0.21ix }
                                H {
                                        # Why does @Wide need to be here????
                                        2.4i @Wide @HAdjust
                                        { Times Bold 38p } @Font 
@CompanyLargeName
                                }
                        @Rowa
                                H { @Null }
                        @Rowa
                                vmargin { 0.001v }
                                H { 8p @Font { @CompanySloganOne } }
                        @Rowa
                                vmargin { 0.001v }
                                H { 8p @Font { @CompanySloganTwo } }
                        @Rowb
                                vmargin { 0.1i }
                                X { {Helvetica Bold 16p } @Font { @PersonName } 
}
                        @Rowc
                                A { @CompanyName }
                                B { @Code @PersonEmail }
                        @Rowc
                                A { @PersonStreetAddr }
                                B { {Helvetica Slope -1p} @Font "voice:" 
@PersonVoicePhone }
                        @Rowc
                                A { @PersonCityProv }
                                B { {Helvetica Slope -1p} @Font "facsimile:" 
@PersonFaxPhone }
                        @Rowc
                                A { @PersonCountry " " @PersonPostalCode }
                                B { @Code @PersonURL }
                }
        }
}

@Use { @BasicSetup

        # this adjusts the vertical centering of the text on the card,
        # 0.5v works with 10p font (default was { 1.00v @OrIfPlain 1f })
        # 
        @DisplayGap     { 0.5v }        # gap above, below displays
}

@Use { @DocumentSetup

        @PageType       { Letter }      # page type (sets width, height)

        # TopMargin should probably be 0.5i, which works on the Brother
        # MFC-8600, but seems to have to be a bit higher for my LZR1260
        # (even when everything is centred on the page).
        #
        # On the Apple LaserWriter 16/600 that's about 1/16" too much.
        #
        @TopMargin      { 0.4375i }     # top margin of all pages
        @FootMargin     { 0.5625i }     # bottom margin of all pages

        # These work with GhostScript 6.01 "ljet2p" driver and a Brother
        # MFC-8600 printer....
        #
        address@hidden  { 0.74375i }    # top margin of all pages
        address@hidden  { 0.15625i }    # bottom margin of all pages

        # These should be 0.75i exactly (which works OK on the MFC-8600, but
        # with the Apple LaserWriter 16/600 there's about 1/16" offset
        # necessary (perhaps depending on which way the paper is inserted?)
        #
        @OddLeftMargin  { 0.6875i }     # left margin of odd pages
        @OddRightMargin { 0.6875i }     # right margin of odd pages
        @EvenLeftMargin { 0.8125i }     # left margin of even pages
        @EvenRightMargin { 0.8125i }    # right margin of even pages

        # Note that the margin marks should line up exactly with the
        # outside card edges... (i.e. they are the outside cut marks)
        #
        @PageBackground { @BoundaryMarks
                                linewidth { 0.2p }
                                length { 0.25i }
                                gap { 0.1i }
                        }

        # this is a one-page "document" that mostly fills the printable area
        @PageHeaders    { None }
}

#
#  The @OrdinarySetup @Use clause - options specific to ordinary documents.
#

@Use { @OrdinarySetup
}

@SysDatabase @FontDef  { fontdefs }               # font definitions

#
# Start of the document proper
#
@Document
        @InitialSpace   { troff }
        @InitialFont    { Times Base 10p }
//
@Text @Begin

8i @Wide 10i @High @Tab

        # remove these named parameters when printing cards:
#       above { yes }                           # DRAFT
#       below { yes }                           # DRAFT
#       between { single }                      # DRAFT
#       side { single }                         # DRAFT

        # we don't want any margin between the cards....
        vmargin { 0.0i }

        # for some reason the boxes drawn by my LZR1260 are a tiny tiny
        # bit smaller than specified (1/64" too small) perhaps because
        # of paper or mechanism slip (horizontal lines are spot on).
        #
        # also, strictly speaking only the height of one column need be
        # specified
        #
        @Fmta {
                @Col 3.5i @Wide { 2i @High A } !
                @Col 3.5i @Wide { 2i @High B }
        }
{

        @Rowa
                A { {} /0.51v @CentredDisplay @CompanyCard }
                B { {} /0.51v @CentredDisplay @CompanyCard }

        @Rowa
                A { {} /0.51v @CentredDisplay @CompanyCard }
                B { {} /0.51v @CentredDisplay @CompanyCard }

        @Rowa
                A { {} /0.51v @CentredDisplay @CompanyCard }
                B { {} /0.51v @CentredDisplay @CompanyCard }

        @Rowa
                A { {} /0.51v @CentredDisplay @CompanyCard }
                B { {} /0.51v @CentredDisplay @CompanyCard }

        @Rowa
                A { {} /0.51v @CentredDisplay @CompanyCard }
                B { {} /0.51v @CentredDisplay @CompanyCard }
}
@End @Text


-- 
                                                        Greg A. Woods

+1 416 218-0098      VE3TCP      <address@hidden>      <robohack!woods>
Planix, Inc. <address@hidden>; Secrets of the Weird <address@hidden>


reply via email to

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