develooper Front page | perl.perlpoint | Postings from March 2002

Bug Report

From:
Robert Inder
Date:
March 16, 2002 06:07
Subject:
Bug Report
Message ID:
f51u1rgob96.fsf@auk.3lg.org

I've found a bug in pp2latex.

The code....

    =Background

    *Blah

    *Blah

    *A Sublist

    >

    *Foo

    *Bar

    *Wub

Generates

    \section{Example}

    \begin{itemize}
    \item Blay
    \item Blah
    \item A Sublist
    \end{itemize}

    % Shift >

    \begin{itemize}
    \item Foo
    \item Bar
    \item Wub
    \end{itemize}

Note that the outer "itemize" is incorrectly ended, so the
inner list is not a sublist, but appears to be a continuation.

I've had a quick look, and the problem looks horribly
deep inside PerlPoint.  It looks to me that the document
is being parsed and fed to the backend as...

       ListItem....
       ListItem...
   --> EndList
       Shift
       BeginImisedList
       ListItem...

I believe the problem is in the "EndItemize".  

The natural interpretation of ">" is "start a sub-list of this item".
And the fact that you can only use it within a list re-inforces
this idea somewhat.
And if you planted a new "list start", this is what both HTML and
Latex would do.  And since Latex works very hard to get spacings
right, telling it to do a sublist is the "right thing to do".

But once the parser has signaled the end of the outer list,
">" collapses to just "move over a bit".

pp2html does this by opening
a null <UL>, and keeping track of how many "bits" it has moved
over, so it can unwind the right amount at the right time.

And pp2latex simply ignores it --- for, I suspect, because almost
any way of telling LaTeX to start "moving over a bit" will fail
horribly unless there is a corresponding something to tell it to stop.
And that is tricky if 
the indented list happens to be the last thing on a slide/page,
there won't be a  corresponding "<" (the parser prohibits it), thus
obliging the back end to keep track of indentation.  AAAAARGH!

I've fudged soemthing in pp2latex that does the minimum
I need, but it is a hack.  Someone should sort this properly!

Robert.

------------------------------------------------------------------------
Robert Inder   Interactive Information Limited,           07770 30 40 52
               3, Lauriston Gardens,    Edinburgh    EH3 9HH    SCOTLAND
------------------------------------------------------------------------



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About