Re: [NTG-context] How to Determine the Current File Name and Line Number AND PAGE NUMBER in the ConTeXt Source?

2009-07-03 Thread Taco Hoekwater

Mojca Miklavec wrote:



Line Number

I don't know of any way, but TeX sometimes complains on errors and
outputs the line number along. 


There is \inputlineno in TeX, so  \the\inputlineno or the lua
equivalent \ctxlua{tex.inputlineno} will work.

Best wishes,
Taco
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] How to Determine the Current File Name and Line Number AND PAGE NUMBER in the ConTeXt Source?

2009-07-03 Thread luigi scarso
On Fri, Jul 3, 2009 at 8:56 AM, Taco Hoekwater t...@elvenkind.com wrote:

 Mojca Miklavec wrote:


  Line Number

 I don't know of any way, but TeX sometimes complains on errors and
 outputs the line number along.


 There is \inputlineno in TeX, so  \the\inputlineno or the lua
 equivalent \ctxlua{tex.inputlineno} will work.

The problem is exactly locate the error in source .
Sometimes the errorline  of the log are in someway imprecise , ie. the
errors is (are)
around here  .

-- 
luigi
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] How to Determine the Current File Name and Line Number AND PAGE NUMBER in the ConTeXt Source?

2009-07-03 Thread Taco Hoekwater


luigi scarso wrote:
 
 
 On Fri, Jul 3, 2009 at 8:56 AM, Taco Hoekwater t...@elvenkind.com
 mailto:t...@elvenkind.com wrote:
 
 Mojca Miklavec wrote:
 
 
 Line Number
 
 I don't know of any way, but TeX sometimes complains on errors and
 outputs the line number along.
 
 
 There is \inputlineno in TeX, so  \the\inputlineno or the lua
 equivalent \ctxlua{tex.inputlineno} will work.
 
 The problem is exactly locate the error in source .
 Sometimes the errorline  of the log are in someway imprecise , ie. the
 errors is (are)
 around here  .

Yeah, that can't be helped (unless you don't do multi-line paragraphs
nor macros)

Best wishes,
Taco
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] How to Determine the Current File Name and Line Number AND PAGE NUMBER in the ConTeXt Source?

2009-07-03 Thread luigi scarso
On Fri, Jul 3, 2009 at 9:14 AM, Taco Hoekwater t...@elvenkind.com wrote:



 luigi scarso wrote:
 
 
  On Fri, Jul 3, 2009 at 8:56 AM, Taco Hoekwater t...@elvenkind.com
  mailto:t...@elvenkind.com wrote:
 
  Mojca Miklavec wrote:
 
 
  Line Number
 
  I don't know of any way, but TeX sometimes complains on errors
 and
  outputs the line number along.
 
 
  There is \inputlineno in TeX, so  \the\inputlineno or the lua
  equivalent \ctxlua{tex.inputlineno} will work.
 
  The problem is exactly locate the error in source .
  Sometimes the errorline  of the log are in someway imprecise , ie. the
  errors is (are)
  around here  .

 Yeah, that can't be helped (unless you don't do multi-line paragraphs
 nor macros)

we need something like a stack trace;
also a lua try/except construct should be nice .
-- 
luigi
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] How to Determine the Current File Name and Line Number AND PAGE NUMBER in the ConTeXt Source?

2009-07-03 Thread Taco Hoekwater


luigi scarso wrote:
 
 we need something like a stack trace;
 also a lua try/except construct should be nice .

stack trace of tex?
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] How to Determine the Current File Name and Line Number AND PAGE NUMBER in the ConTeXt Source?

2009-07-03 Thread luigi scarso
On Fri, Jul 3, 2009 at 9:33 AM, Taco Hoekwater t...@elvenkind.com wrote:



 luigi scarso wrote:
 
  we need something like a stack trace;
  also a lua try/except construct should be nice .

 stack trace of tex?

No no, sorry -- I mean traceback, something like  this
Traceback (innermost last):
  Module ZPublisher.Publish, line 119, in publish
  Module ZPublisher.mapply, line 88, in mapply
  Module ZPublisher.Publish, line 42, in call_object
  Module OFS.ObjectManager, line 569, in manage_exportObject
  Module OFS.XMLExportImport, line 56, in exportXML
  Module OFS.XMLExportImport, line 31, in XMLrecord
  Module Shared.DC.xml.ppml, line 263, in load
  Module pickle, line 872, in load
  Module Shared.DC.xml.ppml, line 418, in load_binput
AttributeError: 'unicode' object has no attribute 'id'


-- 
luigi
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] How to Determine the Current File Name and Line Number AND PAGE NUMBER in the ConTeXt Source?

2009-07-03 Thread Taco Hoekwater


