[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Groff] SUMMARY: Re: preparing for nroff vrs html output?
From: |
groff |
Subject: |
[Groff] SUMMARY: Re: preparing for nroff vrs html output? |
Date: |
Fri, 10 Jan 2003 19:36:45 -0800 |
In your message dated: Fri, 10 Jan 2003 13:51:36 PST,
The pithy ruminations from address@hidden on
<[Groff] preparing for nroff vrs html output?> were:
=> I'm trying to create a groff document using -ms that will format correctly
for
=> postscript, nroff, and html output. The problem is that html.tmac uses
=> ".nroff", so any nroff-specific formatting is included in addition to
=> instructions that should only apply to HTML output.
=>
=> For example, 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
OK, here's the solution I've worked up (thanks go to Ralph Corderoy
<address@hidden> and James J. Ramsey <address@hidden>):
.\"----------------------------------------------------------------------------
.de xF
.\"" eXclusive Formatting
.\"" if $1 = \(.T then apply the formatting found in $[2-n]
.\"" examples:
.\"" .xF groff .IP \fBgroff\fR\ \fIoutput\fR 1.25i
.\"" .xF nroff \fBnroff\fR (really \fBascii\fR) output
.\"" .xF html .HTML <H1>html</H1><big>output</big><blockquote><P>
.\"" note that any quotes within the arguments to .xF will be stripped out
.\""
.\"" Split the arguments into two strings:
.\"" x1 (the output specifier to match against)
.\"" xN (the remainder of the arguments)
. ds x1 \\$1
. shift 1
. ds xN \\$*
.\""
. ie '\\*(x1'\*(.T' \\*(xN
. el \{\
.\"" try aliases for common output devices
. if '\\*(x1'groff' .if 'ps'\*(.T' \\*(xN
. if '\\*(x1'troff' .if 'ps'\*(.T' \\*(xN
. if '\\*(x1'nroff' .if 'ascii'\*(.T' \\*(xN
. if '\\*(x1'tty' .if 'ascii'\*(.T' \\*(xN
. if '\\*(x1'hp' .if 'lj4'\*(.T' \\*(xN
. if '\\*(x1'lj' .if 'lj4'\*(.T' \\*(xN
. if '\\*(x1'tex' .if 'dvi'\*(.T' \\*(xN
. if '\\*(x1'TeX' .if 'dvi'\*(.T' \\*(xN
. \}
.. \" end of xF
.\"----------------------------------------------------------------------------
Mark
-----
Mark Bergman Biker, Rock Climber, Unix mechanic, IATSE #1 Stagehand
http://wwwkeys.pgp.net:11371/pks/lookup?op=get&search=bergman%40merctech.com
I want a newsgroup with a infinite S/N ratio! Now taking CFV on:
rec.motorcycles.stagehands.pet-bird-owners.pinballers.unix-supporters
15+ So Far--Want to join? Check out: http://www.panix.com/~bergman