[NTG-context] printing tab in lua: print('a\tb') fails

luigi scarso luigi.scarso at gmail.com
Thu Nov 27 14:00:48 CET 2008


On Thu, Nov 27, 2008 at 1:03 PM, Hans Hagen <pragma at wxs.nl> wrote:

> luigi scarso wrote:
> >
> >     Correction:
> >
> >     -- works as comments in luacode
> >     % is used to format strings
> >
> >
> >
> > It's a bit different: code below is ok, and TeX comment is seen "before"
> > lua comment .
> > Only Hello! is print on pdf
> >
> > %%%%%%%%%%%%%%%%%%
> >  \def\Foo{%
> > \startluacode
> > -- this is a lua comment
> > %%  this is a TeX comment
> > \stopluacode
> > }
>
> sure, since you use a \def which then stores catcodes as they are in tex
> mode
>
> \startluacode
>        function document.luigishouldknowbetter(whatever)
>                for i=1,100 do
>                        print(whatever) -- this is a lua comment
>                end
>        end
> \stopluacode
>
> \def\Foo
>   {\ctxlua{document.luigishouldknowbetter("Hello world!")}}
>
>
Exactly.
In my opinion, this is better than my example, because I don't like to mix
things  (and also for namespace document).


-- 
luigi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.ntg.nl/pipermail/ntg-context/attachments/20081127/4f937325/attachment.html 


More information about the ntg-context mailing list