[NTG-context] Creating TeX dimensions and counters registers directly in Lua

2012-08-22 Thread Jaroslav Hajtmar
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)}

Re: [NTG-context] Creating TeX dimensions and counters registers directly in Lua

2012-08-22 Thread Wolfgang Schuster
Am 22.08.2012 um 09:19 schrieb Jaroslav Hajtmar hajt...@gyza.cz: 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

Re: [NTG-context] Struggling with ConTeXt

2012-08-22 Thread Olivier Binda
Thank you for the tips. Here, I cleaned up the code some more (sorry to have left stuff over last time),. I added some explanations to make my issue clearer \startusableMPgraphic{myFrame} draw OverlayBox withpen pencircle scaled 1pt withcolor green; draw (currentpicture enlarged 2cm)

Re: [NTG-context] Struggling with ConTeXt

2012-08-22 Thread Aditya Mahajan
On Wed, 22 Aug 2012, Olivier Binda wrote: Thank you for the tips. Here, I cleaned up the code some more (sorry to have left stuff over last time),. I added some explanations to make my issue clearer \startusableMPgraphic{myFrame} draw OverlayBox withpen pencircle scaled 1pt withcolor

Re: [NTG-context] Creating TeX dimensions and counters registers directly in Lua

2012-08-22 Thread Jaroslav Hajtmar
Thanks Wolfgang for the reply, but I must have misunderstood. My point is, that TeX registers was subsequently visible and usable in TeX (eg for width or height of boxes, etc.) Eg. for example, \the\mydimension can see that this does not occur! In addition, I solve the problem at LuaTEX, so

Re: [NTG-context] Struggling with ConTeXt

2012-08-22 Thread Olivier Binda
On 22/08/2012 10:42, Aditya Mahajan wrote: On Wed, 22 Aug 2012, Olivier Binda wrote: Thank you for the tips. Here, I cleaned up the code some more (sorry to have left stuff over last time),. I added some explanations to make my issue clearer \startusableMPgraphic{myFrame} draw

Re: [NTG-context] Creating TeX dimensions and counters registers directly in Lua

2012-08-22 Thread Hans Hagen
On 22-8-2012 11:09, Jaroslav Hajtmar wrote: Thanks Wolfgang for the reply, but I must have misunderstood. My point is, that TeX registers was subsequently visible and usable in TeX (eg for width or height of boxes, etc.) Eg. for example, \the\mydimension can see that this does not occur! In

Re: [NTG-context] Creating TeX dimensions and counters registers directly in Lua

2012-08-22 Thread Peter Münster
On Wed, Aug 22 2012, Jaroslav Hajtmar wrote: \ctxlua{myluadimension = number.topoints(1)} \ctxlua{context(myluadimension)} \def\myluadimension{\ctxlua{context(myluadimension)}} ... \hbox to\myluadimension{X} -- Peter

[NTG-context] Ctx ... Lua

2012-08-22 Thread Procházka Lukáš
Hello, sometimes in this mail discussion I'm encountering a Ctx/Lua command which has been unknown for me or I would use other (known) commands to do the job. So - would it be possible to explain - what's the difference/advantage btw \directlua and \ctxlua - what \ctxcommand{} does - what

Re: [NTG-context] Creating TeX dimensions and counters registers directly in Lua

2012-08-22 Thread Jaroslav Hajtmar
Thank to Hans and Peter too. It works in context fine now. I would like realize this same in pure LuaTeX. I was primarily in the query for it to find Lua equivalent of TeX primitives \newdimen and \newcount (for direct creating new TeX registers) I could use something like

Re: [NTG-context] Ctx ... Lua

2012-08-22 Thread Wolfgang Schuster
Am 22.08.2012 um 13:15 schrieb Procházka Lukáš l...@pontex.cz: Hello, sometimes in this mail discussion I'm encountering a Ctx/Lua command which has been unknown for me or I would use other (known) commands to do the job. So - would it be possible to explain - what's the

[NTG-context] Lua: document v. userdata

2012-08-22 Thread Rogers, Michael K
In a recent thread, Hans used the document namespace, where I (naively) expected userdata: On Aug 22, 2012, at 6:32 AM, Hans Hagen wrote: \ctxlua{document.myluadimension = 200pt} Is there a reason not to use userdata.myluadimension? Or is document.myluadimension safe, because myluadimension

