groff
[Top][All Lists]
Advanced

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

Re: Count number of spaces at beginning of line?


From: Oliver Corff
Subject: Re: Count number of spaces at beginning of line?
Date: Mon, 1 May 2023 22:07:06 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1

Hi Branden,


On 30/04/2023 14:50, G. Branden Robinson wrote:
At 2023-04-29T21:22:00-0500, Dave Kemper wrote:
On 4/29/23, Oliver Corff <oliver.corff@email.de> wrote:
Is there any possibility to count leading spaces in groff?
See the documentation for the \n[lsn] register.  I've never used it,
but its description sounds like what you're looking for.
Indeed, a preprocessor seems like overkill for this application, but for
the fact that your original spec had the section title on the same line
as the leading spaces, which makes it hard to get that title into the
context of a leading space macro.  (Trap-called macros do not receive
arguments.)

I confess that my ad-hoc description was defective. It assumed some kind
of mechanism for detecting zero spaces before the first line, otherwise
the algorithm could start with the assumption that the first line is
never indented.

Best regards,

Oliver.

Regards,
Branden

--
Dr. Oliver Corff
mailto:oliver.corff@email.de




reply via email to

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