groff
[Top][All Lists]
Advanced

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

Re: [Groff] Q: .B man macros and escape


From: walter harms
Subject: Re: [Groff] Q: .B man macros and escape
Date: Thu, 04 Oct 2012 16:33:04 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.1.16) Gecko/20101125 SUSE/3.0.11 Thunderbird/3.0.11


Am 04.10.2012 15:41, schrieb Werner LEMBERG:
> 
>> As documented you can escape "\" by using "\\" or "\e\".
> 
> To which documentation are you referring?

Unix Text Processing p.377
i guess it is also mentioned in the man/info pages related to groff.

> 
>> This went wrong in a man page. Please try the stripped down example:
>>
>> .TH test 3 test
>> .SH test
>> .B "\en"
>> .B "\\n"
>>
>> with "man -l example.1" i see the \n only once.
>> Bug of feature ?
>> NTL i found no mention in groff_man.
> 
> If you say
> 
>   groff -Tutf8 -man -ww mantest.man
> 
> you get the following warning:
> 
>   mantest.man:4: a newline character is not allowed in an escape name
> 
> which you've probably missed.  Reason is that `"\\n"' doesn't survive
> multiple expansions.  After the first expansion you have `\n', but
> after the second expansion this tries to access a number register
> which has the newline character as its name.
> 

I suspected this. The problem for user is that you use "man" and you do
no see any errors (most times this is really better).
The use of "\n" is a specific problem for man pages. I would suggest adding
a line that explains that and shows the alternative.

here my idea for "MACROS TO SET FONTS".

"If your \fItext\fP contains a backslash you will need to escape it. The most 
easy way
 of doing so is to use \ee."

hope that helps,
 wh


> You have to say
> 
>   .B "\\\\n"
> 
> to make it work with backslashes only.
> 
> 
>     Werner
> 



reply via email to

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