ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Weird print("\n...") error
@ 2012-11-02 21:12 Procházka Lukáš
  2012-11-03  7:47 ` Peter Münster
  2012-11-03 15:08 ` luigi scarso
  0 siblings, 2 replies; 4+ messages in thread
From: Procházka Lukáš @ 2012-11-02 21:12 UTC (permalink / raw)
  To: ConTeXt

[-- Attachment #1: Type: text/plain, Size: 1112 bytes --]

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?

TIA.

Best regards,

Lukas

[-- Attachment #2: Test.mkiv --]
[-- Type: application/octet-stream, Size: 83 bytes --]

\starttext
  \startluacode
    print("\nT")
  \stopluacode

  Abc
\stoptext

[-- Attachment #3: 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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Weird print("\n...") error
  2012-11-02 21:12 Weird print("\n...") error 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
  1 sibling, 1 reply; 4+ messages in thread
From: Peter Münster @ 2012-11-03  7:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Fri, Nov 02 2012, Procházka Lukáš wrote:

>     print("\nT")

      print("\n" .. "T")


> Any explanation?

\nT is an unknown command.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Weird print("\n...") error
  2012-11-02 21:12 Weird print("\n...") error Procházka Lukáš
  2012-11-03  7:47 ` Peter Münster
@ 2012-11-03 15:08 ` luigi scarso
  1 sibling, 0 replies; 4+ messages in thread
From: luigi scarso @ 2012-11-03 15:08 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Weird print("\n...") error
  2012-11-03  7:47 ` Peter Münster
@ 2012-11-03 21:01   ` Procházka Lukáš
  0 siblings, 0 replies; 4+ messages in thread
From: Procházka Lukáš @ 2012-11-03 21:01 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sat, 03 Nov 2012 08:47:33 +0100, Peter Münster <pmlists@free.fr> wrote:

> On Fri, Nov 02 2012, Procházka Lukáš wrote:
>
>>     print("\nT")
>
>       print("\n" .. "T")
>
>
>> Any explanation?
>
> \nT is an unknown command.
>

Thanks for your advice, I learned some more also at http://wiki.contextgarden.net/Programming_in_LuaTeX.

Best regards,

Lukas


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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-11-03 21:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-02 21:12 Weird print("\n...") error 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 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).