On 07/04/2010 10:01 PM, uwesto...@lyx.org wrote:
Author: uwestoehr
Date: Mon Jul  5 04:01:10 2010
New Revision: 34753
URL: http://www.lyx.org/trac/changeset/34753

Log:
lyx2lyx/lyx_2_0.py:
- add routine to revert flex insets to TeX code

Author: uwestoehr
Date: Mon Jul  5 05:19:54 2010
New Revision: 34754
URL:http://www.lyx.org/trac/changeset/34754

Log:
lyx2lyx/lyx_2_0.py:
- add routine to revert character styles
- revert character styles to TeX code instead of deleting them - fixes #6803

Modified:
    lyx-devel/trunk/lib/lyx2lyx/lyx_2_0.py


There is a lot you do not cover in these routines, e.g., math. But the good news is that there is already a lyx2latex routine that you can use here. Look at how it is used, for example, in the revert_beamer_args routine. In the revert_flex_inset case, you ought to be able to do something like:
    content = lyx2latex(document, document.lines[i:z+1]
    content = LaTeXname + "{" + content + "}"
    document.body[i:z+1] = put_cmd_in_ert(content)
after you find z. Same for revert_charstyles, more or less.

Richard

Reply via email to