GNU bug report logs - #62870
Texinfo: stexi->texi: Itemize End command not in a line of its own

Previous Next

Package: guile;

Reported by: Luis Felipe <sirgazil <at> zoho.com>

Date: Sat, 15 Apr 2023 19:53:01 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Luis Felipe <sirgazil <at> zoho.com>
To: 62870 <at> debbugs.gnu.org
Subject: bug#62870: Texinfo: stexi->texi: Itemize End command not in a line of its own
Date: Sat, 15 Apr 2023 19:51:54 +0000
[Message part 1 (text/plain, inline)]
Hi,

The command ending an itemization (end command) is not placed in a line 
of its own, but it should:

"Block commands: These commands are written at the start of a line, with 
general text on following lines, terminated by a matching '@end' command 
on a line of its own." — Texinfo manual, @-Command Syntax.

This happens with the "itemize" command, but not with similar block 
commands like "example", "lisp", "display" and "format".

Operating system: Guix System x86_64 Kernel: 6.1.14-gnu
GNU Guile: 3.0.9


STEPS TO REPRODUCE

1. Start a Guile REPL
2. Run the following code:

   #+begin_src scheme
     (use-modules (texinfo serialize))
     (stexi->texi
      '(*fragment* (itemize (item "mango") (item "lemon"))))
   #+end_src


EXPECTED RESULT

A string like this one:

#+begin_src scheme
  "@itemize\n <at> item\nmango\n <at> item\nlemon\n <at> end itemize\n"
#+end_src

Which displays like this:

#+begin_example
@itemize
@item
mango
@item
lemon
@end itemize
#+end_example


UNEXPECTED RESULT

A string where the "@end itemize" command is not on a line of its own. 
Instead, the command gets appended to the last item in the list:

#+begin_src scheme
  "\n <at> c %start of fragment\n\n <at> itemize \n <at> item\nmango <at> item\nlemon <at> end 
itemize\n\n\n <at> c %end of fragment\n"
#+end_src

Which displays like this:

#+begin_example

@c %start of fragment

@itemize
@item
mango <at> item
lemon <at> end itemize


@c %end of fragment
#+end_example

Since the "@end" command is expected to be on a line of its own, tools 
like Texinfo's "makeinfo" program emit warnings like the following when 
converting the fragment to HTML:

#+begin_example
index.texi:73: warning: @end should only appear at the beginning of a line
#+end_example

(It seems also that the "items" themselves are not properly formatted, 
and, in addition, I wouldn't expect the wrapping comments about start 
and end of the fragment; but those seem like a different story, and 
don't trigger warnings anyways.)


WORKAROUND

Append a newline character to the last item of the list, like so:

#+begin_src scheme
  (use-modules (texinfo serialize))
  (stexi->texi
   '(*fragment* (itemize (item "mango") (item "lemon\n"))))
#+end_src

-- 
Luis Felipe López Acevedo
https://luis-felipe.gitlab.io/

[OpenPGP_0x0AB0D067012F08C3.asc (application/pgp-keys, attachment)]
[OpenPGP_signature (application/pgp-signature, attachment)]

This bug report was last modified 2 years and 59 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.