On 10/9/2024 5:29 PM, Thomas Meyer wrote:
Hello Hans and Otared,

thank you for your answers.
Context can run Lua. The output then ends up somewhere in the console output between the other specifications. LuaLaTeX can execute Lua. The output is then the only one in the console. Console output was not what I wanted. However, I was naive enough to hope that the output would be in TeXShop, but that only works with pdf I think.
So I am still a little helpless.

Well, context

context foo.lua

is asking for tex run, not a lua run; what do you expect from

foo.lua :

context.starttext()
context("Hi there")
context.stoptext()

other than a tex document showing that text. How is luatex to know if you want to typeset or just run tex? So don't take latex as reference. You don't want to start the whole tex machinery to run a lua file, running in luaonly mode is what one needs then.

When you have foo.lua :

print("Hi there")

and want it in the console you run:

mtxun --script

and here i get this in the console when i hit the "compile" key

>mtxrun --script "oeps.lua"
Hi There

So you need to figure out in texshop how to relate a run command "mtxrun --script" to a file with suffix ".lua".

This approach hasn't changes in the about 20 years that we have luatex. You can ask Dick to add an option like that (specify runner for a lua file) it it's not already there.

Hans

ps. Of course we can add support for a first line parsing when context sees a .lua file

-- mtxrun --script %filename%

or just

-- runner=mtxrun

for editors that lack support for suffix specific runners, but let's first see what texshop can do already.

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
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to