groff
[Top][All Lists]
Advanced

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

Re: [Groff] Groffing a Perl routine


From: Miklos Somogyi
Subject: Re: [Groff] Groffing a Perl routine
Date: Fri, 21 Nov 2008 21:47:57 +1100


Tadziu & Ted, thank you very much for the quick reply.

First I tried Tadziu's suggestion with a simple file containing nothing but a short segment
of a Perl routine. It worked beautifully.
However, when I applied it with the same segment in context, it gave me warnings.
Then I tried the same context stuff with "\e", and it was like a cake.

Gents, thank you again,

Miklos

On 21/11/2008, at 08:19 PM, (Ted Harding) wrote:

On 21-Nov-08 08:32:46, Tadziu Hoffmann wrote:

forget about special characters and leave this thing as it is,
for a while?

.eo
.ec

Provided no "in-code" escapes or macros (e.g. to embolden or format
a particular segment of Perl code) will be needed, Tadziu's solution
will be simple and effective.

However, read the warnings in 'info groff' under .eo and .ec about
the interactions which can occur if you interfere with groff's
interpretation of "\".

If disabling interpretation of "\" would cause problems, then an
alternative (which is more trouble to start with) is to apply a
filter to the Perl code so as to convert each occurrence of "\"
into "\e". This could be done by using 'awk' (or even Perl ... !)
to create an alternative copy of the code file where this replacement
has been made, or (say if you are using 'vim' to edit the troff file)

a) Highlight (using vim command V) the block of lines to change
b) Execute the vim editing command

  :s/\\/\\e/g

With this approach, nothing has been changed in how groff interprets
a "\" which you want it to interpret, and each occurrence of "\"
in the Perl code will now be "\e" and will be output as "\" when
printed. The Perl code in the troff file will, however, now be less
readable.

Good luck with it all!
Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Fax-to-email: +44 (0)870 094 0861
Date: 21-Nov-08                                       Time: 09:18:57
------------------------------ XFMail ------------------------------







reply via email to

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