[bug #57034] [PATCH] AT MM Macro Does Not Display in Signature (SG)

2021-03-16 Thread Dave
Follow-up Comment #2, bug #57034 (project groff):

Tadziu posted an updated patch:
http://lists.gnu.org/archive/html/groff/2021-03/msg00014.html

___

Reply to this item at:

  

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




Re: problem with mm macros

2021-03-16 Thread Tadziu Hoffmann
> I've attached your patch to http://savannah.gnu.org/bugs/?57034.

Just a brief follow-up to this: the test in the patch is
for a string expansion that returns nothing, in this case
usually because the string is not defined, and then groff
gives a warning.

There are two obvious ways to fix this: either an explicit
empty string that signifies the end of the author's titles,
or storing the number of titles in a register.  Both require
one extra register per author, but I think the latter is better,
since it easily allows using .ne to request enough space to
output an author's signature block without page breaks.

With that in mind, here's a better patch (relative to the
original m.tmac).  No provision is made for single titles
that are so long that they take more than one line to print.


--- a/contrib/mm/m.tmac
+++ b/contrib/mm/m.tmac
@@ -2975,7 +2975,8 @@
 .\"indent stored in cov*abs-ind
 .\" number of authors stored in cov*au
 .\" author(s) stored in cov*au!x!y
-.\" author(s) title stored in cov*at!x!y
+.\" number of author's titles strored in cov*at!x
+.\" author(s) title(s) stored in cov*at!x!y
 .\"x is the author-index [1-cov*au], y is the argument-index [1-9].
 .\" author(s) firm stored in cov*firm
 .\" new date (if .ND exists) is stored in cov*new-date
@@ -3019,6 +3020,7 @@
 .\" Must appear directly after .AU
 .de AT
 .if \\n[.$]<1 .@error "AT: no arguments"
+.nr cov*at!\\n[cov*au] \\n[.$]
 .nr cov*i 0 1
 .while \\n[.$]>=\\n+[cov*i] \{\
 .  ds cov*at!\\n[cov*au]!\\n[cov*i] "\\$[\\n[cov*i]]
@@ -3304,18 +3306,23 @@
 .nr let*i 0 1
 .while \\n+[let*i]<=\\n[cov*au] \{\
 .  if \\n[let*i]>1 .as let*tmp /
-.  as let*tmp \\*[cov*au!\\n[let*k]!2]
+.  as let*tmp \\*[cov*au!\\n[let*i]!2]
 .\}
 .if !''\\$1' .as let*tmp -\\$1
 .in (u;\\n[.l]/2)
 .nf
 .nr let*i 0 1
 .while \\n+[let*i]<=\\n[cov*au] \{\
+.  ne 3v+\\n[cov*at!\\n[let*i]]v
 .  SP 3v
 .  if \\n[let*i]=\\n[let*k] \{\
 \Z'\h'-(u;\\n[.l]/2)'\\*[let*tmp]'\c
 .  \}
 \\*[cov*au!\\n[let*i]!1]
+.  nr let*j 0 1
+.  while \\n+[let*j]<=\\n[cov*at!\\n[let*i]] \{\
+\\*[cov*at!\\n[let*i]!\\n[let*j]]
+.  \}
 .\}
 .fi
 .in


Re: problem with mm macros

2021-03-16 Thread Robert Goulding
Thanks, I will try it out. And if the LT macros are still broken, I'll put
in a report. I think they will be, as the LT macros are (I believe) a
non-standard addition to GNU mm, separate from the MT macros.

Robert.

On Mon, Mar 15, 2021 at 4:02 PM Dave Kemper  wrote:

> Thanks, Tadziu!  I've attached your patch to
> http://savannah.gnu.org/bugs/?57034.
>
> Andreas and Robert, are the other issues you noted in this thread
> manifestations of the same problem, or separate problems?  I'm not at
> all an mm user so don't know the expected behavior, but from the
> descriptions, it sounds like at least the .LT problem Robert reported
> is something different.
>
> Would you two mind opening new bugs in our bug tracker
> (http://savannah.gnu.org/bugs/?group=groff=additem) to document
> these problems if they're different from 57034?  You can submit bug
> reports here without creating an account.
>
>

-- 
Robert Goulding
Director, John J. Reilly Center for Science, Technology, and Values;
Director, Program in History and Philosophy of Science;
Assoc. Professor, Program of Liberal Studies,
Fellow, Medieval Institute,
University of Notre Dame.


Re: problem with mm macros

2021-03-16 Thread Andreas Eder
On Mo 15 Mär 2021 at 15:00, Dave Kemper  wrote:

> Andreas and Robert, are the other issues you noted in this thread
> manifestations of the same problem, or separate problems?  I'm not at
> all an mm user so don't know the expected behavior, but from the
> descriptions, it sounds like at least the .LT problem Robert reported
> is something different.

Yes, the .LT problem is something different and the problem with .AF also.

Andreas



Re: problem with mm macros

2021-03-16 Thread Andreas Eder
On Mo 15 Mär 2021 at 17:45, Tadziu Hoffmann  
wrote:

> This can be fixed quickly by adding, below the line that
> prints the author's name,
>
>   \\*[cov*au!\\n[let*i]!1]
>
> the following lines:
>
>   .nr let*j 0 1
>   .while !'\\*[cov*at!\\n[let*i]!\\n+[let*j]]''  \{\
>   \\*[cov*at!\\n[let*i]!\\n[let*j]]
>   .\}
>
> Since the number of titles for each author is not stored anywhere,
> this assumes that an empty value signals the end of the author's
> titles, i.e., there can be no empty author's titles (but \& works).

Thank you for fixing this, It works.
The only difference to either heirloom or neateqn output is that both
name and title are not in bold.
Wether this is impostant or not os a dofferent question.

Andreas