groff
[Top][All Lists]
Advanced

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

Re: Changing color of box background or box frame


From: G. Branden Robinson
Subject: Re: Changing color of box background or box frame
Date: Tue, 5 Mar 2024 15:39:12 -0600

Hi Michał,

At 2024-03-05T09:32:20+0000, Michał Kruszewski via wrote:
> I often write documents including short code snippets or shell
> commands.  I usually put such snippets into a box using .B1 and .B2.

Those are ms(7) and mm(7) macro names, and if you're using the former, I
have good news for you.

> However, those code snippets are intended to be run on different
> targets, for example, Raspberry Pi and the host machine.
> 
> I would like to be able to somehow distinguish where to execute the
> code without requiring my users to read the text.  A good solution is
> to simply change the color of the background of the box or change the
> color of the box frame.

Certainly.

> I had a few tries with the .gcolor, but I always ended up changing the
> color of both the frame and the text inside the frame or changing the
> color of nothing.

Right.  The `gcolor` request sets the "stroke color".

> Does anyone know how to easily change the color of the background in
> the box or the color of the box frame?

If you're using groff_ms(7), then if you're running groff 1.23.0, an
auxiliary package named "sboxes", by Deri James, should be readily
available to you.  It is designed for exactly this sort of thing.

I'm attaching a brief paper documenting this package in traditional Unix
fashion, using itself.

The mom(7) in groff 1.23.0 supports a similar feature; supporting it in
me(7) or mm(7) could be done but requires a volunteer.

Regards,
Branden

Attachment: msboxes.pdf
Description: msboxes.pdf

Attachment: signature.asc
Description: PGP signature


reply via email to

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