LATEX-L Archives

Mailing list for the LaTeX3 project


Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Bruno Le Floch <[log in to unmask]>
Reply To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Tue, 2 Jan 2018 07:50:15 -0500
text/plain (39 lines)
Happy New Year to you too,

On 01/02/2018 06:21 AM, Alexander Grahn wrote:
> * Variant form 'cF' invalid for base form '\tl_if_blank:nF'.
> It is issued for the line of code
>   \cs_generate_variant:Nn\tl_if_blank:nF{cF}
> that used to work without warning before. Which is the correct method for
> generating variants of conditionals?

This is not a warning for conditionals: there would be no warning for
instance for


The warning is for changing from n to N/c, or from N to n/o/V/v/f/x.  In
fact, your previous definition did not work: you almost certainly want a
"v"-type variant.  Let's see what "\tl_if_blank:cF {foo}" does with the
definition you gave.  First {foo} is changed to \foo.  Then
\tl_if_blank:nF is called with argument a token list containing a single
token, \foo.  Namely this is doing \tl_if_blank:nF { \foo }.  That token
list always contains a single item; it is never blank.  So
\tl_if_blank:cF is equivalent to \use_ii:nn.

A v-type variant would do what you presumably want: turn { foo } to \foo
then extract the contents of \foo and test if those are blank.

We could try to improve the error message, but last time I looked it was
hard to have as much information as I would have liked.  In the very
specific case of \tl_if_blank we could provide \tl_if_blank:NTF as a
synonym of \tl_if_blank:VTF, so that users would naturally try to take a
variant of \tl_if_blank:NTF to build \tl_if_blank:cTF.

Best regards,