On Fri, Jun 03 2011, Thomas A. Schmitz wrote:
Ah, expdoifelse is for "expanded doifelse," right? Any examples for such a lua helper? Sounds good, but I still haven't been able to understand how to mix xml and lua code.
\startluacode function my_externalfigure(file, t) local args_present for k, v in pairs(t) do if v == "" then t[k] = nil else args_present = true end end context.externalfigure({file}, args_present and t) end \stopluacode \startxmlsetups xml:externalfigure \ctxlua{my_externalfigure("\xmlatt{#1}{resource}", {width = "\xmlatt{#1}{width}", height = "\xmlatt{#1}{height}"})} \stopxmlsetups My first idea was "\expanded{\externalfigure[...][\doif...]}" but it does not work... -- Peter