lout-users
[Top][All Lists]
Advanced

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

Non-floating tables (part 1/1)


From: Valeriy E. Ushakov
Subject: Non-floating tables (part 1/1)
Date: Wed, 8 Nov 1995 23:02:54 +0300 (MSK)

Here's the code for non floating tables. To make it into nonfloating
figures just rename all tabs to figs.

I hope that the size of this archive is appropriate for posting
directly to the list.

I hope it helps. (there were at least two or three requests for smth
like this). Comments and suggestions are appreciated (especially from
Jeff ;-)

---- Cut Here and feed the following to sh ----
#!/bin/sh
# This is a shell archive (produced by GNU sharutils 4.1).
# To extract the files from this archive, save it to some FILE, remove
# everything before the `!/bin/sh' line above, then type `sh FILE'.
#
# Made on 1995-11-08 23:01 MSK by <address@hidden>.
# Source directory was `/home/uwe/work/lout/exp'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
# This shar contains:
# length mode       name
# ------ ---------- ------------------------------------------
#   3761 -rw-r--r-- immtab/immtab
#    210 -rw-r--r-- immtab/setup
#    867 -rw-r--r-- immtab/README
#    983 -rw-r--r-- immtab/immtest.lt
#
touch -am 1231235999 $$.touch >/dev/null 2>&1
if test ! -f 1231235999 && test -f $$.touch; then
  shar_touch=touch
else
  shar_touch=:
  echo
  echo 'WARNING: not restoring timestamps.  Consider getting and'
  echo "installing GNU \`touch', distributed in GNU File Utilities..."
  echo
fi
rm -f 1231235999 $$.touch
#
# ============= immtab/immtab ==============
if test ! -d 'immtab'; then
  echo 'x - creating directory immtab'
  mkdir 'immtab'
fi
if test -f 'immtab/immtab' && test X"$1" != X"-c"; then
  echo 'x - skipping immtab/immtab (file already exists)'
else
  echo 'x - extracting immtab/immtab (text)'
  sed 's/^X//' << 'SHAR_EOF' > 'immtab/immtab' &&
