bug-groff
[Top][All Lists]
Advanced

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

[bug #55754] Table with eqn does not format correctly.


From: G. Branden Robinson
Subject: [bug #55754] Table with eqn does not format correctly.
Date: Sat, 12 Jun 2021 09:54:06 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0

Update of bug #55754 (project groff):

                  Status:                    None => Invalid                
             Assigned to:                    None => gbranden               
             Open/Closed:                    Open => Closed                 

    _______________________________________________________

Follow-up Comment #2:

Hi Graham,

There wasn't really a bug here, but our documentation did not point out
something that the AT&T tbl documentation from the 1970s made clear: you can't
embed .EQ/.EN macros inside a tbl(1) table.

However, it was easy to miss, being buried among a list of caveats.

"Note that when eqn and tbl are used together on the same file tbl should be
used first. If there are no equations within tables, either order works, but
it is usually faster to run tbl first, since eqn normally produces a larger
expansion of the input than tbl. However, if there are equations within tables
(using the delim mechanism in eqn), tbl must be first or the output will be
scrambled. Users must also beware of using equations in n-style columns; this
is nearly always wrong, since tbl attempts to split numerical format items
into two parts and this is not possible with equations. The user can defend
against this by giving the delim(xx) table option; this prevents splitting of
numerical columns within the delimiters. For example, if the eqn delimiters
are $$, giving delim($$) a numerical column such as "1245 $+- 16$" will be
divided after 1245, not after 16."

I've prepared a change to our tbl(1) man page to clarify this issue.


commit c86962a3207558ec79763dcf1294916a08c0d40b (HEAD -> master)
Author:     G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat Jun 12 02:56:52 2021 +1000
Commit:     G. Branden Robinson <g.branden.robinson@gmail.com>
CommitDate: Sat Jun 12 02:57:41 2021 +1000

    tbl(1): Advise users to avoid .EQ calls in tables.
    
    Suggest alternative.  Prompted by Savannah #55754.

diff --git a/src/preproc/tbl/tbl.1.man b/src/preproc/tbl/tbl.1.man
index 370f3843..c54279a9 100644
--- a/src/preproc/tbl/tbl.1.man
+++ b/src/preproc/tbl/tbl.1.man
@@ -1025,6 +1025,20 @@ should always be called before
 .RI ( groff (@MAN1EXT@)
 automatically takes care of the correct order of preprocessors).
 .
+Don't call the
+.B EQ
+and
+.B EN
+macros within tables;
+instead,
+set up delimeters in your
+.I eqn \" generic
+input and use the
+.B delim()
+table option so that
+.IR \%@g@tbl
+will recognize them.
+.
 .
 .\" ====================================================================
 .SS "GNU \f[I]tbl\f[] enhancements"


Here is an updated version of your table which implements the advice above.  I
also removed your unnecessary use of text blocks for all of the table cells. 
This had two benefits: (1) it makes the source document mush shorter and
easier to read and (2) it makes the final table row (for "Break-Even Point")
vertically centered relative to the tall equation cell to its right.

This is still an ms document.

I have attached the results of my formatting it with groff 1.22.4, using the
command "groff -t -e -ms tbl-gbr.ms > tbl-gbr.ps".


.EQ
delim @@
.EN
.TS
tab(#) center delim(@@);
cp-3 | cp-3
l | cw(3i) .
_
.sp 5p
DEFINITIONS#EQUATION
.sp 5p
=
.sp 5p
TR = Total Revenue#@TR mark ~=~ TC@
FC = Fixed Costs#@(P times X) lineup ~=~ FC ~+~ (V times X)@
V = Variable Costs#@(P times X) ~-~ (V times X) lineup ~=~ FC@
P = Price#@(PX ~-~ VX) lineup ~=~ FC@
X = Unit Sales#@X(P - V) lineup ~=~ FC@
BEP = Break-Even Point#@BEP ~=~ X lineup ~=~ FC over left ( P - V right )@
.sp 5p
_
.TE


(file #51551)
    _______________________________________________________

Additional Item Attachment:

File name: tbl-gbr.ps.png                 Size:27 KB
    <https://file.savannah.gnu.org/file/tbl-gbr.ps.png?file_id=51551>



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?55754>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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