ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: luigi scarso <luigi.scarso@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Weird print("\n...") error
Date: Sat, 3 Nov 2012 16:08:40 +0100	[thread overview]
Message-ID: <CAG5iGsDp38maobqdHqBHO9VwB5OPnj6ifW-X74YxR6SGj9ZW5g@mail.gmail.com> (raw)
In-Reply-To: <op.wm5zugk5dk1lar@lk-2008-nbk>


[-- Attachment #1.1: Type: text/plain, Size: 1569 bytes --]

On Fri, Nov 2, 2012 at 10:12 PM, Procházka Lukáš <LPr@pontex.cz> 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/Env3/
> **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


-- 
luigi

[-- Attachment #1.2: Type: text/html, Size: 2232 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

      parent reply	other threads:[~2012-11-03 15:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-02 21:12 Procházka Lukáš
2012-11-03  7:47 ` Peter Münster
2012-11-03 21:01   ` Procházka Lukáš
2012-11-03 15:08 ` luigi scarso [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAG5iGsDp38maobqdHqBHO9VwB5OPnj6ifW-X74YxR6SGj9ZW5g@mail.gmail.com \
    --to=luigi.scarso@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).