# immtab - immediate tables for lout
#
# This file implements immediate (non floating) tables. The idea is
# borrowed from numbered displays implemetation in standard lout `dl'
# package. Cross references are resolved in two runs.
#
# Uwe <address@hidden>
#
X
# Make @DocumentLayout options visible
extend  @DocumentLayout
X
# Symbols for end-user
export  @BeginImmediateTables @EndImmediateTables
X       @ImmediateTable @RawImmediateTable
X       @ITable @RITable
X
def @ImmediateTables
@Begin
X
X    def @BegImmTabPlace         { @Galley }
X    def @ImmTabNextNumPlace { @Galley }
X    def @EndImmTabPlace         { @Galley }
X
X    def @ImmTabNextNumber into { @ImmTabNextNumPlace&&following } {}
X    def @TNN { @ImmTabNextNumber @BegImmTabPlace }
X
X    def @ImmTabPlace   { @Galley }
X
X    def @BeginImmTabs into { @BegImmTabPlace&&preceding }
X       right prefix
X    {
X       def @TList
X            right num
X       {
X            def @TableNum
X            {
X                @TableNumbers @Case {
X                    No @Yield {}
X                    else @Yield { prefix @DotJoin { @TableNumbers @Num num } }
X                }
X            }
X
X           // @NumberMarker @TableNum
X           // @ImmTabNextNumPlace
X           // @TList @Next num
X        }
X
X       // @TList 1
X       // @EndImmTabPlace
X    }
X
X    macro @BeginImmediateTables { // @BegImmTabPlace // @BeginImmTabs }
X
X    def @EndImmediateTables force into { @EndImmTabPlace&&preceding } {}
X
X    # Modified @Table. Beware, some rudiments may still be there.
X    # And I didn't test all the options.
X    def @ImmTable into { @ImmTabPlace&&preceding }
X        named @ShortCaption { dft }
X        named @Caption { dft }
X        named @LongCaption named @TableNum {} { dft }
X        named @Format right @Body { |0.5rt @Body | }
X        named @Tag {}
X        named @InitialLanguage { @InitialLanguage }
X        named @BypassNumber { dft }
X        named @OnePage { No }
X        right @Body
X    @Begin
X    
X        def @TableNumber
X        {
X            @BypassNumber @Dft @NumberOf @Tag
X        }
X    
X        def @TableLabel
X        {
X            @TableNumbers @Case {
X                No   @Yield @Null
X                else @Yield @B { @Word&&table @TableNumber. }
X            }
X        }
X    
X        def @ContentsCaption
X        {
X            @ShortCaption @Dft @Caption
X        }
X    
X        def @OnePageSym right x
X        {
X            @OnePage @Case {
X                No  @Yield x
X                Yes @Yield { @OneRow x }
X            }
X        }
X
X        @InitialLanguage @Language
X        {
X            //  @MakeTableContents @TableContentsEntry
X                    indent { 0f }
X                    number { @TableNumber }
X                    title { @InitialLanguage @Language @ContentsCaption }
X                    pagenum { @PageOf @Tag }
X            // @NumberMarker&&preceding @Tagged @Tag
X            // @OnePageSym
X               {
X                   @Format @Body
X                // @PageMarker&&preceding @Tagged @Tag
X                //@DisplayGap
X                   @CaptionFont @Font @CaptionBreak @Break
X                   @Caption @Case {
X                       dft      @Yield @Null
X                       else     @Yield { ||0.5rt @TableLabel  @Caption }
X                   }
X                //@DisplayGap
X                   @CaptionFont @Font @CaptionBreak @Break
X                   @LongCaption @Case {
X                       dft      @Yield @Null
X                       else     @Yield { @LongCaption @TableNum { @TableLabel 
} }
X                   }
X               }
X            //
X        }
X    @End @ImmTable
X
X    macro @ImmediateTable    { @CD  @ImmTabPlace // @TNN // @ImmTable }
X    macro @RawImmediateTable { @RCD @ImmTabPlace // @TNN // @ImmTable }
X
X    macro @ITable  { @ImmediateTable   }
X    macro @RITable { @RawImmediateTable        }
X
@End @ImmediateTables
SHAR_EOF
  $shar_touch -am 1108215695 'immtab/immtab' &&
  chmod 0644 'immtab/immtab' ||
  echo 'restore of immtab/immtab failed'
  shar_count="`wc -c < 'immtab/immtab'`"
  test 3761 -eq "$shar_count" ||
    echo "immtab/immtab: original size 3761, current size $shar_count"
fi
# ============= immtab/setup ==============
if test -f 'immtab/setup' && test X"$1" != X"-c"; then
  echo 'x - skipping immtab/setup (file already exists)'
else
  echo 'x - extracting immtab/setup (text)'
  sed 's/^X//' << 'SHAR_EOF' > 'immtab/setup' &&
@SysInclude { fontdefs }
@SysInclude { langdefs }
@SysInclude { dl }
@SysInclude { reportf }
@Include    { immtab }
X
@Use { @DocumentLayout }
@Use { @ReportLayout @CoverSheet { No } }
@Use { @ImmediateTables }
SHAR_EOF
  $shar_touch -am 1108225995 'immtab/setup' &&
  chmod 0644 'immtab/setup' ||
  echo 'restore of immtab/setup failed'
  shar_count="`wc -c < 'immtab/setup'`"
  test 210 -eq "$shar_count" ||
    echo "immtab/setup: original size 210, current size $shar_count"
fi
# ============= immtab/README ==============
if test -f 'immtab/README' && test X"$1" != X"-c"; then
  echo 'x - skipping immtab/README (file already exists)'
else
  echo 'x - extracting immtab/README (text)'
  sed 's/^X//' << 'SHAR_EOF' > 'immtab/README' &&
This is a quick hack that implements immediate (non floating) tables
in Lout. The idea is borrowed from implementation of numbered displays
in `dl'. The definition of @ImmediateTable is copied from definition
of @Table almost verbatim.
X
X
Add
X       @BeginImmediateTables <prefix>
X
at the begining of the (sub*)section. Add
X
X       @EndImmediateTables
X
at the end.
X
Invoke @ImmediateTable (or @ITable; would like @IT, but it's too easy
to confuse with italic) with the same arguments you would normally
invoke @Table. This will place the table with the caption and number
in a centered display at the point of invocation.
X
There's a `raw' variant named @RawImmediateTable (@RITable) that use
@RCD instead of @CD.
X
Immediate tables are numbered separately from Tables, so using both
types in one section is probably a bad idea.
X
See also file `immtest.lt'.
X
X
Uwe <address@hidden>
SHAR_EOF
  $shar_touch -am 1108220895 'immtab/README' &&
  chmod 0644 'immtab/README' ||
  echo 'restore of immtab/README failed'
  shar_count="`wc -c < 'immtab/README'`"
  test 867 -eq "$shar_count" ||
    echo "immtab/README: original size 867, current size $shar_count"
fi
# ============= immtab/immtest.lt ==============
if test -f 'immtab/immtest.lt' && test X"$1" != X"-c"; then
  echo 'x - skipping immtab/immtest.lt (file already exists)'
else
  echo 'x - extracting immtab/immtest.lt (text)'
  sed 's/^X//' << 'SHAR_EOF' > 'immtab/immtest.lt' &&
@Include { setup }
X
@Report
X  @Title { Immediate Tables }
//
X
@Section
X  @Title { Sample Section }
X  @Tag   { sample }
@Begin
@BeginImmediateTables address@hidden sample}
X
@PP
Test of { Helvetica Base -1p } @Font "@ImmediateTable".
X
@ImmediateTable
X  @Caption { Test of {Helvetica Base -1p} @Font "@ImmediateTable" }
@CurveBox { Test. Place actual { Helvetica Base -1p } @Font "@Tab" here. }
X
Text continued. And we place another table.
X
@ImmediateTable 
X  @Caption { Second Test of {Helvetica Base -1p} @Font "@ImmediateTable" }
X  @Tag { important.table }
@CurveBox { Second Test }
X
Text continued. And we place another table.
X
@ImmediateTable 
X  @Caption { Third Test of {Helvetica Base -1p} @Font "@ImmediateTable" }
@CurveBox { Third Test }
X
Text continued. And we place another table.
X
@ImmediateTable 
X  @Caption { Forth Test of {Helvetica Base -1p} @Font "@ImmediateTable" }
@CurveBox { Forth Test }
X
See also Table address@hidden important.table}.
X
@EndImmediateTables
@End @Section
SHAR_EOF
  $shar_touch -am 1108224395 'immtab/immtest.lt' &&
  chmod 0644 'immtab/immtest.lt' ||
  echo 'restore of immtab/immtest.lt failed'
  shar_count="`wc -c < 'immtab/immtest.lt'`"
  test 983 -eq "$shar_count" ||
    echo "immtab/immtest.lt: original size 983, current size $shar_count"
fi
exit 0


Best regards!

SY, Uwe.
--------
address@hidden                          |       Zu Grunde kommen
http://www.niif.spb.su/~uwe/            |       Ist zu Grunde gehen


reply via email to

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