Closed muzimuzhi closed 2 weeks ago
Sigh - I guess the package wasn't tested against dev
- drat. I see you went for
\cs_gset_protected:Npn \fp_set:NV
{ \exp_args:NNV \fp_set:Nn }
but shouldn't
\cs_generate_variant:Nn \fp_set:Nn { NV }
work equally well? I could do that in expl3
today and we could avoid a patch release!
but shouldn't
\cs_generate_variant:Nn \fp_set:Nn { NV }
work equally well?
True. At the time I was not sure about whether \cs_generate_variant:Nn
works like \cs_new...
or \cs_(g)set...
.
Update: Oh, \relax
is treated as non-existent in expl3.
I'll update the workaround posted in https://github.com/CTeX-org/ctex-kit/issues/723#issuecomment-2451472859.
The \__template_assign_variable:
is responsible for processing 7 types: tl
, clist
, fp
, int
, dim
, skip
, and muskip
. Among them only the first two have \<type>_(g)set:NV
defined.
Hmm, lets see what everyone else thinks - a test for the existence of a V
-type variant would add steps to every key assignment - perhaps easier to to quickly add the V
-type variants even though they are not all needed.
Or, use \exp_args:NNV \<type>_(g)set:Nn
in replace of \<type>_(g)set:NV
.
Or, use
\exp_args:NNV \<type>_(g)set:Nn
in replace of\<type>_(g)set:NV
.
Sure, that would work - I was thinking not only about a 'quick fix' but also that we perhaps should make sure this doesn't come up elsewhere, and adding a few variants to expl3
addresses that
Sure, that would work - I was thinking not only about a 'quick fix' but also that we perhaps should make sure this doesn't come up elsewhere, and adding a few variants to
expl3
addresses that
I would add the V-type variants and make a note in the template code that (if ever) this part gets extended with further variable types then it is necessary to ensure that the corresponding V-type is implemented.
@FrankMittelbach Cool - I'll shortcut the normal main/dev cycle for expl3
and upload both at the same time (may be tomorrow) ...
Should be fixed: if everyone is happy with that being done at the expl3
end, I'll close (and mark hotfixed).
Maybe add some tests (to lttemplates005.lvt
)?
Doing tests as suggested, there is still an issue - I will need to look again at this. Fix hopefully later today - with tests :)
Sorted - I'll close
Brief outline of the bug
193bfa8d4 (Expand variable contents when passing \KeyValue content (fixes #1486), 2024-10-07) added something like
\exp_not:c { #1 V }
to\__template_assign_variable:n
, in which#1
has the form<type>_(g)set:N
. See line 2127 below.https://github.com/latex3/latex2e/blob/19854823731d3c1ec932bab9223a3cb576852f19/base/lttemplates.dtx#L2120-L2138
Among the possible
<type>
values, at least forfp
,\fp_(g)set:NV
are (previously) undefined, but are now wrongly defined to\relax
.Release release-2024-11-01 is affected.
(First reported in https://github.com/CTeX-org/ctex-kit/issues/723, by myself.)
Minimal example showing the bug
The first error
Log file (required) and possibly PDF file
latex-KayValue-2.log