ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <schuster.wolfgang@googlemail.com>
To: hajtmar@gyza.cz, mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: OT: Problem with writing macros into variables in LuaTeX
Date: Sun, 18 Mar 2012 11:53:54 +0100	[thread overview]
Message-ID: <55678723-48C9-4CAE-B726-8DA75E52A625@googlemail.com> (raw)
In-Reply-To: <4F65B813.7080902@gyza.cz>


Am 18.03.2012 um 11:25 schrieb Jaroslav Hajtmar:

> 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')}}

Untested:

\def\puttglobvar#1{\directlua{put2globvar([==[\detokenize{#1}]==])}

You can also try to replace \detokenize with \unexpanded (in ConTeXt \normalunexpanded).

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


  parent reply	other threads:[~2012-03-18 10:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-18 10:25 Jaroslav Hajtmar
2012-03-18 10:38 ` Hans Hagen
2012-03-18 10:53 ` Wolfgang Schuster [this message]
     [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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55678723-48C9-4CAE-B726-8DA75E52A625@googlemail.com \
    --to=schuster.wolfgang@googlemail.com \
    --cc=hajtmar@gyza.cz \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).