Re: Multiline @cindex entries misrender in groff Texinfo manual

2024-06-02 Thread Gavin Smith
On Thu, May 16, 2024 at 10:41:44PM +0200, Patrice Dumas wrote:
> On Thu, May 16, 2024 at 02:21:21PM -0500, G. Branden Robinson wrote:
> > At 2024-05-16T12:55:51-0500, Dave Kemper wrote:
> > > In a few places, the groff Texinfo manual uses a line-ending @ to
> > > continue a @cindex entry.  An example is:
> > > 
> > >   @cindex print to the standard error stream (@code{tm}, @code{tm1},@
> > >   @code{tmc})

...

> There is a specific context in which @ followed by a newline is removed
> and the line is not considered to be ended, on the @def* command line.
> It is said explicitely in that section that in other contexts, the @
> followed by a newline is not a continuation character:
> https://www.gnu.org/software/texinfo/manual/texinfo/texinfo.html#Def-Cmd-Continuation-Lines

...

> > I suspect it's not a coincidence that DVI and PDF are the formats for
> > which texinfo uses TeX to generate the output.
> 
> Indeed, seems like @ followed by a new line does not ends the @-command
> line in Texinfo TeX.  I don't know if it should be considered as
> undefined behaviour or if TeX (or makeinfo, though I'd say that makeinfo
> is right...) should be changed.  I'd lean towards undefined behaviour in
> that case.

I agree that it is undefined behaviour.  makeinfo could flag it as an
error.  It may not be possible to modify texinfo.tex to stop reading
the line at the end of the first line for input line

@cindex aaa@
bbb

Perhaps a warning like this (of course the same change would have to
be made to the XS parser):

diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index d39b0b14bd..a6bfab8014 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -5428,6 +5428,12 @@ sub _handle_other_command($)
   $command), $source_info);
   }
   if ($command eq "\n") {
+if ($self->_top_context() eq 'ct_line') {
+  $self->_line_warn(
+"\@ should not occur at end of argument to line command",
+$source_info);
+}
+
 $current = _end_line($self, $current, $source_info);
 $retval = $GET_A_NEW_LINE;
   }



Putting a bunch of jpg files on an mm document - too slow

2024-06-02 Thread Blake McBride
Greetings,

I have a bunch of jpg files I need to put into an mm file.  The way I am
doing it right now is:

1. convert jpg files to ps files using:  convert pic.jpg pic.ps
2. Include the pics in the mm file using:  .PSPIC pic.ps 4in
3. Run groff:   groff -mm file.mm >file.ps
4. Convert the file to a PDF file with:  ps2pdf file.ps file.pdf

It works. The problem is that stem #4 takes a long time.  Sometimes more
than five minutes!

I tried using gs directly but that didn't help.

I also tried:

1.  Convert the jpg file to a pdf file with:  convert file.jpg file.ps
2.  Include the picture with:  .PDFPIC file.pdf 4in
3.  Run groff with:  pdfroff -mm -U file.mm >file.pdf

But line 3 gives me the following error:

GPL Ghostscript 9.55.0: Unrecoverable error, exist code 1
Segmentation fault (core dumped)

I'm sure the jpg and mm files are correct.

Any suggestions on including jpg files into an mm document faster?

Thanks!

Blake McBride


Re: Putting a bunch of jpg files on an mm document - too slow

2024-06-02 Thread Damian McGuckin

On Sun, 2 Jun 2024, Blake McBride wrote:


I have a bunch of jpg files I need to put into an mm file.  The way I am
doing it right now is:

1. convert jpg files to ps files using:  convert pic.jpg pic.ps
2. Include the pics in the mm file using:  .PSPIC pic.ps 4in
3. Run groff:   groff -mm file.mm >file.ps
4. Convert the file to a PDF file with:  ps2pdf file.ps file.pdf

It works. The problem is that stem #4 takes a long time.  Sometimes more
than five minutes!


Did you try

groff -mm -Tpdf file.mm > file.pdf

What is your CPU?

What is the resolution of the JPG files?

- Damian



Putting a bunch of jpg files on an mm document - too slow

2024-06-02 Thread Blake McBride
Greetings,

I have a bunch of jpg files I need to put into an mm file.  The way I am
doing it right now is:

1. convert jpg files to ps files using:  convert pic.jpg pic.ps
2. Include the pics in the mm file using:  .PSPIC pic.ps 4in
3. Run groff:   groff -mm file.mm >file.ps
4. Convert the file to a PDF file with:  ps2pdf file.ps file.pdf

It works. The problem is that stem #4 takes a long time.  Sometimes more
than five minutes!

I tried using gs directly but that didn't help.

Any suggestions on including jpg files into an mm document faster?

Thanks!

Blake


Re: Putting a bunch of jpg files on an mm document - too slow

2024-06-02 Thread Blake McBride
I tried:

1.  Convert the jpg file to a pdf file with:  convert file.jpg file.ps
2.  Include the picture with:  .PDFPIC file.pdf 4in
3.  Run groff with:  pdfroff -mm -U file.mm >file.pdf

But line 3 gives me the following error:

GPL Ghostscript 9.55.0: Unrecoverable error, exist code 1
Segmentation fault (core dumped)

I'm sure the jpg and mm files are correct.

Thanks!

Blake


On Sun, Jun 2, 2024 at 2:05 PM Blake McBride  wrote:

> Greetings,
>
> I have a bunch of jpg files I need to put into an mm file.  The way I am
> doing it right now is:
>
> 1. convert jpg files to ps files using:  convert pic.jpg pic.ps
> 2. Include the pics in the mm file using:  .PSPIC pic.ps 4in
> 3. Run groff:   groff -mm file.mm >file.ps
> 4. Convert the file to a PDF file with:  ps2pdf file.ps file.pdf
>
> It works. The problem is that stem #4 takes a long time.  Sometimes more
> than five minutes!
>
> I tried using gs directly but that didn't help.
>
> Any suggestions on including jpg files into an mm document faster?
>
> Thanks!
>
> Blake
>
>