groff
[Top][All Lists]
Advanced

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

Re: [Groff] preparing for nroff vrs html output?


From: groff
Subject: Re: [Groff] preparing for nroff vrs html output?
Date: Fri, 10 Jan 2003 15:17:39 -0800

In your message dated: Fri, 10 Jan 2003 14:49:08 PST,
The pithy ruminations from "James J. Ramsey" on 
<Re: [Groff] preparing for nroff vrs html output?> were:
=> 
=> --- address@hidden wrote:
=> > I'd like to format a list in a
=> > different way, depending on the 
=> > output:
=> > 
=> >    .if t .IP "\s-2\(bu\s+2"
=> >    .if n .IP "*" 1i
=> >    .if '\*[.T]'html' .LI
=> >    List element 1
=> > 
=> > This works fine for troff or nroff output. However,
=> > for html output, I get an
=> > extra <P> due to the ".if n" test, before the <LI>
=> > begins.
=> 
=> How about 
=> 
=> .ie t .IP "\s-2\(bu\s+2" \" For troff
=> .el \{\
=> .   ie '\*[.T]'html' .LI \" For html
=> .   el .IP "*" 1i        \" For neither troff nor 
=> .                        \" html (presumably nroff)
=> .   \}

Thanks!


That'll work, but I was really hoping to avoid that sort of thing. Picture 
expanding the conditional to cover all of the potential standard output 
processors, and then using a different conditional for each specific tweek to 
the text. The example I gave, with different formatting for a list of items, 
was only one of many instances where I want to selectively format the text 
based on [troff|nroff|html]. Other instances include diffences in fonts, 
vertical spacing, and indentation.

What I'd like is something like an exclusive:

        .if t   .\" only applies to troff (grops)
        .if h   .\" only applies to -Thtml (grohtml)
        .if n   .\" only applies to nroff (grotty)
        .if d   .\" only applies to dvi (grodvi)
        .if lb  .\" only applies to Canon LBP devices (grolbp)
        .if lj  .\" only applies to HP LJ devics (grolj4)

I was hoping that had been added to groff since I last looked really closely at 
programming macros (oh, about 1984!).

I'll try to write a macro that implements this type of conditional, taking 
arguments for the output device and the command to apply to just that output 
type. Your example will be a good start.

Thanks,

Mark



reply via email to

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