ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] LMTX: Command handling, Interface between TeX and Lua
@ 2023-12-13 17:13 Gerion Entrup
  2023-12-13 20:57 ` [NTG-context] " Bruce Horrocks
  0 siblings, 1 reply; 3+ messages in thread
From: Gerion Entrup @ 2023-12-13 17:13 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 1201 bytes --]

Hi,

I'd like to understand more of the inner workings of LMTX.
When I understand it right, most of the code is now processed in Lua but
I was not able to find it.

For example, I tried to find out how setupitemgroup is handled (just as
an example of a more complex command). The wiki has a (kind of)
autogenerated description:
https://wiki.contextgarden.net/Command/setupitemgroup
I found the data for this (at least this is my guess) here:
tex/texmf-context/tex/context/interface/mkiv/i-itemgroup.xml

Are these xml files created by hand or somehow generated? Now, when I
use `\setupitemgroup[itemize:1][symbol=3,itemalign=middle]`: How are the
arguments handled and is this a generic process or specific to each
command?

Is there a simple way to define a new command/environment and handle
the keyword arguments in Lua? For example defining a frontend command
like this:

\startsomething[firstword={Some},secondword={Text}]
	Body
\stopsomething


which I can handle in some lua code like this:

function something(firstword, secondword, body)
	tex.print(firstword)
	tex.print(secondword)
	tex.print(body)
end

Are there any resources beside the context code itself where I can learn
that?

Gerion

[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

[-- Attachment #2: Type: text/plain, Size: 511 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-12-14 13:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-13 17:13 [NTG-context] LMTX: Command handling, Interface between TeX and Lua Gerion Entrup
2023-12-13 20:57 ` [NTG-context] " Bruce Horrocks
2023-12-14 13:10   ` Gerion Entrup

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).