Re: r40785 - in lyx-devel/trunk/src: . tex2lyx

2012-03-13 Thread Georg Baum
Uwe Stöhr wrote: Am 10.03.2012 13:53, schrieb Georg Baum: Yes. Unfortunately this is not done, since special properties of characters like % are already handled in the tokenize phase. For example, \begin{verbatim} x %\end{verbatim} is not handled correctly, since tex2lyx believes that

Re: r40785 - in lyx-devel/trunk/src: . tex2lyx

2012-03-13 Thread Georg Baum
Uwe Stöhr wrote: > Am 10.03.2012 13:53, schrieb Georg Baum: > >> Yes. Unfortunately this is not done, since special properties of >> characters like % are already handled in the tokenize phase. For example, >> >> \begin{verbatim} >> x >> %\end{verbatim} >> >> is not handled correctly, since

Re: r40785 - in lyx-devel/trunk/src: . tex2lyx

2012-03-12 Thread Uwe Stöhr
Am 10.03.2012 13:53, schrieb Georg Baum: Yes. Unfortunately this is not done, since special properties of characters like % are already handled in the tokenize phase. For example, \begin{verbatim} x %\end{verbatim} is not handled correctly, since tex2lyx believes that %\end{verbatim} is a

Re: r40785 - in lyx-devel/trunk/src: . tex2lyx

2012-03-12 Thread Uwe Stöhr
Am 10.03.2012 14:03, schrieb Georg Baum: The special language option handling looks fragile. I believe it will work without the special code if you use p.verbatimOption() instead of p.getArg(). Thanks, this works. I will commit as soon as the git transformation is ready and committing is

Re: r40785 - in lyx-devel/trunk/src: . tex2lyx

2012-03-12 Thread Uwe Stöhr
Am 10.03.2012 13:53, schrieb Georg Baum: Yes. Unfortunately this is not done, since special properties of characters like % are already handled in the tokenize phase. For example, \begin{verbatim} x %\end{verbatim} is not handled correctly, since tex2lyx believes that %\end{verbatim} is a

Re: r40785 - in lyx-devel/trunk/src: . tex2lyx

2012-03-12 Thread Uwe Stöhr
Am 10.03.2012 14:03, schrieb Georg Baum: The special language option handling looks fragile. I believe it will work without the special code if you use p.verbatimOption() instead of p.getArg(). Thanks, this works. I will commit as soon as the git transformation is ready and committing is

Re: r40785 - in lyx-devel/trunk/src: . tex2lyx

2012-03-10 Thread Georg Baum
Uwe Stöhr wrote: Am 04.03.2012 22:47, schrieb Jean-Marc Lasgouttes: The point that Georg wanted to make is that we know what the correct solution is: reset all catcodes in the parser when we are in verbatim, or just read character by character until we find \end{verbatim}. I'm not sure

Re: r40785 - in lyx-devel/trunk/src: . tex2lyx

2012-03-10 Thread Georg Baum
Uwe Stöhr wrote: While doing this I stumbled of a tex2lyx bug with listings: http://www.lyx.org/trac/ticket/8065 The solution would be the same as I now did for verbatim. What do you think? I agree (once the verbatim support is improved). I also found out that listings are currently not

Re: r40785 - in lyx-devel/trunk/src: . tex2lyx

2012-03-10 Thread Georg Baum
Uwe Stöhr wrote: > Am 04.03.2012 22:47, schrieb Jean-Marc Lasgouttes: > >> The point that Georg wanted to make is that we know what the correct >> solution is: reset all catcodes in the parser when we are in verbatim, or >> just read character by character until we find \end{verbatim}. > > I'm

Re: r40785 - in lyx-devel/trunk/src: . tex2lyx

2012-03-10 Thread Georg Baum
Uwe Stöhr wrote: > While doing this I stumbled of a tex2lyx bug with listings: > http://www.lyx.org/trac/ticket/8065 > > The solution would be the same as I now did for verbatim. > What do you think? I agree (once the verbatim support is improved). > I also found out that listings are

