On Friday 18 January 2002 10:55 am, you wrote:
> >>>>> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:
> 
> Angus> On Thursday 17 January 2002 5:20 pm, Jean-Marc Lasgouttes
> Angus> wrote:
> >> >>>>> "Dekel" == Dekel Tsur <[EMAIL PROTECTED]> writes:
> >> 
> Dekel> On Tue, Jan 15, 2002 at 05:28:12PM +0000, [EMAIL PROTECTED]
> Dekel> wrote:
> >> >> Tidy up the file mathed.lyx. Still doesn't run without bolting
> >> the >> lyxcode definition in the preamble but is otherwise Ok I
> >> think.
> >> 
> Dekel> It does work for me. Can you trace the problem ? Does anyone
> Dekel> else have this problem ?
> >>  I would think it is due to his use of cxx stl library (either a
> >> bug in the library or in the way we use it).
> 
> Angus> This suggests that you have some idea where/how this bug is
> Angus> triggered? Care to through me some pointers?
> 
> Try to take a look at LaTeXFeatures::getTClassPreamble(). It uses a
> vector of bool (which should be safe) and stringstreams. I seem to
> remember I have seen cases where cxx stringstream did not behave as
> gnu version, but this is very hazy for me.
> 
> I would try to add some debug statements in there.
> 
> JMarc

That, indeed, highlights the problem. Jean-Marc. I added the print statements 
below to LaTeXFeatures.C and ran lyx on lib/examples/mathed.lyx to produce 
the output below. As you can see, tcpreamble should be full of stuff and 
isn't. I've used ostringstream in the past without any problems, but this is 
wierd!

Angus

Index: src/LaTeXFeatures.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/LaTeXFeatures.C,v
retrieving revision 1.53
diff -u -p -r1.53 LaTeXFeatures.C
--- src/LaTeXFeatures.C 2002/01/10 10:05:43     1.53
+++ src/LaTeXFeatures.C 2002/01/18 11:11:33
@@ -343,11 +343,14 @@ string const LaTeXFeatures::getTClassPre
        tcpreamble << tclass.preamble();

        for (layout_type i = 0; i < tclass.numLayouts(); ++i) {
+               std::cerr << layout[i] << " " << tclass[i].name() << 
std::endl;
                if (layout[i]) {
+                       std::cerr << tclass[i].preamble() << std::endl;
                        tcpreamble  << tclass[i].preamble();
                }
        }

+       std::cerr << "The whole thing\n" << tcpreamble.str() << std::endl;
        return tcpreamble.str().c_str();
 }


aleem@pneumon:src-> ./lyx
1 Standard

0 Itemize
0 Enumerate
0 Description
0 List
0 Part
1 Section

0 Subsection
0 Subsubsection
0 Paragraph
0 Subparagraph
0 Part*
0 Section*
0 Subsection*
0 Subsubsection*
0 Paragraph*
0 Subparagraph*
0 Title
0 Author
0 Date
0 Abstract
0 Bibliography
1 LyX-Code
 \newenvironment{lyxcode}
   {\begin{list}{}{
     \setlength{\rightmargin}{\leftmargin}
     \raggedright
     \setlength{\itemsep}{0pt}
     \setlength{\parsep}{0pt}
     \normalfont\ttfamily}%
    \item[]}
   {\end{list}}

0 Comment
0 Address
0 Right Address
0 Quotation
0 Quote
0 Verse
1 Caption

0 LaTeX Title
The whole thing

Reply via email to