According to my lights, the following code should typeset 212. However, my lights are obviously on the dark side as I actually get 111. How can I change the code to work as expected?
\documentclass{article}
\usepackage{xparse}
\begin{document}
\ExplSyntaxOn
\NewDocumentCommand \mylist {m}
{
\clist_map_inline:nn { #1 }
{
\seq_set_split:Nnn \l_tmpa_seq { : } { ##1 }
\seq_count:N \l_tmpa_seq
}
}
\ExplSyntaxOff
\mylist{tikz:something,somethingelse,tikz:thirdthing}
\end{document}
The purpose of this is to process a sequence of images with potentially different options. For example,
\mylist{tikz:first-tikz-input,{graphics={width=.2\textwidth},rotate=30}:example-image-a,tikz:second-tikz-input}
I've tried using \clist_map_variable: instead of \clist_map_inline:. I've also tried generating \seq_set_split:Nno and \seq_set_split:Nnx, but whatever I try, the items stubbornly refuse to be split at the : delimiters.
Can I store sequences in sequences with expl3 suggests this may not be possible directly (if nesting sequences in comma-separated lists is relevantly like nesting them in sequences). However, the descriptions in the documentation suggest that nesting them should now be possible, so I'm not sure if those answers are current.
:which has a special meaning inexpl3, that's why I use/or!in such cases – May 02 '17 at 18:12\clist_map_inline, but using\seq_set_from_clist:Nnmay be too much... – May 02 '17 at 18:23:being a safe splitter in Forest/TikZ, but, of course, it can't be here. Although the documentation does not mention this .... – cfr May 02 '17 at 18:37\seqvariable compared to the\clist- type – May 02 '17 at 19:27