groff
[Top][All Lists]
Advanced

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

Re: [MS] Split Header


From: Wael Karram
Subject: Re: [MS] Split Header
Date: Mon, 18 Dec 2023 09:08:42 +0200
User-agent: Evolution 3.50.2

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On Sun, 2023-12-17 at 14:28 -0600, G. Branden Robinson wrote:
> Hi Wael,
> 
> Bad news first.
> 
> At 2023-12-12T17:30:15+0200, Wael Karram wrote:
> > I'm trying to get a split header much like say in a classic mail card
> > where you'd have some details on the left and parallel to them other
> > details on the right - this is using the ms macro set.
> > 
> > In the past I used something like this:
> 
> > .mk
> > .DS L
> > Left-aligned side
> > .DE
> > .rt
> > .DS R
> > Right-aligned side
> > .DE
> 
> > Now, it doesn't work anymore after a recent groff update.
> 
> "Something like", but not exactly, I have to conclude: the foregoing
> example does not work as you seem to desire on any of groff 1.22.3,
> 1.22.4, or 1.23.0, which covers about nine years.
> 
> > What ends up happening is that indeed the text is aligned as intended
> > - but on different consecutive lines.
> 
> Given the above example, the left- and right- aligned material never
> occupies the same output line for me.  There is a change in the way
> things align from 1.22.4 to 1.23.0, but it's simply different, not
> necessarily better or worse.
> 
> By using low-level *roff requests to alter the drawing position, I think
> you may be changing the state of the formatter out from where the ms
> macro package expects it to be.
> 
> I had a look with Heirloom Doctools troff and ms, but quickly gave up
> because that ms doesn't support right-aligned displays at all.
> 
> (For what it's worth, it doesn't overprint the two displays either, so
> once again they're on different lines.)
> 
> > Omitting the DEs makes it work as intended, but gives a warning about
> > unterminated DSes.
> 
> The warning sounds valid to me.  This seems like an accidental success
> and not something that will be generally useful.
> 
> > Is there any other way to achieve what I am looking for? I have tried
> > searching to no avail.
> 
> Now for the good news.
> 
> The `tl` request was made for this sort of thing.
> 
> $ cat ATTIC/wael2.ms
> .LP
> .tl 'Left-aligned side''Right-aligned side'
> $ ~/groff-1.22.3/bin/nroff -ms -Tascii ATTIC/wael2.ms|cat -n|head
>      1
>      2
>      3
>      4
>      5
>      6
>      7  Left-aligned side                         Right-aligned side
>      8
>      9
>     10
> $ /usr/bin/nroff -ms -Tascii ATTIC/wael2.ms|cat -n|head # groff 1.22.4
>      1
>      2
>      3
>      4
>      5
>      6
>      7  Left-aligned side                         Right-aligned side
>      8
>      9
>     10
> $ ~/groff-stable/bin/nroff -ms -Tascii ATTIC/wael2.ms|cat -n|head # 1.23.0
>      1
>      2
>      3
>      4
>      5
>      6
>      7  Left-aligned side                              Right-aligned side
>      8
>      9
>     10
> $ nroff -ms -Tascii ATTIC/wael2.ms|cat -n|head # groff Git HEAD
>      1
>      2
>      3
>      4
>      5
>      6
>      7  Left-aligned side                              Right-aligned side
>      8
>      9
>     10
> 
> So that might work better for you.  Remember to call a paragraphing or
> sectioning macro to start your ms document, as I did with `LP`.
> 
> Yes, `tl` is a low-level request too, but not as disruptive to the state
> of the formatter.  It writes an output line and gets out of the way.
> 
> (The default line length in ms(7) did change in groff 1.23.0.  This is
> documented.[1])
> 
> Regards,
> Branden
> 
> [1] NEWS:
> 
> o The s (ms) macro package now uses a default line length of 6.5 inches
>   by default, resulting in 1-inch left and right margins.  When the
>   "papersize.tmac" package is used by employing the "-d paper" groff(1)
>   option on typesetting devices, the default page offset and line length
>   are adjusted to maintain these margins.
Hello,
Thanks a lot for all the advice.
I have managed to solve it all the same by keeping the same structure but
floating the displays by surrounding them with floating keeps.
I am not sure why it even works, but it does.


- -- 
Kind Regards,
Wael Karram.


-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEf7UaZwwbhSDHrd14OzVgOMyxCAgFAmV/7/kACgkQOzVgOMyx
CAhM2A/9FBAlXr/SDEG6phhSUh+L1IMmlicY0YpDkELoiYThWDNqyV9KjZJjyb2u
sLItgKgLGPfhXZCJX/aOrBj768ugL0nc8eha8U7IJu2qcfah4Lhp0jFxdgTbNWc4
ROY/1MQ+FO7OimdzOoTOyvcfV0FStbOX2ioXwHF/3Lm1rX6Wd9Em8wRGwX7k+hay
janruU4mHEFsoG6hX+g2HuPrIHU8mlqdWkqodjrx5xn3oy5WNAwVE3HsbtBEHCE6
k8/QnQP2ztsQLK6r05wAWrU2POnWJeCT0CRQdLTjYEO4cYvO33pXS01YsiBUVMwG
PVfeUB/+Jq77pdBI2firH9nkOJIQEM4lXv8aloljVtbhPeIbjhaI+HAYxSTOmdqe
ha2m6x4tOxQm1cV3dX0Mc78d6m+5AmnoPN8n9C51w/ZJcpTQJJltKnJnP/SHp5kX
/Hjo0TmgGCgzq4TWZVw5/xWkst8SpfeMSNB2QjVoCJc+pOhcQatMzHdkAgvuDJvL
63t3+h90HuowSZV2E38q1RSW2GKxHuEmu2glWP6PZg+0MOq1ZtXIkq2UEgGm+zYo
2q21IX1X/+FpauAwxuoW2oHqAAtnfo2Fb23BQUqlYLDrsNOUszXViuq9kDjAql3I
Np7v/ltmZOqOSmcIRw9QIj7s49wIEMrJWuSiTjrtcRPNA/+JWdo=
=4pPi
-----END PGP SIGNATURE-----



reply via email to

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