Re: r40785 - in lyx-devel/trunk/src: . tex2lyx

2012-03-05 Thread Uwe Stöhr
Am 05.03.2012 03:07, schrieb Uwe Stöhr: your section{ example stangely fails. It failed of course as I explicitly handled this case incorrectly. Now everything should be in shape. regards Uwe

Re: r40785 - in lyx-devel/trunk/src: . tex2lyx

2012-03-05 Thread Uwe Stöhr
Am 05.03.2012 03:07, schrieb Uwe Stöhr: your section{ example stangely fails. It failed of course as I explicitly handled this case incorrectly. Now everything should be in shape. regards Uwe

Re: r40785 - in lyx-devel/trunk/src: . tex2lyx

2012-03-04 Thread Uwe Stöhr
Am 01.03.2012 00:48, schrieb Uwe Stöhr: Paragraph ended in line 1032 Missing \end_layout. Strange that I don't get this. I now had a closer look and fixed this now. If you want a more fancy test, try this: \begin{verbatim} \begin{foo} \end{verbatim} This will convert everything what

Re: r40785 - in lyx-devel/trunk/src: . tex2lyx

2012-03-04 Thread Uwe Stöhr
Am 01.03.2012 21:18, schrieb Georg Baum: If you can tell me what exactly fails I can have a look, but I want to avoid doing duplicate work. I tried to use this Context context(true, parent_context.textclass); context.layout = parent_context.textclass.plainLayout(); context.check_layout(os);

Re: r40785 - in lyx-devel/trunk/src: . tex2lyx

2012-03-04 Thread Jean-Marc Lasgouttes
Le 04/03/2012 15:12, Uwe Stöhr a écrit : I now created a new function where \begin and \end inside verbatim environments are no longer parsed. This must maybe be optimized a bit for other cases. Could you please give it a try? I also now updated the verbatim example in our test file. You

Re: r40785 - in lyx-devel/trunk/src: . tex2lyx

2012-03-04 Thread Uwe Stöhr
Am 04.03.2012 22:47, schrieb Jean-Marc Lasgouttes: The point that Georg wanted to make is that we know what the correct solution is: reset all catcodes in the parser when we are in verbatim, or just read character by character until we find \end{verbatim}. I'm not sure about the catcodes.

Re: r40785 - in lyx-devel/trunk/src: . tex2lyx

2012-03-04 Thread Uwe Stöhr
Am 01.03.2012 00:48, schrieb Uwe Stöhr: Paragraph ended in line 1032 Missing \end_layout. Strange that I don't get this. I now had a closer look and fixed this now. If you want a more fancy test, try this: \begin{verbatim} \begin{foo} \end{verbatim} This will convert everything what

Re: r40785 - in lyx-devel/trunk/src: . tex2lyx

2012-03-04 Thread Uwe Stöhr
Am 01.03.2012 21:18, schrieb Georg Baum: If you can tell me what exactly fails I can have a look, but I want to avoid doing duplicate work. I tried to use this Context context(true, parent_context.textclass); context.layout = _context.textclass.plainLayout(); context.check_layout(os); But

Re: r40785 - in lyx-devel/trunk/src: . tex2lyx

2012-03-04 Thread Jean-Marc Lasgouttes
Le 04/03/2012 15:12, Uwe Stöhr a écrit : I now created a new function where \begin and \end inside verbatim environments are no longer parsed. This must maybe be optimized a bit for other cases. Could you please give it a try? I also now updated the verbatim example in our test file. You

Re: r40785 - in lyx-devel/trunk/src: . tex2lyx

2012-03-04 Thread Uwe Stöhr
Am 04.03.2012 22:47, schrieb Jean-Marc Lasgouttes: The point that Georg wanted to make is that we know what the correct solution is: reset all catcodes in the parser when we are in verbatim, or just read character by character until we find \end{verbatim}. I'm not sure about the catcodes.

Re: r40785 - in lyx-devel/trunk/src: . tex2lyx

2012-03-01 Thread Georg Baum
Uwe Stöhr wrote: Am 28.02.2012 22:11, schrieb Georg Baum: Your test code in test-structure.tex fails already. LyX complains like this: Paragraph ended in line 1032 Missing \end_layout. Strange that I don't get this. All my examples are exported as expected. Looking in the LyX-code I

Re: r40785 - in lyx-devel/trunk/src: . tex2lyx

2012-03-01 Thread Georg Baum
Uwe Stöhr wrote: > Am 28.02.2012 22:11, schrieb Georg Baum: > >> Your test code in test-structure.tex fails already. LyX complains like >> this: >> >> Paragraph ended in line 1032 >> Missing \end_layout. > > Strange that I don't get this. All my examples are exported as expected. > Looking in

Re: r40785 - in lyx-devel/trunk/src: . tex2lyx

2012-02-29 Thread Uwe Stöhr
Am 28.02.2012 22:11, schrieb Georg Baum: Your test code in test-structure.tex fails already. LyX complains like this: Paragraph ended in line 1032 Missing \end_layout. Strange that I don't get this. All my examples are exported as expected. Looking in the LyX-code I can also don't see a

Re: r40785 - in lyx-devel/trunk/src: . tex2lyx

2012-02-29 Thread Uwe Stöhr
Am 28.02.2012 22:11, schrieb Georg Baum: Your test code in test-structure.tex fails already. LyX complains like this: Paragraph ended in line 1032 Missing \end_layout. Strange that I don't get this. All my examples are exported as expected. Looking in the LyX-code I can also don't see a

Re: r40785 - in lyx-devel/trunk/src: . tex2lyx

2012-02-28 Thread Georg Baum
Uwe Stöhr wrote: Am 21.02.2012 22:09, schrieb Georg Baum: this is far more complicated than what you implemented. Believe me, if it was that easy I would have added verbatim support a long time ago. I think we could not support verbatim before as we had no feature to convert to. OK, to

Re: r40785 - in lyx-devel/trunk/src: . tex2lyx

2012-02-28 Thread Georg Baum
Uwe Stöhr wrote: > Am 21.02.2012 22:09, schrieb Georg Baum: > >> this is far more complicated than what you implemented. Believe me, if it >> was that easy I would have added verbatim support a long time ago. > > I think we could not support verbatim before as we had no feature to > convert to.

Re: r40785 - in lyx-devel/trunk/src: . tex2lyx

2012-02-26 Thread Uwe Stöhr
Am 21.02.2012 22:09, schrieb Georg Baum: this is far more complicated than what you implemented. Believe me, if it was that easy I would have added verbatim support a long time ago. I think we could not support verbatim before as we had no feature to convert to. + else if (name ==

Re: r40785 - in lyx-devel/trunk/src: . tex2lyx

2012-02-26 Thread Uwe Stöhr
Am 21.02.2012 22:09, schrieb Georg Baum: this is far more complicated than what you implemented. Believe me, if it was that easy I would have added verbatim support a long time ago. I think we could not support verbatim before as we had no feature to convert to. + else if (name ==

Re: r40785 - in lyx-devel/trunk/src: . tex2lyx

2012-02-21 Thread Georg Baum
uwesto...@lyx.org wrote: Author: uwestoehr Date: Tue Feb 21 00:38:13 2012 New Revision: 40785 URL: http://www.lyx.org/trac/changeset/40785 Log: support for verbatim: step 2: tex2lyx support Uwe, this is far more complicated than what you implemented. Believe me, if it was that easy I

Re: r40785 - in lyx-devel/trunk/src: . tex2lyx

2012-02-21 Thread Georg Baum
uwesto...@lyx.org wrote: > Author: uwestoehr > Date: Tue Feb 21 00:38:13 2012 > New Revision: 40785 > URL: http://www.lyx.org/trac/changeset/40785 > > Log: > support for verbatim: step 2: tex2lyx support Uwe, this is far more complicated than what you implemented. Believe me, if it was that