lyx2lyx regression? Malformed LyX document after roundtrip

Scott Kostyshak skostysh at lyx.org
Sun Sep 13 14:33:20 UTC 2020


On Sun, Sep 13, 2020 at 11:43:31AM +0100, José Abílio Matos wrote:
> On Sunday, September 13, 2020 5:42:55 AM WEST Scott Kostyshak wrote:
> > On current master I get the following:
> > 
> > $ lyx -e lyx20x Beamer.lyx && lyx Beamer.20.lyx
> > Warning: Malformed LyX document: Missing layout name on line 1876
> > Warning: Malformed LyX document: Missing layout name on line 3053
> > Warning: Malformed LyX document: Missing layout name on line 4716
> > 
> > The reason this might be a regression is that if I first export to 2.3.x
> > format, and then in 2.3.0 I do the roundtrip with 2.0.x format, I do not
> > get those warnings:
> > 
> > $ lyx -e lyx23x Beamer.lyx
> > $ lyx230 -e lyx20x Beamer.23.lyx && lyx230 Beamer.23.20.lyx
> 
> First the general consideration:
> LyX 2.1 was the version where Jürgen's overhaul of the beamer layout was 
> implemented. I like and I prefer it to the previous version but this change 
> implied a significant change from the previous layout.
> 
> The conversion from lyx 2.0 format (from a beamer layout) to 2.1 is a tricky 
> issue. The reversion is even more difficult and is done on a best effort 
> basis.
> The round trip for a beamer layout, 2.1 -> 2.0 -> 2.1 is useless in practical 
> terms.

Sounds like this test is a good candidate to be inverted (i.e., tell the
tests we expect it to fail). It might not be worth the time to investigate.

> FWIW in the general case it would also be nice to be able to assess in
> the roundtrip the delta from the pdf output although that can not
> easily be done in an automatic way. :-)

We do actually have support for detecting and using "comparepdf", which
is a command-line tool that can look for differences in text or
appearance. We don't use it much though.

> Second consideration:
> If there is difference by doing the reversion by stages between 2.3 and 2.4 
> codes we need to see how the lyx2lyx code for reversions has changed for 
> lyx_23.py, lyx_22.py and lyx_21.py. The list should be very small.
> 
> Now after this long preamble I do not see the problem you describe. The lyx 
> files loads correctly but on the other hand I can not compile the resulting 
> document it fails in the same way for all the versions complaining that:
> ! Argument of \beamer at decodegobble has an extra }.

Compilation errors for old formats is in some sense expected. The
development.lyx manual states the following:

  the minimum requirement of the reversion routine is that it produces a
  valid document which can be read by an older LyX

> FWIW I am using Fedora 33 (with python 3.9 beta) but I do not see how this 
> could make a difference. :-)

Interesting. I'm surprised you don't get the terminal warnings. I guess
differences in Python version are the only thing that can explain that.

Scott
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20200913/eefc000a/attachment.asc>


More information about the lyx-devel mailing list