Of coures I meant: layout2layout bug.

On 04/22/2014 10:42 PM, Richard Heck wrote:
On 04/22/2014 08:20 PM, aparsloe wrote:
The Customisation manual (downloaded with LyX 2.1.0 an hour ago) says in Section 5.3.9:

The layout for a Flex inset is being defined. In this case, |<Type>| must be of the form "|Flex:<name>|", where |name| may be be any valid identifier not used by a pre-existing Flex inset. The identifier may include spaces, but in that case the whole thing must be wrapped in quotes.

In answering a query on the user's list I find that the double quotes are necessary in LyX 2.1.0 irrespective of whether the name includes spaces. (This wasn't the case in beta2 but seems to have arisen since then.) LyX Document

This is close to right, but the problem is in the conversion of layouts. It's fine not to quote the names. Look at e.g. logicalmkup.module. Mone of the InsetLayout names are quoted, yet they work fine. The problem is that there is some buggy conversion code, and it seems to run only when the name is not quoted.

Georg, this is the format 48 conversion code you introduced at 6b49b6b1. In this case, we end up converting

InsetLayout Flex:ShortLabel
   LyXType            custom
   LatexType            command
   LatexName            shortLyXname
   Decoration            Classic
   LabelFont
    Color            phantomtext
   End
   LabelString            lab
   Multipar            0
   PassThru            0
End

to:

InsetLayout Flex:ShortLabel
   LyXType                      custom
   LatexType                    command
   LatexName                    shortLyXname
   Decoration                   Classic
   LabelFont
        Color                   phantomtext
        ResetsFont true
   End
   LabelString                  lab
   Multipar                     0
   PassThru                     0
        ResetsFont true
End

Note the extra ResetsFont in the LabelFont declaration. This is because we find "End", but the wrong one.

Note also that this code does not allow for the possibility of a quoted name. So the check:
    if name == "flex" or name[:5] == "flex:":
                    isflexlayout = True
fails if the name is quoted. That's why quotes vs no quotes matters.

Richard


Reply via email to