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 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




Reply via email to