Hi,

I just discovered a "feature" of the listings inset that actually should be considered as a bug: Additional options given on the advanced page are implicitly sorted alphabetically. However, if using listing styles, the order of options is relevant. Consider the following example:

In my preamble, I have defined a custom listings style:

  \lstdefinestyle{acstyle}{
    ...                                       % many, many  settings
    mathescape=true             
  }

Now I want to apply this style, but set mathescape to false. So I type in the "Advanced" settings of the inset:

style=acstyle
mathescape=false

However, when I press "Apply", LyX immediately sorts the options alphabetically, which results in:

mathescape=false
style=acstyle

And hence, the mathescape=true  from the style "wins" :-(


IMHO this problem also shows a more general issue: When combining main settings and advanced settings, the order of application remains unclear. It seems that the same sorting rules apply here, which might as well yield surprising effects.

The best possible solution for this problem I can imagine would be:

  (a) to not sort options, but respect their order; and
  (b) to reflect all main settings on the "Advanced" page as well.

The idea behind (b) works as follows: When I activate an option in the "Main Settings", its string representation is automatically added to the end of the advanced settings; when I deactivate it, it is removed. When I manually add an option in the advanced settings for which a checkbox exists in the main settings, the checkbox is activated.

Thereby, *all* settings become visible and editable on the "Advanced" page, on which they can (because of (a)) be ordered in whatever order the user prefers.

However, just implementing (a) would already be a suitable workaround for most cases.

Daniel

Reply via email to