ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Passing TeX parameters to the lua functions
@ 2011-12-05 20:22 Jaroslav Hajtmar
  2011-12-05 20:33 ` Wolfgang Schuster
  0 siblings, 1 reply; 5+ messages in thread
From: Jaroslav Hajtmar @ 2011-12-05 20:22 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hello ConTeXist.
Sorry for the beginner question, more for Lua(TeX) experts.
Can somehow be achieved that the parameter of TeX macro get to 
luafunction unchanged?
In the debug.txt file is the result obtained.

Thanx Jaroslav

\startluacode
debug=io.open("debug.txt","w+")

function testfun(param)
     debug:write(param)
     -- tex.print(param)
end

\stopluacode


\def\testmac#1{\directlua{testfun('#1')}}

\starttext

$\frac{x_\alpha+y_\beta}{z_\gamma}$

\testmac{\frac{x_\alpha+y_\beta}{z_\gamma}}

\stoptext


___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

end of thread, other threads:[~2011-12-05 21:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-05 20:22 Passing TeX parameters to the lua functions Jaroslav Hajtmar
2011-12-05 20:33 ` Wolfgang Schuster
2011-12-05 21:06   ` Jaroslav Hajtmar
2011-12-05 21:08     ` Wolfgang Schuster
2011-12-05 21:19       ` Jaroslav Hajtmar

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).