[NTG-context] \jobname and \doifelse

Hans Hagen j.hagen at xs4all.nl
Sun Nov 6 11:21:54 CET 2022


On 11/5/2022 4:30 PM, Pablo Rodriguez via ntg-context wrote:
> Dear list,
> 
> using current latest (2022.10.22 11:23), I have the following sample:
> 
>    \starttext
>    \doifelse{\jobname}{a}
>      {yes}{no}
>    \jobname
> 
>    \startluacode
>    if tex.jobname == "a" then
>      context("yes")
>    else
>      context("no")
>    end
>    \stopluacode
>    \stoptext
> 
> I get "no" as in TeX and "yes" with Lua, being "a.tex" the source file.
> 
> The TeX conditional used to work before.
> 
> Am I missing something or have I hit a bug?
> 
> I’m on Linux64 (if this may be relevant).
More relevan tis that you'r on TeX where catcodes matter
(here letter vs other)

   \doifelse{\inputfilebarename}{oeps}
     {yes}{no}

   \doifelse{\detokenize\expandafter{\jobname}}{\detokenize{oeps}}
     {yes}{no}


Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------



More information about the ntg-context mailing list