From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/79027 Path: news.gmane.org!not-for-mail From: luigi scarso Newsgroups: gmane.comp.tex.context Subject: Re: Weird print("\n...") error Date: Sat, 3 Nov 2012 16:08:40 +0100 Message-ID: References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0287463153==" X-Trace: ger.gmane.org 1351955332 31158 80.91.229.3 (3 Nov 2012 15:08:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 3 Nov 2012 15:08:52 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Nov 03 16:09:01 2012 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TUfLE-0004K1-N8 for gctc-ntg-context-518@m.gmane.org; Sat, 03 Nov 2012 16:08:56 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 924DD101F6; Sat, 3 Nov 2012 16:08:47 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id qnPaZF+ZPx7r; Sat, 3 Nov 2012 16:08:45 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 81E09101E7; Sat, 3 Nov 2012 16:08:45 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id C38A5101E7 for ; Sat, 3 Nov 2012 16:08:43 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id fnd8QoGXHlxE for ; Sat, 3 Nov 2012 16:08:42 +0100 (CET) Original-Received: from filter2-til.mf.surf.net (filter2-til.mf.surf.net [194.171.167.218]) by balder.ntg.nl (Postfix) with ESMTP id 6D25F101E3 for ; Sat, 3 Nov 2012 16:08:42 +0100 (CET) Original-Received: from mail-ea0-f169.google.com (mail-ea0-f169.google.com [209.85.215.169]) by filter2-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id qA3F8e2O017374 for ; Sat, 3 Nov 2012 16:08:41 +0100 Original-Received: by mail-ea0-f169.google.com with SMTP id k11so2146038eaa.14 for ; Sat, 03 Nov 2012 08:08:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=skeMJTKaKGAhZdaroNOS+vXG+SFWTWdlaRpLLvNkzD0=; b=vqe8/DvG133N/tI7q5p94KxlB/uEFPam3chkUtnPtYODmgS3wtiOKRkrME9KdaG0Ts mdciBnzxJAJEFT1o9drUeikrtA/DEJjE7F/l8CcDNTgqljYzL7eQTvEciBcB80mdiOwi FCyQR8OI/IJ3zp6f7CwxYdusPTt+PTZLpnXZlid7D9CoUGMypnbDltX7E+R3j1/sq1b6 bp2HtNsRKt6A04AsZggBZPUWk61vDZFYJg/thTUz+z2ebAQP5FqlB72m/VnZXRNpEZSe C7GVitt6Ujbjwwr6reB4ahBNT/zgfUBUwv/XilpggiwGEMhhvePiUoWxGECEDA6LXGIf Tz9w== Original-Received: by 10.14.214.133 with SMTP id c5mr17943260eep.8.1351955320813; Sat, 03 Nov 2012 08:08:40 -0700 (PDT) Original-Received: by 10.223.192.193 with HTTP; Sat, 3 Nov 2012 08:08:40 -0700 (PDT) In-Reply-To: X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.215.169; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0TIj38Ftu - b4272d6055c2 - 20121103 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.218 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:79027 Archived-At: --===============0287463153== Content-Type: multipart/alternative; boundary=047d7b603b98a637d304cd98a0dc --047d7b603b98a637d304cd98a0dc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Fri, Nov 2, 2012 at 10:12 PM, Proch=C3=A1zka Luk=C3=A1=C5=A1 wrote: > Hello, > > I encountered a weird error. > > The following code prints correctly to the console: > > ---- > \starttext > \startluacode > print("\n@T") > \stopluacode > > Abc > \stoptext > ---- > > Gives correct: > > " > ... > fonts > virtual math > unable to resolve name mapsfromchar > fonts > fallback modern rm 12pt is loaded > > @T > backend > xmp > using file 'c:/ConTeXt/tex/texmf-context/** > tex/context/base/lpdf-pdx.xml' > ... > " > > But the following code fails (?!): > > ---- > \starttext > \startluacode > print("\nT") > \stopluacode > > Abc > \stoptext > ---- > > With: > > " > ... > fonts > fallback modern rm 12pt is loaded > ! Undefined control sequence. > > system > tex > error on line 4 in file D:/Lukas/ConTeXt/Test/Env= 3/ > **Test.mkiv: Undefined control sequence ... > > 1 \starttext > 2 \startluacode > 3 print("\nT") > 4 >> \stopluacode > 5 > 6 Abc > 7 \stoptext > 8 > > print("\nT > ") > \luat_start_lua_code_indeed ...tlua \zerocount {#1 > }} > l.4 \stopluacode > ... > " > > Any explanation? > It's about catcode. You can the difference with \loggingall \startluacode context("\n@T") \stopluacode \stoptext and \loggingall \startluacode context("\nT") \stopluacode \stoptext --=20 luigi --047d7b603b98a637d304cd98a0dc Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On Fri, Nov 2, 2012 at 10:12 PM, Proch= =C3=A1zka Luk=C3=A1=C5=A1 <LPr@pontex.cz> wrote:
Hello,

I encountered a weird error.

The following code prints correctly to the console:

----
\starttext
=C2=A0 \startluacode
=C2=A0 =C2=A0 print("\n@T")
=C2=A0 \stopluacode

=C2=A0 Abc
\stoptext
----

Gives correct:

"
...
fonts =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 > virtual math > unable to r= esolve name mapsfromchar
fonts =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 > fallback modern rm 12pt is lo= aded

@T
backend =C2=A0 =C2=A0 =C2=A0 =C2=A0 > xmp > using file 'c:/ConTeX= t/tex/texmf-context/tex/context/base/lpdf-pdx.xml'
...
"

But the following code fails (?!):

----
\starttext
=C2=A0 \startluacode
=C2=A0 =C2=A0 print("\nT")
=C2=A0 \stopluacode

=C2=A0 Abc
\stoptext
----

With:

"
...
fonts =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 > fallback modern rm 12pt is lo= aded
! Undefined control sequence.

system =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0> tex > error on line 4 in f= ile D:/Lukas/ConTeXt/Test/Env3/Test.mkiv: Undefined control sequence= ...

1 =C2=A0 =C2=A0 \starttext
2 =C2=A0 =C2=A0 =C2=A0 \startluacode
3 =C2=A0 =C2=A0 =C2=A0 =C2=A0 print("\nT")
4 >> =C2=A0 =C2=A0\stopluacode
5
6 =C2=A0 =C2=A0 =C2=A0 Abc
7 =C2=A0 =C2=A0 \stoptext
8

=C2=A0 =C2=A0 print("\nT
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0")
\luat_start_lua_code_indeed ...tlua \zerocount {#1
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 }}
l.4 =C2=A0 \stopluacode
...
"

Any explanation?
It's about catcode= . You can the difference with
\loggingall
\startluacode
=C2=A0con= text("\n@T")=C2=A0
=C2=A0 \stopluacode
\stoptext

an= d
\loggingall
\startluacode
=C2=A0context("\nT")=C2=A0
=C2=A0 \stopluaco= de
\stoptext


--
luigi

--047d7b603b98a637d304cd98a0dc-- --===============0287463153== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --===============0287463153==--