[help-texinfo] SOLVED - Re: makeinfo: error messages for processing nested entries (table->item->enumeration)

2017-08-07 Thread Simon Sobisch
Thank you very much!

Am 07.08.2017 um 19:35 schrieb Gavin Smith:
> On Mon, Aug 07, 2017 at 12:18:40AM +0200, Simon Sobisch wrote:
>> makeinfo produces error messages like
>>
>> ./1.texi:488: @item outside of table or list
>> ./1.texi:501: unmatched `@end table'
>>
>> for the following part
>>
>> @p @table @asis  <--- line 475
>> @p @item Color
>> @p [...]  The eight colors, by number, with the constant names defined
>> in screenio.cpy, are as follows:
>> @enumerate 0
>> @p @item Black: COB-COLOR-BLACK
>> @p @item Blue: COB-COLOR-BLUE
>> @p @item Green: COB-COLOR-GREEN
>> @p @item Cyan (Turquoise): COB-COLOR-CYAN
>> @p @item Red: COB-COLOR-RED
>> @p @item Magenta: COB-COLOR-MAGENTA
>> @p @item Yellow: COB-COLOR-YELLOW
>> @p @item White: COB-COLOR-WHITE
>> @end enumerate
>> @item Text Brightness <--- line 488
>> @p [...]
>> @item [...]
>> @p [...]
>> @end table<--- line 501
>>
>> As far as I see the @item in line 488 and the @end table belong to the
>> @table in line 475.
>> This is the way it can be seen in the PDF generated by texi2pdf, too.
> 
> It appears to be related to the use of the macro @p.
> 
> I found a definition in Macros.texi at 
> https://svn.code.sf.net/p/open-cobol/code/external-doc/guide/
> 
> @comment +---+
> @comment | MACRO: p  |
> @comment |   |
> @comment | Begin a new paragraph in a manner appropriate for either INFO or  |
> @comment | TeX.  |
> @comment +---+
> 
> @macro p
> @ifinfo
> @sp 1
> @end ifinfo
> @iftex
> @sp 0.5
> @end iftex
> @end macro
> 
> I haven't checked for sure, but what is likely happening is that the 
> macro is being expanded as
> 
> @sp 1 @table @asis
> 
> which may be wrong as @table should begin a new line.
> 
> One thing you could try is changing the macro definition, like:
> 
> @macro p
> @ifinfo
> @sp 1
> 
> @end ifinfo
> @iftex
> @sp 0.5
> 
> @end iftex
> @end macro
> 
> Then it would be expanded as
> 
> @sp 1
> @table @asis
> 
> Possibly the macros worked with older versions of makeinfo, but there 
> are a few incompatibilities around the use of macros.
> 

I did not read the "must be on a new line" part. As @p is used all over
the place and the files are changed by others too I've gone the "fix
macro approach" (there were similar issues with much less occurrences
which I've fixed directly by inserting a line break).

I've changed the macro the following way and it works fine now!

  @comment
+---+
  @comment | MACRO: p
  |
  @comment |
  |
  @comment | Begin a new paragraph in a manner appropriate for either
INFO or  |
  @comment | TeX.
  |
 +@comment |
  |
 +@comment | NOTE: the additional line break before @end macro is
necessary!!! |
  @comment
+---+
  @macro p
  @ifinfo
  @sp 1
  @end ifinfo
  @iftex
  @sp 0.5
  @end iftex
 +
  @end macro

I'm going on to fixing the other issues that are in the tex files...

Simon



Re: [help-texinfo] makeinfo: error messages for processing nested entries (table->item->enumeration)

2017-08-07 Thread Gavin Smith
On Mon, Aug 07, 2017 at 12:18:40AM +0200, Simon Sobisch wrote:
> makeinfo produces error messages like
> 
> ./1.texi:488: @item outside of table or list
> ./1.texi:501: unmatched `@end table'
> 
> for the following part
> 
> @p @table @asis  <--- line 475
> @p @item Color
> @p [...]  The eight colors, by number, with the constant names defined
> in screenio.cpy, are as follows:
> @enumerate 0
> @p @item Black: COB-COLOR-BLACK
> @p @item Blue: COB-COLOR-BLUE
> @p @item Green: COB-COLOR-GREEN
> @p @item Cyan (Turquoise): COB-COLOR-CYAN
> @p @item Red: COB-COLOR-RED
> @p @item Magenta: COB-COLOR-MAGENTA
> @p @item Yellow: COB-COLOR-YELLOW
> @p @item White: COB-COLOR-WHITE
> @end enumerate
> @item Text Brightness <--- line 488
> @p [...]
> @item [...]
> @p [...]
> @end table<--- line 501
> 
> As far as I see the @item in line 488 and the @end table belong to the
> @table in line 475.
> This is the way it can be seen in the PDF generated by texi2pdf, too.

It appears to be related to the use of the macro @p.

I found a definition in Macros.texi at 
https://svn.code.sf.net/p/open-cobol/code/external-doc/guide/

@comment +---+
@comment | MACRO: p  |
@comment |   |
@comment | Begin a new paragraph in a manner appropriate for either INFO or  |
@comment | TeX.  |
@comment +---+

@macro p
@ifinfo
@sp 1
@end ifinfo
@iftex
@sp 0.5
@end iftex
@end macro

I haven't checked for sure, but what is likely happening is that the 
macro is being expanded as

@sp 1 @table @asis

which may be wrong as @table should begin a new line.

One thing you could try is changing the macro definition, like:

@macro p
@ifinfo
@sp 1

@end ifinfo
@iftex
@sp 0.5

@end iftex
@end macro

Then it would be expanded as

@sp 1
@table @asis

Possibly the macros worked with older versions of makeinfo, but there 
are a few incompatibilities around the use of macros.

Another possibility:
@macro p
@ifinfo
@sp 1 @c

@end ifinfo
@iftex
@sp 0.5 @c

@end iftex
@end macro

so it is expanded as

@sp 1 @c
@table @asis

This is closer to the implementation of @macro in TeX (in texinfo.tex).

If you decide you can live without the @p macro, I'd suggest getting rid 
of it and starting paragraphs in the usual way (with a blank line).

> * Side question: Do you see any use of producing an info file from a
> 570+ pages document? I'd currently only think HTML (splitted) or docbook
> are reasonable for a size like this but would like to know if/how others
> read big texinfo files in general.

Yes, I don't see why not. Someone might want to look up information in 
the manual in the Info format. I'm not aware of any disadvantage that 
Info has for looking at large manuals in particular.