ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Mojca Miklavec <mojca.miklavec.lists@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: How to Determine the Current File Name and Line Number AND PAGE NUMBER in the ConTeXt Source?
Date: Thu, 2 Jul 2009 23:52:09 +0200	[thread overview]
Message-ID: <6faad9f00907021452x6fc29d16r84188d058e6bcc0@mail.gmail.com> (raw)
In-Reply-To: <50d1c22d0907011118h2d75ed8cmc1ec557da4518b62@mail.gmail.com>

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
___________________________________________________________________________________

  parent reply	other threads:[~2009-07-02 21:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-01 18:18 ivo welch
2009-07-01 18:40 ` Hans Hagen
2009-07-02 21:52 ` Mojca Miklavec [this message]
2009-07-03  6:56   ` Taco Hoekwater
2009-07-03  7:05     ` luigi scarso
2009-07-03  7:14       ` Taco Hoekwater
2009-07-03  7:30         ` luigi scarso
2009-07-03  7:33           ` Taco Hoekwater
2009-07-03  7:44             ` luigi scarso
2009-07-03  7:47               ` Taco Hoekwater
2009-07-03  7:51                 ` luigi scarso
2009-07-03  8:06                   ` Taco Hoekwater
2009-07-03  8:13                     ` luigi scarso
2009-07-03  8:18                       ` Taco Hoekwater
2009-07-03  8:24                         ` luigi scarso

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=6faad9f00907021452x6fc29d16r84188d058e6bcc0@mail.gmail.com \
    --to=mojca.miklavec.lists@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).