groff
[Top][All Lists]
Advanced

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

Re: [Groff] preserve ascii escape characters from input


From: Ted Harding
Subject: Re: [Groff] preserve ascii escape characters from input
Date: Wed, 24 Feb 2010 21:20:09 -0000 (GMT)

On 24-Feb-10 20:48:27, Werner LEMBERG wrote:
> 
>> Hi.  I’m new to troff, and I’m trying to write a simple manpage
>> listing ANSI escape sequences.  It would be neat if I could provide
>> examples of the sequences’ output in the very manpage itself, but
>> for that I’d need to preserve ASCII escape characters (\033, '')
>> that I wrote in the input file.  Groff seems to eat them away.  Is
>> there a way to prevent this, or some troff command I can use to
>> output ASCII 033?
> 
> Please provide a minimal sample file which demonstrates what you want
> to do and what fails.
>     Werner

I *think* what he is trying to do is find out how to create groff
input such that the character "\" is displayed in the output.

If so, then the following may help.

When the character "\" occurs in the groff input file, it is always
treated as an "escape" character so that what follows is given a
special interpretation by groff and is not interpreted literally.

There are very many such escape sequences recognised by groff.
Have a look at 'info groff' under "* Escape Index::" to see what
they are.

In particular, the sequence \0" is interpreted by groff so as
to place in the output a space whose width is the width of a
digit in the current font. Hence entering something like

  "the ASCII escape \033 will ... "

produces

  "the ASCII escape@@33 will ..."

(where I am using "@" to represent a space).

When you want to make groff produce "|" as a visible character
in the output, enter it as "\e" (another of groff's escape
sequences, which is interpreted as "the escape character",
whatever it is -- by default it is "\" but it can be changed).

Hence in the above example you should enter

  "the ASCII escape \e033 will ... "

and this will then be rendered in the output as

  "the ASCII escape \033 will ..."

Does this help?
Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Fax-to-email: +44 (0)870 094 0861
Date: 24-Feb-10                                       Time: 21:19:58
------------------------------ XFMail ------------------------------




reply via email to

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