On 7/4/25 4:35 AM, Jürgen Spitzmüller wrote:
Am Freitag, dem 04.07.2025 um 00:38 +0200 schrieb John Ankarström:
The problem is that the List Preamble argument is PassThru, i.e.,
takes raw LaTeX code, and as such the label won't be tracked by LyX.
This may easily be fixed by removing PassThru from List Preamble; see
the diff above.
I think this should be implemented as part of the official
distribution.  There is really no reason for List Preamble to be
PassThru.
We can not do this just like that, as it would break existing documents
that rely on the inset being pass thru.

The rationale for having it pass thru is that usually the list preamble
is used for LaTeX code, and I still think this makes sense.

A workaround for your case would be to add a LyX label _before_ the
example, then in the example use LaTeX code (\label{exa:foo}).

This will give you a LaTeX warning, but otherwise it will work.

What we could add to the style is a second inset:

        Argument listpreamble:2
                LabelString    "Main Example Label"
                MenuString     "Main Label"
                Tooltip        "A Label for the main example number"
        EndArgument

With this, you could still use the pass-thru normal list preamble.

This requires a file format change, though.

If you want to add this, go ahead.

Riki


--
lyx-devel mailing list
lyx-devel@lists.lyx.org
https://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to