[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Groff] Groffing a Perl routine
From: |
Ted Harding |
Subject: |
Re: [Groff] Groffing a Perl routine |
Date: |
Fri, 21 Nov 2008 09:19:00 -0000 (GMT) |
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 ------------------------------