hbezemer--- via <groff@gnu.org> writes: > Dear all, > > I'm trying to create a html file with some graphics created by pic. > Maybe I'm missing the obvious but I'm not able to get it to work. > The following command: > echo ".PS\nbox\n.PE" | pic | groff -Thtml -U > > results in: > <!-- Creator : groff version 1.23.0 --> > <!-- CreationDate: Wed Nov 29 06:35:31 2023 --> > <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" > "http://www.w3.org/TR/html4/loose.dtd"> > <html> > <head> > <meta name="generator" content="groff -Thtml, see www.gnu.org"> > <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> > <meta name="Content-Style" content="text/css"> > <style type="text/css"> > p { margin-top: 0; margin-bottom: 0; vertical-align: top } > pre { margin-top: 0; margin-bottom: 0; vertical-align: top } > table { margin-top: 0; margin-bottom: 0; vertical-align: top } > h1 { text-align: center } > </style> > <title></title> > </head> > <body> > > <hr> > <hr> > </body> > </html> > > I like to get some advice on what I can do better. > > Kind regards, > > Hans
Hi Hans, place the input into a filename and invoke groff using -p and -ms (rather than use pic in a pipeline). The reason is that groff parses the input file twice (once to generate html and once to generate the images via ps). So: $ cat foo.n .PS box .PE $ groff -p -ms -Thtml foo.n <!-- Creator : groff version 1.22.4 --> <!-- CreationDate: Wed Nov 29 14:05:19 2023 --> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta name="generator" content="groff -Thtml, see www.gnu.org"> <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> <meta name="Content-Style" content="text/css"> <style type="text/css"> p { margin-top: 0; margin-bottom: 0; vertical-align: top } pre { margin-top: 0; margin-bottom: 0; vertical-align: top } table { margin-top: 0; margin-bottom: 0; vertical-align: top } h1 { text-align: center } </style> <title></title> </head> <body> <hr> <p align="center" style="margin-top: 1em"><img src="grohtml-1446821.png" alt="Image grohtml-1446821.png"></p> <hr> </body> </html> regards, Gaius