Hello,
On Thu, May 23, 2013 at 10:11 PM, Richard Heck <rgh...@lyx.org> wrote: > > I have posted a lyx2lyx conversion routine to the bug report > http://www.lyx.org/trac/ticket/8588#comment:23 > Please test and let me know if there are problems. If so, please post the > file causing the problems here, stripped down to be as minimal as possible. > I've tested the patch and managed to come up with a 2.0.6 document that didn't get properly converted. Attached are the input and conversion result. I would have expected to get 4 different chunk insets, instead of 1. I think the docs are self-explanatory, but please let me know if I should be more verbose on what went wrong. Thanks, Liviu > I have not yet written the REversion routine. I'll do that after this is > right. > > Richard > > > > On 05/23/2013 12:25 PM, Liviu Andronic wrote: > > On Thu, May 23, 2013 at 6:14 PM, Richard Heck <rgh...@lyx.org> wrote: > > So we take what's in the first Chunk paragraph, strip off the << and >>= > delimiters, and put that into the argument of the Chunk inset. > > Yes. Often after stripping the contents will be an empty string (""). > Then I think there is no need to include the Chunk argument inset. > > > Then we take > everything up to the last Chunk paragraph, put that as a sequence of > paragraphs into the Chunk inset, and discard the last Chunk paragraph. Yes? > > That is my understanding, too. I attach a new pair of examples that > contain multiple lines of code. Old Style version: > \begin_layout Chunk > <<TEST>>= > \end_layout > > \begin_layout Chunk > 2+2 > \end_layout > > \begin_layout Chunk > 3+3 > \end_layout > > \begin_layout Chunk > @ > \end_layout > > > New Inset version: > \begin_layout Standard > \begin_inset Flex Chunk > status open > > \begin_layout Plain Layout > > \begin_inset Argument 1 > status open > > \begin_layout Plain Layout > TEST > \end_layout > > \end_inset > > 2+2 > \end_layout > > \begin_layout Plain Layout > > 3+3 > \end_layout > > \end_inset > > > \end_layout > > > Liviu > > > Richard > > > > On 05/23/2013 12:11 PM, Liviu Andronic wrote: > > Richard, > I'm sorry but I gave you an imperfect equivalent for the inset > example. The attached knitr-new.lyx is better, and also uses the > argument inset. The relevant bits are: > > \begin_layout Standard > \begin_inset Flex Chunk > status open > > \begin_layout Plain Layout > > \begin_inset Argument 1 > status open > > \begin_layout Plain Layout > > TEST > \end_layout > > \end_inset > > 2+2 > \end_layout > > \end_inset > > > \end_layout > > > The code below is the old-style equivalent of the above. > > > On Thu, May 23, 2013 at 5:17 PM, Richard Heck <rgh...@lyx.org> wrote: > > \begin_layout Chunk > <<TEST>>= > \end_layout > > \begin_layout Chunk > 2+2 > \end_layout > > \begin_layout Chunk > @ > \end_layout > > Is it correct, then, to remove the first and last chunks, and leave only > the > middle bit? > > I do not have a good understanding of the LyX file format. Maybe JMarc > knows better? > > Liviu > > > > -- Do you know how to read? http://www.alienetworks.com/srtest.cfm http://goodies.xfce.org/projects/applications/xfce4-dict#speed-reader Do you know how to write? http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail
knitr-old.lyx
Description: application/lyx
knitr-old-conv.lyx
Description: application/lyx