ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Creating TeX dimensions and counters registers directly in Lua
@ 2012-08-22  7:19 Jaroslav Hajtmar
  2012-08-22  7:43 ` Wolfgang Schuster
  0 siblings, 1 reply; 8+ messages in thread
From: Jaroslav Hajtmar @ 2012-08-22  7:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hello all,
Is it possible to create a new dimension ConTeXt register directly in 
Lua, or I have to first create the ConTeXt dimensional register and then 
to subsequently assign it a value?

Here is example:

\starttext
     \newdimen\mydimension
     \directlua{tex.setdimen("mydimension", 123)}
\stoptext

works fine, but all like:

\starttext
     \directlua{tex.print([[\newdimen\myotherdimension]])}
     \directlua{tex.setdimen("myotherdimension", 123)}
     \directlua{tex.newdimen("myotherdimension")}

     etc...

\stoptext

fails.

In addition, I am interested in whether directly in Lua to create a new 
counter as in the previous.

\starttext
\newcount\mycount
\directlua{
tex.setcount("mycount",125)
}

again works, but anything like:

\starttext
     \directlua{tex.print([[\newcount\myothercount]])}
     \directlua{tex.newcount("myothercount")}
     etc...

\stoptext

again fails...

Is there any source or examples to study anything about it?

Thanx Jaroslav

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

end of thread, other threads:[~2012-08-22 19:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-22  7:19 Creating TeX dimensions and counters registers directly in Lua Jaroslav Hajtmar
2012-08-22  7:43 ` Wolfgang Schuster
2012-08-22  9:09   ` Jaroslav Hajtmar
2012-08-22 10:32     ` Hans Hagen
2012-08-22 11:24       ` Jaroslav Hajtmar
2012-08-22 12:12         ` Hans Hagen
2012-08-22 19:47           ` Jaroslav Hajtmar
2012-08-22 10:34     ` Peter Münster

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