Hi André,
Hans is right, it's a version problem.
You're using 2012.05.30 11:26 (from May)
I'm using 2012.09.25 21:44.
resolvers.inputstack is defined in my tex-data.lua.
I looked up your version among the commits on
http://repo.or.cz/w/context.git/shortlog,
and found that resolvers.inputstack is
Dear Sietse,
Thanks a lot!!!
Finally found it, after lots of trial-and-erroring through
likely-looking table names in file-job.lua: the stack of input files
is kept in resolvers.inputstack.
I don't program any lua. But I was taking a look at file-job.lua
myself. I have a lot to learn!! :-)
On 28-9-2012 14:34, Andre Caldas wrote:
Although, I think there should be a luatex command for this. That
is, something not related to ConTeXt.
lfs.currentdir()
-
Hans Hagen | PRAGMA ADE
Hi!
the following should work.
\cldcontext{
environment.runpath .. '/' ..
file.pathpart(resolvers.inputstack[#resolvers.inputstack])
}
Sorry, to ask such a dumb question...
- Do I need to include file-job.lua somehow?
André Caldas.
Hi André,
Sorry, to ask such a dumb question...
- Do I need to include file-job.lua somehow?
No need to include it, it's part of the ConTeXt core.
I only mentioned the filename in case people wanted to see what else
was in that file; the code snippet should Just Work. Is it working for
you?
- Do I need to include file-job.lua somehow?
No need to include it, it's part of the ConTeXt core.
[...]
Is it working for you?
No. I get:
! LuaTeX error main ctx instance:1: attempt to get length of field
'inputstack' (a nil value)
stack traceback:
main ctx instance:1: in main
Hi André,
My mistake: I tested the code I gave you in \startluacode, but then
for the e-mail I wrapped it in \cldcontext. This is not the same: in
\startluacode # has its literal value, but in \cldcontext it is
interpreted as part of a macro parameter like #1.
So to get the length of a table t
My mistake: I tested the code I gave you in \startluacode, but then
for the e-mail I wrapped it in \cldcontext.
I had tested it using startluacode, also. :-(
These two versions both work, and I actually tested them this time:
\startluacode
context(environment.runpath .. '/' ..
On 28-9-2012 23:56, Andre Caldas wrote:
My mistake: I tested the code I gave you in \startluacode, but then
for the e-mail I wrapped it in \cldcontext.
I had tested it using startluacode, also. :-(
These two versions both work, and I actually tested them this time:
\startluacode
Thank you for yor time, Peter. But this is not what I wanted... :-(
Is there a way to know the directory of the currently being processed
source file?
This works with mkiv:
\starttext
PWD: \cldcontext{io.popenpwd:read()}
\stoptext
This gives the directory where the context command was
I want to know a function that returns
/fullpath_to_project/products/
when I call it from the script products/product.tex. And I want it to return
/fullpath_to_project/products/product/
when I call it from the script products/product/article.tex.
Finally found it, after lots of
Hello!
Is there a way to know the directory of the currently being processed
source file?
Something like
dirname(__FILE__)
in PHP.
Cheers,
André Caldas.
___
If your question is of interest to others as well, please
On Mon, Sep 24 2012, Andre Caldas wrote:
Is there a way to know the directory of the currently being processed
source file?
This works with mkiv:
\starttext
PWD: \cldcontext{io.popenpwd:read()}
\stoptext
--
Peter
On Mon, Sep 24 2012, Peter Münster wrote:
\starttext
PWD: \cldcontext{io.popenpwd:read()}
\stoptext
Or better:
\starttext
PWD: \cldcontext{environment.runpath}
\stoptext
--
Peter
___
If your question
14 matches
Mail list logo