groff
[Top][All Lists]
Advanced

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

Re: [Groff] Allowing user also to check if a line starts with ho


From: Ted Harding
Subject: Re: [Groff] Allowing user also to check if a line starts with ho
Date: Sun, 15 Feb 2009 18:32:13 -0000 (GMT)

On 15-Feb-09 15:24:37, Werner LEMBERG wrote:
>> Excellent!  I've experimented with it for a while, and it works as
>> documented except for one bit of strange behavior:
>> 
>> If the first thing that occurs in the text following leading spaces
>> is a font-switch, the font-switch doesn't take effect.  [...]
>>
>> .de LSM
>> .LP
>> ..
>> .lsm LSM
>>
>> ...
>>        \fIfor
>>        all
>>        good
>>
>> The "for" is not italicized. [...]  The lsm macro seems to be
>> reading away all initial escapes.
> 
> I'll document this better, but it is correct behaviour.  The \fI is
> read while skipping the spaces -- there are a bunch of other escapes
> (\F, \H, \m, \M, ...) which don't lead to a token but modify the
> current `groff state' immediately.  Right before processing the `f' of
> the word `for', your `LSM' macro is called, which in turn calls `LP'.
> However, `LP' resets the current font, cancelling the effect of \fI.

How about preceding everything following the initial spaces with "\&"?
The usual interpretation of "\&" is that it is a "real character"
but nothing is output after it is processed (i.e. it is in effect
a character occupying zero space, which makes no mark).

Not having studied the implementation of .lsm, I can't vouch for
this suggestion, but in principle it should work. Therefore, try

        \&\fIfor
        all
        good

Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Fax-to-email: +44 (0)870 094 0861
Date: 15-Feb-09                                       Time: 18:32:10
------------------------------ XFMail ------------------------------




reply via email to

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