Re: [NTG-context] making horizontal space in luacode.
Dear Aditya, Hans Both solutions work well. It is really efficient to write matrix in ConTeXt + lua. I am enjoying the benefit of lua in ConTeXt. Thank you. Best regards, Dalyoung
\definehspace[skip][3em] \starttext \startluacode context("Some text") context.hspace{"skip"} context("More text") \stopluacode \stoptext
Aditya
------------------------------
Message: 5 Date: Mon, 22 Oct 2012 09:40:01 +0200 From: Hans Hagen
To: mailing list for ConTeXt users Subject: Re: [NTG-context] making horizontal space in luacode. Message-ID: <5084F851.7050203@wxs.nl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed On 22-10-2012 07:15, Aditya Mahajan wrote:
On Mon, 22 Oct 2012, Jeong Dal wrote:
Dear all,
1. I'd like to make a horizontal space using \hspace[3em] inside luacode.
But context.hspace({3em}), context.hspace({"3em"}), context.hspace("3em") don't work. And print(" ") doesn't work either.
How to make some horizontal space in luacode?
\hspace does not accept dimensions. The syntax for hspace is
\definehspace[whatever][3em]
\hspace[whatever].
So, you need:
\definehspace[skip][3em] \starttext \startluacode context("Some text") context.hspace{"skip"} context("More text") \stopluacode \stoptext
Indeed this is the best way. At some point I'll wrap primitives (maybe in another namespace). If you really want to use context.hskip, you can say context.hskip(false,"10pt plus 5pt") etc as a first false argument will signal a drop of {}.
Hans
participants (1)
-
Jeong Dal