José  Matos wrote:

> On Wednesday 05 February 2003 15:15, Angus Leeming wrote:
>> >> def merge_formula_inset(lines):
>> >>     i=0
>> >>     while 1:
>> >>         i = find_token(lines, "\\begin_inset Formula", i)
>> >>         if i == -1: break
>> >>         if lines[i+1] in math_env:
>> >>             lines[i] = lines[i] + lines[i+1]
>> >>             del lines[i+1]
>> >>         i = i + 1
>>
>> That's odd. Running the attached test case through
>>         $ lyx2lyx -t 216 test_215.lyx > test_216.lyx
>> changes only the file format.
> 
>   Because there is a blank space after the first \[

Got it. Remove that and I get:
-\begin_inset Formula
-\[
+\begin_inset Formula\[

>   Is that a file created with reLyX? If yes I will trim the final space to
> test for it.

Sort of. I inserted lots of line breaks by hand to try and get some reaction 
from your code ;-)

If I run reLyX on this:
\begin{document}

\[
a=b\int_{y}^{x}\: rcos\theta\:\textrm{d}r\]

\end{document}

I get:
$ cat test_215.lyx | sed 's/\(.\)$/\1X/'
#LyX 1.2 created this file. For more info see http://www.lyx.org/X
\lyxformat 2.15X
\textclass articleX

\layout StandardX


\begin_inset Formula \[ X
a=b\int_{y}^{x}\: rcos\theta\:\textrm{d}r\]X
\end_inset X


\the_endX

So, I guess you don't need to do anything and nor do I in this case either.

-- 
Angus

Reply via email to