groff
[Top][All Lists]
Advanced

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

Re: [Groff] nroff vs. troff conditional using escapes?


From: Steve Izma
Subject: Re: [Groff] nroff vs. troff conditional using escapes?
Date: Tue, 26 Feb 2008 11:14:44 -0500
User-agent: Mutt/1.5.13 (2006-08-11)

On Tue, Feb 26, 2008 at 02:01:57PM +0900, Michael(tm) Smith wrote:
> Subject: Re: [Groff] nroff vs. troff conditional using escapes?
> 
> So I think what would actually best for me to try to do is have
> my app always generated the \c before and after the string, and to
> preserve any whitespace that follows the string...

I convert a lot of xml to groff using python with various parsers
(sometimes built-in python parsers, sometimes external like
nsgmls, which is extremely fast). I find that I can solve most
inline spacing problems with the solutions you and Clarke have
discussed, i.e., any time the parser outputs a text line my
script prepends \& and appends \c. Also, it seems to me that if a \c
starts a line, it gives the same effect as being appended to the
previous text line, but I rarely need to deal with this.

Using such a python script as a preprocessor for groff is very
fast and allows you to do various kinds of string manipulations
at very little speed cost. For that reason, I've never bothered
to go the XLST route.

        -- Steve

-- 
Steve Izma
    Computing Systems Administrator       519-884-0710 ext. 6125
    Wilfrid Laurier University Press      FAX: 519-725-1399
    Waterloo, Ont., Canada N2L 3C5        address@hidden




reply via email to

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