Mark van Rossum wrote: > THe attached valid latex file, leads to bad lyx code. > (Only option is to kill lyx)
Nasty. Hundreds of ERROR (Paragraph::DepthHook): no hook. Ok there are lots of problems here. First, (fighting back ;-), underscores are generally regarded as not valid in label entries. \label{fig_comp} Running through reLyX and then through lyx2lyx to bump the lyx format to the current version produces \begin_inset LatexCommand \label{fig \begin_inset ERT status Collapsed \layout Standard _ \end_inset comp} \end_inset If I edit your original latex file, replacing 'fig_comp' with 'figcomp' and then $ reLyX -f test.tex; lyx2lyx test.lyx > test_relyx_lyx2lyx.lyx I get the LyX code: \begin_inset LatexCommand \label{figcomp} \end_inset The good news for you is that tex2lyx (André Pönitz's proposed replacement for reLyX) is able to cope with your 'nasty' label generating the LyX code: \begin_inset LatexCommand \label{fig_comp} \end_inset Moreover, although it generates LyX format 225 (current cvs) the lyx2lyx in the cvs tree is able to revert to format 221 (that of LyX 1.3.x) LyX 1.3.x has no problems at all with this file. This 1.3.x file is superficially a little different to that created by the route available to you becuase LyX 1.4.x has much better support for the comment environment. Reverting back to 1.3.x format forces lyx2lyx to insert ERT. Note to José: could lyxrevert insert a comment layout instead? I attach the 'evil' tex->relyx->lyx2lyx file 'test_relyx_lyx2lyx.lyx' and the 'good' tex->tex2lyx->lyx2lyx(cvs) file test_tex2lyx_lyx2lyx.lyx (I commented out \usepackage{namedplus} in test_tex2lyx_lyx2lyx.lyx because I do not have this package installed.) Note to André: shouldn't comments in the user preamble should be preserved? This one was silently swallowed. Maybe someone else can ascertain where the real bug lies in the relyx output that leads to the original 'no hook' problem. -- Angus
test_relyx_lyx2lyx.lyx
Description: application/lyx
test_tex2lyx_lyx2lyx.lyx
Description: application/lyx