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

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
    tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________

Reply via email to