On Thu, Dec 23, 2010 at 1:57 PM, Mojca Miklavec
<[email protected]> wrote:
> Dear list,
>
> I cannot figure out what I am doing wrong here. If I remove \hbox, it
> works fine, but I would like to draw a table.
>
> \starttext
> \startluacode
> function draw_table(unicode_start,n_columns)
>  for i=0,0xF do
>    tex.print('\\dontleavehmode\\definedfont[Serif at 20pt]\\kern0pt')
>    for j=0,n_columns do
>      --tex.print('\\hbox{ \\char %d }', unicode_start+i*16+j)
>      tex.print('\\hbox to 1.5em{\\hss %s \\hss}',
> unicode.utf8.char(unicode_start+i*16+j))
>    end
>    tex.print('\\crlf')
>  end
> end
>
> draw_table(0x00C0,4)
> \stopluacode
> \stoptext
>
> Any hints welcome.

I don't know but for the moment this works
\starttext
\startluacode
function draw_table(unicode_start,n_columns)
 for i=0,0xF do
   tex.print('\\dontleavehmode\\definedfont[Serif at 20pt]\\kern0pt')
   for j=0,n_columns do
     local d = string.format( "\\hbox to 1.5em{\\hss \%s
\\hss}",unicode.utf8.char(unicode_start+i*16+j))
     tex.print(d)
   end
   tex.print('\\crlf')
 end
end

draw_table(0x00C0,4)
\stopluacode
\stoptext


-- 
luigi
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : [email protected] / 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