bugGNU troff - Bugs: bug #55007, [PATCH] contrib/hdtbl/examples:...

 
 

bug #55007: [PATCH] contrib/hdtbl/examples: Flush the output before a table

Submitted by:  Bjarni Ingi Gislason <bjarniig>
Submitted on:  Sun 11 Nov 2018 09:10:43 PM UTC  
 
Category:  Macro - others Severity:  2 - Minor
Item Group:  Example rendering Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open Planned Release:  None

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 11 Nov 2018 09:10:43 PM UTC, original submission:  

From 09201e83bd25bc17c1005531115ad08f3b768f1a Mon Sep 17 00:00:00 2001
From: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Date: Sun, 11 Nov 2018 20:56:31 +0000
Subject: [PATCH] contrib/hdtbl/examples: Flush the output before a table

1) The unflushed output lines before calling the macro "TBL" get into
its diversion and are printed after the table.

  Add a break request before the table to separate the text from it.

  See "groff_tmac(5)" about diversions.

2) Remove space at end of lines (as "git apply --verbose
--whitespace=fix" reported such lines in the first diff-file).

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
---
contrib/hdtbl/examples/col_rowspan_colors.roff  | 1 +
contrib/hdtbl/examples/color_boxes.roff         | 9 ++++++---
contrib/hdtbl/examples/color_nested_tables.roff | 2 ++
contrib/hdtbl/examples/color_table_cells.roff   | 7 +++++--
contrib/hdtbl/examples/color_transitions.roff   | 9 +++++----
contrib/hdtbl/examples/mixed_pickles.roff       | 7 ++++---
6 files changed, 23 insertions(+), 12 deletions(-)

diff --git a/contrib/hdtbl/examples/col_rowspan_colors.roff b/contrib/hdtbl/examples/col_rowspan_colors.roff
index 22743c87..1b32a5c4 100644
--- a/contrib/hdtbl/examples/col_rowspan_colors.roff
+++ b/contrib/hdtbl/examples/col_rowspan_colors.roff
@@ -69,6 +69,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
.in 1c
.PN 8 Indented text before table.
*** *** ***
+.br \" Separate the text from the table
.TBL width=90% border=1n csp=1n cpd=1n bgc=wheat tal=c .TR .TD
.TBL  border= cols=11 width=1c tal=c csp=0 cpd=0 \"cols must be odd
.CPTN val=b Randomly Colored Table Cells with Colspan/\%Rowspan
diff --git a/contrib/hdtbl/examples/color_boxes.roff b/contrib/hdtbl/examples/color_boxes.roff
index 9e42b5aa..7f29ee41 100644
--- a/contrib/hdtbl/examples/color_boxes.roff
+++ b/contrib/hdtbl/examples/color_boxes.roff
@@ -30,19 +30,22 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
.
.H Horizontal Rules and Boxes .br with Randomly Colored Border and Background
.PN 25 Text before horizontal rule.
+.br \" Separate the text from the table
.TBL border=.5n bc=green bgc=red width=7c tal=c csp=.2n cpd=.3n .TR .TD .ETB
.PN 10 Text after horizontal rule and before table.
.de ctab
.nr ? 0 1
-.PN 5 .random# ".defcolor color\En+? rgb \E*[#random]"
+.PN 5 .random# ".defcolor color\En+? rgb \E*[#random]"
.TD ".TBL border=1c bc=color1 csp=0 cpd=0 height=3c bgc=color2" .TR .TD .ETB
..
.
+.br \" Separate the text from the table
.TBL tal=c border= csp=0 cpd=0 cols=5 width=3c
.PN 2 .TR ".PN 5 .ctab"
-.ETB
+.ETB
.PN 15 Text after table.
-.TBL border=.5n bc=color1 bgc=color2 width=15c tal=c csp=.2n cpd=.3n .TR .TD .ETB
+.br \" Separate the text from the table
+.TBL border=.5n bc=color1 bgc=color2 width=15c tal=c csp=.2n cpd=.3n .TR .TD .ETB
.PN 25 Text after horizontal rule.
.
.\" ====================================================================
diff --git a/contrib/hdtbl/examples/color_nested_tables.roff b/contrib/hdtbl/examples/color_nested_tables.roff
index cb0e9c42..2ce9f4cf 100644
--- a/contrib/hdtbl/examples/color_nested_tables.roff
+++ b/contrib/hdtbl/examples/color_nested_tables.roff
@@ -34,6 +34,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
.PN 15 Text before first table.
.nr # 0 1
*****
+.br \" Separate the text from the table
.PN 39 .random# ".defcolor c\\n[#] rgb \\\\*[#random] " \
   ".TBL csp=0 cpd=0 border=1n bc=c\\n[#]" \
   ".if \\\\n+#=1 .CPTN val=b Nested Tables with Randomly Colored Border" \
@@ -45,6 +46,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
.
.PN 15 Text before second table.
*****
+.br \" Separate the text from the table
.nr # 0 1
.PN 39 .random# ".defcolor c\\n[#] rgb \\\\*[#random] " \
   ".TBL csp=0 cpd=1n border= bgc=c\\n[#]" \
diff --git a/contrib/hdtbl/examples/color_table_cells.roff b/contrib/hdtbl/examples/color_table_cells.roff
index 2f84b286..975a6811 100644
--- a/contrib/hdtbl/examples/color_table_cells.roff
+++ b/contrib/hdtbl/examples/color_table_cells.roff
@@ -32,18 +32,21 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
.
.H Horizontal Rules and Randomly Colored Table Cells
.PN 15 Text before HR.
+.br \" Separate the text from the table
.TBL border=.5n bc=green bgc=red width=7c tal=c csp=.2n cpd=.3n .TR .TD .ETB
.PN 10 Text after HR and before Table.
.
.nr ? 0 1
.de ctab
.TR height=\nl/10
-.PN 8 .random# ".defcolor c\\\\n+? rgb \E*[#random]" ".TD bgc=c\\\\n?"
+.PN 8 .random# ".defcolor c\\\\n+? rgb \E*[#random]" ".TD bgc=c\\\\n?"
..
+.br \" Separate the text from the table
.TBL tal=c border= csp=0 cpd=0 cols=8 width=\nl/10
.PN 8 .ctab
-.ETB
+.ETB
.PN 10 Text after table.
+.br \" Separate the text from the table
.TBL border=.5n bc=c1 bgc=c2 width=15c tal=c csp=.2n cpd=.3n .TR .TD .ETB
.PN 15 Text after HR.
.
diff --git a/contrib/hdtbl/examples/color_transitions.roff b/contrib/hdtbl/examples/color_transitions.roff
index 0225a937..9cc1d951 100644
--- a/contrib/hdtbl/examples/color_transitions.roff
+++ b/contrib/hdtbl/examples/color_transitions.roff
@@ -35,23 +35,24 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
.PN 20 .ETB
..
.PN 30 Before table.
+.br \" Separate the text from the table
.TBL cols=3 width=33% border= csp=0 cpd=0 bgc=
.CPTN val=b Color Transitions
-.TR
+.TR
.TD ".ctab 0+\En[#cc]u \En[#cc]u \En[#cc]u"     \"        black -> white
.TD ".ctab 1f-\En[#cc]u 1f-\En[#cc]u 1f-\En[#cc]u"\"        white -> black
.TD ".ctab 1f \En[#cc]u \En[#cc]u"              \"        red   -> white
-.TR
+.TR
.TD ".ctab 0 1f-\En[#cc]u \En[#cc]u"            \"        green   -> blue
.TD ".ctab 1f 1f-\En[#cc]u 1f"                  \"        white   -> magenta
.TD ".ctab 1f \En[#cc]u 1f"                     \"        magenta -> white
-.TR
+.TR
.TD ".ctab 0+\En[#cc]u \En[#cc]u 1f-\En[#cc]u"  \"        blue   -> yellow
.TD ".ctab 1f-\En[#cc]u 1f-\En[#cc]u \En[#cc]u" \"        yellow -> blue
.TD ".ctab 1f 0+\En[#cc]u 0"                    \"        red    -> yellow
.\" Alternative to some other color transition
.\".TD ".ctab 0+\En[#cc]u 1f-\En[#cc]u 1f-\En[#cc]u"\"        cyan   -> red
-.ETB
+.ETB
.PN 30 After table.
.
.\" ====================================================================
diff --git a/contrib/hdtbl/examples/mixed_pickles.roff b/contrib/hdtbl/examples/mixed_pickles.roff
index 190c8608..5ff8658e 100644
--- a/contrib/hdtbl/examples/mixed_pickles.roff
+++ b/contrib/hdtbl/examples/mixed_pickles.roff
@@ -32,12 +32,13 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
    EPS Image, eqn Equation, tbl Table, and pic Picture
.
Call groff with options \-t, \-e, and \-p!
+.br \" Separate the text from the table
.
.TBL width=90% tal=c csp=.2n cpd=0
.  TR
.    TD
.      TBL width='25% 75%' csp=.5n cpd=.5n hal=c
-.        TR
+.        TR
.          TD hl=d vl=d rowspan=2 bgc=red4 fgc=linen fsz=1.2 fst=HB val=m
.            PSPIC -I -\\n[.l]u gnu.eps
.            sp .5
@@ -45,7 +46,7 @@ Call groff with options \-t, \-e, and \-p!
.          TD bgc=linen
.
.EQ
-int from 0 to 1 {( ln x ) sup 2} over {sqrt {1 - x sup 2}} dx approx 0.245
+int from 0 to 1 {( ln x ) sup 2} over {sqrt {1 - x sup 2}} dx approx 0.245
.EN
.
.            nop \0\0\0\0\0equation with \fIeqn\fP
@@ -73,7 +74,7 @@ Bit @ Code @ Warning @ Bit @ Code @ Warning
.
.            sp .5
.            nop table with \fItbl\fP
-.        TR
+.        TR
.          TD colspan=2 bgc=azure2 fgc=blue4
.
.PS
--
2.19.1

Bjarni Ingi Gislason <bjarniig>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bgarrigues (Updated the item)
  • -email is unavailable- added by bjarniig (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-11-26 bgarrigues CategoryNone => Macro - others
        Severity3 - Normal => 2 - Minor
        Item GroupNone => Example rendering

    Back to the top


    Powered by Savane 3.5