groff
[Top][All Lists]
Advanced

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

Re: using pic with -Thtml


From: hbezemer
Subject: Re: using pic with -Thtml
Date: Wed, 29 Nov 2023 17:05:58 +0100
User-agent: s-nail v14.9.24

Dear Gaius,

Good point, I wanted to create a minimal working
example, which created the same (missing) output as my
reallife example. And it did, but I think there's
another issue. When changing -ms to -mm (the macro I'm
using): No images are created.

Thus, groff -p -mm -Thtml foo.n
results in:

<!-- Creator     : groff version 1.23.0 -->
<!-- CreationDate: Wed Nov 29 16:03:10 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 style="margin-top: 1em">- 1 -</p>
<hr>
</body>
</html>

Maybe groff_mm(7) is the culprit?

Kind regards,

Hans
  
Gaius Mulley <gaiusmod2@gmail.com> wrote:

> 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



reply via email to

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