groff
[Top][All Lists]
Advanced

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

[Groff] Bug in tbl?


From: Tadziu Hoffmann
Subject: [Groff] Bug in tbl?
Date: Tue, 19 Oct 2004 16:39:52 +0200
User-agent: Mutt/1.4i

Greetings, fellow groffers!

I'm wanting to create a table like the following:

  +---+---+---+
  | 1 | 2 |   |
  |   +---+   |
  |   | 5 |   |
  |   +---+   |
  |   | 8 | 3 |
  +---+---+---+

My description for the table is:

  .TS
  center tab(;) allbox;
  ctccd.
  1;2;3
  \^;5;\^
  \^;8;\^
  .TE

What I get, however, is this:

  +---+---+---+
  | 1 | 2 | 3 |
  |   +---+   |
  |   | 5 |   |
  |   +---+   |
  |   | 8 |   |
  +---+---+---+

I believe this is a bug in tbl.  [Or am I doing something wrong?]
I've included a little context diff of a patched table.cpp which
fixes this, but I'm not sure whether it is the correct way to achieve
the desired result because I don't think I really understand the
positioning in table.cpp.  (The behavior of equations in tables is
bizarre at times.)  One question I would like to pose to the list
is whether we want the baselines of the "1" and the "3" to line
up in case they are both aligned equally (i.e., both "t" or both
"d"), or whether they should be positioned completely idependently.
In the latter case, remove the comparison of vertical_alignment,
and simply position_vertically() always.  What about the "2" (or
the "8")?

---------- cut here (with a very sharp editor) ----------
diff -u table.orig.cpp table.cpp 
--- table.orig.cpp      2004-10-19 14:42:38.000000000 +0200
+++ table.cpp   2004-10-19 15:11:14.000000000 +0200
@@ -2607,8 +2607,15 @@
        if (e) {
          if (e->end_row == r && e->start_row == i) {
            simple_entry *simple = e->to_simple_entry();
-           if (simple)
+           if (simple) {
+              if(first->mod->vertical_alignment !=
+                  simple->mod->vertical_alignment) {
+                prints('\n');
+                simple->position_vertically();
+                prints("\\&");
+              }
              simple->simple_print(0);
+            }
          }
          c = e->end_col;
        }
---------- cut here (with a very sharp editor) ----------





reply via email to

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