luigi scarso wrote:
 
 No no, sorry -- I mean traceback, something like  this
 Traceback (innermost last):

Yeah, I though so. Repeat question: for TeX (macros)?


___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] How to Determine the Current File Name and Line Number AND PAGE NUMBER in the ConTeXt Source?

2009-07-03 Thread luigi scarso
On Fri, Jul 3, 2009 at 9:47 AM, Taco Hoekwater t...@elvenkind.com wrote:



 luigi scarso wrote:
 
  No no, sorry -- I mean traceback, something like  this
  Traceback (innermost last):

 Yeah, I though so.

ok

 Repeat question: for TeX (macros)?

Is it impossible ?

-- 
luigi
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] How to Determine the Current File Name and Line Number AND PAGE NUMBER in the ConTeXt Source?

2009-07-03 Thread Taco Hoekwater


luigi scarso wrote:
 
 Repeat question: for TeX (macros)?
 
 Is it impossible ?

Right now: yes. Later: doable.
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] How to Determine the Current File Name and Line Number AND PAGE NUMBER in the ConTeXt Source?

2009-07-03 Thread luigi scarso
On Fri, Jul 3, 2009 at 10:06 AM, Taco Hoekwater t...@elvenkind.com wrote:



 luigi scarso wrote:
 
  Repeat question: for TeX (macros)?
 
  Is it impossible ?

 Right now: yes. Later: doable.

So doable .
Given that I like to lost in code, where should I start to look ?


-- 
luigi
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] How to Determine the Current File Name and Line Number AND PAGE NUMBER in the ConTeXt Source?

2009-07-03 Thread Taco Hoekwater


luigi scarso wrote:
 
 
 On Fri, Jul 3, 2009 at 10:06 AM, Taco Hoekwater t...@elvenkind.com
 mailto:t...@elvenkind.com wrote:
 
 
 
 luigi scarso wrote:
 
  Repeat question: for TeX (macros)?
 
  Is it impossible ?
 
 Right now: yes. Later: doable.
 
 So doable .
 Given that I like to lost in code, where should I start to look ?

Not now, you will need a bit of luatex interfacing that is not
programmed yet.


___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] How to Determine the Current File Name and Line Number AND PAGE NUMBER in the ConTeXt Source?

2009-07-03 Thread luigi scarso
On Fri, Jul 3, 2009 at 10:18 AM, Taco Hoekwater t...@elvenkind.com wrote:


 Not now, you will need a bit of luatex interfacing that is not
 programmed yet.


ok -- stop here . Eventually at eurotex .

-- 
luigi
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] How to Determine the Current File Name and Line Number AND PAGE NUMBER in the ConTeXt Source?

2009-07-02 Thread Mojca Miklavec
Hello,

Did you take a look at the thread
 How to Determine the Current File Name and Line Number in the
ConTeXt Source?
from yesterday?

On Wed, Jul 1, 2009 at 20:18, ivo welch wrote:

 Current File Name
There's \jobname, but if you read from other files this won't help you.

 Line Number
I don't know of any way, but TeX sometimes complains on errors and
outputs the line number along. I could imagine an ugly hack: to
trigger an artificial error, read the line number, ignore that number
and continue ... but I don't know if that's doable. Another ugly hack
would be talking to synctex. SyncTeX definitely knows the current
line number and file name, but I don't know if there's a way to fetch
those variables back to TeX. In any case it's probably something
that's equally difficult in ConTeXt than in plain TeX.

On the other hand, in LuaTeX there might exist elegant solutions.

 AND PAGE NUMBER in the ConTeXt Source?

What do you mean by page number in ConTeXt source?

 is there also a way to determine the current output page number on which
 typesetting is currently being made?

See Hans' response.

 (I know this is a difficult problem in
 LaTeX, and I presume the same is the case for ConTeXt, because it uses the
 same underlying TeX engine.)

... but LuaTeX simplifies matters a lot. In LuaTeX that should be doable.

Mojca
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] How to Determine the Current File Name and Line Number AND PAGE NUMBER in the ConTeXt Source?

2009-07-01 Thread ivo welch
is there also a way to determine the current output page number on which
typesetting is currently being made?  (I know this is a difficult problem in
LaTeX, and I presume the same is the case for ConTeXt, because it uses the
same underlying TeX engine.)

/iaw
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] How to Determine the Current File Name and Line Number AND PAGE NUMBER in the ConTeXt Source?

2009-07-01 Thread Hans Hagen

ivo welch wrote:

is there also a way to determine the current output page number on which
typesetting is currently being made?  (I know this is a difficult problem in
LaTeX, and I presume the same is the case for ConTeXt, because it uses the
same underlying TeX engine.)


\realpageno
\userpageno
\subpageno

of course it depends on the pagebreak so the other ways is to use the 
referencing mechanism


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___