groff
[Top][All Lists]
Advanced

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

Re: Represent several consecutive newlines


From: G. Branden Robinson
Subject: Re: Represent several consecutive newlines
Date: Mon, 9 May 2022 11:27:00 -0500

Hi, Alex!

At 2022-05-09T17:44:01+0200, Alejandro Colomar wrote:
> Is it possible to represent the following precisely in a manual page?:

Yes.

> It's the output of a program that I'd like to represent precisely in
> EXAMPLES, but groff(1) doesn't like things like:
> 
> [[
> .EX
> .RB $ " echo -e \"\n\nHere's some text.\n\n\nAnd here's some more.\""
> 
> 
> Here's some text.
> 
> 
> And here's some more.
> .EE
> ]]

Right.  You'll get warnings about the blank lines if the CHECKSTYLE
register is set to 3 or more.

Once again the non-printing input break comes to the rescue.  Here's how
I'd do it.

[[
.TH foo 1 2022-05-09 "groff test suite"
.P
Here is an example.
.RS
.P
.EX
$ \c
.B printf \[dq]\[rs]n\[rs]nfoo\[rs]n\[rs]n\[rs]n\[rs]n\[rs]nbar\[rs]n\[dq]
\&
\&
foo
\&
\&
\&
bar
.EE
.RE
.P
That was an example.
]]

There are of course many other ways to achieve the same goal, if one
strays beyond the portability advice offered in groff_man(7) (to be
found in groff_man_style(7) in groff 1.23).

In a *roff document that was not a manual page, I'd use the 'sp' request
or a macro package's wrapper for it, if one were present.

Regards,
Branden

Attachment: signature.asc
Description: PGP signature


reply via email to

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