Re: [NTG-context] Lua: document v. userdata

2012-08-22 Thread Hans Hagen
On 22-8-2012 14:55, Rogers, Michael K wrote: In a recent thread, Hans used the document namespace, where I (naively) expected userdata: On Aug 22, 2012, at 6:32 AM, Hans Hagen wrote: \ctxlua{document.myluadimension = 200pt} Is there a reason not to use userdata.myluadimension? Or is

Re: [NTG-context] Ctx ... Lua

2012-08-22 Thread Hans Hagen
On 22-8-2012 13:26, Wolfgang Schuster wrote: Am 22.08.2012 um 13:15 schrieb Procházka Lukáš l...@pontex.cz: Hello, sometimes in this mail discussion I'm encountering a Ctx/Lua command which has been unknown for me or I would use other (known) commands to do the job. So - would it be

Re: [NTG-context] Creating TeX dimensions and counters registers directly in Lua

2012-08-22 Thread Jaroslav Hajtmar
Great!!! Thanx very much Hans... Normally I do all things in ConTeXt, but I am preparing a beginning tutorial for users of LaTeX and PlainTeX, who would be interested in getting to know the basics LuaTEX. Therefore I am seeking a solution applicable in LuaLaTeX and LuaPlain too. Jaroslav

[NTG-context] built-in units command (mkiv) fails

2012-08-22 Thread Andreas Mang
Hi there, Did / Do I miss something or is there a problem with the built-in \unit command? minimal example: start example \starttext 10 \unit{km/h} \stoptext stop example output: 10 kilometersolidushour ConTeXt: ver: 2012.08.16 22:20 MKIV fmt: 2012.8.22 Similar results

[NTG-context] Code in contextref-env.tex

2012-08-22 Thread john Culleton
In the file contextref-env.tex I find code like the following: \setupsectionblock[\v!frontpart] [\c!page=\v!yes] \setupsectionblock[\v!bodypart] [\c!page=\v!yes] \setupsectionblock[\v!appendix] [\c!page=\v!yes] \setupsectionblock[\v!frontpart] [\c!before=,\c!after=] I have no idea what the

Re: [NTG-context] Code in contextref-env.tex

2012-08-22 Thread Aditya Mahajan
On Wed, 22 Aug 2012, john Culleton wrote: In the file contextref-env.tex I find code like the following: \setupsectionblock[\v!frontpart] [\c!page=\v!yes] \setupsectionblock[\v!bodypart] [\c!page=\v!yes] \setupsectionblock[\v!appendix] [\c!page=\v!yes] \setupsectionblock[\v!frontpart]

Re: [NTG-context] Code in contextref-env.tex

2012-08-22 Thread Sietse Brouwer
I have no idea what the sequences like \v!and \c! etc. mean. Are they references to modes? I asked much the same question on tex.stackexchange.com two months ago, except mine was not so nice and focused. Aditya gave a very nice explanation of what the letters do; clearer than the one on the

[NTG-context] mp

2012-08-22 Thread Hans Hagen
Hi, In the next version you can run mp files: % test.mp beginfig(1) ; fill fullcircle scaled 10cm withcolor 0.5red ; fill fullcircle scaled 4cm withcolor 0.5white ; endfig ; beginfig(2) ; fill fullcircle scaled 10cm withcolor 0.5green ; fill fullcircle scaled 5cm

Re: [NTG-context] Code in contextref-env.tex

2012-08-22 Thread Hans Hagen
On 22-8-2012 23:02, Sietse Brouwer wrote: I have no idea what the sequences like \v!and \c! etc. mean. Are they references to modes? I asked much the same question on tex.stackexchange.com two months ago, except mine was not so nice and focused. Aditya gave a very nice explanation of what the

Re: [NTG-context] mp

2012-08-22 Thread Aditya Mahajan
On Wed, 22 Aug 2012, Hans Hagen wrote: Hi, In the next version you can run mp files: context test.mp Nice. How is font setup handled? Using verbatimtex ... etex? Or using the styling directives as you explain below. Would something like context --environment=font-setup test.mp work?