ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* OT: Problem with writing macros into variables in LuaTeX
@ 2012-03-18 10:25 Jaroslav Hajtmar
  2012-03-18 10:38 ` Hans Hagen
  2012-03-18 10:53 ` Wolfgang Schuster
  0 siblings, 2 replies; 7+ messages in thread
From: Jaroslav Hajtmar @ 2012-03-18 10:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hello Gurus.
Sorry for OT, but I solve one problem in parallel in ConTeXt and pure 
LuaTeX too and I got into trouble.
I have a problem in  LuaTEX with putting macro name into global 
variables and their re-listing. In ConTeXt, the problem is not with it.

Here is my minimal LuaTeX example:

\directlua{function put2globvar(parameter) globvar=parameter end}
\directlua{function getglobvar() tex.print(globvar) end}

\def\puttoglobvar#1{\directlua{put2globvar('#1')}}
\def\globvar{\directlua{getglobvar()}}

% OK
Text --
\puttoglobvar{Text}
\globvar

% OK
$\alpha$ --
\puttoglobvar{$alpha$}
\globvar

% not working
$\alpha$ --
\puttoglobvar{$\alpha$}
\globvar

% Error ...
%\puttoglobvar{$\\alpha$}
%\globvar


\bye

Can you please advise?

Thanx Jaroslav Hajtmar

___________________________________________________________________________________
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] 7+ messages in thread

end of thread, other threads:[~2012-03-18 13:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-18 10:25 OT: Problem with writing macros into variables in LuaTeX Jaroslav Hajtmar
2012-03-18 10:38 ` Hans Hagen
2012-03-18 10:53 ` Wolfgang Schuster
     [not found]   ` <4F65C7F4.1090604@gyza.cz>
2012-03-18 12:40     ` Jaroslav Hajtmar
2012-03-18 13:14       ` luigi scarso
2012-03-18 13:17         ` Jaroslav Hajtmar
     [not found]     ` <06EE6FAB-E51B-4996-9655-450CF0B05839@googlemail.com>
     [not found]       ` <4F65D98F.8020504@gyza.cz>
     [not found]         ` <821C6165-2D05-4848-A66C-B00B1862F422@googlemail.com>
2012-03-18 13:15           ` 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).