groff
[Top][All Lists]
Advanced

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

Re: man: EX/EE nested within nf/fi


From: Alejandro Colomar
Subject: Re: man: EX/EE nested within nf/fi
Date: Sun, 16 Jun 2024 23:14:56 +0200

Hi Doug, Branden,

On Tue, Jun 11, 2024 at 07:58:51PM GMT, Douglas McIlroy wrote:
> > I'd structure what you have like this:
> >
> > .nf
> > .EX
> > ...
> > .EE
> > .fi
> 
> .EX/.EE is too dumb for this.  Anything between .EE and .fi will get
> filled, which is almost certainly contrary to the purpose of .nf/.fi.
> Mandoc's diagnostic is good advice.

Hmmm, true.

        alx@debian:~/tmp/groff/fi$ cat nfi.man
        .TH EXE 7 2024-06-10 alx
        .SH Name
        nf \- EX
        .SH SYNOPSIS
        .nf
        .B #include <foo.h>
        .P
        .EX
        struct {
                int a;
                int b;
        };
        .EE
        .P
        .BR "#include <bar.h>  /* foobar foobar foobar foobar foobar foobar */"
        .P
        .B #define BAR \[dq]bar\[dq]
        .fi
        alx@debian:~/tmp/groff/fi$ MANWIDTH=40 man ./nfi.man | cat
        EX..Miscellaneous Information EX...E(7)

        Name
             nf - EX

        SYNOPSIS
             #include <foo.h>

             struct {
                  int a;
                  int b;
             };

             #include <bar.h>  /* foobar foobar
             foobar foobar foobar foobar */

             #define BAR "bar"

        alx            2024‐06‐10     EX...E(7)

Branden, how about using some register in EX/EE so that it can nest
within nf/fi?

On Wed, Jun 12, 2024 at 03:21:15AM GMT, G. Branden Robinson wrote:
> At 2024-06-11T19:58:51-0400, Douglas McIlroy wrote:
> > Mandoc's diagnostic is good advice.
>
> Not for Alex's case, I don't think.  He really does want filling off for
> all of his synopsis but also wants a monospaced font for only part of
> it, so that he can indent and align structure members easily (without
> resorting to formatter requests).

Well, since groff(1) doesn't behave as I want, mandoc(1)'s diagnostic is
a good advise that I'm writing source that will misbehave.

Hopefully, we can fix this to nest nicely.

Have a lovely day!
Alex

P.S.:  Doug, I'm not subscribed to the list.  If you don't mind --and
remember--, please CC me in your responses; otherwise, I'll miss them
until I check the archives for unrelated stuff, like happened now.  :)


-- 
<https://www.alejandro-colomar.es/>

Attachment: signature.asc
Description: PGP signature


reply via email to

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