groff-commit
[Top][All Lists]
Advanced

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

[Groff-commit] groff/contrib/hdtbl ChangeLog Makefile.sub grof...


From: Werner LEMBERG
Subject: [Groff-commit] groff/contrib/hdtbl ChangeLog Makefile.sub grof...
Date: Sat, 23 Jan 2010 07:47:40 +0000

CVSROOT:        /cvsroot/groff
Module name:    groff
Changes by:     Werner LEMBERG <wl>     10/01/23 07:47:40

Modified files:
        contrib/hdtbl  : ChangeLog Makefile.sub groff_hdtbl.man 
                         hdmisc.tmac hdtbl.tmac 
        contrib/hdtbl/examples: chess_board.roff col_rowspan_colors.roff 
                                color_boxes.roff 
                                color_nested_tables.roff 
                                color_table_cells.roff 
                                color_transitions.roff 
                                mixed_pickles.roff rainbow.roff 
                                short_reference.roff 
Added files:
        contrib/hdtbl/examples: common.roff 

Log message:
        Break out example formatting to a separate file.
        
        * hdmisc.tmac: Move example formatting stuff to...
        * examples/common.roff: This new file.
        
        * hdtbl.tmac (HM, t*HM, BM, t*BM): Remove.
        
        * examples/*.roff: Include `common.roff'.
        
        * groff_hdtbl.man: Remove references to `HM' and `BM'.
        
        * Makefile.sub: Handle `examples/common.roff'.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/hdtbl/ChangeLog?cvsroot=groff&r1=1.29&r2=1.30
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/hdtbl/Makefile.sub?cvsroot=groff&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/hdtbl/groff_hdtbl.man?cvsroot=groff&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/hdtbl/hdmisc.tmac?cvsroot=groff&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/hdtbl/hdtbl.tmac?cvsroot=groff&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/hdtbl/examples/chess_board.roff?cvsroot=groff&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/hdtbl/examples/col_rowspan_colors.roff?cvsroot=groff&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/hdtbl/examples/color_boxes.roff?cvsroot=groff&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/hdtbl/examples/color_nested_tables.roff?cvsroot=groff&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/hdtbl/examples/color_table_cells.roff?cvsroot=groff&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/hdtbl/examples/color_transitions.roff?cvsroot=groff&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/hdtbl/examples/mixed_pickles.roff?cvsroot=groff&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/hdtbl/examples/rainbow.roff?cvsroot=groff&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/hdtbl/examples/short_reference.roff?cvsroot=groff&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/hdtbl/examples/common.roff?cvsroot=groff&rev=1.1

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/groff/groff/contrib/hdtbl/ChangeLog,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -b -r1.29 -r1.30
--- ChangeLog   7 Apr 2009 06:02:52 -0000       1.29
+++ ChangeLog   23 Jan 2010 07:47:39 -0000      1.30
@@ -1,3 +1,18 @@
+2010-01-23  Larry Kollar  <address@hidden>
+
+       Break out example formatting to a separate file.
+
+       * hdmisc.tmac: Move example formatting stuff to...
+       * examples/common.roff: This new file.
+
+       * hdtbl.tmac (HM, t*HM, BM, t*BM): Remove.
+
+       * examples/*.roff: Include `common.roff'.
+
+       * groff_hdtbl.man: Remove references to `HM' and `BM'.
+
+       * Makefile.sub: Handle `examples/common.roff'.
+
 2009-04-05  Joachim Walsdorff  <address@hidden>
 
        * hdtbl.tmac (ETB, t*free): Correct two typos, fixing register
@@ -205,7 +220,7 @@
        * Import of hdtbl 0.91 (with some further modifications).  Still
        many rough edges.
 
-Copyright 2006, 2008, 2009
+Copyright 2006, 2008, 2009, 2010
   Free Software Foundation, Inc.
 
 Copying and distribution of this file, with or without modification,

Index: Makefile.sub
===================================================================
RCS file: /cvsroot/groff/groff/contrib/hdtbl/Makefile.sub,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- Makefile.sub        8 Jan 2009 08:28:26 -0000       1.8
+++ Makefile.sub        23 Jan 2010 07:47:40 -0000      1.9
@@ -1,4 +1,4 @@
-# Copyright (C) 2006, 2009 Free Software Foundation, Inc.
+# Copyright (C) 2006, 2009, 2010 Free Software Foundation, Inc.
 #      Written by Werner Lemberg (address@hidden)
 # 
 # This file is part of groff.
@@ -84,6 +84,7 @@
   $(PROCESSEDEXAMPLEFILES) \
   $(GENFILES) \
   examples/stamp \
+  examples/common.roff \
   stamp-strip \
   hdmisc.tmac-s hdtbl.tmac-s
 
@@ -98,7 +99,7 @@
 
 all: $(PROCESSEDEXAMPLEFILES) stamp-strip
 
-$(PROCESSEDEXAMPLEFILES): gnu.eps examples/stamp
+$(PROCESSEDEXAMPLEFILES): gnu.eps examples/stamp examples/common.roff
 
 gnu.eps:
        if test -f $(top_srcdir)/doc/gnu.eps; then \

Index: groff_hdtbl.man
===================================================================
RCS file: /cvsroot/groff/groff/contrib/hdtbl/groff_hdtbl.man,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- groff_hdtbl.man     23 Jan 2010 07:16:45 -0000      1.11
+++ groff_hdtbl.man     23 Jan 2010 07:47:40 -0000      1.12
@@ -918,19 +918,6 @@
 .B ms
 macro package.
 .
-.PP
-.B hdtbl
-has built-in page header and page footer macros,
-.B HM
-and
-.BR BM .
-If they interfere with your own header and footer macros, simply
-say
-.CR ".rm\ HM"
-and
-.CR ".rm\ BM"
-to remove them.
-.
 .
 .SH AUTHOR
 .

Index: hdmisc.tmac
===================================================================
RCS file: /cvsroot/groff/groff/contrib/hdtbl/hdmisc.tmac,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- hdmisc.tmac 5 Apr 2009 16:43:02 -0000       1.11
+++ hdmisc.tmac 23 Jan 2010 07:47:40 -0000      1.12
@@ -5,7 +5,7 @@
 
 This file is part of groff, the GNU roff type-setting system.
 
-Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+Copyright (C) 2005, 2006, 2009, 2010 Free Software Foundation, Inc.
 written by Joachim Walsdorff <address@hidden>.
 
 groff is free software; you can redistribute it and/or modify it under
@@ -300,319 +300,4 @@
 .    fi                \"      reactivate formatting
 ..
 .
-.
-.\"    ******************************************************************
-.\"    **      Some macros and the page setup used by the examples     **
-.\"    ******************************************************************
-.
-.\"    ******************************************************************
-.\"    **      some of the following macros use system commands        **
-.\"    **      and are therefore `unsafe': they need the `-U' argument **
-.\"    **      when calling groff/troff                                **
-.\"    ******************************************************************
-.
-.\"    ******************************************************************
-.\"    **              Header macro for the examples                   **
-.\"    ******************************************************************
-.de H
-.  nr *w* (17 * \w\\$* / 10 + 4n)
-.  TBL border=1n \
-       bc=yellow \
-       bgc=red4 \
-       fgc=yellow \
-       csp=0 \
-       fst=TB \
-       "fsz=1.7 1.5" \
-       hal=c \
-       tal=c \
-       "width=(\\n[*w*]+4n)<?\n[.l]"
-.  TR .TD
-.  P1 \\$*
-.  ETB
-.  SP
-..
-.
-.
-.\"    ******************************************************************
-.\"    **      Utility macro for the date, requires UNIX date.         **
-.\"    **      after return string *date contains the date in the      **
-.\"    **      standard form of the Unix date-command,                 **
-.\"    **      for example "Sun Dec  5 22:27:57     2004"              **
-.\"    ******************************************************************
-.de date
-.  pso bash -c "echo -n .ds *date\ ;date"
-.  tm \\*[*date] ***
-..
-.
-.
-.\"    ******************************************************************
-.\"    **      Utility macro for time measurement, requires UNIX date  **
-.\"    **      .time s[tart]|[end]                                     **
-.\"    **              .time start:                                    **
-.\"    **                      reg *time gets the start-time (seconds) **
-.\"    **              .time [end]:                                    **
-.\"    **                      reg *time gets the difference of the    **
-.\"    **                              end- and start-time (seconds)   **
-.\"    ******************************************************************
-.de time
-.  ds * \\$1\"
-.  substring * 0 0
-.  ie "\\*[*]"s" \
-.    pso bash -c "echo -n .nr *time 0+;date +%s"
-.  el \{\
-.   pso bash -c "echo -n .nr *time -;date +%s"
-.   nr *time 0-\\n[*time]
-.   tm elapsed time: \\n[*time] seconds
-.  \}
-..
-.
-.
-.\"    ******************************************************************
-.\"    **              Perform n-times all the arbitrary arguments     **
-.\"    **              .PN n a2 a3 ...                                 **
-.\"    **                      PN is nestable                          **
-.\"    ******************************************************************
-.de PN
-.  nr *pn +1
-.  nr PN\\n[*pn] (\\$1 + 1) 1
-.  shift
-.
-.  while \\n-[PN\\n[*pn]] \
-.    P1 \\$@
-.
-.  nr *pn -1
-..
-.
-.
-.\"    Utility macro:  .d2x decimal_number [base [string_name]]
-.\"
-.\"            Convert `decimal_number' to another base `base' (in the
-.\"            range 1..16) and store the result in string `string_name'.
-.\"            If `base' is missing or empty, convert to a hexadecimal
-.\"            number.  If `string_name' is missing or empty, return value
-.\"            in string `hex#', otherwise return the value in both
-.\"            `string_name' and `hex#'.
-.\"
-.\"            The base value 1 is handled specially: The returned
-.\"            string contains the character `|' `decimal_number' times
-.\"            (for example, input value 4 yields `||||').
-.ds d2x-0 0\"
-.ds d2x-1 1\"
-.ds d2x-2 2\"
-.ds d2x-3 3\"
-.ds d2x-4 4\"
-.ds d2x-5 5\"
-.ds d2x-6 6\"
-.ds d2x-7 7\"
-.ds d2x-8 8\"
-.ds d2x-9 9\"
-.ds d2x-10 A\"
-.ds d2x-11 B\"
-.ds d2x-12 C\"
-.ds d2x-13 D\"
-.ds d2x-14 E\"
-.ds d2x-15 F\"
-.
-.
-.de d2x
-.  if !\B\\$1 \{\
-.    tm \\n[.F]:\\n[.c]: invalid or missing first argument
-.    tm1 "     usage: `.d2x decimal_number [base [string_name]]'
-.    return
-.  \}
-.
-.  nr i# (-1) 1
-.  nr j# 1
-.  ds hex#
-.  nr dec# (\\$1) 1
-.
-.  if !\\$1 \
-.    nr dec# (-\\n[dec#])
-.
-.  ie !"\\$2"" \{\
-.    ie !\B\\$2 \
-.      tm \\n[.F]:\\n[.c]: invalid base `\\$2'
-.    el \
-.      ie ((\\$2 < 1) : (\\$2 > 16)) \
-.        tm \\n[.F]:\\n[.c]: invalid base `\\$2'
-.      el \
-.        nr b# \\$2
-.  \}\}
-.  el \
-.    nr b# 16
-.
-.  nr xb# 1
-.
-.  ie (\\n[b#] == 1) \{\
-.    nr dec# +1
-.    while \\n-[dec#] \
-.      as hex# |\"
-.  \}
-.  el \{\
-.    while (\\n[dec#] - \\n[xb#]) \{\
-.      nr xb# (\\n[xb#] * \\n[b#])
-.      nr j# +1
-.    \}
-.
-.    while (\\n+[i#] < \\n[j#]) \{\
-.      nr ** (\\n[dec#] / \\n[xb#])
-.      as hex# \\*[d2x-\\n[**]]\"
-.      nr dec# (\\n[dec#] - (\\n[xb#] * \\n[**]))
-.      nr xb# (\\n[xb#] / \\n[b#])
-.    \}
-.  \}
-.
-.  \" strip leading zero, if any
-.  ds * \\*[hex#]\"
-.  substring * 0 0
-.  if "\\*[*]"0" \
-.    substring hex# 1 -1
-.
-.  if (\\$1 < 0) \
-.    ds hex# -\\*[hex#]\"
-.
-.  if !"\\$3"" \{\
-.    ie !\A\\$3 \
-.      tm \\n[.F]:\\n[.c]: invalid string name `\\$3'
-.    el \
-.      ds \\$3 \\*[hex#]\"
-.  \}
-..
-.
-.
-.\"    Utility macro:  .random#
-.\"                    .random-seed seed1 seed2
-.\"
-.\"            Return pseudo-random numbers in the range 0..0xFFFFFF,
-.\"            represented as the concatenation of `#' and six
-.\"            hexadecimal digits, in the string `#random'.  The
-.\"            macro `random-seed' can be used to set seed values,
-.\"            which should be integers in the range 1..2147483562 and
-.\"            1..2147483398 for `seed1' and `seed2', respectively
-.\"            (the macro applies a modulo operation to assure this
-.\"            range).  If `random-seed' isn't called the registers
-.\"            `seconds', `minutes', `hours', `dy', `mo', `year', and
-.\"            `$$' are used to compute it.
-.\"
-.\"            The used generator is presented in L'Ecuyer's 1988 paper
-.\"            `Efficient and Portable Combined Random Number
-.\"            Generators', which combines two Multiplicative Linear
-.\"            Congruential Generators (MLCGs) to achieve a period of
-.\"            2.3*10^18.
-.af hours 00
-.af minutes 00
-.af seconds 00
-.af year 0000
-.af mo 00
-.af dy 00
-.
-.ds random-s1 \n[minutes]\n[seconds]\n[$$]\n[hours]\"
-.\" prevent overflow
-.substring random-s1 0 8
-.
-.nr random-s1 (\*[random-s1] % 2147483562)
-.nr random-s2 \n[dy]\n[year]\n[mo]
-.
-.
-.de random-seed
-.  if !(\\n[.$] == 2) \{\
-.    tm1 "random-seed: Invalid number of arguments.
-.    tm1 "             usage: `.random-seed seed1 seed2'
-.    return
-.  \}
-.
-.  nr random-s1 (\\$1 % 2147483562)
-.  nr random-s2 (\\$2 % 2147483398)
-..
-.
-.
-.de random#
-.  nr * (\\n[random-s1] / 53668)
-.  nr random-s1 (40014 * (\\n[random-s1] - (\\n[*] * 53668)) \
-                - (\\n[*] * 12211))
-.  if !\\n[random-s1] \
-.    nr random-s1 +2147483563
-.
-.  nr * (\\n[random-s2] / 52774)
-.  nr random-s2 (40692 * (\\n[random-s2] - (\\n[*] * 52774)) \
-                - (\\n[*] * 3791))
-.  if !\\n[random-s2] \
-.    nr random-s2 +2147483399
-.
-.  nr * (\\n[random-s1] - \\n[random-s2])
-.  if (\\n[*] < 1) \
-.    nr * +2147483562
-.
-.  \" reduce the result to the leftmost 24 bits
-.  nr * (\\n[*] / 128)
-.
-.  d2x \\n[*]
-.  ds hex# 000000\\*[hex#]\"
-.  substring hex# -6
-.  ds #random #\\*[hex#]\"
-..
-.
-.
-.\"    ******************************************************************
-.\"    **                      minimal Page setup                      **
-.\"    ******************************************************************
-.
-.nr s \n[.ps]
-.nr v \n[.v]
-.pv 1.2 1.2 "" X
-.nr l 6.6i                             \"      set text width
-.ll \n[l]u
-.nr o 2c                               \"      set offset
-.po \n[o]u
-.nr p 29.7c                            \"      set paper length (A4)
-.pl \n[p]u
-.nr tH 1i                              \"      set top margin
-.sp |\n[tH]u
-.
-.ev 99
-.lt \n[l]u
-.ev
-.
-.
-.de HM
-.  sp |.5i                             \"      print header in top margin
-.  tl \\*[t*HM]
-.  sp |\\n[tH]u
-.  ev
-..
-.
-.
-.de BM
-.  ev 99
-.  sp |(\\n[p]u - .5i)                 \"      print footer in bottom margin
-.  tl \\*[t*BM]
-.  bp
-..
-.
-.
-.de EM
-.  rm BM                       \"      no page number at bottom of last page
-.
-.  if !"\\*[t*kept]"" \{\
-.    tm1 "hdtbl: Not all tables have been printed.
-.    tm1 "       Add `.bp' at the end of your document.
-.  \}
-.  if !"\\*[t*held]"" \{\
-.    tm1 "hdtbl: There are held tables which haven't been printed.
-.    tm1 "       Add `.t*free' at the end of your document.
-.  \}
-.  if \\n[t*#] \
-.    tm hdtbl: Missing `.ETB' macro at end of document.
-..
-.
-.
-.em EM
-.
-.if "\n[.m]"" \
-.  gcolor black
-.if "\n[.M]"" \
-.  fcolor white
-.
-.mso hdtbl.tmac\"                      load table macros
-.
 .\" EOF

Index: hdtbl.tmac
===================================================================
RCS file: /cvsroot/groff/groff/contrib/hdtbl/hdtbl.tmac,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- hdtbl.tmac  7 Apr 2009 06:02:52 -0000       1.13
+++ hdtbl.tmac  23 Jan 2010 07:47:40 -0000      1.14
@@ -5,7 +5,7 @@
 
 This file is part of groff, the GNU roff type-setting system.
 
-Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+Copyright (C) 2005, 2006, 2009, 2010 Free Software Foundation, Inc.
 written by Joachim Walsdorff <address@hidden>.
 
 groff is free software; you can redistribute it and/or modify it under
@@ -35,14 +35,6 @@
 .mso hdmisc.tmac
 .mso 62bit.tmac
 .
-.wh 0 HM       \"      comment this out if a page header macro exists
-.wh -1i BM     \"      comment this out if a bottom margin macro exists
-.
-.\" replace `HM' with the name of your pageheader macro, e.g., address@hidden' 
for MS
-.am HM
-.  t*hm
-..
-.
 .
 .\"    *****************************************************************
 .\"    *               default values for some arguments               *
@@ -73,11 +65,6 @@
             "\m[\\*[t*fgc]]Table \\n+[t*cptn]:\0\c\k*"\"
 .
 .
-.\"                    Running title, running footer
-.ds t*HM //arbitrary text for pageheader, except on the first page//\"
-.ds t*BM //arbitrary text for pagefooter, except on the last page/\\n[%]/\"
-.
-.
 .\" %beginstrip%
 .
 .\" for better error messages
@@ -979,6 +966,8 @@
 ..
 .
 .
+.\" Append to your page header macro ('address@hidden' for MS)
+.\" to enable tables to span pages.
 .de t*hm
 .  ev t*tbl
 .  nr ** \\n[.t]

Index: examples/chess_board.roff
===================================================================
RCS file: /cvsroot/groff/groff/contrib/hdtbl/examples/chess_board.roff,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- examples/chess_board.roff   5 Jan 2009 20:10:42 -0000       1.5
+++ examples/chess_board.roff   23 Jan 2010 07:47:40 -0000      1.6
@@ -5,7 +5,7 @@
 
 This file is part of groff, the GNU roff type-setting system.
 
-Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+Copyright (C) 2005, 2006, 2009, 2010 Free Software Foundation, Inc.
 written by Joachim Walsdorff <address@hidden>.
 
 groff is free software; you can redistribute it and/or modify it under
@@ -22,6 +22,7 @@
 along with this program. If not, see <http://www.gnu.org/licenses/>.
 
 ..
+.so examples/common.roff
 .
 .time start
 .nr *x 8

Index: examples/col_rowspan_colors.roff
===================================================================
RCS file: /cvsroot/groff/groff/contrib/hdtbl/examples/col_rowspan_colors.roff,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- examples/col_rowspan_colors.roff    4 Jan 2009 14:50:57 -0000       1.5
+++ examples/col_rowspan_colors.roff    23 Jan 2010 07:47:40 -0000      1.6
@@ -5,7 +5,7 @@
 
 This file is part of groff, the GNU roff type-setting system.
 
-Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+Copyright (C) 2005, 2006, 2009, 2010 Free Software Foundation, Inc.
 written by Joachim Walsdorff <address@hidden>.
 
 groff is free software; you can redistribute it and/or modify it under
@@ -22,6 +22,7 @@
 along with this program. If not, see <http://www.gnu.org/licenses/>.
 
 ..
+.so examples/common.roff
 .
 .time start
 .de color#

Index: examples/color_boxes.roff
===================================================================
RCS file: /cvsroot/groff/groff/contrib/hdtbl/examples/color_boxes.roff,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- examples/color_boxes.roff   4 Jan 2009 14:50:57 -0000       1.4
+++ examples/color_boxes.roff   23 Jan 2010 07:47:40 -0000      1.5
@@ -5,7 +5,7 @@
 
 This file is part of groff, the GNU roff type-setting system.
 
-Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+Copyright (C) 2005, 2006, 2009, 2010 Free Software Foundation, Inc.
 written by Joachim Walsdorff <address@hidden>.
 
 groff is free software; you can redistribute it and/or modify it under
@@ -22,6 +22,7 @@
 along with this program. If not, see <http://www.gnu.org/licenses/>.
 
 ..
+.so examples/common.roff
 .
 .time start
 .H Horizontal Rules and Boxes .br with Randomly Colored Border and Background

Index: examples/color_nested_tables.roff
===================================================================
RCS file: /cvsroot/groff/groff/contrib/hdtbl/examples/color_nested_tables.roff,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- examples/color_nested_tables.roff   4 Jan 2009 14:50:57 -0000       1.4
+++ examples/color_nested_tables.roff   23 Jan 2010 07:47:40 -0000      1.5
@@ -5,7 +5,7 @@
 
 This file is part of groff, the GNU roff type-setting system.
 
-Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+Copyright (C) 2005, 2006, 2009, 2010 Free Software Foundation, Inc.
 written by Joachim Walsdorff <address@hidden>.
 
 groff is free software; you can redistribute it and/or modify it under
@@ -22,6 +22,7 @@
 along with this program. If not, see <http://www.gnu.org/licenses/>.
 
 ..
+.so examples/common.roff
 .
 .time start
 .PN 15 Text before first table.

Index: examples/color_table_cells.roff
===================================================================
RCS file: /cvsroot/groff/groff/contrib/hdtbl/examples/color_table_cells.roff,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- examples/color_table_cells.roff     4 Jan 2009 14:50:58 -0000       1.4
+++ examples/color_table_cells.roff     23 Jan 2010 07:47:40 -0000      1.5
@@ -5,7 +5,7 @@
 
 This file is part of groff, the GNU roff type-setting system.
 
-Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+Copyright (C) 2005, 2006, 2009, 2010 Free Software Foundation, Inc.
 written by Joachim Walsdorff <address@hidden>.
 
 groff is free software; you can redistribute it and/or modify it under
@@ -22,6 +22,7 @@
 along with this program. If not, see <http://www.gnu.org/licenses/>.
 
 ..
+.so examples/common.roff
 .
 .time start
 .H Horizontal Rules and Randomly Colored Table Cells

Index: examples/color_transitions.roff
===================================================================
RCS file: /cvsroot/groff/groff/contrib/hdtbl/examples/color_transitions.roff,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- examples/color_transitions.roff     5 Jan 2009 20:10:42 -0000       1.6
+++ examples/color_transitions.roff     23 Jan 2010 07:47:40 -0000      1.7
@@ -5,7 +5,7 @@
 
 This file is part of groff, the GNU roff type-setting system.
 
-Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+Copyright (C) 2005, 2006, 2009, 2010 Free Software Foundation, Inc.
 written by Joachim Walsdorff <address@hidden>.
 
 groff is free software; you can redistribute it and/or modify it under
@@ -22,6 +22,7 @@
 along with this program. If not, see <http://www.gnu.org/licenses/>.
 
 ..
+.so examples/common.roff
 .
 .time start
 .de ctab

Index: examples/mixed_pickles.roff
===================================================================
RCS file: /cvsroot/groff/groff/contrib/hdtbl/examples/mixed_pickles.roff,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- examples/mixed_pickles.roff 5 Jan 2009 20:10:42 -0000       1.4
+++ examples/mixed_pickles.roff 23 Jan 2010 07:47:40 -0000      1.5
@@ -5,7 +5,7 @@
 
 This file is part of groff, the GNU roff type-setting system.
 
-Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+Copyright (C) 2005, 2006, 2009, 2010 Free Software Foundation, Inc.
 written by Joachim Walsdorff <address@hidden>.
 
 groff is free software; you can redistribute it and/or modify it under
@@ -22,6 +22,7 @@
 along with this program. If not, see <http://www.gnu.org/licenses/>.
 
 ..
+.so examples/common.roff
 .
 .time start
 .

Index: examples/rainbow.roff
===================================================================
RCS file: /cvsroot/groff/groff/contrib/hdtbl/examples/rainbow.roff,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- examples/rainbow.roff       5 Jan 2009 20:10:42 -0000       1.5
+++ examples/rainbow.roff       23 Jan 2010 07:47:40 -0000      1.6
@@ -5,7 +5,7 @@
 
 This file is part of groff, the GNU roff type-setting system.
 
-Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+Copyright (C) 2005, 2006, 2009, 2010 Free Software Foundation, Inc.
 written by Joachim Walsdorff <address@hidden>.
 
 groff is free software; you can redistribute it and/or modify it under
@@ -22,6 +22,7 @@
 along with this program. If not, see <http://www.gnu.org/licenses/>.
 
 ..
+.so examples/common.roff
 .
 .time start
 .

Index: examples/short_reference.roff
===================================================================
RCS file: /cvsroot/groff/groff/contrib/hdtbl/examples/short_reference.roff,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- examples/short_reference.roff       4 Jan 2009 14:50:58 -0000       1.5
+++ examples/short_reference.roff       23 Jan 2010 07:47:40 -0000      1.6
@@ -5,7 +5,7 @@
 
 This file is part of groff, the GNU roff type-setting system.
 
-Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+Copyright (C) 2005, 2006, 2009, 2010 Free Software Foundation, Inc.
 written by Joachim Walsdorff <address@hidden>.
 
 groff is free software; you can redistribute it and/or modify it under
@@ -22,6 +22,7 @@
 along with this program. If not, see <http://www.gnu.org/licenses/>.
 
 ..
+.so examples/common.roff
 .
 .time start
 .pv 1.2 1.2 "" x

Index: examples/common.roff
===================================================================
RCS file: examples/common.roff
diff -N examples/common.roff
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ examples/common.roff        23 Jan 2010 07:47:40 -0000      1.1
@@ -0,0 +1,341 @@
+.\"    -*-     mode: roff      -*-
+.ig
+
+common.roff
+
+This file is part of groff, the GNU roff type-setting system.
+
+Copyright (C) 2010 Free Software Foundation, Inc.
+written by Joachim Walsdorff <address@hidden>.
+
+groff is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+groff is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+..
+.
+.
+.\"    ******************************************************************
+.\"    **      Some macros and the page setup used by the examples     **
+.\"    ******************************************************************
+.
+.\"    ******************************************************************
+.\"    **      some of the following macros use system commands        **
+.\"    **      and are therefore `unsafe': they need the `-U' argument **
+.\"    **      when calling groff/troff                                **
+.\"    ******************************************************************
+.
+.\"    ******************************************************************
+.\"    **              Header macro for the examples                   **
+.\"    ******************************************************************
+.de H
+.  nr *w* (17 * \w\\$* / 10 + 4n)
+.  TBL border=1n \
+       bc=yellow \
+       bgc=red4 \
+       fgc=yellow \
+       csp=0 \
+       fst=TB \
+       "fsz=1.7 1.5" \
+       hal=c \
+       tal=c \
+       "width=(\\n[*w*]+4n)<?\n[.l]"
+.  TR .TD
+.  P1 \\$*
+.  ETB
+.  SP
+..
+.
+.
+.\"    ******************************************************************
+.\"    **      Utility macro for the date, requires UNIX date.         **
+.\"    **      after return string *date contains the date in the      **
+.\"    **      standard form of the Unix date-command,                 **
+.\"    **      for example "Sun Dec  5 22:27:57     2004"              **
+.\"    ******************************************************************
+.de date
+.  pso bash -c "echo -n .ds *date\ ;date"
+.  tm \\*[*date] ***
+..
+.
+.
+.\"    ******************************************************************
+.\"    **      Utility macro for time measurement, requires UNIX date  **
+.\"    **      .time s[tart]|[end]                                     **
+.\"    **              .time start:                                    **
+.\"    **                      reg *time gets the start-time (seconds) **
+.\"    **              .time [end]:                                    **
+.\"    **                      reg *time gets the difference of the    **
+.\"    **                              end- and start-time (seconds)   **
+.\"    ******************************************************************
+.de time
+.  ds * \\$1\"
+.  substring * 0 0
+.  ie "\\*[*]"s" \
+.    pso bash -c "echo -n .nr *time 0+;date +%s"
+.  el \{\
+.   pso bash -c "echo -n .nr *time -;date +%s"
+.   nr *time 0-\\n[*time]
+.   tm elapsed time: \\n[*time] seconds
+.  \}
+..
+.
+.
+.\"    ******************************************************************
+.\"    **              Perform n-times all the arbitrary arguments     **
+.\"    **              .PN n a2 a3 ...                                 **
+.\"    **                      PN is nestable                          **
+.\"    ******************************************************************
+.de PN
+.  nr *pn +1
+.  nr PN\\n[*pn] (\\$1 + 1) 1
+.  shift
+.
+.  while \\n-[PN\\n[*pn]] \
+.    P1 \\$@
+.
+.  nr *pn -1
+..
+.
+.
+.\"    Utility macro:  .d2x decimal_number [base [string_name]]
+.\"
+.\"            Convert `decimal_number' to another base `base' (in the
+.\"            range 1..16) and store the result in string `string_name'.
+.\"            If `base' is missing or empty, convert to a hexadecimal
+.\"            number.  If `string_name' is missing or empty, return value
+.\"            in string `hex#', otherwise return the value in both
+.\"            `string_name' and `hex#'.
+.\"
+.\"            The base value 1 is handled specially: The returned
+.\"            string contains the character `|' `decimal_number' times
+.\"            (for example, input value 4 yields `||||').
+.ds d2x-0 0\"
+.ds d2x-1 1\"
+.ds d2x-2 2\"
+.ds d2x-3 3\"
+.ds d2x-4 4\"
+.ds d2x-5 5\"
+.ds d2x-6 6\"
+.ds d2x-7 7\"
+.ds d2x-8 8\"
+.ds d2x-9 9\"
+.ds d2x-10 A\"
+.ds d2x-11 B\"
+.ds d2x-12 C\"
+.ds d2x-13 D\"
+.ds d2x-14 E\"
+.ds d2x-15 F\"
+.
+.
+.de d2x
+.  if !\B\\$1 \{\
+.    tm \\n[.F]:\\n[.c]: invalid or missing first argument
+.    tm1 "     usage: `.d2x decimal_number [base [string_name]]'
+.    return
+.  \}
+.
+.  nr i# (-1) 1
+.  nr j# 1
+.  ds hex#
+.  nr dec# (\\$1) 1
+.
+.  if !\\$1 \
+.    nr dec# (-\\n[dec#])
+.
+.  ie !"\\$2"" \{\
+.    ie !\B\\$2 \
+.      tm \\n[.F]:\\n[.c]: invalid base `\\$2'
+.    el \
+.      ie ((\\$2 < 1) : (\\$2 > 16)) \
+.        tm \\n[.F]:\\n[.c]: invalid base `\\$2'
+.      el \
+.        nr b# \\$2
+.  \}\}
+.  el \
+.    nr b# 16
+.
+.  nr xb# 1
+.
+.  ie (\\n[b#] == 1) \{\
+.    nr dec# +1
+.    while \\n-[dec#] \
+.      as hex# |\"
+.  \}
+.  el \{\
+.    while (\\n[dec#] - \\n[xb#]) \{\
+.      nr xb# (\\n[xb#] * \\n[b#])
+.      nr j# +1
+.    \}
+.
+.    while (\\n+[i#] < \\n[j#]) \{\
+.      nr ** (\\n[dec#] / \\n[xb#])
+.      as hex# \\*[d2x-\\n[**]]\"
+.      nr dec# (\\n[dec#] - (\\n[xb#] * \\n[**]))
+.      nr xb# (\\n[xb#] / \\n[b#])
+.    \}
+.  \}
+.
+.  \" strip leading zero, if any
+.  ds * \\*[hex#]\"
+.  substring * 0 0
+.  if "\\*[*]"0" \
+.    substring hex# 1 -1
+.
+.  if (\\$1 < 0) \
+.    ds hex# -\\*[hex#]\"
+.
+.  if !"\\$3"" \{\
+.    ie !\A\\$3 \
+.      tm \\n[.F]:\\n[.c]: invalid string name `\\$3'
+.    el \
+.      ds \\$3 \\*[hex#]\"
+.  \}
+..
+.
+.
+.\"    Utility macro:  .random#
+.\"                    .random-seed seed1 seed2
+.\"
+.\"            Return pseudo-random numbers in the range 0..0xFFFFFF,
+.\"            represented as the concatenation of `#' and six
+.\"            hexadecimal digits, in the string `#random'.  The
+.\"            macro `random-seed' can be used to set seed values,
+.\"            which should be integers in the range 1..2147483562 and
+.\"            1..2147483398 for `seed1' and `seed2', respectively
+.\"            (the macro applies a modulo operation to assure this
+.\"            range).  If `random-seed' isn't called the registers
+.\"            `seconds', `minutes', `hours', `dy', `mo', `year', and
+.\"            `$$' are used to compute it.
+.\"
+.\"            The used generator is presented in L'Ecuyer's 1988 paper
+.\"            `Efficient and Portable Combined Random Number
+.\"            Generators', which combines two Multiplicative Linear
+.\"            Congruential Generators (MLCGs) to achieve a period of
+.\"            2.3*10^18.
+.af hours 00
+.af minutes 00
+.af seconds 00
+.af year 0000
+.af mo 00
+.af dy 00
+.
+.ds random-s1 \n[minutes]\n[seconds]\n[$$]\n[hours]\"
+.\" prevent overflow
+.substring random-s1 0 8
+.
+.nr random-s1 (\*[random-s1] % 2147483562)
+.nr random-s2 \n[dy]\n[year]\n[mo]
+.
+.
+.de random-seed
+.  if !(\\n[.$] == 2) \{\
+.    tm1 "random-seed: Invalid number of arguments.
+.    tm1 "             usage: `.random-seed seed1 seed2'
+.    return
+.  \}
+.
+.  nr random-s1 (\\$1 % 2147483562)
+.  nr random-s2 (\\$2 % 2147483398)
+..
+.
+.
+.de random#
+.  nr * (\\n[random-s1] / 53668)
+.  nr random-s1 (40014 * (\\n[random-s1] - (\\n[*] * 53668)) \
+                - (\\n[*] * 12211))
+.  if !\\n[random-s1] \
+.    nr random-s1 +2147483563
+.
+.  nr * (\\n[random-s2] / 52774)
+.  nr random-s2 (40692 * (\\n[random-s2] - (\\n[*] * 52774)) \
+                - (\\n[*] * 3791))
+.  if !\\n[random-s2] \
+.    nr random-s2 +2147483399
+.
+.  nr * (\\n[random-s1] - \\n[random-s2])
+.  if (\\n[*] < 1) \
+.    nr * +2147483562
+.
+.  \" reduce the result to the leftmost 24 bits
+.  nr * (\\n[*] / 128)
+.
+.  d2x \\n[*]
+.  ds hex# 000000\\*[hex#]\"
+.  substring hex# -6
+.  ds #random #\\*[hex#]\"
+..
+.
+.
+.\"    ******************************************************************
+.\"    **                      minimal Page setup                      **
+.\"    ******************************************************************
+.
+.nr s \n[.ps]
+.nr v \n[.v]
+.pv 1.2 1.2 "" X
+.nr l 6.6i                             \"      set text width
+.ll \n[l]u
+.nr o 2c                               \"      set offset
+.po \n[o]u
+.nr p 29.7c                            \"      set paper length (A4)
+.pl \n[p]u
+.nr tH 1i                              \"      set top margin
+.sp |\n[tH]u
+.
+.ev 99
+.lt \n[l]u
+.ev
+.
+.
+.de HM
+.  sp |.5i                             \"      print header in top margin
+.  tl \\*[t*HM]
+.  sp |\\n[tH]u
+.  ev
+..
+.
+.
+.de BM
+.  ev 99
+.  sp |(\\n[p]u - .5i)                 \"      print footer in bottom margin
+.  tl \\*[t*BM]
+.  bp
+..
+.
+.
+.de EM
+.  rm BM                       \"      no page number at bottom of last page
+.
+.  if !"\\*[t*kept]"" \{\
+.    tm1 "hdtbl: Not all tables have been printed.
+.    tm1 "       Add `.bp' at the end of your document.
+.  \}
+.  if !"\\*[t*held]"" \{\
+.    tm1 "hdtbl: There are held tables which haven't been printed.
+.    tm1 "       Add `.t*free' at the end of your document.
+.  \}
+.  if \\n[t*#] \
+.    tm hdtbl: Missing `.ETB' macro at end of document.
+..
+.
+.
+.em EM
+.
+.if "\n[.m]"" \
+.  gcolor black
+.if "\n[.M]"" \
+.  fcolor white
+.
+.mso hdtbl.tmac\"                      load table macros
+.
+.\" EOF




reply via email to

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