On 11/1/21 5:13 PM, Hans Hagen via ntg-context wrote:
On 11/1/2021 2:26 PM, Pablo Rodriguez via ntg-context wrote:
[...] Is there a way to wrap os.exec() in the sample so that it only runs if "dir" is available?
I know that os.name would be an option here, but not in my real world document.
\starttext \startluacode if lfs.isfile(tex.jobname .. ".pdf") then context("YES") end if lfs.isfile(file.addsuffix(environment.outputfilename,"pdf")) then context("YES") end if #dir.glob(file.addsuffix(environment.outputfilename,"pdf")) > 0 then context("YES") end \stopluacode \stoptext
Many thanks for your reply, Hans. I can see that I explained my question poorly, but your code fits me in other case. Many thanks for your help, Pablo -- http://www.ousia.tk