lyx2lyx error: \begin{english} is inside a bold layout instead of outside

Guenter Milde milde at users.sf.net
Sun Mar 1 21:43:52 UTC 2020


On 2020-02-23, Scott Kostyshak wrote:
> On Fri, Feb 21, 2020 at 11:26:08AM -0500, Scott Kostyshak wrote:
>> The following tests are failing on master:

>>   export/examples/ko/Welcome_lyx22 (Failed)
>>   export/examples/ko/Welcome_lyx23 (Failed)

>> To reproduce manually, export Welcome.lyx in mater to LyX 2.3.x format.
>> Then open the created file either with master or 2.3.x and compile with
>> the default format (XeLaTeX) and get the following error:

>>   ! Extra }, or forgotten \endgroup.

>> This happens because the ERT "\begin{English}" is inside the bold
>> layout. Either we need to end it at the end of the bold layout, or we
>> need to move the "\begin{English}" before the bold starts. That is, the
>> current LaTeX code being produced is:

>>   \textbf{\begin{english}Note for Linux users:}

> Bisect gives the following:

>   0d49918c0c815ead4ab70128fd6677118bf08c1e is the first bad commit
>   commit 0d49918c0c815ead4ab70128fd6677118bf08c1e
>   Author: Günter Milde <milde at lyx.org>
>   Date:   Thu Jul 4 20:49:06 2019 +0200

>       Refactor lyx2lyx for speed and simplicity.

> Günter can you reproduce?

I can reproduce the problem but not the bisect result:

Converting an MWE with lyx2lyx from commit fc99ef2ab3e60b4 28.05.2019,
I get the same nesting mixup and compilation error.

I rather assume the problem goes back to the inclusion of the
revert_language() function or at least to commit
  c70c0494 10.03.2019 Enhance revert_language function
(which solved the case of English text parts in a document with no longer
supported main language).



In the the revert_language() function in lyx2lyx_tools.py,
I find a comment:

        # TODO: handle nesting issues with font attributes, e.g.
        # \begin_layout Standard
        #
        # \emph on
        # \lang macedonian
        # Македонски јазик
        # \emph default
        #  — јужнословенски јазик, дел од групата на словенски јазици од јазичното
        #  семејство на индоевропски јазици.
        #  Македонскиот е службен и национален јазик во Македонија.
        # \end_layout

added 2019-06-03 in commit
8e06c2ffa9d  Fix some problems with lyx2lyx_tools.revert_languages().

with description

  Amends 7bb30286.

  Tested cases are now handled fine.

  (There are still many cases where the language support emulation
  is too complex for lyx2lyx and manual fixes are required after
  lyx2lyx conversion.)


I still stand by these comments: backporting support for new languages is
known to be incomplete. Improvements are welcome but

* we cannot and do not promise correct back-translating of documents using
  new features

* IMV it is better an unsolved problem results in compilation error with
  message than in siltent generation of wrong output.

I recommend filing an enhancement ticket and inverting the tests as "lyxbug".

Günter



More information about the lyx-devel mailing list