groff
[Top][All Lists]
Advanced

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

Re: [Groff] Comments affecting groff output?


From: Ted Harding
Subject: Re: [Groff] Comments affecting groff output?
Date: Wed, 13 Jul 2011 23:40:32 +0100 (BST)

On 13-Jul-11 22:02:14, Tadziu Hoffmann wrote:
> 
>> It also works (in Anton's example) without the dot, as in:
> [snip]
>> .   if (2=2) \{\"Remove this comment including the space in col. 17
> [snip]
>> .   if (2=2) \{\
>> \"Remove this comment including the space in col. 17
> [snip]
>> .   if (2=2) \{
>> \"Remove this comment including the space in col. 17
> 
> Sorry, I can't confirm that this works.  I get "Test not passed"
> in all three cases.  Have you perhaps declared a blank line macro?
> 
> 
> It is absolutely essential that the backslash is the
> last character on the line, because only the sequence
> <backslash><newline> gets removed, effectively replacing
> 
>   .if conditional \{\
>   stuff
>   .}
> 
> by
> 
>   .if conditional \{stuff
>   .}
> 
> 
> Similarly,
> 
>   .if conditional \{\
>   \" comment
>   stuff
>   .}
> 
> *will* introduce a blank line, whereas
> 
>   .if conditional \{\
>   .\" comment
>   stuff
>   .}
> 
> won't.

Spot on, Tadziu! And good diagnostics!
Yes, in my groff production set-up I do have a blank
line macro defined, namely to do nothing:

.\".\" Blank line macro does nothing (use ".blm" to reset default)
.de no_blank_line_effect
..
.blm no_blank_line_effect


This is primarily to avoid nasty side-effects when changing
colours in 'pic' code -- without it, one gets unwanted vertical
displacements. However, it also means that one can include blank
lines in troff input to improve laypout for readability.

However, when trying out Anton's code, I had forgotten about
my '.blm' definition, which of course would give successful
results which would fail without it.

My apologies!
Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Fax-to-email: +44 (0)870 094 0861
Date: 13-Jul-11                                       Time: 23:40:29
------------------------------ XFMail ------------------------------



reply via email to

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